diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2020-11-29 13:46:34 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2020-11-29 13:46:34 (GMT) |
commit | 49b99cf1b058eec8f23ce78b85f68a8305e9785e (patch) | |
tree | 3b92096dbcd5479bb2ded1804ad5e1755d7a8e73 | |
parent | 9572872ad7a4c06f362fd37f26c35890238caed2 (diff) | |
parent | 4fea1bcccd283a407fe0936c56e56cc40a019b3c (diff) | |
download | hdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.zip hdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.tar.gz hdf5-49b99cf1b058eec8f23ce78b85f68a8305e9785e.tar.bz2 |
Merge branch 'develop' into zzz-gitlab-ci
413 files changed, 36882 insertions, 10343 deletions
diff --git a/.gitattributes b/.gitattributes index 2ad5b6e..f72b49c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -365,6 +365,7 @@ m4/ax_check_rqrd_class.m4 -text m4/ax_java_check_class.m4 -text m4/ax_java_options.m4 -text m4/ax_jni_include_dir.m4 -text +m4/ax_prog_doxygen.m4 -text m4/ax_prog_jar.m4 -text m4/ax_prog_java.m4 -text m4/ax_prog_java_cc.m4 -text diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a7faaa7..c891bac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -106,6 +106,7 @@ jobs: if: matrix.generator == 'autogen' run: | sh ./autogen.sh + sh ./bin/chkmanifest mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" $GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran --enable-java diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 7cce4d0..47feb7a 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -100,6 +100,7 @@ jobs: if: matrix.generator == 'autogen' run: | sh ./autogen.sh + sh ./bin/chkmanifest mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" $GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran --enable-java diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 799c117..ccd4fbc 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -189,7 +189,7 @@ HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN) #----------------------------------------------------------------------------- # Configure the COPYING.txt file for the windows binary package #----------------------------------------------------------------------------- -if (WIN32 OR MINGW) +if (WIN32) configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY) endif () @@ -208,7 +208,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${HDF5_SOURCE_DIR}/release_docs/COPYING ${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt ) - if (WIN32 OR MINGW) + if (WIN32) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt @@ -222,7 +222,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL ) - if (WIN32 OR MINGW) + if (WIN32) set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt @@ -290,7 +290,7 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp") set (CPACK_GENERATOR "TGZ") - if (WIN32 OR MINGW) + if (WIN32) set (CPACK_GENERATOR "ZIP") if (NSIS_EXECUTABLE) @@ -455,7 +455,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut if (HDF5_PACKAGE_EXTLIBS) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - if (WIN32 OR MINGW) + if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/") else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") @@ -464,7 +464,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut endif () endif () if (SZIP_FOUND AND SZIP_USE_EXTERNAL) - if (WIN32 OR MINGW) + if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;ALL;/") else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") @@ -473,7 +473,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut endif () endif () if (PLUGIN_FOUND AND PLUGIN_USE_EXTERNAL) - if (WIN32 OR MINGW) + if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PLUGIN_BINARY_DIR};PLUGIN;ALL;/") else () set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${PLUGIN_BINARY_DIR};PLUGIN;libraries;/") diff --git a/CMakeLists.txt b/CMakeLists.txt index d0eebad..f404c90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,6 +225,7 @@ set (HDF5_JAVA_LIB_DIR ${HDF5_SOURCE_DIR}/java/lib) set (HDF5_JAVA_LOGGING_JAR ${HDF5_SOURCE_DIR}/java/lib/slf4j-api-1.7.25.jar) set (HDF5_JAVA_LOGGING_NOP_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-nop-1.7.25.jar) set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple-1.7.25.jar) +set (HDF5_DOXYGEN_DIR ${HDF5_SOURCE_DIR}/doxygen) #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO @@ -532,6 +533,20 @@ 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) @@ -572,12 +587,15 @@ endif () # Certain systems may add /Debug or /Release to output paths # and we need to call the executable from inside the CMake configuration #----------------------------------------------------------------------------- -set (EXE_EXT "") -if (WIN32 OR MINGW) - set (EXE_EXT ".exe") - add_compile_definitions (_BIND_TO_CURRENT_VCLIBS_VERSION=1 _CRT_SECURE_NO_WARNINGS _CONSOLE) +if (WIN32) + add_compile_definitions (_CRT_SECURE_NO_WARNINGS) + if (MSVC) + add_compile_definitions (_BIND_TO_CURRENT_VCLIBS_VERSION=1 _CONSOLE) + endif () endif () +option (HDF5_MINGW_STATIC_GCC_LIBS "Statically link libgcc/libstdc++" OFF) + if (MSVC) set (CMAKE_MFC_FLAG 0) set (WIN_COMPILE_FLAGS "") @@ -585,7 +603,7 @@ if (MSVC) endif () set (MAKE_SYSTEM) -if (CMAKE_BUILD_TOOL MATCHES "make") +if (CMAKE_MAKE_PROGRAM MATCHES "make") set (MAKE_SYSTEM 1) endif () @@ -777,7 +795,7 @@ endif () option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF) if (HDF5_ENABLE_THREADSAFE) # check for unsupported options - if (WIN32 OR MINGW) + if (WIN32) message (STATUS " **** thread-safety option not supported with static library **** ") message (STATUS " **** thread-safety option will not be used building static library **** ") endif () @@ -50,6 +50,7 @@ ./m4/ax_java_check_class.m4 ./m4/ax_java_options.m4 ./m4/ax_jni_include_dir.m4 +./m4/ax_prog_doxygen.m4 ./m4/ax_prog_jar.m4 ./m4/ax_prog_java_cc.m4 ./m4/ax_prog_java_works.m4 @@ -157,6 +158,7 @@ ./config/clang-warnings/error-general ./config/clang-warnings/general ./config/clang-warnings/no-developer-general +./config/clang-warnings/noerror-general ./config/gnu-warnings/4.8-4.last ./config/gnu-warnings/4.8 ./config/gnu-warnings/4.9 @@ -170,6 +172,8 @@ ./config/gnu-warnings/cxx-5 ./config/gnu-warnings/cxx-error-5 ./config/gnu-warnings/cxx-error-general +./config/gnu-warnings/cxx-noerror-5 +./config/gnu-warnings/cxx-noerror-general ./config/gnu-warnings/developer-4.8 ./config/gnu-warnings/developer-7 ./config/gnu-warnings/developer-8 @@ -186,6 +190,9 @@ ./config/gnu-warnings/no-developer-4.8 ./config/gnu-warnings/no-developer-8 ./config/gnu-warnings/no-developer-general +./config/gnu-warnings/noerror-5 +./config/gnu-warnings/noerror-8 +./config/gnu-warnings/noerror-general ./config/intel-warnings/ifort-general ./config/intel-warnings/general @@ -193,6 +200,32 @@ ./doc/code-conventions.md +./doxygen/aliases +./doxygen/Doxyfile.in +./doxygen/dox/api-compat-macros.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/rm-template.dox +./doxygen/examples/H5Fclose.c +./doxygen/examples/H5Fcreate.c +./doxygen/examples/hello_hdf5.c +./doxygen/img/HDFG-logo.png + ./examples/Attributes.txt ./examples/Makefile.am ./examples/h5_chunk_read.c @@ -508,9 +541,11 @@ ./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 ./release_docs/HISTORY-1_8.txt ./release_docs/HISTORY-1_10.txt -./release_docs/HISTORY-1_8_0-1_10_0.txt +./release_docs/HISTORY-1_12.txt ./release_docs/INSTALL ./release_docs/INSTALL_CMake.txt ./release_docs/INSTALL_Cygwin.txt @@ -535,6 +570,7 @@ ./src/H5err.txt ./src/H5detect.c ./src/H5make_libsettings.c +./src/H5module.h ./src/H5mpi.c ./src/H5overflow.txt ./src/H5private.h @@ -798,6 +834,8 @@ ./src/H5HP.c ./src/H5HPprivate.h ./src/H5I.c +./src/H5Idbg.c +./src/H5Iint.c ./src/H5Imodule.h ./src/H5Ipkg.h ./src/H5Iprivate.h @@ -917,9 +955,8 @@ ./src/H5Rpkg.h ./src/H5Rprivate.h ./src/H5Rpublic.h -./src/H5UC.c -./src/H5UCprivate.h ./src/H5RS.c +./src/H5RSmodule.h ./src/H5RSprivate.h ./src/H5S.c ./src/H5Sall.c @@ -978,6 +1015,8 @@ ./src/H5Tvlen.c ./src/H5TS.c ./src/H5TSprivate.h +./src/H5UC.c +./src/H5UCprivate.h ./src/H5VL.c ./src/H5VLcallback.c ./src/H5VLconnector.h @@ -1045,9 +1084,9 @@ ./test/be_extlink2.h5 ./test/big.c ./test/bittests.c +./test/btree2.c ./test/btree_idx_1_6.h5 ./test/btree_idx_1_8.h5 -./test/btree2.c ./test/cache.c ./test/cache_api.c ./test/cache_common.c @@ -1066,13 +1105,15 @@ ./test/direct_chunk.c ./test/dsets.c ./test/dt_arith.c -./test/dtypes.c ./test/dtransform.c +./test/dtypes.c ./test/earray.c ./test/efc.c ./test/enc_dec_plist.c ./test/enc_dec_plist_cross_platform.c ./test/enum.c +./test/err_compat.c +./test/error_test.c ./test/evict_on_close.c ./test/extend.c ./test/external.c @@ -1080,25 +1121,21 @@ ./test/external_common.h ./test/external_env.c ./test/external_fname.h -./test/error_test.c -./test/err_compat.c -./test/filter_error.h5 -./test/links_env.c ./test/family_v16_00000.h5 ./test/family_v16_00001.h5 ./test/family_v16_00002.h5 ./test/family_v16_00003.h5 ./test/farray.c ./test/fheap.c -./test/filespace_1_8.h5 -./test/filespace_1_6.h5 -./test/freespace.c -./test/filenotclosed.c ./test/file_image.c ./test/file_image_core_test.h5 -./test/fill_old.h5 +./test/filenotclosed.c +./test/filespace_1_6.h5 +./test/filespace_1_8.h5 ./test/fill18.h5 +./test/fill_old.h5 ./test/fillval.c +./test/filter_error.h5 ./test/filter_fail.c ./test/filter_plugin.c ./test/filter_plugin1_dsets.c @@ -1108,13 +1145,12 @@ ./test/flush1.c ./test/flush2.c ./test/flushrefresh.c +./test/freespace.c ./test/fsm_aggr_nopersist.h5 ./test/fsm_aggr_persist.h5 -./test/genall5.c -./test/genall5.h +./test/gen_bad_compound.c ./test/gen_bad_offset.c ./test/gen_bad_ohdr.c -./test/gen_bad_compound.c ./test/gen_bogus.c ./test/gen_bounds.c ./test/gen_cross.c @@ -1138,6 +1174,8 @@ ./test/gen_sizes_lheap.c ./test/gen_specmetaread.c ./test/gen_udlinks.c +./test/genall5.c +./test/genall5.h ./test/getname.c ./test/gheap.c ./test/group_old.h5 @@ -1157,6 +1195,7 @@ ./test/le_extlink2.h5 ./test/lheap.c ./test/links.c +./test/links_env.c ./test/memleak_H5O_dtype_decode_helper_H5Odtype.h5 ./test/mergemsg.h5 ./test/mf.c @@ -1170,15 +1209,15 @@ ./test/ntypes.c ./test/null_vol_connector.c ./test/null_vol_connector.h -./test/ohdr.c ./test/objcopy.c ./test/objcopy_ref.c +./test/ohdr.c ./test/page_buffer.c ./test/paged_nopersist.h5 ./test/paged_persist.h5 +./test/pool.c ./test/reserved.c ./test/ros3.c -./test/pool.c ./test/s3comms.c ./test/set_extent.c # ====distribute this for now. See HDFFV-8236==== @@ -1204,30 +1243,30 @@ ./test/tattr.c ./test/tbad_msg_count.h5 ./test/tbogus.h5 -./test/tchecksum.c ./test/tcheck_version.c +./test/tchecksum.c ./test/tconfig.c ./test/tcoords.c +./test/test_filter_plugin.sh.in +./test/test_filters_be.h5 +./test/test_filters_le.h5 +./test/test_usecases.sh.in +./test/test_vol_plugin.sh.in ./test/testabort_fail.sh.in ./test/testcheck_version.sh.in -./test/testexternal_env.sh.in ./test/testerror.sh.in -./test/testlinks_env.sh.in -./test/test_filter_plugin.sh.in -./test/test_filters_le.h5 -./test/test_filters_be.h5 +./test/testexternal_env.sh.in ./test/testflushrefresh.sh.in ./test/testframe.c ./test/testhdf5.c ./test/testhdf5.h ./test/testlibinfo.sh.in -./test/test_mirror.sh.in -./test/test_usecases.sh.in -./test/test_vol_plugin.sh.in +./test/testlinks_env.sh.in ./test/testmeta.c +./test/test_mirror.sh.in ./test/testswmr.sh.in -./test/testvdsswmr.sh.in ./test/testvds_env.sh.in +./test/testvdsswmr.sh.in ./test/tfile.c ./test/tgenprop.c ./test/th5o.c @@ -1243,7 +1282,6 @@ ./test/tmisc.c ./test/tmtimen.h5 ./test/tmtimeo.h5 -./test/ttime.c ./test/trefer.c ./test/trefer_deprec.c ./test/trefer_shutdown.c @@ -1252,7 +1290,7 @@ ./test/tsizeslheap.h5 ./test/tskiplist.c ./test/tsohm.c -./test/ttst.c +./test/ttime.c ./test/ttsafe.c ./test/ttsafe.h ./test/ttsafe_acreate.c @@ -1260,18 +1298,19 @@ ./test/ttsafe_cancel.c ./test/ttsafe_dcreate.c ./test/ttsafe_error.c +./test/ttst.c ./test/tunicode.c ./test/tvlstr.c ./test/tvltypes.c ./test/twriteorder.c ./test/unlink.c ./test/unregister.c +./test/use.h ./test/use_append_chunk.c ./test/use_append_chunk_mirror.c ./test/use_append_mchunks.c ./test/use_common.c ./test/use_disable_mdc_flushes.c -./test/use.h ./test/vds.c ./test/vds_env.c ./test/vds_swmr.h @@ -2736,6 +2775,7 @@ ./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/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 diff --git a/Makefile.am b/Makefile.am index 9cb5d02..21bc550 100644 --- a/Makefile.am +++ b/Makefile.am @@ -187,6 +187,16 @@ 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 + # Run tests with different Virtual File Drivers. # Currently, only invoke check-vfd in the test directory. check-vfd: @@ -75,6 +75,6 @@ Periodically development code snapshots are provided at the following URL: Source packages for current and previous releases are located at: https://portal.hdfgroup.org/display/support/Downloads -Development code is available at our BitBucket Server: - https://bitbucket.hdfgroup.org/projects/HDFFV/repos/hdf5/browse +Development code is available at our Github location: + https://github.com/HDFGroup/hdf5.git diff --git a/bin/checkposix b/bin/checkposix index 233d15c..c29c290 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -44,7 +44,27 @@ foreach $arg (@ARGV) { # # If a user specifies one file, process it no matter what so people # can inspect files we normally skip (like H5system.c). + + $ignore = 0; + + # Ignored files in src/ if($#ARGV gt 0 and $filename =~ /H5FDmulti|H5FDstdio|H5VLpassthru|H5system|H5detect|H5make_libsettings/) { + $ignore = 1; + } + # Ignored atomic test files in test/ + if($#ARGV gt 0 and $filename =~ /atomic_reader|atomic_writer/) { + $ignore = 1; + } + # Ignored filter plugins in test/ + if($#ARGV gt 0 and $filename =~ /^filter_plugin\d_/) { + $ignore = 1; + } + # Ignored generators in test/ + if($#ARGV gt 0 and $filename =~ /^gen_/) { + $ignore = 1; + } + + if($ignore) { print "$filename is exempt from using Standard library macro wrappers\n"; next; } @@ -95,13 +115,13 @@ foreach $arg (@ARGV) { # These are really HDF5 functions/macros even though they don't # start with `h' or `H'. - next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT)?(_NOFUNC|_TAG)?$/; + next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT|_NOPUSH)?(_NOFUNC|_TAG)?$/; next if $name =~ /^(BEGIN|END)_FUNC$/; next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)(_VAR)?$/; next if $name =~ /^CI_(PRINT_STATS|INC_SRC|INC_DST)$/; next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/; next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/; - next if $name =~ /^(UNIQUE_MEMBERS|S_ISDIR)$/; + next if $name =~ /^(SIZE_OVERFLOW|UNIQUE_MEMBERS|S_ISDIR)$/; next if $name =~ /^addr_defined$/; # These functions/macros are exempt. @@ -140,15 +160,38 @@ foreach $arg (@ARGV) { next if $name =~ /^(pow_fun|round_fun|abs_fun|lround_fun|llround_fun)$/; } + # This is a macro parameter in H5Rint.c. Ignore it in this file. + if($filename =~ /H5Rint/) { + next if $name =~ /^(func)$/; + } + + # Internal calls in the HDFS VFD (H5FDhdfs.c). Ignore it in this file. + if($filename =~ /H5FDhdfs/) { + next if $name =~ /^(hdfs)/; + } + + # Macros, etc. from the mirror VFD (H5FDmirror.c). Ignore in this file. + if($filename =~ /H5FDmirror/) { + next if $name =~ /^(LOG)/; + next if $name =~ /^(BSWAP_64|is_host_little_endian)$/; + } + + # These are things in H5FDs3comms.c and H5FDros3.c. Ignore them in these files. + if($filename =~ /H5FDs3comms|H5FDros3/) { + next if $name =~ /^(curl_|curlwritecallback|gmnow)/; + next if $name =~ /^(ros3_|ROS3_|S3COMMS_)/; + next if $name =~ /^(EVP_sha256|SHA256|ISO8601NOW)$/; + } + # TESTING (not comprehensive - just noise reduction) # Test macros and functions (testhdf5.h) next if $name =~ /^(AddTest|TestErrPrintf|TestSummary|TestCleanup|TestShutdown)$/; next if $name =~ /^(CHECK|CHECK_PTR|CHECK_PTR_NULL|CHECK_PTR_EQ|CHECK_I)$/; - next if $name =~ /^(VERIFY|VERIFY_STR|VERIFY|TYPE|MESSAGE|ERROR)$/; + next if $name =~ /^(VERIFY|VERIFY_STR|VERIFY_TYPE|MESSAGE|ERROR)$/; # Test macros and functions (h5test.h) - next if $name =~ /^(TESTING|PASSED|SKIPPED|FAIL_PUTS_ERROR|FAIL_STACK_ERROR|TEST_ERROR)$/; + next if $name =~ /^(TESTING|PASSED|SKIPPED|PUTS_ERROR|FAIL_PUTS_ERROR|FAIL_STACK_ERROR|TEST_ERROR|AT)$/; next if $name =~ /^(GetTestExpress)$/; # Ignore functions that start with test_ or check_ @@ -158,9 +201,49 @@ foreach $arg (@ARGV) { # Ignore functions that start with h5_ next if $name =~ /^h5_/; + # Ignore process completed status + next if $name =~ /(WIFEXITED|WEXITSTATUS|WIFSIGNALED|WTERMSIG|WCOREDUMP|WIFSTOPPED|WSTOPSIG)/; + # Ignore usage functions next if $name =~ /^usage$/; + # Ignore callbacks + next if $name =~ /(_cb\d?)$/; + + # Specific tests (not even remotely comprehensive) + + # accum test code + if($filename =~ /accum/) { + next if $name =~ /^(accum_)/; + } + + # cache test code + if($filename =~ /cache/) { + next if $name =~ /(_entry|_entries|_cache|_check|_dependency|_status|_op)$/; + next if $name =~ /^(verify_|smoke_check_|row_major_|col_major_)/; + next if $name =~ /^(resize_configs_are_equal|CACHE_ERROR)$/ + } + + # Splitter VFD test code. Ignore in vfd.c. + if($filename =~ /vfd/) { + next if $name =~ /^(SPLITTER_|splitter_)/; + next if $name =~ /(_splitter_)/; + next if $name =~ /^(file_exists)$/; + } + + # S3 VFD test code. Ignore in ros3.c and s3comms.c. + # HDFS VFD test code. Ignore in hdfs.c. + if($filename =~ /ros3|s3comms|hdfs/) { + next if $name =~ /^(JSVERIFY|JSFAILED_|JSERR_|jserr_|FAIL_)/; + next if $name =~ /^(curl_)/; + next if $name =~ /^(S3COMMS_FORMAT_CREDENTIAL|ISO8601NOW|gmnow)$/; + } + + # VDS test code. Ignore in vds.c. + if($filename =~ /vds/) { + next if $name =~ /^(vds_)/; + } + print "$filename:$.: $name\n"; } @@ -28,61 +28,99 @@ $Source = ""; # usually the same as the package name. # %TypeString = ("haddr_t" => "a", + "H5A_info_t" => "Ai", + "H5A_operator1_t" => "Ao", + "H5A_operator2_t" => "AO", "hbool_t" => "b", + "H5AC_cache_config_t" => "Cc", + "H5AC_cache_image_config_t" => "CC", "double" => "d", "H5D_alloc_time_t" => "Da", + "H5D_append_cb_t" => "DA", "H5FD_mpio_collective_opt_t" => "Dc", "H5D_fill_time_t" => "Df", "H5D_fill_value_t" => "DF", + "H5D_gather_func_t" => "Dg", "H5FD_mpio_chunk_opt_t" => "Dh", "H5D_mpio_actual_io_mode_t" => "Di", + "H5FD_file_image_callbacks_t" => "DI", "H5D_chunk_index_t" => "Dk", "H5D_layout_t" => "Dl", "H5D_mpio_no_collective_cause_t" => "Dn", "H5D_mpio_actual_chunk_opt_mode_t" => "Do", + "H5D_operator_t" => "DO", "H5D_space_status_t" => "Ds", - "H5D_vds_view_t" => "Dv", + "H5D_scatter_func_t" => "DS", "H5FD_mpio_xfer_t" => "Dt", - "H5FD_splitter_vfd_config_t" => "Dr", + "H5D_vds_view_t" => "Dv", "herr_t" => "e", + "H5E_auto1_t" => "Ea", + "H5E_auto2_t" => "EA", "H5E_direction_t" => "Ed", "H5E_error_t" => "Ee", - "H5E_type_t" => "Et", "H5ES_status_t" => "Es", + "H5E_type_t" => "Et", + "H5FD_class_t" => "FC", "H5F_close_degree_t" => "Fd", "H5F_fspace_strategy_t" => "Ff", - "H5F_file_space_type_t" => "Ff", + "H5F_flush_cb_t" => "FF", + "H5F_info2_t" => "FI", "H5F_mem_t" => "Fm", "H5F_scope_t" => "Fs", - "H5F_fspace_type_t" => "Ft", + "H5F_file_space_type_t" => "Ft", "H5F_libver_t" => "Fv", + "H5G_iterate_t" => "Gi", "H5G_obj_t" => "Go", "H5G_stat_t" => "Gs", "hsize_t" => "h", + "H5_alloc_stats_t" => "Ha", + "H5_atclose_func_t" => "Hc", "hssize_t" => "Hs", - "H5E_major_t" => "i", - "H5E_minor_t" => "i", - "H5_iter_order_t" => "Io", - "H5_index_t" => "Ii", + "H5E_major_t" => "i", # H5E_major_t is typedef'd to hid_t + "H5E_minor_t" => "i", # H5E_minor_t is typedef'd to hid_t "hid_t" => "i", + "H5I_free_t" => "If", + "H5_index_t" => "Ii", + "H5I_iterate_func_t" => "II", + "H5_iter_order_t" => "Io", "int" => "Is", "int32_t" => "Is", + "H5I_search_func_t" => "IS", + "H5I_type_t" => "It", "unsigned" => "Iu", "unsigned int" => "Iu", "uint32_t" => "Iu", - "uint64_t" => "UL", - "H5I_type_t" => "It", "H5O_token_t" => "k", + "H5L_iterate1_t" => "Li", + "H5L_iterate2_t" => "LI", "H5G_link_t" => "Ll", #Same as H5L_type_t now "H5L_type_t" => "Ll", + "H5L_elink_traverse_t" => "Lt", + "H5MM_allocate_t" => "Ma", "MPI_Comm" => "Mc", + "H5MM_free_t" => "Mf", "MPI_Info" => "Mi", + "H5M_iterate_t" => 'MI', "H5FD_mem_t" => "Mt", "off_t" => "o", + "H5O_iterate1_t" => "Oi", + "H5O_iterate2_t" => "OI", + "H5O_mcdt_search_cb_t" => "Os", "H5O_type_t" => "Ot", "H5P_class_t" => "p", - "hobj_ref_t" => "Ro", + "H5P_cls_create_func_t" => "Pc", + "H5P_prp_create_func_t" => "PC", + "H5P_prp_delete_func_t" => "PD", + "H5P_prp_get_func_t" => "PG", + "H5P_iterate_t" => "Pi", + "H5P_cls_close_func_t" => "Pl", + "H5P_prp_close_func_t" => "PL", + "H5P_prp_compare_func_t" => "PM", + "H5P_cls_copy_func_t" => "Po", + "H5P_prp_copy_func_t" => "PO", + "H5P_prp_set_func_t" => "PS", "hdset_reg_ref_t" => "Rd", + "hobj_ref_t" => "Ro", "H5R_ref_t" => "Rr", "H5R_type_t" => "Rt", "char" => "s", @@ -92,122 +130,74 @@ $Source = ""; "H5S_sel_type" => "St", "htri_t" => "t", "H5T_cset_t", => "Tc", + "H5T_conv_t" => "TC", "H5T_direction_t", => "Td", + "H5T_pers_t" => "Te", + "H5T_conv_except_func_t" => "TE", "H5T_norm_t" => "Tn", "H5T_order_t" => "To", "H5T_pad_t" => "Tp", - "H5T_pers_t" => "Te", "H5T_sign_t" => "Ts", "H5T_class_t" => "Tt", "H5T_str_t" => "Tz", "unsigned long" => "Ul", "unsigned long long" => "UL", - "H5VL_subclass_t" => "VS", - "H5VL_get_conn_lvl_t" => "VL", + "uint64_t" => "UL", "H5VL_attr_get_t" => "Va", - "H5VL_attr_optional_t" => "Vs", + "H5VL_blob_optional_t" => "VA", "H5VL_attr_specific_t" => "Vb", "H5VL_blob_specific_t" => "VB", - "H5VL_class_value_t" => "VC", "H5VL_dataset_get_t" => "Vc", + "H5VL_class_value_t" => "VC", "H5VL_dataset_specific_t" => "Vd", - "H5VL_dataset_optional_t" => "Vt", "H5VL_datatype_get_t" => "Ve", "H5VL_datatype_specific_t" => "Vf", - "H5VL_datatype_optional_t" => "Vu", "H5VL_file_get_t" => "Vg", "H5VL_file_specific_t" => "Vh", - "H5VL_file_optional_t" => "Vv", "H5VL_group_get_t" => "Vi", "H5VL_group_specific_t" => "Vj", - "H5VL_group_optional_t" => "Vw", "H5VL_link_create_type_t" => "Vk", "H5VL_link_get_t" => "Vl", + "H5VL_get_conn_lvl_t" => "VL", "H5VL_link_specific_t" => "Vm", - "H5VL_link_optional_t" => "Vx", "H5VL_object_get_t" => "Vn", + "H5VL_request_notify_t" => "VN", "H5VL_object_specific_t" => "Vo", - "H5VL_object_optional_t" => "Vy", "H5VL_request_specific_t" => "Vr", + "H5VL_attr_optional_t" => "Vs", + "H5VL_subclass_t" => "VS", + "H5VL_dataset_optional_t" => "Vt", + "H5VL_datatype_optional_t" => "Vu", + "H5VL_file_optional_t" => "Vv", + "H5VL_group_optional_t" => "Vw", + "H5VL_link_optional_t" => "Vx", + "H5VL_object_optional_t" => "Vy", "H5VL_request_optional_t" => "Vz", - "H5VL_blob_optional_t" => "VA", - "void" => "x", - "FILE" => "x", - "H5_alloc_stats_t" => "x", - "H5A_operator_t" => "x", - "H5A_operator1_t" => "x", - "H5A_operator2_t" => "x", - "H5A_info_t" => "x", - "H5AC_cache_config_t" => "x", - "H5AC_cache_image_config_t" => "x", - "H5D_append_cb_t" => "x", - "H5D_gather_func_t" => "x", - "H5D_operator_t" => "x", - "H5D_scatter_func_t" => "x", - "H5E_auto_t" => "x", - "H5E_auto1_t" => "x", - "H5E_auto2_t" => "x", - "H5E_walk_t" => "x", - "H5E_walk1_t" => "x", - "H5E_walk2_t" => "x", - "H5F_flush_cb_t" => "x", - "H5F_info1_t" => "x", - "H5F_info2_t" => "x", - "H5F_retry_info_t" => "x", - "H5FD_t" => "x", - "H5FD_class_t" => "x", - "H5FD_stream_fapl_t" => "x", - "H5FD_ros3_fapl_t" => "x", - "H5FD_hdfs_fapl_t" => "x", - "H5FD_file_image_callbacks_t" => "x", - "H5FD_mirror_fapl_t" => "x", - "H5G_iterate_t" => "x", - "H5G_info_t" => "x", - "H5I_free_t" => "x", - "H5I_iterate_func_t" => "x", - "H5I_search_func_t" => "x", - "H5L_class_t" => "x", - "H5L_elink_traverse_t" => "x", - "H5L_info1_t" => "x", - "H5L_info2_t" => "x", - "H5L_iterate1_t" => "x", - "H5L_iterate2_t" => "x", - "H5M_iterate_t" => 'x', - "H5MM_allocate_t" => "x", - "H5MM_free_t" => "x", - "H5O_info1_t" => "x", - "H5O_info2_t" => "x", - "H5O_native_info_t" => "x", - "H5O_iterate1_t" => "x", - "H5O_iterate2_t" => "x", - "H5O_mcdt_search_cb_t" => "x", - "H5P_cls_create_func_t" => "x", - "H5P_cls_copy_func_t" => "x", - "H5P_cls_close_func_t" => "x", - "H5P_iterate_t" => "x", - "H5P_prp_create_func_t" => "x", - "H5P_prp_copy_func_t" => "x", - "H5P_prp_close_func_t" => "x", - "H5P_prp_delete_func_t" => "x", - "H5P_prp_get_func_t" => "x", - "H5P_prp_set_func_t" => "x", - "H5P_prp_compare_func_t" => "x", - "H5T_cdata_t" => "x", - "H5T_conv_t" => "x", - "H5T_conv_except_func_t" => "x", - "H5VL_t" => "x", - "H5VL_class_t" => "x", - "H5VL_loc_params_t" => "x", - "H5VL_request_notify_t" => "x", - "H5Z_func_t" => "x", - "H5Z_filter_func_t" => "x", "va_list" => "x", + "void" => "x", "size_t" => "z", "H5Z_SO_scale_type_t" => "Za", "H5Z_class_t" => "Zc", "H5Z_EDC_t" => "Ze", "H5Z_filter_t" => "Zf", + "H5Z_filter_func_t" => "ZF", "ssize_t" => "Zs", +# Types below must be defined here, as they appear in function arguments, +# but they are not yet supported in the H5_trace_args() routine yet. If +# they are used as an actual parameter type (and not just as a pointer to +# to the type), they must have a "real" abbreviation added (like the ones +# above), moved to the section of entries above, and support for displaying +# the type must be added to H5_trace_args(). + "H5ES_err_info_t" => "#", + "H5FD_t" => "#", + "H5FD_hdfs_fapl_t" => "#", + "H5FD_mirror_fapl_t" => "#", + "H5FD_ros3_fapl_t" => "#", + "H5FD_splitter_vfd_config_t" => "#", + "H5L_class_t" => "#", + "H5VL_class_t" => "#", + "H5VL_loc_params_t" => "#", + "H5VL_request_status_t" => "#", ); @@ -248,7 +238,9 @@ sub argstring ($$$) { # Normalize the data type by removing redundant white space, # certain type qualifiers, and indirection. - $atype =~ s/^\bconst\b//; + $atype =~ s/^\bconst\b//; # Leading const + $atype =~ s/\s*const\s*//; # const after type, possibly in the middle of '*'s + $atype =~ s/^\bstatic\b//; $atype =~ s/\bH5_ATTR_UNUSED\b//g; $atype =~ s/\bH5_ATTR_DEPRECATED_USED\b//g; $atype =~ s/\bH5_ATTR_NDEBUG_UNUSED\b//g; @@ -272,53 +264,65 @@ sub argstring ($$$) { --$ptr; $tstr = $TypeString{"$atype*"}; } elsif (!exists $TypeString{$atype}) { - errmesg $file, $func, "untraceable type \`$atype", '*'x$ptr, "\'"; +# Defer throwing error until type is actually used +# errmesg $file, $func, "untraceable type \`$atype", '*'x$ptr, "\'"; } else { $tstr = $TypeString{$atype}; } - return ("*" x $ptr) . ($array?"[$array]":"") . $tstr; + return ("*" x $ptr) . ($array ? "[$array]" : "") . $tstr; } ############################################################################## # Given information about an API function, rewrite that function with # updated tracing information. # -sub rewrite_func ($$$$$) { - my ($file, $type, $name, $args, $body) = @_; - my ($arg,$trace); - my (@arg_name, @arg_str); +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) = @_; + my ($arg, $trace, $argtrace); + my (@arg_name, @arg_str, @arg_type); local $_; + # Keep copy of original arguments + my $orig_args = $args; + # Parse return value my $rettype = argstring $file, $name, $type; - goto error if $rettype =~ /!/; # Parse arguments if ($args eq "void") { $trace = "H5TRACE0(\"$rettype\", \"\");\n"; + $argtrace = "H5ARG_TRACE0(\"\")"; } else { # Split arguments. First convert `/*in,out*/' to get rid of the - # comma, then split the arguments on commas. - $args =~ s/(\/\*\s*in),\s*(out\s*\*\/)/$1_$2/g; + # comma and remove lines beginning with a '#', then split the arguments + # on commas. + $args =~ s/(\/\*\s*in),\s*(out\s*\*\/)/$1_$2/g; # Get rid of comma in 'in,out' + $args =~ s/H5FL_TRACK_PARAMS//g; # Remove free list macro + $args =~ s/\n#.*?\n/\n/g; # Remove lines beginning with '#' my @args = split /,[\s\n]*/, $args; my $argno = 0; my %names; for $arg (@args) { - if($arg=~/\w*\.{3}\w*/){ + if($arg=~/\w*\.{3}\w*/){ # Skip "..." for varargs parameter next; } - unless ($arg=~/^(([a-z_A-Z]\w*\s+)+\**) + unless ($arg=~/^((\s*[a-z_A-Z](\w|\*)*\s+)+(\s*\*\s*|\s*const\s*|\s*volatile\s*)*) ([a-z_A-Z]\w*)(\[.*?\])? (\s*\/\*\s*(in|out|in_out)\s*\*\/)?\s*$/x) { errmesg $file, $name, "unable to parse \`$arg\'"; goto error; } else { - my ($atype, $aname, $array, $adir) = ($1, $3, $4, $6); + my ($atype, $aname, $array, $adir) = ($1, $5, $6, $8); $names{$aname} = $argno++; $adir ||= "in"; $atype =~ s/\s+$//; push @arg_name, $aname; + push @arg_type, $atype; if ($adir eq "out") { push @arg_str, "x"; @@ -342,7 +346,9 @@ sub rewrite_func ($$$$$) { # Compose the trace macro $trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \""; + $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 @@ -363,63 +369,147 @@ sub rewrite_func ($$$$$) { # Append argument $trace .= "$_"; + $argtrace .= ", $_"; $len += length; # Add length of appended argument name } # Append final ');' for macro $trace .= ");\n"; + $argtrace .= ")"; } - goto error if grep {/!/} @arg_str; - - # The H5TRACE() statement - if ($body =~ /\/\*[ \t]*NO[ \t]*TRACE[ \t]*\*\//) { - # Ignored due to NO TRACE comment. - } elsif ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) { - # Replaced an H5TRACE macro. - } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*[ \t]*(\(.*?\))?;??)\n/"$1$2$trace"/es) { - # Added an H5TRACE macro after a FUNC_ENTER macro. - } else { - errmesg $file, $name, "unable to insert tracing information"; - print "body = ", $body, "\n"; - goto error; + + # Check for API / non-API routine name + if( $name =~ /H5[A-Z]{0,2}[a-z].*/) { + # The H5TRACE() statement, for API routines + if ($body =~ /\/\*[ \t]*NO[ \t]*TRACE[ \t]*\*\//) { + # Ignored due to NO TRACE comment. + } else { + # Check for known, but unsupported type + if ( $trace =~ /(^#)|([^*]#)/ ) { + # Check for unsupported return type + if ( $type =~ /(^#)|([^*]#)/ ) { + errmesg $file, $name, "unsupported type in return type\nAdd to TypeString hash in trace script and update H5_trace_args()"; + print "type = '$type'\n"; + } + + # Check for unsupported argument type + $index = 0; + for (@arg_str) { + if ( $_ =~ /(^#)|([^*]#)/ ) { + errmesg $file, $name, "unsupported type in args\nAdd to TypeString hash in trace script and update H5_trace_args()"; + print "type = $arg_type[$index]\n"; + } + $index++; + } + goto error; + } + + # Check for unknown (and therefore unsupported) type + if ( $trace =~ /(^!)|([^*]!)/ ) { + # Check for unsupported return type + if ( $type =~ /(^!)|([^*]!)/ ) { + errmesg $file, $name, "unknown type in return type\nAdd to TypeString hash in trace script and also update H5_trace_args() if used by value"; + print "type = '$type'\n"; + } + + # Check for unsupported argument type + $index = 0; + for (@arg_str) { + if ( $_ =~ /(^!)|([^*]!)/ ) { + errmesg $file, $name, "unknown type in args\nAdd to TypeString hash in trace script and also update H5_trace_args() if used by value"; + print "type = $arg_type[$index]\n"; + } + $index++; + } + goto error; + } + + if ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) { + # Replaced an H5TRACE macro. + } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*[ \t]*(\(.*?\))?;??)\n/"$1$2$trace"/es) { + # Added an H5TRACE macro after a FUNC_ENTER macro. + } else { + errmesg $file, $name, "unable to insert tracing information"; + print "body = ", $body, "\n"; + goto error; + } + } + + #Increment # of API routines modified + $file_api++; + } + + # Check for H5ARG_TRACE macros in non-API routines + if ( $body =~ /H5ARG_TRACE/ ) { + # Check for untraceable type (deferred until $argtrace used) + if ( $argtrace =~ /(^!)|([^*]!)/ ) { + errmesg $file, $name, "untraceable type in args"; + print "args = '$orig_args'\n"; + goto error; + } + + # Replace / update H5ARG_TRACE macro. + $body =~ s/(H5ARG_TRACE(\d+\s*\(.*?\))?)/"$argtrace"/esg; + + #Increment # of non-API routines modified + $file_args++; } - error: - return "\n$type\n$name($args)\n$body"; + return "\n$begin$type$aftertype$name($orig_args)$close$body"; } ############################################################################## # Process each source file, rewriting API functions with updated # tracing information. # -my $total_api = 0; for $file (@ARGV) { + $file_api = 0; + $file_args = 0; + # Ignore some files that do not need tracing macros unless ($file eq "H5FDmulti.c" or $file eq "src/H5FDmulti.c" or $file eq "H5FDstdio.c" or $file eq "src/H5FDstdio.c") { - + # Snarf up the entire file open SOURCE, $file or die "$file: $!\n"; $Source = join "", <SOURCE>; close SOURCE; - # Make modifications + # Make a copy of the original data my $original = $Source; - my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type - (H5[A-Z]{0,2}[^_A-Z0-9]\w*) #name - \s*\((.*?)\)\s* #args - (\{.*?\n\}[^\n]*) #body - /rewrite_func($file,$1,$3,$4,$5)/segx; - $total_api += $napi; + + # 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; + } # If the source changed then print out the new version if ($original ne $Source) { - printf "%s: instrumented %d API function%s\n", - $file, $napi, 1==$napi?"":"s"; + printf "%s: instrumented %d API function%s and %d argument list%s\n", + $file, $file_api, (1 == $file_api ? "" : "s"), + $file_args, (1 == $file_args ? "" : "s"); rename $file, "$file~" or die "unable to make backup"; open SOURCE, ">$file" or die "unable to modify source"; print SOURCE $Source; close SOURCE; + + $total_api += $file_api; + $total_args += $file_args; } } } @@ -431,6 +521,9 @@ if ($found_errors eq 1) { printf "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"; exit 1; } else { - printf "Finished processing HDF5 API calls\n"; + printf "Finished processing HDF5 API calls:\n"; + printf "\tinstrumented %d API function%s and %d argument list%s\n", + $total_api, (1 == $total_api ? "" : "s"), + $total_args, (1 == $total_args ? "" : "s"); } diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 3035841..c50315f 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -41,7 +41,7 @@ foreach (example ${examples}) else () TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - if (MINGW) + if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) target_link_options (${HDF5_CPP_LIBSH_TARGET} PRIVATE -static-libgcc -static-libstdc++ ) @@ -66,7 +66,7 @@ foreach (example ${tutr_examples}) else () TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - if (MINGW) + if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) target_link_options (${HDF5_CPP_LIBSH_TARGET} PRIVATE -static-libgcc -static-libstdc++ ) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 04822cf..de2306e 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -117,7 +117,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET} ) - if (MINGW) + if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) target_link_options (${HDF5_CPP_LIBSH_TARGET} PRIVATE -static-libgcc -static-libstdc++ ) diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 2d1185b..02f0cbc 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -435,7 +435,7 @@ class H5_DLLCPP PredType : public AtomType { #if H5_SIZEOF_UINT_FAST64_T != 0 static PredType *NATIVE_UINT_FAST64_; #endif /* H5_SIZEOF_UINT_FAST64_T */ - // End of Declaration of pointers + // End of Declaration of pointers #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 550b7ea..1255e39 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -49,7 +49,7 @@ if (NOT BUILD_SHARED_LIBS) else () TARGET_C_PROPERTIES (cpp_testhdf5 SHARED) target_link_libraries (cpp_testhdf5 PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET}) - if (MINGW) + if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) target_link_options (${HDF5_CPP_LIBSH_TARGET} PRIVATE -static-libgcc -static-libstdc++ ) diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index e7788e5..e583c3b 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -222,7 +222,7 @@ test_szip_filter(H5File &file1) SKIPPED(); } -#else /* H5_HAVE_FILTER_SZIP */ +#else /* H5_HAVE_FILTER_SZIP */ SUBTEST("szip filter"); SKIPPED(); H5std_string fname = file1.getFileName(); diff --git a/config/clang-cxxflags b/config/clang-cxxflags index edd62e7..4926313 100644 --- a/config/clang-cxxflags +++ b/config/clang-cxxflags @@ -173,6 +173,7 @@ if test "X-clang" = "X-$cxx_vendor" -o "X-Apple LLVM" = "X-$cxx_vendor"; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_clang_arguments general)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_clang_arguments error-general)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_clang_arguments noerror-general)" ###################### # Developer warnings # diff --git a/config/clang-flags b/config/clang-flags index b4f5e2e..cb5ce8d 100644 --- a/config/clang-flags +++ b/config/clang-flags @@ -173,6 +173,7 @@ if test "X-clang" = "X-$cc_vendor" -o "X-Apple LLVM" = "X-$cc_vendor"; then H5_CFLAGS="$H5_CFLAGS $(load_clang_arguments general)" H5_ECFLAGS="$H5_ECFLAGS $(load_clang_arguments error-general)" + H5_NECFLAGS="$H5_NECFLAGS $(load_clang_arguments noerror-general)" ###################### # Developer warnings # diff --git a/config/clang-warnings/noerror-general b/config/clang-warnings/noerror-general new file mode 100644 index 0000000..ad50dfc --- /dev/null +++ b/config/clang-warnings/noerror-general @@ -0,0 +1,80 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +-Wbad-function-cast +-Wimplicit-function-declaration +-Wincompatible-pointer-types +-Wmissing-declarations +-Wpacked +-Wshadow +-Wswitch +# +# NOTE: Following files are not compatible with incompatible-pointer-types as errors +# src/H5Dchunk.c,src/H5Dint.c,src/H5Gint.c,src/H5HFcache.c,src/H5I.c,src/H5T.c +-Wno-error=incompatible-pointer-types-discards-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake index 3cded02..46d3979 100644 --- a/config/cmake/HDF5PluginMacros.cmake +++ b/config/cmake/HDF5PluginMacros.cmake @@ -26,7 +26,7 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type) # the hdf5 settings -DHDF5_PACKAGE_NAME:STRING=hdf5 -DHDF5_HDF5_HEADER:STRING=h5pubconf.h - -DHDF5_LINK_LIBS:STRING=$<TARGET_FILE:${HDF5_LIBSH_TARGET}> + -DHDF5_LINK_LIBS:STRING=$<TARGET_LINKER_FILE:${HDF5_LIBSH_TARGET}> -DHDF5_INCLUDE_DIR:PATH=${HDF5_SRC_DIR}|${HDF5_SRC_BINARY_DIR} -DPL_PACKAGE_NAME:STRING=${PLUGIN_PACKAGE_NAME} -DH5PL_CPACK_ENABLE:BOOL=ON @@ -49,8 +49,8 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type) -DLZ4_PACKAGE_NAME:STRING=${LZ4_PACKAGE_NAME} -DLZF_TGZ_NAME:STRING=${LZF_TGZ_NAME} -DLZF_PACKAGE_NAME:STRING=${LZF_PACKAGE_NAME} - #-DSZ_TGZ_NAME:STRING=${SZ_TGZ_NAME} - #-DSZ_PACKAGE_NAME:STRING=${SZ_PACKAGE_NAME} + -DSZF_TGZ_NAME:STRING=${SZF_TGZ_NAME} + -DSZF_PACKAGE_NAME:STRING=${SZF_PACKAGE_NAME} -DZFP_TGZ_NAME:STRING=${ZFP_TGZ_NAME} -DZFP_PACKAGE_NAME:STRING=${ZFP_PACKAGE_NAME} ) @@ -78,7 +78,7 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type) # the hdf5 settings -DHDF5_PACKAGE_NAME:STRING=hdf5 -DHDF5_HDF5_HEADER:STRING=h5pubconf.h - -DHDF5_LINK_LIBS:STRING=$<TARGET_FILE:${HDF5_LIBSH_TARGET}> + -DHDF5_LINK_LIBS:STRING=$<TARGET_LINKER_FILE:${HDF5_LIBSH_TARGET}> -DHDF5_INCLUDE_DIR:PATH=${HDF5_SRC_DIR}|${HDF5_SRC_BINARY_DIR} -DPL_PACKAGE_NAME:STRING=${PLUGIN_PACKAGE_NAME} -DH5PL_CPACK_ENABLE:BOOL=ON @@ -101,8 +101,8 @@ macro (EXTERNAL_PLUGIN_LIBRARY compress_type) -DLZ4_PACKAGE_NAME:STRING=${LZ4_PACKAGE_NAME} -DLZF_TGZ_NAME:STRING=${LZF_TGZ_NAME} -DLZF_PACKAGE_NAME:STRING=${LZF_PACKAGE_NAME} - #-DSZ_TGZ_NAME:STRING=${SZ_TGZ_NAME} - #-DSZ_PACKAGE_NAME:STRING=${SZ_PACKAGE_NAME} + -DSZF_TGZ_NAME:STRING=${SZF_TGZ_NAME} + -DSZF_PACKAGE_NAME:STRING=${SZF_PACKAGE_NAME} -DZFP_TGZ_NAME:STRING=${ZFP_TGZ_NAME} -DZFP_PACKAGE_NAME:STRING=${ZFP_PACKAGE_NAME} ) diff --git a/config/cmake/HDFCXXCompilerFlags.cmake b/config/cmake/HDFCXXCompilerFlags.cmake index 7bbebbc..5925989 100644 --- a/config/cmake/HDFCXXCompilerFlags.cmake +++ b/config/cmake/HDFCXXCompilerFlags.cmake @@ -89,7 +89,11 @@ if (NOT MSVC AND NOT MINGW) 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") - ADD_H5_FLAGS (H5_CXXFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-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 "Clang") ADD_H5_FLAGS (HDF5_CMAKE_CXX_FLAGS "${HDF5_SOURCE_DIR}/config/clang-warnings/general") @@ -152,7 +156,11 @@ if (NOT MSVC AND NOT MINGW) 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") - ADD_H5_FLAGS (H5_CXXFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/cxx-error-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 6.x+ know about @@ -177,7 +185,11 @@ if (NOT MSVC AND NOT MINGW) 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") - #ADD_H5_FLAGS (H5_CXXFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-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") diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 31af2f8..5f35e61 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -69,6 +69,18 @@ endif () # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- 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 () + if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") list (APPEND HDF5_CMAKE_C_FLAGS "-erroff=%none -DBSD_COMP") else () @@ -96,14 +108,22 @@ if (NOT MSVC AND NOT MINGW) # 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") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-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") - ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") + if (HDF5_ENABLE_WARNINGS_AS_ERRORS) + ADD_H5_FLAGS (H5_CFLAGS0 "${HDF5_SOURCE_DIR}/config/clang-warnings/error-general") + else () + ADD_H5_FLAGS (H5_CFLAGS0 "${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 () @@ -132,7 +152,6 @@ if (NOT MSVC AND NOT MINGW) 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 @@ -158,7 +177,11 @@ if (NOT MSVC AND NOT MINGW) # 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") - ADD_H5_FLAGS (H5_CFLAGS1 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-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 () endif () # Append more extra warning flags that only gcc 6.x+ know about @@ -179,7 +202,9 @@ if (NOT MSVC AND NOT MINGW) # 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") - ADD_H5_FLAGS (H5_CFLAGS3 "${HDF5_SOURCE_DIR}/config/gnu-warnings/error-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 () diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 926e230..71c8b4a 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -40,6 +40,8 @@ set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) +set (HDF5_MINGW_STATIC_GCC_LIBS ON CACHE BOOL "Statically link libgcc/libstdc++" FORCE) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) @@ -155,15 +157,15 @@ set (LZF_PACKAGE_NAME "lzf" CACHE STRING "Name of LZF package" FORCE) #set (MAFISC_PACKAGE_NAME "mafisc" CACHE STRING "Name of MAFISC package" FORCE) ###### -# sz +# szf ###### -set (SZ_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ from github repository" FORCE) -set (SZ_GIT_BRANCH "master" CACHE STRING "" FORCE) +set (SZF_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ from github repository" FORCE) +set (SZF_GIT_BRANCH "master" CACHE STRING "" FORCE) -set (SZ_TGZ_NAME "sz.tar.gz" CACHE STRING "Use SZ from compressed file" FORCE) +set (SZF_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ from compressed file" FORCE) -set (SZ_PACKAGE_NAME "sz" CACHE STRING "Name of SZ package" FORCE) +set (SZF_PACKAGE_NAME "szf" CACHE STRING "Name of SZ package" FORCE) ###### # zfp diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 41570eb..7d59ce5 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -49,7 +49,7 @@ endif () message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}") -if (WIN32 OR MINGW) +if (WIN32) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -131,7 +131,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -202,7 +202,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/cmake/jvolTest.cmake b/config/cmake/jvolTest.cmake index 3a3877b..bcd9dbd 100644 --- a/config/cmake/jvolTest.cmake +++ b/config/cmake/jvolTest.cmake @@ -54,7 +54,7 @@ message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.sl set (ENV{HDF5_VOL_CONNECTOR} "${TEST_VOL}") -if (WIN32 OR MINGW) +if (WIN32) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -136,7 +136,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list(LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -207,7 +207,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list(LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 3a8d5b7..61c535e 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -204,7 +204,7 @@ endif () #set (LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set (LOCAL_UPDATE "TRUE") -set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") +set (REPOSITORY_URL "https://github.com/HDFGroup/hdf5.git") set (REPOSITORY_BRANCH "develop") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index f132234..33ec74b 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -57,7 +57,9 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") ### ext libs on system #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO") +#set(ENV{ZLIB_ROOT} "some_location") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") +#set(ENV{SZIP_ROOT} "some_location") #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") ### disable using ext zlib diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index eb0392e..8ca8159 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -143,8 +143,8 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) endif () endif () - #----- Use MSVC Naming conventions for Shared Libraries - if (MINGW AND ${libtype} MATCHES "SHARED") + option (HDF5_MSVC_NAMING_CONVENTION "Use MSVC Naming conventions for Shared Libraries" OFF) + if (HDF5_MSVC_NAMING_CONVENTION AND MINGW AND ${libtype} MATCHES "SHARED") set_target_properties (${libtarget} PROPERTIES IMPORT_SUFFIX ".lib" IMPORT_PREFIX "" @@ -343,7 +343,7 @@ macro (HDF_DIR_PATHS package_prefix) set (${package_prefix}_INSTALL_INCLUDE_DIR include) endif () if (NOT ${package_prefix}_INSTALL_DATA_DIR) - if (NOT WIN32) + if (NOT MSVC) if (APPLE) if (${package_prefix}_BUILD_FRAMEWORKS) set (${package_prefix}_INSTALL_EXTRA_DIR ../SharedSupport) @@ -353,12 +353,13 @@ macro (HDF_DIR_PATHS package_prefix) set (${package_prefix}_INSTALL_FWRK_DIR ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) endif () set (${package_prefix}_INSTALL_DATA_DIR share) - set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) else () set (${package_prefix}_INSTALL_DATA_DIR ".") - set (${package_prefix}_INSTALL_CMAKE_DIR cmake) endif () endif () + if (NOT ${package_prefix}_INSTALL_CMAKE_DIR) + set (${package_prefix}_INSTALL_CMAKE_DIR share/cmake) + endif () # Always use full RPATH, i.e. don't skip the full RPATH for the build tree set (CMAKE_SKIP_BUILD_RPATH FALSE) diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index b011ae8..758b62b 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -46,7 +46,7 @@ endif () message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -105,7 +105,7 @@ if (TEST_ERRREF) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 2b8b6b0..baf15c0 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -38,7 +38,7 @@ endif () message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") @@ -212,7 +212,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) @@ -283,7 +283,7 @@ if (NOT TEST_SKIP_COMPARE) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) - if (WIN32 OR MINGW) + if (WIN32) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) diff --git a/config/commence.am b/config/commence.am index 6e3d9a9..f47d704 100644 --- a/config/commence.am +++ b/config/commence.am @@ -70,9 +70,9 @@ H5CPP=${DESTDIR}$(bindir)/h5c++ # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. -AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@ +AM_CFLAGS=@AM_CFLAGS@ @H5_CFLAGS@ AM_FCFLAGS=@AM_FCFLAGS@ @H5_FCFLAGS@ -AM_CXXFLAGS=@AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@ +AM_CXXFLAGS=@AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_CPPFLAGS=@AM_CPPFLAGS@ @H5_CPPFLAGS@ AM_LDFLAGS=@AM_LDFLAGS@ @H5_LDFLAGS@ @@ -96,9 +96,9 @@ CHECK_CLEANFILES=*.chkexe *.chklog *.clog *.clog2 # commands that should be executed even if a file with the same name already # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ - build-tests check-clean check-install check-p check-s check-vfd \ - check-passthrough-vol install-doc lib progs tests uninstall-doc \ - _exec_check-s _test help + build-tests check-clean check-install check-p check-s check-vfd \ + check-passthrough-vol install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help trace doxygen help: @$(top_srcdir)/bin/makehelp diff --git a/config/gnu-cxxflags b/config/gnu-cxxflags index 44cbc69..eb490b3 100644 --- a/config/gnu-cxxflags +++ b/config/gnu-cxxflags @@ -184,6 +184,7 @@ if test "X-g++" = "X-$cxx_vendor"; then if test $cxx_vers_major -eq 4 -a $cxx_vers_minor -ge 8 -o $cxx_vers_major -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-general)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-general)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments cxx-noerror-general)" ###################### # Developer warnings # @@ -224,6 +225,7 @@ if test "X-g++" = "X-$cxx_vendor"; then if test $cxx_vers_major -ge 5; then H5_CXXFLAGS="$H5_CXXFLAGS $(load_gnu_arguments cxx-5)" H5_ECXXFLAGS="$H5_ECXXFLAGS $(load_gnu_arguments cxx-error-5)" + H5_NECXXFLAGS="$H5_NECXXFLAGS $(load_gnu_arguments cxx-noerror-5)" fi # gcc >= 6 @@ -241,6 +243,7 @@ if test "X-g++" = "X-$cxx_vendor"; then if test $cxx_vers_major -ge 8; then 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)" 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 diff --git a/config/gnu-flags b/config/gnu-flags index 7cf90b8..f9b9ceb 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -118,12 +118,16 @@ if test "X-gcc" = "X-$cc_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 needs the "-std=c99" flag removed. cygwin-*) ;; - + # On Solaris, gcc needs the gnu99 standard to pick up certain POSIX + # things. Do NOT use this as the gcc norm as this encourages the use + # of non-standard gcc extensions. + *solaris*) + H5_CFLAGS="$H5_CFLAGS -std=gnu99" + ;; + # Everybody else gets c99 as the standard. *) H5_CFLAGS="$H5_CFLAGS -std=c99" ;; @@ -192,6 +196,7 @@ if test "X-gcc" = "X-$cc_vendor"; then if test $cc_vers_major -eq 4 -a $cc_vers_minor -ge 8 -o $cc_vers_major -gt 4; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments general)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-general)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-general)" ###################### # Developer warnings # @@ -231,6 +236,7 @@ if test "X-gcc" = "X-$cc_vendor"; then if test $cc_vers_major -ge 5; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 5)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-5)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-5)" fi # gcc >= 6 @@ -248,6 +254,7 @@ if test "X-gcc" = "X-$cc_vendor"; then if test $cc_vers_major -ge 8; then H5_CFLAGS="$H5_CFLAGS $(load_gnu_arguments 8)" H5_ECFLAGS="$H5_ECFLAGS $(load_gnu_arguments error-8)" + H5_NECFLAGS="$H5_NECFLAGS $(load_gnu_arguments noerror-8)" DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments developer-8)" NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS $(load_gnu_arguments no-developer-8)" fi diff --git a/config/gnu-warnings/7 b/config/gnu-warnings/7 index 266f5c1..9d5b44d 100644 --- a/config/gnu-warnings/7 +++ b/config/gnu-warnings/7 @@ -3,5 +3,4 @@ -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=1 --Wimplicit-fallthrough=5 -Wrestrict diff --git a/config/gnu-warnings/cxx-noerror-5 b/config/gnu-warnings/cxx-noerror-5 new file mode 100644 index 0000000..7bce3e8 --- /dev/null +++ b/config/gnu-warnings/cxx-noerror-5 @@ -0,0 +1,11 @@ +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Wshadow diff --git a/config/gnu-warnings/cxx-noerror-general b/config/gnu-warnings/cxx-noerror-general new file mode 100644 index 0000000..8cc1d94 --- /dev/null +++ b/config/gnu-warnings/cxx-noerror-general @@ -0,0 +1,32 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tcompound.cpp +# -Werror=cast-align +-Wcast-align +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp +# -Werror=missing-declarations +-Wmissing-declarations +-Wpacked +-Wredundant-decls +-Wswitch +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/tattr.cpp +# -Werror=unused-but-set-variable +-Wunused-but-set-variable +-Wunused-function +-Wunused-variable +# NOTE: c++/src files are not compatible with these warnings as errors +# c++/src/H5Object.cpp,c++/src/H5StrType.cpp,c++/src/H5PredType.cpp +# -Werror=unused-parameter +-Wunused-parameter +# +# Other files not compatible +# NOTE: c++/test files are not compatible with these warnings as errors +# c++/test/titerate.cpp,c++/test/tarray.cpp +# -Werror=missing-declarations +# c++/test/titerate.cpp,c++/test/tarray.cpp,c++/test/tlinks.cpp,c++/test/ttypes.cpp,c++/test/dsets.cpp +# -Werror=unused-parameter diff --git a/config/gnu-warnings/noerror-5 b/config/gnu-warnings/noerror-5 new file mode 100644 index 0000000..a7d40dd --- /dev/null +++ b/config/gnu-warnings/noerror-5 @@ -0,0 +1,12 @@ +-Wincompatible-pointer-types +# +# In GCC 4.4.7, the compiler gripes about shadowed global +# declarations when a local variable uses the name of a +# function that's in a system header file. For some reason, +# later versions of GCC (e.g., 5.2.0) don't complain about +# the shadowed globals. Maybe later versions are less fussy? +# Anyway, the shadowing seems to be harmless, and GCC 4.4.7 +# is not a supported compiler, so let us promote shadowed globals +# warnings to errors only for GCC 5 and later. +# +-Wshadow diff --git a/config/gnu-warnings/noerror-8 b/config/gnu-warnings/noerror-8 new file mode 100644 index 0000000..2f54a4d --- /dev/null +++ b/config/gnu-warnings/noerror-8 @@ -0,0 +1,25 @@ +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Dchunk.c +# -Werror=cast-function-type +-Wcast-function-type +# +# For GCC 8, promote maybe-initialized warnings to an error. GCC 8 +# reports 0 maybe-uninitialized warnings where earlier versions +# make many false reports. GCC 8 seems to analyze calls to static +# in order to detect initializations that occur there. It's possible +# that GCC 8 only performs that analysis at -O3, though. +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDlog.c, +# -Werror=maybe-uninitialized +-Wmaybe-uninitialized +# NOTE: src/ files are not compatible with these warnings as errors +# src/H5Shyper.c,src/H5SL.c,src/H5Shyper.c +# -Werror=maybe-uninitialized +# NOTE: Test files are not compatible with these warnings as errors +# test/cache_common.c, +# -Werror=maybe-uninitialized +# NOTE: hl/src/ files are not compatible with these warnings as errors +# hl/src/H5DS.c, +# -Werror=maybe-uninitialized diff --git a/config/gnu-warnings/noerror-general b/config/gnu-warnings/noerror-general new file mode 100644 index 0000000..e19014f --- /dev/null +++ b/config/gnu-warnings/noerror-general @@ -0,0 +1,91 @@ +# +# HDF5 code should not trigger the following warnings under any +# circumstances, so ask the compiler to treat them as errors: +# +-Wbad-function-cast +-Wdeclaration-after-statement +-Wimplicit-function-declaration +-Wmissing-declarations +-Wmissing-prototypes +-Wnested-externs +-Wold-style-definition +-Wpacked +-Wpointer-sign +-Wpointer-to-int-cast +-Wredundant-decls +-Wstrict-prototypes +-Wswitch +# +#-Werror=discarded-qualifiers +# +# +# NOTE: File Driver files are not compatible with these warnings as errors +# H5FDdirect.c,H5FDmpio.c,H5FDros3.c, +# -Werror=unused-function +# +-Wunused-function +# +# H5FDdrvr_module.h +# -Werror=unused-variable +# +-Wunused-variable +# +# H5VLpassthru.c +# -Werror=unused-parameter +# +-Wunused-parameter +# +# +# +# NOTE: Tools files are not compatible with these warnings as errors +# lib/h5tools.c +# -Werror=cast-align +# +-Wcast-align +# +# lib/h5diff_array.c +# -Werror=unused-but-set-variable +# +-Wunused-but-set-variable +# +# lib/h5tools_utils.c +# -Werror=unused-parameter +# +# +# NOTE: JNI files are not compatible with these warnings as errors +# jni/h5pDCPLImp.c,jni/nativeData.c,jni/h5util.c,jni/h5rImp.c +# jni/h5sImp.c,jni/h5tImp.c +# -Werror=cast-align +# jni/h5util.c +# -Werror=format(-overflow) +# +-Wformat +# +# +#Examples and tests do not use the same set of extensive warning flags as libraries +# Here is a list of tests and examples that have issues with the stricter warnings as error +# +# NOTE: Test files are not compatible with these warnings as errors +# thread_id.c, +# -Werror=unused-function +# dsets.c +# -Werror=unused-parameter +# external.c,perform/sio_engine.c +# -Werror=format(-truncation) +# +# +# NOTE: Examples files are not compatible with these warnings as errors +# h5_vds-eiger.c,h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c,h5_vds-percival-unlim-maxmin.c +# h5_vds-percival.c,h5_read.c,h5_rdwt.c,h5_mount.c,h5_extend.c,h5_extend_write.c +# h5_write.c,h5_vds-simpleIO.c,h5_ref2reg_deprec.c,h5_crtgrp.c,h5_select.c +# h5_vds-percival-unlim.c,h5_crtatt.c,h5_group.c,h5_attribute.c,h5_crtdat.c +# h5_reference_deprec.c +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=strict-prototypes +# h5_rdwt.c,h5_crtgrp.c,h5_crtatt.c,h5_crtdat.c +# -Werror=old-style-definition +# h5_vds-exclim.c,h5_vds.c,h5_vds-exc.c, +# -Werror=unused-variable +# h5_elink_unix2win.c,h5_extlink.c,h5_attribute.c +# -Werror=unused-parameter + diff --git a/config/sanitizer/formatting.cmake b/config/sanitizer/formatting.cmake index 677a69a..5aaa2a6 100644 --- a/config/sanitizer/formatting.cmake +++ b/config/sanitizer/formatting.cmake @@ -90,55 +90,3 @@ function(clang_format TARGET_NAME) endif() endfunction() -# -# cmake-format -# -find_program(CMAKE_FORMAT_EXE "cmake-format") -mark_as_advanced(FORCE CMAKE_FORMAT_EXE) -if(CMAKE_FORMAT_EXE) - message(STATUS "cmake-format found: ${CMAKE_FORMAT_EXE}") -else() - message(STATUS "cmake-format not found!") -endif() - -# When called, this function will call 'cmake-format' program on all listed -# files (if both the program and the files exist and are found) -# ~~~ -# Required: -# TARGET_NAME - The name of the target to create. -# -# Optional: -# ARGN - Any arguments passed in will be considered as 'files' to perform the -# formatting on. Any items that are not files will be ignored. Both relative and -# absolute paths are accepted. -# ~~~ -function(cmake_format TARGET_NAME) - if(CMAKE_FORMAT_EXE) - set(FORMAT_FILES) - # Determine files that exist - foreach(iter IN LISTS ARGN) - if(EXISTS ${iter}) - set(FORMAT_FILES ${FORMAT_FILES} ${iter}) - elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${iter}) - set(FORMAT_FILES ${FORMAT_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${iter}) - endif() - endforeach() - - # Generate target - if(FORMAT_FILES) - if(TARGET ${TARGET_NAME}) - message( - ERROR - "Cannot create cmake-format target '${TARGET_NAME}', already exists.") - else() - add_custom_target(${TARGET_NAME} COMMAND ${CMAKE_FORMAT_EXE} -i - ${FORMAT_FILES}) - - if(NOT TARGET cmake-format) - add_custom_target(cmake-format) - endif() - add_dependencies(cmake-format ${TARGET_NAME}) - endif() - endif() - endif() -endfunction() diff --git a/config/sanitizer/tools.cmake b/config/sanitizer/tools.cmake index 2f73cce..242e33f 100644 --- a/config/sanitizer/tools.cmake +++ b/config/sanitizer/tools.cmake @@ -111,4 +111,4 @@ else() set(CMAKE_CXX_CPPCHECK "" CACHE STRING "" FORCE) # delete it -endif()
\ No newline at end of file +endif() diff --git a/configure.ac b/configure.ac index e7a65ce..15ca068 100644 --- a/configure.ac +++ b/configure.ac @@ -104,14 +104,10 @@ AC_SUBST([AR_FLAGS]) ## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but ## not exported to h5cc (or h5fc, etc.) ## -## H5_ECFLAGS (and company) are for warnings that should be treated as errors. -## AC_SUBST([H5_CFLAGS]) -AC_SUBST([H5_ECFLAGS]) AC_SUBST([H5_CPPFLAGS]) AC_SUBST([H5_FCFLAGS]) AC_SUBST([H5_CXXFLAGS]) -AC_SUBST([H5_ECXXFLAGS]) AC_SUBST([H5_JNIFLAGS]) AC_SUBST([H5_JAVACFLAGS]) AC_SUBST([H5_JAVAFLAGS]) @@ -296,7 +292,7 @@ AC_MSG_CHECKING([for clang sanitizer checks]) AC_ARG_ENABLE([sanitize-checks], [AS_HELP_STRING([--enable-sanitize-checks=address], [(clang/clang++ compilers only) Enable sanitize checks. - Address is useful for detecting issues dealing with + Address is useful for detecting issues dealing with memory. See AddressSanitizer in config/sanitizer/README.md for more information. [default=none] @@ -311,7 +307,7 @@ fi if test "X$CC_BASENAME" = "Xclang"; then AC_SUBST([CLANG_SANITIZE_CHECKS]) - # There are several sanitizer tools. At present we are testing + # There are several sanitizer tools. At present we are testing # and describing only -fsanitizer=address with autotools. case "X-$CLANG_SANITIZE_CHECKS" in X-no|X-none) @@ -328,8 +324,8 @@ if test "X$CC_BASENAME" = "Xclang"; then # The clang compiler doesn't support some of them; they should be # checked before adding them to the list in the help message. # The sanitizers/sanitizers.cmake file lists these options: - # address, memory, memoryWithOrigins, undefined, thread, leak, - # 'address;undefined'. Which and which combinations of these are + # address, memory, memoryWithOrigins, undefined, thread, leak, + # 'address;undefined'. Which and which combinations of these are # supported varies by compiler version, but unsupported options # or combinations will result in configure errors reported in config.log. # Comma separated lists of sanitize options wil be entered intact in @@ -1024,7 +1020,10 @@ AC_ARG_ENABLE([tests], [HDF5_TESTS=$enableval]) if test "X$HDF5_TESTS" = "Xno"; then + AC_MSG_RESULT([yes]) echo "Building HDF5 tests is disabled" +else + AC_MSG_RESULT([no]) fi ## ---------------------------------------------------------------------- @@ -1045,10 +1044,71 @@ AC_ARG_ENABLE([tools], [HDF5_TOOLS=$enableval]) if test "X$HDF5_TOOLS" = "Xno"; then + AC_MSG_RESULT([yes]) echo "Building HDF5 tools is disabled" +else + AC_MSG_RESULT([no]) fi ## ---------------------------------------------------------------------- +## Check if they would like to enable building doxygen files +## + +## This needs to be exposed for the library info file. +AC_SUBST([HDF5_DOXYGEN]) + +## Default is to not build DOXYGEN +HDF5_DOXYGEN=no + +AC_MSG_CHECKING([if building doxygen is enabled]) + +AC_ARG_ENABLE([doxygen], + [AS_HELP_STRING([--enable-doxygen], + [Compile the HDF5 doxygen files [default=no]])], + [HDF5_DOXYGEN=$enableval]) + +if test "X$HDF5_DOXYGEN" = "Xyes"; then + AC_MSG_RESULT([yes]) + DX_DOXYGEN_FEATURE(ON) + DX_DOT_FEATURE(OFF) + DX_HTML_FEATURE(ON) + DX_CHM_FEATURE(OFF) + DX_CHI_FEATURE(OFF) + DX_MAN_FEATURE(ON) + DX_RTF_FEATURE(OFF) + DX_XML_FEATURE(OFF) + DX_PDF_FEATURE(OFF) + DX_PS_FEATURE(OFF) + + AC_SUBST([DOXYGEN_PACKAGE]) + AC_SUBST([DOXYGEN_VERSION_STRING]) + AC_SUBST([DOXYGEN_INCLUDE_ALIASES]) + AC_SUBST([DOXYGEN_PROJECT_LOGO]) + AC_SUBST([DOXYGEN_PROJECT_BRIEF]) + AC_SUBST([DOXYGEN_INPUT_DIRECTORY]) + AC_SUBST([DOXYGEN_OPTIMIZE_OUTPUT_FOR_C]) + AC_SUBST([DOXYGEN_MACRO_EXPANSION]) + AC_SUBST([DOXYGEN_OUTPUT_DIRECTORY]) + + 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_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]) + +else + AC_MSG_RESULT([no]) + echo "Doxygen support is disabled" +fi + + +## ---------------------------------------------------------------------- ## Create libtool. If shared/static libraries are going to be enabled ## or disabled, it should happen before these macros. LT_PREREQ([2.2]) @@ -2184,10 +2244,6 @@ if test "X-$DEV_WARNINGS" = X- ; then DEV_WARNINGS=no fi -## Allow this variable to be substituted in -## other files (src/libhdf5.settings.in, etc.) -AC_SUBST([DEV_WARNINGS]) - case "X-$DEV_WARNINGS" in X-yes) H5_CFLAGS="$H5_CFLAGS $DEVELOPER_WARNING_CFLAGS" @@ -2203,6 +2259,45 @@ case "X-$DEV_WARNINGS" in esac ## ---------------------------------------------------------------------- +## Check if we should consider certain compiler warnings as errors +## +## These should NOT be on by default as the risk of breakage is high +## when compiling HDF5 on new (or new versions) of platforms and +## compilers. It can also cause failures when header files we have no +## control over (e.g. MPI, HDFS) raise warnings. +## +AC_MSG_CHECKING([enable warnings as errors]) +AC_ARG_ENABLE([warnings-as-errors], + [AS_HELP_STRING([--enable-warnings-as-errors], + [Determines whether certain warnings will be + considered errors. This is mainly for use + by HDF5 library developers. + [default=no] + ])], + [WARNINGS_AS_ERRORS=$enableval]) + +## Set default +if test "X-$WARNINGS_AS_ERRORS" = X- ; then + WARNINGS_AS_ERRORS=no +fi + +case "X-$WARNINGS_AS_ERRORS" in + X-yes) + H5_CFLAGS="$H5_CFLAGS $H5_ECFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $H5_ECXXFLAGS" + AC_MSG_RESULT([yes]) + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $H5_NECFLAGS" + H5_CXXFLAGS="$H5_CXXFLAGS $H5_NECXXFLAGS" + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_ERROR([Unrecognized value: $WARNINGS_AS_ERRORS]) + ;; +esac + +## ---------------------------------------------------------------------- ## Check if the compiler should use profiling flags/settings ## AC_MSG_CHECKING([profiling]) @@ -3124,6 +3219,9 @@ if test "x$HAVE_LIBHDFS" = "xyes"; then [Proceed to build with libhdfs]) fi +## Read-only HDFS files are not built if not required. +AM_CONDITIONAL([HDFS_VFD_CONDITIONAL], [test "X$HAVE_LIBHDFS" = "Xyes"]) + ## Checkpoint the cache AC_CACHE_SAVE @@ -3758,6 +3856,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_DOXYGEN_CONDITIONAL], [test "X$HDF5_DOXYGEN" = "Xyes"]) ## ---------------------------------------------------------------------- ## Build the Makefiles. @@ -3863,6 +3962,7 @@ AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) AC_CONFIG_FILES([src/libhdf5.settings Makefile + doxygen/Doxyfile src/Makefile test/Makefile test/H5srcdir_str.h diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in new file mode 100644 index 0000000..24fc4ba --- /dev/null +++ b/doxygen/Doxyfile.in @@ -0,0 +1,2545 @@ +# Doxyfile 1.8.18 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = @DOXYGEN_PACKAGE@ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = @DOXYGEN_VERSION_STRING@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = @DOXYGEN_PROJECT_BRIEF@ + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = @DOXYGEN_PROJECT_LOGO@ + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @DOXYGEN_OUTPUT_DIRECTORY@ + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# 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 = + +# 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 +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) + +ALIASES = + +@INCLUDE = @DOXYGEN_INCLUDE_ALIASES@ + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = YES + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# (including Cygwin) ands Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = YES + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = YES + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if <section_label> ... \endif and \cond <section_label> +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +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 +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = @DOXYGEN_INPUT_DIRECTORY@ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = H5*public.h \ + H5*module.h \ + H5FDmpio.h \ + H5VLconnector.h \ + H5VLconnector_passthru.h \ + H5VLnative.h \ + H5version.h \ + *.dox + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = examples + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = ../src ../examples ../test examples + +# 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 +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = *.c + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# <filter> <input-file> +# +# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = NO + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = NO + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +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 +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = H5 + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +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 +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# 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 = + +# 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 +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# 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 +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png The default and svg Looks nicer but requires the +# pdf2svg tool. +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use <access key> + S +# (what the <access key> is depends on the OS and browser, but it is typically +# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down +# key> to jump into the search results window, the results can be navigated +# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel +# the search. The filter options can be selected when the cursor is inside the +# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys> +# to select a filter and <Enter> or <escape> to activate or cancel the filter +# option. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +SEARCHENGINE = NO + +# 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 +# are two flavors of web server based searching depending on the EXTERNAL_SEARCH +# setting. When disabled, doxygen will generate a PHP script for searching and +# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing +# and searching needs to be provided by external tools. See the section +# "External Indexing and Searching" for details. +# The default value is: NO. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SERVER_BASED_SEARCH = YES + +# 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 +# which needs to be processed by an external indexer. Doxygen will invoke an +# external search engine pointed to by the SEARCHENGINE_URL option to obtain the +# search results. +# +# Doxygen ships with an example indexer (doxyindexer) and search engine +# (doxysearch.cgi) which are based on the open source search engine library +# Xapian (see: https://xapian.org/). +# +# See the section "External Indexing and Searching" for details. +# The default value is: NO. +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTERNAL_SEARCH = NO + +# 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. +# +# Doxygen ships with an example indexer (doxyindexer) and search engine +# (doxysearch.cgi) which are based on the open source search engine library +# Xapian (see: https://xapian.org/). See the section "External Indexing and +# Searching" for details. +# This tag requires that the tag SEARCHENGINE is set to YES. + +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 +# SEARCHDATA_FILE tag the name of this file can be specified. +# The default file is: searchdata.xml. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SEARCHDATA_FILE = searchdata.xml + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the +# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is +# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple +# projects and redirect the results back to the right project. +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTERNAL_SEARCH_ID = + +# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen +# projects other than the one defined by this configuration file, but that are +# all added to the same external search index. Each project needs to have a +# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of +# to a relative location where the documentation can be found. The format is: +# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTRA_SEARCH_MAPPINGS = + +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. +# The default value is: YES. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: latex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. +# +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_CMD_NAME = + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate +# index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). +# The default file is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +MAKEINDEX_CMD_NAME = makeindex + +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used by the +# printer. +# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x +# 14 inches) and executive (7.25 x 10.5 inches). +# The default value is: a4. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} +# If left blank no extra packages will be included. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the +# generated LaTeX document. The header should contain everything until the first +# chapter. If it is left blank doxygen will generate a standard header. See +# section "Doxygen usage" for information on how to let doxygen write the +# default header to a separate file. +# +# Note: Only use a user-defined header if you know what you are doing! The +# following commands have a special meaning inside the header: $title, +# $datetime, $date, $doxygenversion, $projectname, $projectnumber, +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the +# generated LaTeX document. The footer should contain everything after the last +# chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. +# +# Note: Only use a user-defined footer if you know what you are doing! +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_FOOTER = + +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + +# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the LATEX_OUTPUT output +# directory. Note that the files will be copied as-is; there are no commands or +# markers available. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_FILES = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is +# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will +# contain links (just like the HTML output) instead of page references. This +# makes the output suitable for online browsing using a PDF viewer. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate +# the PDF file directly from the LaTeX files. Set this option to YES, to get a +# higher quality PDF documentation. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode +# command to the generated LaTeX files. This will instruct LaTeX to keep running +# if errors occur, instead of asking the user for help. This option is also used +# when generating formulas in HTML. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BATCHMODE = NO + +# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the +# index chapters (such as File Index, Compound Index, etc.) in the output. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HIDE_INDICES = NO + +# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source +# code with syntax highlighting in the LaTeX output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. See +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# The default value is: plain. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BIB_STYLE = plain + +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The +# RTF output is optimized for Word 97 and may not look too pretty with other RTF +# readers/editors. +# The default value is: NO. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: rtf. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will +# contain hyperlink fields. The RTF file will contain links (just like the HTML +# output) instead of page references. This makes the output suitable for online +# browsing using Word or some other Word compatible readers that support those +# fields. +# +# Note: WordPad (write) and others do not support links. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. +# +# See also section "Doxygen usage" for information on how to generate the +# default style sheet that doxygen normally uses. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an RTF document. Syntax is +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_EXTENSIONS_FILE = + +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for +# classes and files. +# The default value is: NO. + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. A directory man3 will be created inside the directory specified by +# MAN_OUTPUT. +# The default directory is: man. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to the generated +# man pages. In case the manual section does not start with a number, the number +# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is +# optional. +# The default value is: .3. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_EXTENSION = .3 + +# The MAN_SUBDIR tag determines the name of the directory created within +# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by +# MAN_EXTENSION with the initial . removed. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_SUBDIR = + +# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it +# will generate one additional man file for each entity documented in the real +# man page(s). These additional files only source the real man page, but without +# them the man command would be unable to find the correct page. +# The default value is: NO. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that +# captures the structure of the code including all documentation. +# The default value is: NO. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: xml. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_OUTPUT = xml + +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program +# listings (including syntax highlighting and cross-referencing information) to +# the XML output. Note that enabling this will significantly increase the size +# of the XML output. +# The default value is: YES. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_PROGRAMLISTING = YES + +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files +# that can be used to generate PDF. +# The default value is: NO. + +GENERATE_DOCBOOK = NO + +# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in +# front of it. +# The default directory is: docbook. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_OUTPUT = docbook + +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the +# program listings (including syntax highlighting and cross-referencing +# information) to the DOCBOOK output. Note that enabling this will significantly +# increase the size of the DOCBOOK output. +# The default value is: NO. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_PROGRAMLISTING = NO + +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module +# file that captures the structure of the code including all documentation. +# +# Note that this feature is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary +# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI +# output from the Perl module output. +# The default value is: NO. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely +# formatted so it can be parsed by a human reader. This is useful if you want to +# understand what is going on. On the other hand, if this tag is set to NO, the +# size of the Perl module output will be much smaller and Perl will parse it +# just the same. +# The default value is: YES. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file are +# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful +# so different doxyrules.make files included by the same Makefile don't +# overwrite each other's variables. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all +# C-preprocessor directives found in the sources and include files. +# The default value is: YES. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be +# performed. Macro expansion can be done in a controlled way by setting +# EXPAND_ONLY_PREDEF to YES. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then +# the macro expansion is limited to the macros specified with the PREDEFINED and +# EXPAND_AS_DEFINED tags. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES, the include files in the +# INCLUDE_PATH will be searched if a #include is found. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by the +# preprocessor. +# This tag requires that the tag SEARCH_INCLUDES is set to YES. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will be +# used. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that are +# defined before the preprocessor is started (similar to the -D option of e.g. +# gcc). The argument of the tag is a list of macros of the form: name or +# name=definition (no spaces). If the definition and the "=" are omitted, "=1" +# is assumed. To prevent a macro definition from being undefined via #undef or +# recursively expanded use the := operator instead of the = operator. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +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 +# macro definition that is found in the sources will be used. Use the PREDEFINED +# tag if you want to use a different macro definition that overrules the +# definition found in the source code. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will +# remove all references to function-like macros that are alone on a line, have +# an all uppercase name, and do not end with a semicolon. Such function macros +# are typically used for boiler-plate code, and will confuse the parser if not +# removed. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES tag can be used to specify one or more tag files. For each tag +# file the location of the external documentation should be added. The format of +# a tag file without this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where loc1 and loc2 can be relative or absolute paths or URLs. See the +# section "Linking to external documentation" for more information about the use +# of tag files. +# Note: Each tag file must have a unique name (where the name does NOT include +# the path). If a tag file is not located in the directory in which doxygen is +# run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create a +# 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 = + +# 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 +# listed. +# The default value is: NO. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be +# listed. +# The default value is: YES. + +EXTERNAL_GROUPS = YES + +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in +# the related pages index. If set to NO, only the current project's pages will +# be listed. +# The default value is: YES. + +EXTERNAL_PAGES = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram +# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to +# NO turns the diagrams off. Note that this option also works with HAVE_DOT +# disabled, but it is recommended to install and use dot, since it yields more +# powerful graphs. +# The default value is: YES. + +CLASS_DIAGRAMS = YES + +# You can include diagrams made with dia in doxygen documentation. Doxygen will +# then run dia to produce the diagram and insert it in the documentation. The +# DIA_PATH tag allows you to specify the directory where the dia binary resides. +# If left empty dia is assumed to be found in the default search path. + +DIA_PATH = + +# If set to YES the inheritance and collaboration graphs will hide inheritance +# and usage relations if the target is undocumented or is not a class. +# The default value is: YES. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz (see: +# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# Bell Labs. The other options in this section have no effect if this option is +# set to NO +# The default value is: NO. + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed +# to run in parallel. When set to 0 doxygen will base this on the number of +# processors available in the system. You can set it explicitly to a value +# larger than 0 to get control over the balance between CPU load and processing +# speed. +# Minimum value: 0, maximum value: 32, default value: 0. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_NUM_THREADS = 0 + +# When you want a differently looking font in the dot files that doxygen +# generates you can specify the font name using DOT_FONTNAME. You need to make +# sure dot is able to find the font, which can be done by putting it in a +# standard location or by setting the DOTFONTPATH environment variable or by +# setting DOT_FONTPATH to the directory containing the font. +# The default value is: Helvetica. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of +# dot graphs. +# Minimum value: 4, maximum value: 24, default value: 10. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the default font as specified with +# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set +# the path where dot can find it using this tag. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTPATH = + +# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for +# each documented class showing the direct and indirect inheritance relations. +# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a +# graph for each documented class showing the direct and indirect implementation +# dependencies (inheritance, containment, and class references variables) of the +# class with other documented classes. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for +# groups, showing the direct groups dependencies. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside the +# class node. If there are many fields or methods and many nodes the graph may +# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the +# number of items for each type to make the size more manageable. Set this to 0 +# for no limit. Note that the threshold may be exceeded by 50% before the limit +# is enforced. So when you set the threshold to 10, up to 15 fields may appear, +# but if the number exceeds 15, the total amount of fields shown is limited to +# 10. +# Minimum value: 0, maximum value: 100, default value: 10. +# This tag requires that the tag HAVE_DOT is set to YES. + +UML_LIMIT_NUM_FIELDS = 10 + +# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and +# collaboration graphs will show the relations between templates and their +# instances. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +TEMPLATE_RELATIONS = NO + +# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to +# YES then doxygen will generate a graph for each documented file showing the +# direct and indirect include dependencies of the file with other documented +# files. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +INCLUDE_GRAPH = YES + +# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are +# set to YES then doxygen will generate a graph for each documented file showing +# the direct and indirect include dependencies of the file with other documented +# files. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH tag is set to YES then doxygen will generate a call +# dependency graph for every global function or class method. +# +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller +# dependency graph for every global function or class method. +# +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical +# hierarchy of all classes instead of a textual one. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the +# dependencies a directory has on other directories in a graphical way. The +# dependency relations are determined by the #include relations between the +# files in the directories. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). +# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order +# to make the SVG files visible in IE 9+ (other browsers do not have this +# requirement). +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. +# The default value is: png. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# +# Note that this requires a modern browser other than Internet Explorer. Tested +# and working are Firefox, Chrome, Safari, and Opera. +# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make +# the SVG files visible. Older versions of IE do not have SVG support. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +INTERACTIVE_SVG = NO + +# The DOT_PATH tag can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the \dotfile +# command). +# This tag requires that the tag HAVE_DOT is set to YES. + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = + +# The DIAFILE_DIRS tag can be used to specify one or more directories that +# contain dia files that are included in the documentation (see the \diafile +# command). + +DIAFILE_DIRS = + +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file. If left blank, it is assumed +# PlantUML is not used or called during a preprocessing step. Doxygen will +# generate a warning when it encounters a \startuml command in this case and +# will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes +# that will be shown in the graph. If the number of nodes in a graph becomes +# larger than this value, doxygen will truncate the graph, which is visualized +# by representing a node as a red box. Note that doxygen if the number of direct +# children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that +# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. +# Minimum value: 0, maximum value: 10000, default value: 50. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs +# generated by dot. A depth value of 3 means that only nodes reachable from the +# root by following a path via at most 3 edges will be shown. Nodes that lay +# further from the root node will be omitted. Note that setting this option to 1 +# or 2 may greatly reduce the computation time needed for large code bases. Also +# note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. +# Minimum value: 0, maximum value: 1000, default value: 0. +# This tag requires that the tag HAVE_DOT is set to YES. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not seem +# to support this out of the box. +# +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) support +# this, this feature is disabled by default. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page +# explaining the meaning of the various boxes and arrows in the dot generated +# graphs. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# files that are used to generate the various graphs. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_CLEANUP = YES diff --git a/doxygen/aliases b/doxygen/aliases new file mode 100644 index 0000000..c10c3e8 --- /dev/null +++ b/doxygen/aliases @@ -0,0 +1,190 @@ +################################################################################ +# Styling +################################################################################ + +ALIASES += Bold{1}="<b>\1</b>" +ALIASES += Emph{1}="<em>\1</em>" +ALIASES += Code{1}="<tt>\1</tt>" + +################################################################################ +# Return values +################################################################################ + +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 += 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." + +################################################################################ +# General +################################################################################ + +ALIASES += idx_type="\param[in] idx_type Index type" +ALIASES += idx_type{1}="\param[in] \1 Index type" + +ALIASES += order="\param[in] order Iteration order" +ALIASES += order{1}="\param[in] \1 Iteration order" + +ALIASES += op="\param[in] op Callback function" +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" + +################################################################################ +# Attributes +################################################################################ + +ALIASES += attr_id="\param[in] attr_id Attribute identifier" +ALIASES += attr_id{1}="\param[in] \1 Attribute identifier" + +################################################################################ +# Dataset +################################################################################ + +ALIASES += dset_id="\param[in] dset_id Dataset identifier" +ALIASES += dset_id{1}="\param[in] \1 Dataset identifier" + +################################################################################ +# Dataspaces +################################################################################ + +ALIASES += space_id="\param[in] space_id Dataspace identifier" +ALIASES += space_id{1}="\param[in] \1 Dataspace identifier" + +################################################################################ +# Dataypes +################################################################################ + +ALIASES += type_id="\param[in] type_id Datatype identifier" +ALIASES += type_id{1}="\param[in] \1 Datatype identifier" + +ALIASES += file_type_id{1}="\param[in] \1 Datatype (in-file) identifier" +ALIASES += mem_type_id{1}="\param[in] \1 Datatype (in-memory) identifier" + +################################################################################ +# Files +################################################################################ + +ALIASES += file_id="\param[in] file_id File identifier" +ALIASES += file_id{1}="\param[in] \1 File identifier" + +ALIASES += fapl_id="\param[in] fapl_id File access property list identifier" +ALIASES += fapl_id{1}="\param[in] \1 File access property list identifier" + +ALIASES += fcpl_id="\param[in] fcpl_id File creation property list identifier" +ALIASES += fcpl_id{1}="\param[in] \1 File creation property list identifier" + +################################################################################ +# Groups +################################################################################ + +ALIASES += group_id="\param[in] group_id Group identifier" +ALIASES += group_id{1}="\param[in] \1 Group identifier" + +################################################################################ +# Locations +################################################################################ + +ALIASES += loc_id="\param[in] loc_id Location identifier" +ALIASES += loc_id{1}="\param[in] \1 Location identifier" + +ALIASES += fgdt_loc_id="\loc_id. The identifier may be that of a file, group, dataset, or named datatype." +ALIASES += fgdt_loc_id{1}="\loc_id{\1}. The identifier may be that of a file, group, dataset, or named datatype." + +ALIASES += fgdta_loc_id="\loc_id. The identifier may be that of a file, group, dataset, named datatype, or attribute." +ALIASES += fgdta_loc_id{1}="\loc_id{\1}. The identifier may be that of a file, group, dataset, named datatype, or attribute." + +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." + +################################################################################ +# Property lists +################################################################################ + +ALIASES += aapl_id="\param[in] aapl_id Attribute access property list identifier" +ALIASES += aapl_id{1}="\param[in] \1 Attribute access property list identifier" + +ALIASES += acpl_id="\param[in] acpl_id Attribute creation property list identifier" +ALIASES += acpl_id{1}="\param[in] \1 Attribute creation property list identifier" + +ALIASES += dapl_id="\param[in] dapl_id Dataset access property list identifier" +ALIASES += dapl_id{1}="\param[in] \1 Dataset access property list identifier" + +ALIASES += dcpl_id="\param[in] dcpl_id Dataset creation property list identifier" +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 += gapl_id="\param[in] gapl_id Group access property list identifier" +ALIASES += gapl_id{1}="\param[in] \1 Group access property list identifier" + +ALIASES += gcpl_id="\param[in] gcpl_id Group creation property list identifier" +ALIASES += gcpl_id{1}="\param[in] \1 Group creation property list identifier" + +ALIASES += lapl_id="\param[in] lapl_id Link access property list identifier" +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 += plist_id="\param[in] plist_id Property list identifier" +ALIASES += plist_id{1}="\param[in] \1 Property list identifier" + +ALIASES += plistcls_id="\param[in] plistcls_id Property list class identifier" +ALIASES += plistcls_id{1}="\param[in] \1 Property list class identifier" + +ALIASES += tapl_id="\param[in] tapl_id Datatype access property list identifier" +ALIASES += tapl_id{1}="\param[in] \1 Datatype access property list identifier" + +ALIASES += tcpl_id="\param[in] tcpl_id Datatype creation property list identifier" +ALIASES += tcpl_id{1}="\param[in] \1 Datatype creation property list identifier" + +ALIASES += vipl_id="\param[in] vipl_id VOL initialization property list identifier" +ALIASES += vipl_id{1}="\param[in] \1 vipl_id VOL initialization property list identifier" + +################################################################################ +# Objects +################################################################################ + +ALIASES += obj_id="\param[in] obj_id Object identifier" +ALIASES += obj_id{1}="\param[in] \1 Object identifier" +ALIASES += loc_obj_id{1}="\param[in] \1 Location identifier of object" + +ALIASES += fgdta_obj_id="\obj_id. The identifier may be that of a file, group, dataset, named datatype, or attribute." +ALIASES += fgdta_obj_id{1}="\obj_id{\1}. The identifier may be that of a file, group, dataset, named datatype, or attribute." +ALIASES += fgdta_loc_obj_id{1}="\loc_obj_id{\1}. The identifier may be that of a file, group, dataset, named datatype, or attribute." + +################################################################################ +# Others +################################################################################ + +ALIASES += estack_id="\param[in] estack_id Error stack identifier" +ALIASES += estack_id{1}="\param[in] \1 Error stack identifier" + +################################################################################ +# The Usual Suspects +################################################################################ + +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>" +ALIASES += id_types="<table><tr><td>#H5I_FILE</td><td>File</td></tr><tr><td>#H5I_GROUP</td><td>Group</td></tr><tr><td>#H5I_DATATYPE</td><td>Datatype</td></tr><tr><td>#H5I_DATASPACE</td><td>Dataspace</td></tr><tr><td>#H5I_DATASET</td><td>Dataset</td></tr><tr><td>#H5I_ATTR</td><td>Attribute</td></tr></table>" +ALIASES += indexes="<table><tr><td>#H5_INDEX_NAME</td><td>Lexicographic order on name</td></tr><tr><td>#H5_INDEX_CRT_ORDER</td><td>Index on creation order</td></tr></table>" +ALIASES += link_types="<table><tr><td>#H5L_TYPE_HARD</td><td>Hard link</td></tr><tr><td>#H5L_TYPE_SOFT</td><td>Soft link</td></tr><tr><td>#H5L_TYPE_EXTERNAL</td><td>External link</td></tr><tr><td>#H5L_TYPE_ERROR</td><td>Error</td></tr></table>" +ALIASES += mem_types="<table><tr><td>#H5FD_MEM_DEFAULT</td><td>The default file memory allocation type</td></tr><tr><td>#H5FD_MEM_SUPER</td><td>File memory allocated for Superblock</td></tr><tr><td>#H5FD_MEM_BTREE</td><td>File memory allocated for B-tree</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 Global Heap</td></tr><tr><td>#H5FD_MEM_LHEAP</td><td>File memory allocated for Local Heap</td></tr><tr><td>#H5FD_MEM_OHDR</td><td>File memory allocated for Object Header</td></tr></table>" +ALIASES += norm_type="<table><tr><td>#H5T_NORM_IMPLIED</td><td>0</td><td>MSB of mantissa is not stored, always 1</td></tr><tr><td>#H5T_NORM_MSBSET</td><td>1</td><td>MSB of mantissa is always 1</td></tr><tr><td>#H5T_NORM_NONE</td><td>2</td><td>Mantissa is not normalized</td></tr></table>" +ALIASES += obj_types="<table><tr><td>#H5F_OBJ_FILE</td><td>Files only</td></tr><tr><td>#H5F_OBJ_DATASET</td><td>Datasets only</td></tr><tr><td>#H5F_OBJ_GROUP</td><td>Groups only</td></tr><tr><td>#H5F_OBJ_DATATYPE</td><td>Named datatypes only</td></tr><tr><td>#H5F_OBJ_ATTR</td><td>Attributes only</td></tr><tr><td>#H5F_OBJ_ALL</td><td>All of the above</td></tr></tr><tr><td>#H5F_OBJ_LOCAL</td><td>Restrict search to objects opened through current file identifier.</td></tr></table> \attention #H5F_OBJ_LOCAL does not stand alone; it is effective only when used in combination with one or more of the preceding types. For example, #H5F_OBJ_DATASET | #H5F_OBJ_GROUP | #H5F_OBJ_LOCAL would count all datasets and groups opened through the current file identifier." +ALIASES += orders="<table><tr><td>#H5_ITER_INC</td><td>Increasing order</td></tr><tr><td>#H5_ITER_DEC</td><td>Decreasing order</td></tr><tr><td>#H5_ITER_NATIVE</td><td>Fastest available order</td></tr></table>" +ALIASES += padding_type="<table><tr><td>#H5T_PAD_ZERO</td><td>0</td><td>Set background to zeros</td></tr><tr><td>#H5T_PAD_ONE</td><td>1</td><td>Set background to ones</td></tr><tr><td>#H5T_PAD_BACKGROUND</td><td>2</td><td>Leave background alone</td></tr></table>" +ALIASES += scopes="<table><tr><td>#H5F_SCOPE_GLOBAL</td><td>Flushes the entire virtual file</td></tr><tr><td>#H5F_SCOPE_LOCAL</td><td>Flushes only the specified file</td></tr></table>" +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 += 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/H5AC_cache_config_t.dox b/doxygen/dox/H5AC_cache_config_t.dox new file mode 100644 index 0000000..9b9862b --- /dev/null +++ b/doxygen/dox/H5AC_cache_config_t.dox @@ -0,0 +1,415 @@ +/** + * \page H5AC-cache-config-t Metadata Cache Configuration + * \tableofcontents + * + * \section gcf General configuration fields + * + * \par 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. + * + * \par rpt_fcn_enabled + * \parblock + * 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. + * \endparblock + * + * \par open_trace_file + * \parblock + * Boolean field indicating whether the trace_file_name + * field should be used to open a trace file for the cache. + * + * \Emph{*** DEPRECATED ***} Use \Code{H5Fstart/stop} logging functions instead + * + * The trace file is a debuging feature that allow the capture of + * top level metadata cache requests for purposes of debugging and/or + * optimization. This field should normally be set to \c FALSE, as + * trace file collection imposes considerable overhead. + * + * This field should only be set to \c TRUE when the 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 \c close_trace_file + * field is also \c TRUE. + * \endparblock + * + * \par close_trace_file + * \parblock + * Boolean field indicating whether the current trace + * file (if any) should be closed. + * + * \Emph{*** DEPRECATED ***} Use \Code{H5Fstart/stop} logging functions instead + * + * See the above comments on the open_trace_file field. This field + * should be set to \c FALSE unless there is an open trace file on the + * cache that you wish to close. + * \endparblock + * + * \par trace_file_name + * \parblock + * Full path of the trace file to be opened if the + * open_trace_file field is \c TRUE. + * + * \Emph{*** DEPRECATED ***} Use \Code{H5Fstart/stop} logging functions instead + * + * 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. + * + * The length of the path must not exceed #H5AC__MAX_TRACE_FILE_NAME_LEN + * characters. + * \endparblock + * + * \par evictions_enabled + * \parblock + * Boolean field used to either report the current + * evictions enabled status of the cache, or to set the cache's + * evictions enabled status. + * + * In general, the metadata cache should always be allowed to + * evict entries. However, in some cases it is advantageous to + * disable evictions briefly, and thereby postpone metadata + * writes. However, this must be done with care, as the cache + * can grow quickly. If you do this, re-enable evictions as + * soon as possible and monitor cache size. + * + * At present, evictions can only be disabled if automatic + * cache resizing is also disabled (that is, \Code{(incr_mode == + * H5C_incr__off ) && ( decr_mode == H5C_decr__off )}). There + * is no logical reason why this should be so, but it simplifies + * implementation and testing, and I can't think of any reason + * why it would be desireable. If you can think of one, I'll + * revisit the issue. (JM) + * \endparblock + * + * \par 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 \c FALSE, the + * initial_size field is ignored. + * + * \par 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 \Code{[min_size, max_size]}. + * + * \par min_clean_fraction + * \c 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. + * + * \par max_size + * Maximum size to which the cache can be adjusted. The + * supplied value must fall in the closed interval + * \Code{[MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]}. Also, \c max_size must + * be greater than or equal to \c min_size. + * + * \par min_size + * Minimum size to which the cache can be adjusted. The + * supplied value must fall in the closed interval + * \Code{[H5C__MIN_MAX_CACHE_SIZE, H5C__MAX_MAX_CACHE_SIZE]}. Also, \c min_size + * must be less than or equal to \c max_size. + * + * \par epoch_length + * \parblock + * Number of accesses on the cache over which to collect + * hit rate stats before running the automatic cache resize code, + * if it is enabled. + * + * At the end of an epoch, we discard prior hit rate data and start + * collecting afresh. The epoch_length must lie in the closed + * interval \Code{[H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH]}. + * \endparblock + * + * + * \section csicf Cache size increase control fields + * + * \par incr_mode + * Instance of the \c 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: + * \li \c H5C_incr__off: Don't attempt to increase the size of the cache + * automatically.\n + * When this increment mode is selected, the remaining fields + * in the cache size increase section ar ignored. + * \li \c H5C_incr__threshold: Attempt to increase the size of the cache + * whenever the average hit rate over the last epoch drops + * below the value supplied in the \c lower_hr_threshold + * field.\n + * Note that this attempt will fail if the cache is already + * at its maximum size, or if the cache is not already using + * all available space. + * + * Note that you must set \c decr_mode to \c H5C_incr__off if you + * disable metadata cache entry evictions. + * + * \par lower_hr_threshold + * \parblock + * Lower hit rate threshold. If the increment mode + * (\c incr_mode) is \c H5C_incr__threshold and the hit rate drops below the + * value supplied in this field in an epoch, increment the cache size by + * \c size_increment. Note that cache size may not be incremented above + * \c max_size, and that the increment may be further restricted by the + * \c max_increment field if it is enabled. + * + * When enabled, this field must contain a value in the range [0.0, 1.0]. + * Depending on the \c incr_mode selected, it may also have to be less than + * \c upper_hr_threshold. + * \endparblock + * + * \par increment + * \parblock + * 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. + * + * The new cache size is obtained my multiplying the current max cache + * size by the increment, and then clamping to \c max_size and to stay + * within the \c max_increment as necessary. + * \endparblock + * + * \par apply_max_increment + * Boolean flag indicating whether the \c max_increment + * field should be used to limit the maximum cache size increment. + * + * \par max_increment + * If enabled by the \c 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. + * + * \par flash_incr_mode + * \parblock + * Instance of the \c 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. + * + * The addition of the flash increment mode was occasioned by performance + * problems that appear when a local heap is increased to a size in excess + * of the current cache size. While the existing re-size code dealt with + * this eventually, performance was very bad for the remainder of the + * epoch. + * + * At present, there are two possible values for the \c flash_incr_mode: + * + * \li \c H5C_flash_incr__off: Don't perform flash increases in the size of the cache. + * + * \li \c H5C_flash_incr__add_space: Let \c x be either the size of a newly + * newly inserted entry, or the number of bytes by which the + * size of an existing entry has been increased.\n + * If \Code{x > flash_threshold * current max cache size}, + * increase the current maximum cache size by \Code{x * flash_multiple} + * less any free space in the cache, and star a new epoch. For + * now at least, pay no attention to the maximum increment. + * + * In both of the above cases, the flash increment pays no attention to + * the maximum increment (at least in this first incarnation), but DOES + * stay within max_size. + * + * With a little thought, it should be obvious that the above flash + * cache size increase algorithm is not sufficient for all circumstances + * -- for example, suppose the user round robins through + * \Code{(1/flash_threshold) +1} groups, adding one data set to each on each + * pass. Then all will increase in size at about the same time, requiring + * the max cache size to at least double to maintain acceptable + * performance, however the above flash increment algorithm will not be + * triggered. + * + * Hopefully, the add space algorithms detailed above will be sufficient + * for the performance problems encountered to date. However, we should + * expect to revisit the issue. + * \endparblock + * + * \par flash_multiple + * Double containing the multiple described above in the + * \c H5C_flash_incr__add_space section of the discussion of the + * \c flash_incr_mode section. This field is ignored unless \c flash_incr_mode + * is \c H5C_flash_incr__add_space. + * + * \par 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 \c flash_incr_mode is + * \c H5C_flash_incr__add_space. + * + * + * \section csdcf Cache size decrease control fields + * + * \par decr_mode + * \parblock + * Instance of the \c 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. + * + * \li \c H5C_decr__off: Don't attempt to decrease the size of the cache + * automatically.\n + * When this increment mode is selected, the remaining fields + * in the cache size decrease section are ignored. + * \li \c H5C_decr__threshold: Attempt to decrease the size of the cache + * whenever the average hit rate over the last epoch rises + * above the value supplied in the \c upper_hr_threshold + * field. + * \li \c H5C_decr__age_out: At the end of each epoch, search the cache for + * entries that have not been accessed for at least the number + * of epochs specified in the epochs_before_eviction field, and + * evict these entries. Conceptually, the maximum cache size + * is then decreased to match the new actual cache size. However, + * this reduction may be modified by the \c min_size, the + * \c max_decrement, and/or the \c empty_reserve. + * \li \c H5C_decr__age_out_with_threshold: Same as age_out, but we only + * attempt to reduce the cache size when the hit rate observed + * over the last epoch exceeds the value provided in the + * \c upper_hr_threshold field. + * + * Note that you must set \c decr_mode to \c H5C_decr__off if you + * disable metadata cache entry evictions. + * \endparblock + * + * \par upper_hr_threshold + * \parblock + * Upper hit rate threshold. The use of this field + * varies according to the current \c decr_mode : + * + * \c H5C_decr__off or \c H5C_decr__age_out: The value of this field is + * ignored. + * + * \li \c H5C_decr__threshold: If the hit rate exceeds this threshold in any + * epoch, attempt to decrement the cache size by size_decrement.\n + * Note that cache size may not be decremented below \c min_size.\n + * Note also that if the \c upper_threshold is 1.0, the cache size\n + * will never be reduced. + * + * \li \c H5C_decr__age_out_with_threshold: If the hit rate exceeds this + * threshold in any epoch, attempt to reduce the cache size + * by evicting entries that have not been accessed for more + * than the specified number of epochs. + * \endparblock + * + * \par decrement + * \parblock + * This field is only used when the decr_mode is + * \c H5C_decr__threshold. + * + * The field is a double containing the multiplier used to derive the + * new cache size from the old if a cache size decrement is triggered. + * The decrement must be in the range 0.0 (in which case the cache will + * try to contract to its minimum size) to 1.0 (in which case the + * cache will never shrink). + * \endparblock + * + * \par apply_max_decrement + * Boolean flag used to determine whether decrements + * in cache size are to be limited by the \c max_decrement field. + * + * \par 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 \c min_size of the cache, and (in age out modes) by + * the \c empty_reserve field. + * + * \par epochs_before_eviction + * \parblock + * Integer field used in \c H5C_decr__age_out and + * \c H5C_decr__age_out_with_threshold decrement modes. + * + * This field contains the number of epochs an entry must remain + * unaccessed before it is evicted in an attempt to reduce the + * cache size. If applicable, this field must lie in the range + * \Code{[1, H5C__MAX_EPOCH_MARKERS]}. + * \endparblock + * + * \par 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. + * + * \par empty_reserve + * \parblock + * To avoid a constant racheting down of cache size by small + * amounts in the \c H5C_decr__age_out and \c 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. + * + * The value of this field must be in the range [0.0, 1.0]. I would + * expect typical values to be in the range of 0.01 to 0.1. + * \endparblock + * + * + * \section pcf Parallel Configuration Fields + * + * 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, + * which can result in inconsistencies between the caches. + * + * PHDF5 uses several strategies to prevent such inconsistencies in metadata, + * all of which use the fact that the same stream of dirty metadata is seen + * by all processes for purposes of synchronization. This is done by + * having each process count the number of bytes of dirty metadata generated, + * and then running a "sync point" whenever this count exceeds a user + * specified threshold (see \c dirty_bytes_threshold below). + * + * The current metadata write strategy is indicated by the + * \c metadata_write_strategy field. The possible values of this field, along + * with the associated metadata write strategies are discussed below. + * + * \par dirty_bytes_threshold + * \parblock + * Threshold of dirty byte creation used to + * synchronize updates between caches. (See above for outline and + * motivation.) + * + * This value MUST be consistent across all processes accessing the + * file. This field is ignored unless HDF5 has been compiled for + * parallel. + * \endparblock + * + * \par metadata_write_strategy + * Integer field containing a code indicating the + * desired metadata write strategy. The valid values of this field + * are enumerated and discussed below: + * + * \li #H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY\n + * When metadata_write_strategy is set to this value, only process + * zero is allowed to write dirty metadata to disk. All other + * processes must retain dirty metadata until they are informed at + * a sync point that the dirty metadata in question has been written + * to disk.\n + * When the sync point is reached (or when there is a user generated + * flush), process zero flushes sufficient entries to bring it into + * complience with its min clean size (or flushes all dirty entries in + * the case of a user generated flush), broad casts the list of + * entries just cleaned to all the other processes, and then exits + * the sync point.\n + * Upon receipt of the broadcast, the other processes mark the indicated + * entries as clean, and leave the sync point as well. + * + * \li #H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED\n + * In the distributed metadata write strategy, 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 + * In this strategy, when a sync point is triggered (either by dirty + * metadata creation or manual flush), all processes enter a barrier.\n + * On the other side of the barrier, process 0 constructs an ordered + * list of the entries to be flushed, and then broadcasts this list + * to the caches in all the processes.\n + * All processes then scan the list of entries to be flushed, flushing + * some, and marking the rest as clean. The algorithm for this purpose + * ensures that each entry in the list is flushed exactly once, and + * all are marked clean in each cache.\n + * Note that in the case of a flush of the cache, no message passing + * is necessary, as all processes have the same list of dirty entries, + * and all of these entries must be flushed. Thus in this case it is + * sufficient for each process to sort its list of dirty entries after + * leaving the initial barrier, and use this list as if it had been + * received from process zero.\n + * To avoid possible messages from the past/future, all caches must + * wait until all caches are done before leaving the sync point. + */
\ No newline at end of file diff --git a/doxygen/dox/H5Acreate.dox b/doxygen/dox/H5Acreate.dox new file mode 100644 index 0000000..18d648f --- /dev/null +++ b/doxygen/dox/H5Acreate.dox @@ -0,0 +1,9 @@ +/** + * \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 new file mode 100644 index 0000000..46b9bb4 --- /dev/null +++ b/doxygen/dox/H5Aiterate.dox @@ -0,0 +1,9 @@ +/** + * \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 new file mode 100644 index 0000000..b2eeb6c --- /dev/null +++ b/doxygen/dox/H5Fget_info.dox @@ -0,0 +1,47 @@ +/** + * \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 new file mode 100644 index 0000000..686dfe4 --- /dev/null +++ b/doxygen/dox/H5Lget_info.dox @@ -0,0 +1,18 @@ + /** + * \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 new file mode 100644 index 0000000..8f1511e --- /dev/null +++ b/doxygen/dox/H5Lget_info_by_idx.dox @@ -0,0 +1,18 @@ + /** + * \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 new file mode 100644 index 0000000..4d3a8dc --- /dev/null +++ b/doxygen/dox/H5Literate.dox @@ -0,0 +1,22 @@ +/** + * \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 new file mode 100644 index 0000000..174157a --- /dev/null +++ b/doxygen/dox/H5Literate_by_name.dox @@ -0,0 +1,23 @@ +/** + * \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 new file mode 100644 index 0000000..e356576 --- /dev/null +++ b/doxygen/dox/H5Lvisit.dox @@ -0,0 +1,22 @@ +/** + * \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 new file mode 100644 index 0000000..0bb482e --- /dev/null +++ b/doxygen/dox/H5Lvisit_by_name.dox @@ -0,0 +1,22 @@ +/** + * \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 new file mode 100644 index 0000000..e8b7afa --- /dev/null +++ b/doxygen/dox/H5Oget_info.dox @@ -0,0 +1,121 @@ +/** + * \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 + * \ref H5Oget_info3() and \ref H5Oget_info1() is deprecated. + * In version 1.10 #H5Oget_info is identical to \ref 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</td> + * <td>\ref H5Oget_info3() (in release 1.12)</td> + * </tr> + * <tr> + <td></td> + * <td>\ref H5Oget_info1() (in 1.8 or 1.10)</td> + * </tr> + * <tr> + * <td>Emulate Release 1.12</td> + * <td>\ref H5Oget_info3()</td> + * </tr> + * <tr> + * <td>Emulate Release 1.10/1.8 interface</td> + * <td>\ref 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. + * + * \todo Fix reference to the document + * + * \par Version + * <table> + * <tr> + * <th>Release</th> + * <th>Change</th> + * </tr> + * <tr> + * <td>1.12.0</td> + * <td>The macro #H5Oget_info and the function \ref H5Oget_info3() were added, + * and \ref H5Oget_info1() was deprecated.</td> + * </tr> + * <tr> + * <td>1.10.5</td> + * <td>The macro #H5Oget_info was removed.</td> + * </tr> + * <tr> + * <td></td> + * <td>The functions \ref H5Oget_info1() and + * #H5Oget_info are identical in this release.</td> + * </tr> + * <tr> + * <td></td> + * <td>This change was added to restore the broken API compatibility + * introduced in HDF5-1.10.3.</td> + * </tr> + * <tr> + * <td>1.10.3</td> + * <td>The function \ref H5Oget_info() was renamed \ref H5Oget_info1.</td> + * </tr> + * <tr> + * <td></td> + * <td>The macro #H5Oget_info and the function \ref H5Oget_info2() were + * introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.15</td> + * <td>Added a note about the valid values for the \c version field in + * the \ref H5O_hdr_info_t structure.</td> + * </tr> + * <tr> + * <td>1.8.11</td> + * <td>Fortran subroutine introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.10</td> + * <td>Added \ref H5O_type_t structure to the Description section.</td> + * </tr> + * <tr> + * <td></td> + * <td>Separated \ref H5O_hdr_info_t structure from \ref H5O_info_t + * in the Description section.</td> + * </tr> + * <tr> + * <td></td> + * <td>Clarified the definition and implementation of the time fields.</td> + * </tr> + * <tr> + * <td>1.8.0</td> + * <td>Function introduced in this release.</td> + * </tr> + * </table> + * + * + */ diff --git a/doxygen/dox/H5Oget_info_by_idx.dox b/doxygen/dox/H5Oget_info_by_idx.dox new file mode 100644 index 0000000..2598374 --- /dev/null +++ b/doxygen/dox/H5Oget_info_by_idx.dox @@ -0,0 +1,92 @@ +/** + * \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 + * \ref H5Oget_info_by_idx3() and \ref H5Oget_info_by_idx1() is deprecated. + * In version 1.10 #H5Oget_info_by_idx is identical to \ref 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</td> + * <td>\ref H5Oget_info_by_idx3() for 1.12</td> + * </tr> + * <tr> + <td></td> + * <td>\ref H5Oget_info_by_idx1() for 1.8/1.10</td> + * </tr> + * <tr> + * <td>Emulate Release 1.12</td> + * <td>\ref H5Oget_info_by_idx3()</td> + * </tr> + * <tr> + * <td>Emulate Release 1.10/1.8 interface</td> + * <td>\ref H5Oget_info_by_idx1()</td> + * </tr> + * </table> + * + * \todo Fix reference to the document + * + * \par Version + * <table> + * <tr> + * <th>Release</th> + * <th>Change</th> + * </tr> + * <tr> + * <td>1.12.0</td> + * <td>The macro #H5Oget_info_by_idx and function \ref H5Oget_info_by_idx3() were added, + * and \ref H5Oget_info_by_idx1() was deprecated.</td> + * </tr> + * <tr> + * <td>1.10.5</td> + * <td>The macro #H5Oget_info_by_idx was removed.</td> + * </tr> + * <tr> + * <td></td> + * <td>The functions \ref H5Oget_info_by_idx() and + * H5Oget_info_by_idx1() are identical in this release.</td> + * </tr> + * <tr> + * <td></td> + * <td>This change was added to restore the broken API compatibility + * introduced in HDF5-1.10.3.</td> + * </tr> + * <tr> + * <td>1.10.3</td> + * <td>The function \ref H5Oget_info_by_idx() was renamed \ref H5Oget_info_by_idx1.</td> + * </tr> + * <tr> + * <td></td> + * <td>The macro #H5Oget_info_by_idx and the function \ref H5Oget_info_by_idx2() were + * introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.11</td> + * <td>Fortran subroutine introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.0</td> + * <td>Function introduced in this release.</td> + * </tr> + * </table> + * + * + */ diff --git a/doxygen/dox/H5Oget_info_by_name.dox b/doxygen/dox/H5Oget_info_by_name.dox new file mode 100644 index 0000000..b1b9540 --- /dev/null +++ b/doxygen/dox/H5Oget_info_by_name.dox @@ -0,0 +1,99 @@ +/** + * \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 + * \ref H5Oget_info_by_name3(). In version 1.10 #H5Oget_info_by_name is + * identical to \ref 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</td> + * <td>\ref H5Oget_info_by_name3() for 1.12 and above</td> + * </tr> + * <tr> + <td></td> + * <td>\ref H5Oget_info_by_name1() for 1.8 or 1.10</td> + * </tr> + * <tr> + * <td>Emulate Release 1.12</td> + * <td>\ref H5Oget_info_by_name3()</td> + * </tr> + * <tr> + * <td>Emulate Release 1.10 or 1.8 interface</td> + * <td>\ref H5Oget_info_by_name1()</td> + * </tr> + * </table> + * + * \todo Fix reference to the document; exchange 1.8.8 and 1.8.0 + * + * \par Version + * <table> + * <tr> + * <th>Release</th> + * <th>Change</th> + * </tr> + * <tr> + * <td>1.12.0</td> + * <td>The macro #H5Oget_info_by_name and function \ref H5Oget_info_by_name3() were added + * and \ref H5Oget_info_by_name1() was deprecated.</td> + * </tr> + * <tr> + * <td>1.10.5</td> + * <td>The macro #H5Oget_info_by_name was removed.</td> + * </tr> + * <tr> + * <td></td> + * <td>The functions \ref H5Oget_info_by_name() and + * H5Oget_info_by_name1() are identical in this release.</td> + * </tr> + * <tr> + * <td></td> + * <td>This change was added to restore the broken API compatibility + * introduced in HDF5-1.10.3.</td> + * </tr> + * <tr> + * <td>1.10.3</td> + * <td>The function \ref H5Oget_info_by_name() was renamed + * to \ref H5Oget_info_by_name1.</td> + * </tr> + * <tr> + * <td></td> + * <td>The macro #H5Oget_info_by_name was renamed to + * \ref H5Oget_info_by_name1().</td> + * </tr> + * <tr> + * <td></td> + * <td>The macro #H5Oget_info_by_name and the function \ref H5Oget_info_by_name2() + * were introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.8</td> + * <td>Fortran 2003 subroutine and \ref H5O_info_t derived + * type introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.0</td> + * <td>C function introduced in this release.</td> + * </tr> + * </table> + * + * + */ diff --git a/doxygen/dox/H5Ovisit.dox b/doxygen/dox/H5Ovisit.dox new file mode 100644 index 0000000..5030a13 --- /dev/null +++ b/doxygen/dox/H5Ovisit.dox @@ -0,0 +1,92 @@ +/** + * \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, \ref H5Ovisit() is mapped to + * \ref H5Ovisit3(). In version 1.10, \ref H5Ovisit() is identical + * to \ref 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</td> + * <td>\ref H5Ovisit3() in 1.12 or after</td> + * </tr> + * <tr> + <td></td> + * <td>\ref H5Ovisit1() for 1.8 and 1.10</td> + * </tr> + * <tr> + * <td>Emulate Release 1.12</td> + * <td>\ref H5Ovisit3()</td> + * </tr> + * <tr> + * <td>Emulate Release 1.10 or 1.8 interface</td> + * <td>\ref H5Ovisit1()</td> + * </tr> + * </table> + * + * \todo Fix reference to the document + * + * \par Version + * <table> + * <tr> + * <th>Release</th> + * <th>Change</th> + * </tr> + * <tr> + * <td>1.12.0</td> + * <td>The macro #H5Ovisit and function \ref H5Ovisit3() were added, + * and \ref H5Ovisit1() was deprecated.</td> + * </tr> + * <tr> + * <td>1.10.5</td> + * <td>The macro #H5Ovisit was removed.</td> + * </tr> + * <tr> + * <td></td> + * <td>The functions \ref H5Ovisit() and + * H5Ovisit1() are identical in this release.</td> + * </tr> + * <tr> + * <td></td> + * <td>This change was added to restore the broken API compatibility + * introduced in HDF5-1.10.3.</td> + * </tr> + * <tr> + * <td>1.10.3</td> + * <td>The function \ref H5Ovisit() was renamed to \ref H5Ovisit1.</td> + * </tr> + * <tr> + * <td></td> + * <td>The macro #H5Ovisit and the function \ref H5Ovisit2() were + * introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.8</td> + * <td>Fortran subroutine and data structure added.</td> + * </tr> + * <tr> + * <td>1.8.0</td> + * <td>C function introduced.</td> + * </tr> + * </table> + * + * + */ diff --git a/doxygen/dox/H5Ovisit_by_name.dox b/doxygen/dox/H5Ovisit_by_name.dox new file mode 100644 index 0000000..5c6e51a --- /dev/null +++ b/doxygen/dox/H5Ovisit_by_name.dox @@ -0,0 +1,92 @@ +/** + * \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, \ref H5Ovisit_by_name() is mapped to + * \ref H5Ovisit_by_name3(). In version 1.10, \ref H5Ovisit_by_name() + * is identical to \ref 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</td> + * <td>\ref H5Ovisit_by_name3() for 1.12 and above</td> + * </tr> + * <tr> + <td></td> + * <td>\ref H5Ovisit_by_name1() for 1.10 or 1.8</td> + * </tr> + * <tr> + * <td>Emulate Release 1.12 interface</td> + * <td>\ref H5Ovisit_by_name3()</td> + * </tr> + * <tr> + * <td>Emulate Release 1.10 or 1.8 interface</td> + * <td>\ref H5Ovisit_by_name1()</td> + * </tr> + * </table> + * + * \todo Fix reference to the document + * + * \par Version + * <table> + * <tr> + * <th>Release</th> + * <th>Change</th> + * </tr> + * <tr> + * <td>1.12.0</td> + * <td>The macro #H5Ovisit_by_name and function \ref H5Ovisit_by_name3() were added. + * </tr> + * <tr> + * <td>1.10.5</td> + * <td>The macro #H5Ovisit_by_name was removed.</td> + * </tr> + * <tr> + * <td></td> + * <td>The functions \ref H5Ovisit_by_name() and + * H5Ovisit_by_name1() are identical in this release.</td> + * </tr> + * <tr> + * <td></td> + * <td>This change was added to restore the broken API compatibility + * introduced in HDF5-1.10.3.</td> + * </tr> + * <tr> + * <td>1.10.3</td> + * <td>The function \ref H5Ovisit_by_name() was renamed + * to \ref H5Ovisit_by_name1.</td> + * </tr> + * <tr> + * <td></td> + * <td>The macro #H5Ovisit_by_name and the function \ref H5Ovisit_by_name2() + * were introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.8</td> + * <td>Fortran subroutine introduced in this release.</td> + * </tr> + * <tr> + * <td>1.8.0</td> + * <td>Function introduced in this release.</td> + * </tr> + * </table> + * + * + */ diff --git a/doxygen/dox/H5Sencode.dox b/doxygen/dox/H5Sencode.dox new file mode 100644 index 0000000..fe0995c --- /dev/null +++ b/doxygen/dox/H5Sencode.dox @@ -0,0 +1,5 @@ +/** + * \ingroup H5S + * \def H5Sencode() + * H5Sencode() is a macro that is mapped to either H5Sencode1() or H5Sencode2(). +*/ diff --git a/doxygen/dox/api-compat-macros.dox b/doxygen/dox/api-compat-macros.dox new file mode 100644 index 0000000..6b85ccb --- /dev/null +++ b/doxygen/dox/api-compat-macros.dox @@ -0,0 +1,899 @@ +/** \page api-compat-macros API Compatibility Macros + \tableofcontents + + \section audience Audience + The target audience for this document has existing applications that use the + HDF5 library, and is considering moving to the latest HDF5 release to take + advantage of the latest library features and enhancements. + + \section compat-issues Compatibility Issues + With each major release of HDF5, such as 1.12 or 1.10, certain compatibility + issues must be considered when migrating applications from an earlier major + release. + + This document describes the approach taken by The HDF Group to help existing + users of HDF5 address compatibility issues in the HDF5 API. + + \section summary Summary and Motivation + In response to new and evolving requirements for the library and data format, + several basic functions have changed since HDF5 was first released. To allow + existing applications to continue to compile and run properly, all versions + of these functions have been retained in the later releases of the HDF5 library. + + Given the scope of changes available with each major release of HDF5, and + recognizing the potentially time-consuming task of editing all the affected + calls in user applications, The HDF Group has created a set of macros that + can be used to flexibly and easily map existing API calls to previous release + functions. We refer to these as the \Emph{API compatibility macros}. + + The HDF Group generally encourages users to update applications to work with + the latest HDF5 library release so that all new features and enhancements are + available to them. At the same time, The HDF Group understands that, under + some circumstances, updating applications may not be feasible or necessary. + The API compatibility macros, described in this document, provide a bridge + from old APIs to new and can be particularly helpful in situations such as these: + <ul> + <li>Source code is not available - only binaries are available; updating the + application is not feasible.</li> + <li>Source code is available, but there are no resources to update it.</li> + <li>Source code is available, as are resources to update it, but the old + version works quite well so updates are not a priority. At the same time, + it is desirable to take advantage of certain efficiencies in the newer HDF5 + release that do not require code changes.</li> + <li>Source code is available, as are resources to update it, but the applications + are large or complex, and must continue to run while the code updates are + carried out.</li> + </ul> + + \section using Understanding and Using the Macros + As part of latest HDF5 release, several functions that existed in previous + versions of the library were updated with new calling parameters and given + new names. The updated versions of the functions have a number (for, e.g., '2') + at the end of the original function name. The original versions of these + functions were retained and renamed to have an earlier number (for, e.g., '1') + at the end of the original function name. + + For example, consider the function \Code{H5Lvisit} in HDF5 release 1.10 + as compared with 1.12: + + <table> + <tr> + <th>Original function name and signature in 1.10.0</th> + <td colspan="1"> + \Code{herr_t H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data)} + </td> + </tr> + <tr> + <th>Updated function and signature, introduced in release 1.12.0</th> + <td colspan="1"> + \Code{herr_t H5Lvisit2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, void *op_data)} + </td> + </tr> + <tr><th>Original function and signature, renamed in release 1.12.0</th> + <td colspan="1"> + \Code{herr_t H5Lvisit1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate1_t op, void *op_data)} + </td> + </tr> + <tr><th>API compatibility macro, introduced in release 1.12.0</th> + <td colspan="1"> + \Code{H5Lvisit} + <p>The macro, \Code{H5Lvisit}, will be mapped to either \Code{H5Lvisit1} or + \Code{H5Lvisit2}. The mapping is determined by a combination of the + configuration options use to build the HDF5 library and compile-time + options used to build the application. The calling parameters used with the + \Code{H5Lvisit} compatibility macro should match the number and type of the + function the macros will be mapped to (\Code{H5Lvisit1} or \Code{H5Lvisit2}). + </p> + <p>The function names ending in '1' or '2' are referred to as \Emph{versioned names}, + and the corresponding functions are referred to as \Emph{versioned functions}. + For new code development, The HDF Group recommends use of the compatibility macro + mapped to the latest version of the function. The original version of the function + should be considered deprecated and, in general, should not be used when developing + new code. + </p> + </td> + </tr> + </table> + + \section options Compatibility Macro Mapping Options + To determine the mapping for a given API compatibility macro in a given application, + a combination of user-controlled selections, collectively referred to as the + \Emph{compatibility macro mapping options}, is considered in the following sequence: + + <table border="0" style="width: 100.0%;"> + <tr> + <td valign="top" width="50%"> + <ol> + <li>What compatibility macro configuration option was used to build the HDF5 library? + We refer to this selection as the \Emph{library mapping}.</li> + <li>Was a compatibility macro global compile-time option specified when the application + was built? We refer to this (optional) selection as the \Emph{application mapping}. + If an application mapping exists, it overrides the library mapping. + \Emph{(See adjacent notes.)}</li> + <li>Were any compatibility macro function-level compile-time options specified when the + application was built? We refer to these (optional) selections as \Emph{function mappings}. + If function mappings exist, they override library and application mappings for the + relevant API compatibility macros. \Emph{(See adjacent notes.)}</li> + </ol> + </td> + <td valign="top" width="50%"> + <table border="1" cellpadding="10" style="width: 100.0%;"> + <tr><td> + \Bold{Notes:} An application mapping can map APIs to the same version or to a version + older than the configured library mapping. When the application attempts to map APIs + to a newer version of the API than the library was configured with, it will fail to + "upgrade" the mapping (and may fail silently). + + When it is necessary to "upgrade" the macro mappings from those set in the library mapping, + it must be done at the per-function level, using the function-level mappings. As long as + one does not try to map a function to a version that was compiled out in the library mapping, + individual functions can be upgraded or downgraded freely. + </td> + </tr> + </table> + </td> + </tr> + </table> + + \subsection lib-options Library Mapping Options + When the HDF5 library is built, \Code{configure} flags can be used to control the API + compatibility macro mapping behavior exhibited by the library. This behavior can be + overridden by application and function mappings. One configure flag excludes deprecated + functions from the HDF5 library, making them unavailable to applications linked with the + library. + + <div align="center">Table 1: Library Mapping Options + <table border="1" cellpadding="3"> + <tr> + <th>\Code{configure} flag</th> + <th>Macros map to release <br/> (versioned function; \Code{H5Lvisit} shown)</th> + <th>Deprecated functions available? <br/> (\Code{H5Lvisit1})</th> + </tr> + <tr align="center"> + <td>\Code{--with-default-api-version=v112} <br/> (the default in 1.12)</td> + <td>1.12.x (\Code{H5Lvisit2})</td> + <td>yes</td> + </tr> + <tr align="center"> + <td align="left">\Code{--with-default-api-version=v110}</td> + <td>1.10.x (\Code{H5Lvisit1})</td> + <td>yes</td> + </tr> + <tr align="center"> + <td align="left">\Code{--with-default-api-version=v18}</td> + <td>1.8.x (\Code{H5Lvisit1})</td> + <td>yes</td> + </tr> + <tr align="center"> + <td align="left">\Code{--with-default-api-version=v16}</td> + <td>1.6.x (\Code{H5Lvisit1})</td> + <td>yes</td> + </tr> + <tr align="center"> + <td align="left">\Code{--disable-deprecated-symbols}</td> + <td>1.12.x (\Code{H5Lvisit2})</td> + <td>no</td> + </tr> + </table> + </div> + Refer to the file \Code{libhdf5.settings} in the directory where the HDF5 library is + installed to determine the \Code{configure} flags used to build the library. In particular, + look for the two lines shown here under \Emph{Features}: + + \Code{Default API mapping: v112} + + \Code{With deprecated public symbols: yes} + + \subsection app-options Application Mapping Options + When an application using HDF5 APIs is built and linked with the HDF5 library, + compile-time options to \Code{h5cc} can be used to control the API compatibility + macro mapping behavior exhibited by the application. The application mapping + overrides the behavior specified by the library mapping, and can be overridden + on a function-by-function basis by the function mappings. + + If the HDF5 library was configured with the \Code{--disable-deprecated-symbols} flag, then + the deprecated functions will not be available, regardless of the application mapping options. + + <div align="center">Table 2: Application Mapping Options + <table border="1" cellpadding="3"> + <tr> + <th>\Code{h5cc} option</th> + <th>Macros map to release <br/>(versioned function; \Code{H5Lvisit} shown)</th> + <th>Deprecated functions available? <br/>(\Code{H5Lvisit1})</th> + </tr> + <tr align="center"> + <td align="left">\Code{-DH5_USE_112_API} <br/> \Emph{(Default behavior if no option specified.)}</td> + <td>1.12.x (\Code{HLvisit2})</td> + <td>yes* <br/> \Emph{*if available in library}</td> + </tr> + <tr align="center"> + <td align="left">\Code{-DH5_USE_110_API}</td> + <td>1.10.x (\Code{HLvisit1})</td> + <td>yes* <br/> \Emph{*if available in library}</td> + </tr> + <tr align="center"> + <td align="left">\Code{-DH5_USE_18_API}</td> + <td>1.8.x (\Code{H5Lvisit1})</td> + <td>yes* <br/> \Emph{*if available in library}</td> + </tr> + <tr align="center"> + <td align="left">\Code{-DH5_USE_16_API}</td> + <td>1.6.x (\Code{H5Lvisit1})</td> + <td>yes* <br/> \Emph{*if available in library}</td> + </tr> + <tr align="center"> + <td align="left">\Code{-DH5_NO_DEPRECATED_SYMBOLS}</td> + <td>1.10.x (\Code{H5Lvisit1})</td> + <td>no</td> + </tr> + </table> + </div> + + \subsection fun-options Function Mapping Options + Function mappings are specified when the application is built. These mappings + can be used to control the mapping of the API compatibility macros to + underlying functions on a function-by-function basis. The function mappings + override the library and application mappings discussed earlier. + + If the HDF5 library was configured with the \Code{--disable-deprecated-symbols} + flag, or \Code{-DH5_NO_DEPRECATED_SYMBOLS} is used to compile the application, + then the deprecated functions will not be available, regardless of the function + mapping options. + + For every function with multiple available versions, a compile-time version flag + can be defined to selectively map the function macro to the desired versioned + function. The function mapping consists of the function name followed by + "\Code{_vers}" which is mapped by number to a specific function or + struct: + <table> + <tr> + <th>Macro</th> + <th>Function Mapping</th> + <th>Mapped to function or struct</th> + </tr> + <tr><td>\Code{H5xxx}</td> + <td>\Code{H5xxx_vers=1}</td> + <td>\Code{H5xxx1}</td> + </tr> + <tr> + <td> </td> + <td>\Code{H5xxx_vers=2}</td> + <td>\Code{H5xxx2}</td> + </tr> + </table> + + For example, in version 1.10 the \Code{H5Rreference} macro can be mapped to + either \Code{H5Rreference1} or \Code{H5Rreference2}. When used, the value of + the \Code{H5Rreference_vers} compile-time version flag determines which + function will be called: + + <ul> + <li>When \Code{H5Rreference_vers} is set to \Code{1}, the macro \Code{H5Rreference} + will be mapped to \Code{H5Rreference1}. <br/> + \Code{H5cc ... -DH5Rreference_vers=1 ...}</li> + <li>When \Code{H5Rdereference_vers} is set to \Code{2}, the macro \Code{H5Rdereference} + will be mapped to \Code{H5Rdereference2}. <br/> + \Code{h5cc ... -DH5Rreference_vers=2 ...}</li> + <li>When \Code{H5Rreference_vers} is not set, the macro \Code{H5Rreference} will be + mapped to either \Code{H5Rreference1} or \Code{H5Rreference2}, based on the + application mapping, if one was specified, or on the library mapping. <br/> + \Code{h5cc ... }</li> + </ul> + + \warning Please be aware that some function mappings use mapped structures, as + well. If compiling an application with a function mapping that uses + a mapped structure, you must include each function and mapped structure + plus EVERY function that uses the mapped structure, whether or not that + function is used in the application. \Emph{In 1.12, mappings of structures + are used by the H5L and H5O function mappings.}\n\n + For example, an application \Code{application.c} only calls \Code{H5Lvisit}, + \Code{H5Ovisit}, and \Code{H5Oget_info_by_name}. To compile this application + with 1.10 APIs in 1.12 with the function specific mappings, then not only must + \Code{H5Lvisit_vers}, \Code{H5Ovisit_vers}, and \Code{H5Oget_info_by_name_vers} + be specified on the command line, but the mapped structures and every + function that uses the mapped structures must be included, as well. + The full compile line is shown below: + \code{.sh} + h5cc -DH5Lvisit_vers=1 -DH5Ovisit_vers=1 -DH5Oget_info_by_name_vers=1 \ + -DH5Lvisit_by_name_vers=1 -DH5Literate_vers=1 \ + -DH5Literate_by_name_vers= -DH5O_info_t_vers=1 -DH5L_info_t_vers=1 \ + -DH5L_iterate_t_vers=1 -DH5Lget_info_by_idx_vers=1 \ + -DH5Lget_info_vers=1 application.c + \endcode + + \subsubsection fun-options-112 Function Mapping Options in Releases 1.12.x + <table> + <tr> + <th style="text-align: left;">Macro <br/> (\Code{H5xxx})</th> + <th>Default function used if no macro specified + <ul><li>Function/struct mapping:\Code{H5xxx_vers=N}</li></ul> + </th> + <th>Function used if specifying 1.10 + <ul><li>Function/struct mapping: \Code{H5xxx_vers=1}</li></ul> + </th> + </tr> + <tr> + <td>H5Lget_info()</td> + <td>H5Lget_info2() + <ul> + <li>Function mapping:\Code{H5Lget_info_vers=2}</li> + <li>Struct mapping:\Code{H5L_info_t_vers=2}</li> + </ul> + </td> + <td>H5Lget_info1() + <ul> + <li>Function mapping \Code{H5Lget_info_vers=1}</li> + <li>Struct mapping: \Code{H5L_info_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Lget_info_by_idx()</td> + <td>H5Lget_info_by_idx2() + <ul> + <li>Function mapping: \Code{H5Lget_info_by_idx_vers=2}</li> + <li>Struct mapping: \Code{H5L_info_t_vers=2}</li> + </ul> + </td> + <td>H5Lget_info_by_idx1() + <ul> + <li>Function mapping: \Code{H5Lget_info_by_idx_vers=1}</li> + <li>Struct mapping: \Code{H5L_info_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Literate()</td> + <td>H5Literate2() + <ul> + <li>Function mapping: \Code{H5Literate_vers=2}</li> + <li>Struct mapping: \Code{H5L_iterate_t_vers=2}</li> + </ul> + </td> + <td>H5Literate1() + <ul> + <li>Function mapping: \Code{H5Literate_vers=1}</li> + <li>Struct mapping: \Code{H5L_iterate_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Literate_by_name()</td> + <td>H5Literate_by_name2() + <ul> + <li>Function mapping: \Code{H5Literate_by_name_vers=2}</li> + <li>Struct mapping: \Code{H5L_iterate_t_vers=2}</li> + </ul> + </td> + <td>H5Literate_by_name1() + <ul> + <li>Function mapping: \Code{H5Literate_by_name_vers=1}</li> + <li>Struct mapping: \Code{H5L_iterate_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Lvisit()</td> + <td>H5Lvisit2() + <ul> + <li>Function mapping: \Code{H5Lvisit_vers=2}</li> + <li>Struct mapping: \Code{H5L_iterate_t_vers=2}</li> + </ul> + </td> + <td>H5Lvisit1() + <ul> + <li>Function mapping: \Code{H5Lvisit_vers=1}</li> + <li>Struct mapping: \Code{H5L_iterate_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Lvisit_by_name()</td> + <td>H5Lvisit_by_name2() + <ul> + <li>Function mapping: \Code{H5Lvisit_by_name_vers=2}</li> + <li>Struct mapping: \Code{H5L_iterate_t_vers=2}</li> + </ul> + </td> + <td>H5Lvisit_by_name1() + <ul> + <li>Function mapping: \Code{H5Lvisit_by_name_vers=1}</li> + <li>Struct mapping: \Code{H5L_iterate_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Oget_info()</td> + <td>H5Oget_info3() + <ul> + <li>Function mapping: \Code{H5Oget_info_vers=3}</li> + <li>Struct mapping: \Code{H5O_info_t_vers=2}</li> + </ul> + </td> + <td>H5Oget_info1() + <ul> + <li>Function mapping: \Code{H5Oget_info_vers=1}</li> + <li>Struct mapping: \Code{H5O_info_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Oget_info_by_idx()</td> + <td>H5Oget_info_by_idx3() + <ul><li>Function mapping: \Code{H5Oget_info_by_idx_vers=3}</li> + <li>Struct mapping: \Code{H5O_info_t_vers=2}</li> + </ul> + </td> + <td>H5Oget_info_by_idx1() + <ul> + <li>Function mapping: \Code{H5Oget_info_by_idx_vers=1}</li> + <li>Struct mapping: \Code{H5O_info_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Oget_info_by_name()</td> + <td>H5Oget_info_by_name3() + <ul> + <li>Function mapping: \Code{H5O_get_info_by_name_vers=3}</li> + <li>Struct mapping: \Code{H5O_info_t_vers=2}</li> + </ul> + </td> + <td>H5Oget_info_by_name1() + <ul> + <li>Function mapping: \Code{H5O_get_info_by_name_vers=1}</li> + <li>Struct mapping: \Code{H5O_info_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Ovisit()</td> + <td>H5Ovisit3() + <ul> + <li>Function mapping: \Code{H5Ovisit_vers=3}</li> + <li>Struct mapping: \Code{H5O_iterate_t_vers=2}</li> + </ul> + </td> + <td>H5Ovisit1() + <ul><li>Function mapping: \Code{H5Ovisit_vers=1}</li> + <li>Struct mapping: \Code{H5O_iterate_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Ovisit_by_name()</td> + <td>H5Ovisit_by_name3() + <ul> + <li>Function mapping: \Code{H5Ovisit_by_name_vers=3}</li> + <li>Struct mapping: \Code{H5O_iterate_t_vers=2}</li> + </ul> + </td> + <td>H5Ovisit_by_name1() + <ul> + <li>Function mapping: \Code{H5Ovisit_by_name_vers=1}</li> + <li>Struct mapping: \Code{H5O_iterate_t_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Pencode()</td> + <td>H5Pencode2() + <ul> + <li>Function mapping: \Code{H5Pencode_vers=2}</li> + </ul> + </td> + <td>H5Pencode1() + <ul> + <li>Function mapping: \Code{H5Pencode_vers=1}</li> + </ul> + </td> + </tr> + <tr> + <td>H5Sencode()</td> + <td>H5Sencode2() + <ul> + <li>Function mapping: \Code{H5Sencode_vers=2}</li> + </ul> + </td> + <td>H5Sencode1() + <ul> + <li>Function mapping: \Code{H5Sencode_vers=1}</li> + </ul> + </td> + </tr> + </table> + + \subsubsection fun-options-110 Function Mapping Options in Releases 1.10.x + <table> + <tr> + <th>Macro</th> + <th>Default function used <br/> <sub>(if no macro specified)</sub></th> + <th>Introduced in</th> + <th>\Code{h5cc} version flag and value</th> + <th>Mapped to function or struct</th> + </tr> + <tr> + <td rowspan="2">H5Rdereference()</td> + <td rowspan="2">H5Rdereference2()</td> + <td rowspan="2">HDF5-1.10.0</td> + <td>\Code{-DH5Rdereference_vers=1}</td> + <td>H5Rdereference1()</td> + </tr> + <tr> + <td>\Code{-DH5Rdereference_vers=2}</td> + <td>H5Rdereference2()</td> + </tr> + <tr> + <td rowspan="2">H5Fget_info()</td> + <td rowspan="2">H5Fget_info2()</td> + <td rowspan="2">HDF5-1.10.0</td> + <td>\Code{-DH5Fget_info_vers=1}</td> + <td>H5Fget_info1() with struct \ref H5F_info1_t</td> + </tr> + <tr> + <td>\Code{-DH5Fget_info_vers=2}</td> + <td>H5Fget_info2() with struct \ref H5F_info2_t</td> + </tr> + <tr> + <td rowspan="2">H5Oget_info()</td> + <td rowspan="2">H5Oget_info1()</td> + <td rowspan="2">HDF5-1.10.3</td> + <td>\Code{-DH5Oget_info_vers=1}</td> + <td>H5Oget_info1()</td> + </tr> + <tr> + <td>\Code{-DH5Oget_info_vers=2}</td> + <td>H5Oget_info2()</td> + </tr> + <tr> + <td rowspan="2">H5Oget_info_by_idx()</td> + <td rowspan="2">H5Oget_info_by_idx1()</td> + <td rowspan="2">HDF5-1.10.3</td> + <td>\Code{-DH5Oget_info_by_idx_vers=1}</td> + <td>H5Oget_info_by_idx1()</td> + </tr> + <tr> + <td>\Code{-DH5Oget_info_by_idx_vers=2}</td> + <td>H5Oget_info_by_idx2()</td> + </tr> + <tr> + <td rowspan="2">H5Oget_info_by_name()</td> + <td rowspan="2">H5Oget_info_by_name1()</td> + <td rowspan="2">HDF5-1.10.3</td> + <td>\Code{-DH5Oget_info_by_name_vers=1}</td> + <td>H5Oget_info_by_name1()</td> + </tr> + <tr> + <td>\Code{-DH5Oget_info_by_name_vers=2}</td> + <td>H5Oget_info_by_name2()</td> + </tr> + <tr> + <td rowspan="2">H5Ovisit()</td> + <td rowspan="2">H5Ovisit1()</td> + <td rowspan="2">HDF5-1.10.3</td> + <td>\Code{-DH5Ovisit_vers=1}</td> + <td>H5Ovisit1()</td> + </tr> + <tr> + <td>\Code{-DH5Ovisit_vers=2}</td> + <td>H5Ovisit2()</td> + </tr> + <tr> + <td rowspan="2">H5Ovisit_by_name()</td> + <td rowspan="2">H5Ovisit_by_name1()</td> + <td rowspan="2">HDF5-1.10.3</td> + <td>\Code{-DH5Ovisit_by_name_vers=1}</td> + <td>H5Ovisit_by_name1()</td> + </tr> + <tr> + <td>\Code{-DH5Ovisit_by_name_vers=2}</td> + <td>H5Ovisit_by_name2()</td> + </tr> + </table> + + \subsubsection fun-options-18 Function Mapping Options in Releases 1.8.x + At release 1.8.0, the API compatibility macros, function mapping compile-time + version flags and values, and corresponding versioned functions listed in the + following table were introduced. If the application being compiled to run with + any 1.10.x release was written to use any 1.6.x release of HDF5, you must also + consider these macros and mapping options. + + <div align="center">Table 5: Function Mapping Options in Releases 1.8.x + <table border="1" cellpadding="3" style="width: 90.0%;"> + <tr> + <th>Macro</th> + <th><code>h5cc</code> version flag and value</th> + <th>Mapped to function <br/> or struct</th> + </tr> + <tr> + <td rowspan="2">H5Acreate()</td> + <td>\Code{DH5Acreate_vers=1}</td> + <td>H5Acreate1()</td> + </tr> + <tr> + <td>\Code{DH5Acreate_vers=2}</td> + <td>H5Acreate2()</td> + </tr> + <tr> + <td rowspan="2">H5Aiterate()</td> + <td>\Code{DH5Aiterate_vers=1}</td> + <td>H5Aiterate1() <br/> with struct \ref H5A_operator1_t</td> + </tr> + <tr> + <td>\Code{DH5Aiterate_vers=2}</td> + <td>H5Aiterate2() <br/> with struct \ref H5A_operator2_t</td> + </tr> + <tr> + <td rowspan="2">H5Dcreate()</td> + <td>\Code{DH5Dcreate_vers=1}</td> + <td>H5Dcreate1()</td> + </tr> + <tr> + <td>\Code{DH5Dcreate_vers=2}</td> + <td>H5Dcreate2()</td> + </tr> + <tr><td rowspan="2">H5Dopen()</td> + <td>\Code{DH5Dopen_vers=1}</td> + <td>H5Dopen1()</td> + </tr> + <tr> + <td>\Code{DH5Dopen_vers=2}</td> + <td>H5Dopen2()</td> + </tr> + <tr> + <td rowspan="2">H5Eclear()</td> + <td>\Code{DH5Eclear_vers=1}</td> + <td>H5Eclear1()</td> + </tr> + <tr> + <td>\Code{DH5Eclear_vers=2}</td> + <td>H5Eclear2()</td> + </tr> + <tr> + <td rowspan="2">H5Eprint()</td> + <td>\Code{DH5Eprint_vers=1}</td> + <td>H5Eprint1()</td> + </tr> + <tr> + <td>\Code{DH5Eprint_vers=2}</td> + <td>H5Eprint2()</td> + </tr> + <tr> + <td rowspan="2">H5Epush()</td> + <td>\Code{DH5Epush_vers=1}</td> + <td>H5Epush1()</td> + </tr> + <tr> + <td>\Code{DH5Epush_vers=2}</td> + <td>H5Epush2()</td> + </tr> + <tr> + <td rowspan="2">H5Eset_auto()</td> + <td>\Code{DH5Eset_auto_vers=1}</td> + <td>H5Eset_auto1()</td> + </tr> + <tr> + <td>\Code{DH5Eset_auto_vers=2}</td> + <td>H5Eset_auto2()</td> + </tr> + <tr> + <td rowspan="2">H5Eget_auto()</td> + <td>\Code{DH5Eget_auto_vers=1}</td> + <td>H5Eget_auto1()</td> + </tr> + <tr> + <td>\Code{DH5Eget_auto_vers=2}</td> + <td>H5Eget_auto2()</td> + </tr> + <tr> + <td rowspan="2">\ref H5E_auto_t <br/> struct for H5Eset_auto() <br/> and H5Eget_auto()</td> + <td>\Code{DH5E_auto_t_vers=1}</td> + <td>\ref H5E_auto1_t</td> + </tr> + <tr> + <td>\Code{DH5E_auto_t_vers=2}</td> + <td>\ref H5E_auto2_t</td> + </tr> + <tr> + <td rowspan="2">H5Ewalk()</td> + <td>\Code{DH5Ewalk_vers=1}</td> + <td>H5Ewalk1() <br/> with callback \ref H5E_walk1_t <br/> and struct \ref H5E_error1_t</td> + </tr> + <tr> + <td>\Code{DH5Ewalk_vers=2}</td> + <td>H5Ewalk2() <br/> with callback \ref H5E_walk2_t <br/> and struct \ref H5E_error2_t</td> + </tr> + <tr> + <td rowspan="2">H5Gcreate()</td> + <td>\Code{DH5Gcreate_vers=1}</td> + <td>H5Gcreate1()</td> + </tr> + <tr> + <td>\Code{DH5Gcreate_vers=2}</td> + <td>H5Gcreate2()</td> + </tr> + <tr> + <td rowspan="2">H5Gopen()</td> + <td>\Code{DH5Gopen_vers=1}</td> + <td>H5Gopen1()</td> + </tr> + <tr> + <td>\Code{DH5Gopen_vers=2}</td> + <td>H5Gopen2()</td> + </tr> + <tr> + <td rowspan="2">H5Pget_filter()</td> + <td>\Code{DH5Pget_filter_vers=1}</td> + <td>H5Pget_filter1()</td> + </tr> + <tr> + <td>\Code{DH5Pget_filter_vers=2}</td> + <td>H5Pget_filter2()</td> + </tr> + <tr> + <td rowspan="2">H5Pget_filter_by_id()</td> + <td>\Code{DH5Pget_filter_by_id_vers=1}</td> + <td>H5Pget_filter_by_id1()</td> + </tr> + <tr> + <td>\Code{DH5Pget_filter_by_id_vers=2}</td> + <td>H5Pget_filter_by_id2()</td> + </tr> + <tr> + <td rowspan="2">H5Pinsert()</td> + <td>\Code{DH5Pinsert_vers=1}</td> + <td>H5Pinsert1()</td> + </tr> + <tr> + <td>\Code{DH5Pinsert_vers=2}</td> + <td>H5Pinsert2()</td> + </tr> + <tr> + <td rowspan="2">H5Pregister()</td> + <td>\Code{DH5Pregister_vers=1}</td> + <td>H5Pregister1()</td> + </tr> + <tr> + <td>\Code{DH5Pregister_vers=2}</td> + <td>H5Pregister2()</td> + </tr> + <tr> + <td rowspan="2">H5Rget_obj_type()</td> + <td>\Code{DH5Rget_obj_typevers=1}</td> + <td>H5Rget_obj_type1()</td> + </tr> + <tr> + <td>\Code{DH5Rget_obj_type_vers=2}</td> + <td>H5Rget_obj_type2()</td> + </tr> + <tr> + <td rowspan="2">H5Tarray_create()</td> + <td>\Code{DH5Tarray_create_vers=1}</td> + <td>H5Tarray_create1()</td> + </tr> + <tr> + <td>\Code{DH5Tarray_create_vers=2}</td> + <td>H5Tarray_create2()</td> + </tr> + <tr> + <td rowspan="2">H5Tcommit()</td> + <td>\Code{DH5Tcommit_vers=1}</td> + <td>H5Tcommit1()</td> + </tr> + <tr> + <td>\Code{DH5Tcommit_vers=2}</td> + <td>H5Tcommit2()</td> + </tr> + <tr> + <td rowspan="2">H5Tget_array_dims()</td> + <td>\Code{DH5Tget_array_dims_vers=1}</td> + <td>H5Tget_array_dims1()</td> + </tr> + <tr> + <td>\Code{DH5Tget_array_dims_vers=2}</td> + <td>H5Tget_array_dims2()</td> + </tr> + <tr> + <td rowspan="2">H5Topen()</td> + <td>\Code{DH5Topen_vers=1}</td> + <td>H5Topen1()</td> + </tr> + <tr> + <td>\Code{DH5Topen_vers=2}</td> + <td>H5Topen2()</td> + </tr> + <tr> + <td rowspan="2">\ref H5Z_class_t struct for H5Zregister()</td> + <td>\Code{DH5Z_class_t_vers=1}</td> + <td>\ref H5Z_class1_t</td> + </tr> + <tr> + <td>\Code{DH5Z_class_t_vers=2}</td> + <td>\ref H5Z_class2_t</td> + </tr> + </table> + </div> + + \subsubsection further Further Information + It is possible to specify multiple function mappings for a single application build: + \code{.sh} + h5cc ... -DH5Rdereference_vers=1 -DH5Fget_info_vers=2 ... + \endcode + As a result of the function and struct mappings in this compile example, all + occurrences of the macro \Code{H5Rdereference} will be mapped to \Code{H5Rdereference1} + and all occurrences of the macro \Code{H5Fget_info} will be mapped to \Code{H5Fget_info2} + for the application being built. + + The function and struct mappings can be used to guarantee that a given API compatibility + macro will be mapped to the desired underlying function or struct version regardless of + the library or application mappings. In cases where an application may benefit greatly + from features offered by some of the later APIs, or must continue to use some earlier + API versions for compatibility reasons, this fine-grained control may be very important. + + As noted earlier, the function mappings can only reference versioned functions that are + included in the HDF5 library, as determined by the configure flag used to build the + library. For example, if the HDF5 library being linked with the application was built + with the \Code{--disable-deprecated-symbols} option, version 1 of the underlying functions + would not be available, and the example above that defined \Code{H5Rdereference_vers=1} + would not be supported. + + The function mappings do not negate any available functions. If \Code{H5Rdereference1} + is available in the installed version of the HDF5 library, and the application was not + compiled with the \Code{-DH5_NO_DEPRECATED_SYMBOLS} flag, the function \Code{H5Rdereference1} + will remain available to the application through its versioned name. Similarly, + \Code{H5Rdereference2} will remain available to the application as \Code{H5Rdereference2}. + The function mapping version flag \Code{H5Rdereference_vers} only controls the mapping of + the API compatibility macro \Code{H5Rdereference} to one of the two available functions. + + This can be especially useful in any case where the programmer does not have direct control + over global macro definitions, such as when writing code meant to be copied to multiple + applications or when writing code in a header file. + + \section macros Compatibility Macros in HDF5 1.6.8 and Later + A series of similar compatibility macros were introduced into the release 1.6 + series of the library, starting with release 1.6.8. These macros simply alias the + '1' version functions, callbacks, and typedefs listed above to their original + non-numbered names. + + These macros were strictly a forward-looking feature at that time; they were not + necessary for compatibility in 1.6.x. These macros were created at that time to + enable writing code that could be used with any version of the library after 1.6.8 + and any library compilation options except \Code{H5_NO_DEPRECATED_SYMBOLS}, by always + using the '1' version of versioned functions and types. For example, \Code{H5Dopen1} + will always be interpreted in exactly the same manner by any version of the library + since 1.6.8. + + \section use-case Common Use Case + A common scenario where the API compatibility macros may be helpful is the migration + of an existing application to a new HDF5 release. An incremental migration plan is + outlined here: + <ol> + <li>Build the HDF5 library without specifying any library mapping \Code{configure} + flag. In this default mode, the 1.6.x, 1.8.x, and 1.10.x versions of the + underlying functions are available, and the API compatibility macros will + be mapped to the current HDF5 versioned functions.</li> + <li>Compile the application with the \Code{-DH5_USE_NN_API} application mapping + option if it was written for use with an earlier HDF5 library. Because the + application mapping overrides the library mapping, the macros will all be + mapped to the earlier versions of the functions.</li> + <li>Remap one API compatibility macro at a time (or sets of macros), to use the + current HDF5 versions. At each stage, use the function mappings to map the macros + being worked on to the current versions. For example, use the + \Code{-DH5Rdereference_vers=2} version flag setting to remap the \Code{H5Rdereference} + macro to \Code{H5Rdereference2}, the 1.10.x version. + + During this step, the application code will need to be modified to change the calling + parameters used with the API compatibility macros to match the number and type + of the 1.10.x versioned functions. The macro name, for example \Code{H5Rdereference}, + should continue to be used in the code, to allow for possible re-mappings to later + versioned functions in a future release.</li> + <li>After all macros have been migrated to the latest versioned functions in step 3, + compile the application without any application or function mappings. This build + uses the library mappings set in step 1, and maps API compatibility macros to the + latest versions.</li> + <li>Finally, compile the application with the application mapping + \Code{-DH5_NO_DEPRECATED_SYMBOLS}, and address any failures to complete + the application migration process.</li> + </ol> + + */
\ No newline at end of file diff --git a/doxygen/dox/mainpage.dox b/doxygen/dox/mainpage.dox new file mode 100644 index 0000000..eda967b --- /dev/null +++ b/doxygen/dox/mainpage.dox @@ -0,0 +1,44 @@ +/*! \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/rm-template.dox b/doxygen/dox/rm-template.dox new file mode 100644 index 0000000..64e4770 --- /dev/null +++ b/doxygen/dox/rm-template.dox @@ -0,0 +1,72 @@ +/**\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() + * + */ diff --git a/doxygen/examples/H5Fclose.c b/doxygen/examples/H5Fclose.c new file mode 100644 index 0000000..525bad3 --- /dev/null +++ b/doxygen/examples/H5Fclose.c @@ -0,0 +1,13 @@ +#include "hdf5.h" + +int +main() +{ + hid_t file; + if ((file = H5Fcreate("foo.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + return -1; + /* Do something good with this file. */ + if (H5Fclose(file) < 0) + return -2; + return 0; +} diff --git a/doxygen/examples/H5Fcreate.c b/doxygen/examples/H5Fcreate.c new file mode 100644 index 0000000..525bad3 --- /dev/null +++ b/doxygen/examples/H5Fcreate.c @@ -0,0 +1,13 @@ +#include "hdf5.h" + +int +main() +{ + hid_t file; + if ((file = H5Fcreate("foo.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + return -1; + /* Do something good with this file. */ + if (H5Fclose(file) < 0) + return -2; + return 0; +} diff --git a/doxygen/examples/hello_hdf5.c b/doxygen/examples/hello_hdf5.c new file mode 100644 index 0000000..a37d39f --- /dev/null +++ b/doxygen/examples/hello_hdf5.c @@ -0,0 +1,13 @@ +#include "hdf5.h" + +int +main() +{ + herr_t retval; + unsigned majnum, minnum, relnum; + + if ((retval = H5get_libversion(&majnum, &minnum, &relnum)) >= 0) { + printf("Hello, HDF5 %d.%d.%d!\n", majnum, minnum, relnum); + } + return retval; +} diff --git a/doxygen/img/HDFG-logo.png b/doxygen/img/HDFG-logo.png Binary files differnew file mode 100644 index 0000000..a2d52a9 --- /dev/null +++ b/doxygen/img/HDFG-logo.png diff --git a/examples/ph5example.c b/examples/ph5example.c index 06c8919..da777a9 100644 --- a/examples/ph5example.c +++ b/examples/ph5example.c @@ -1087,7 +1087,7 @@ finish: return (nerrors); } -#else /* H5_HAVE_PARALLEL */ +#else /* H5_HAVE_PARALLEL */ /* dummy program since H5_HAVE_PARALLE is not configured in */ int main(void) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index d52f537..441af59 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -505,7 +505,7 @@ h5pget_version_c(hid_t_f H5_ATTR_UNUSED *prp_id, int_f *boot, int_f *freelist, i return 0; } -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ int_f h5pget_version_c(hid_t_f *prp_id, int_f *boot, int_f *freelist, int_f *stab, int_f *shhdr) /******/ diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index fc4acc4..8198135 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -39,7 +39,7 @@ set (HDF_JAVA_SZIP_EXAMPLES set (${HDF_JAVA_EXAMPLES} ${HDF_JAVA_EXAMPLES} ${HDF_JAVA_SZIP_EXAMPLES}) endif (H5_HAVE_FILTER_SZIP) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index bd4f483..6997b2e 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -24,7 +24,7 @@ set (HDF_JAVA_EXAMPLES H5Ex_T_VLString ) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index c2c7d0f..6483f91 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -13,7 +13,7 @@ set (HDF_JAVA_EXAMPLES H5Ex_G_Visit ) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 6cb1e16..867740b 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -13,7 +13,7 @@ set (HDF_JAVA_EXAMPLES H5_ReadWrite ) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 1147e6c..1f6d0dc 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -241,10 +241,14 @@ public class H5 implements java.io.Serializable { */ public final static int LIB_VERSION[] = { 1, 13, 0 }; + /** + * add system property to load library by path + */ public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; - // add system property to load library by name from library path, via - // System.loadLibrary() + /** + * add system property to load library by name from library path, via System.loadLibrary() + */ public final static String H5_LIBRARY_NAME_PROPERTY_KEY = "hdf.hdf5lib.H5.loadLibraryName"; private static String s_libraryName; private static boolean isLibraryLoaded = false; @@ -257,6 +261,9 @@ public class H5 implements java.io.Serializable { loadH5Lib(); } + /** + * load native library + */ public static void loadH5Lib() { // Make sure that the library is loaded only once if (isLibraryLoaded) @@ -468,6 +475,35 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5get_libversion(int[] libversion) throws HDF5LibraryException; + /** + * H5set_free_list_limits + * 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 + * global lists, up to 3 MB of total storage might be allocated (1MB on + * each of regular, array and block type lists). + * + * The settings for block free lists are duplicated to factory free lists. + * Factory free list limits cannot be set independently currently. + * + * @param reg_global_lim + * The limit on all "regular" free list memory used + * @param reg_list_lim + * The limit on memory used in each "regular" free list + * @param arr_global_lim + * The limit on all "array" free list memory used + * @param arr_list_lim + * The limit on memory used in each "array" free list + * @param blk_global_lim + * The limit on all "block" free list memory used + * @param blk_list_lim + * The limit on memory used in each "block" free list + * @return a non-negative value if successful, along with the version information. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + */ public synchronized static native int H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) throws HDF5LibraryException; @@ -1016,7 +1052,7 @@ public class H5 implements java.io.Serializable { /** * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with - * mem_type_id. The entire attribute is read into buf from the file. + * mem_type_id. The entire attribute is read into buffer from the file. * * @param attr_id * IN: Identifier of an attribute to read. @@ -1037,11 +1073,47 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Aread(long attr_id, long mem_type_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread(long attr_id, long mem_type_id, byte[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread(attr_id, mem_type_id, buf, true); } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param obj + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread(long attr_id, long mem_type_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException { return H5Aread(attr_id, mem_type_id, obj, true); @@ -1141,63 +1213,343 @@ public class H5 implements java.io.Serializable { return status; } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of double from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of double to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of double from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of double to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread_double(long attr_id, long mem_type_id, double[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread_double(attr_id, mem_type_id, buf, true); } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of float from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of float to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of float from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of float to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread_float(long attr_id, long mem_type_id, float[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread_float(attr_id, mem_type_id, buf, true); } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of int from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of int to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of int from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of int to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread_int(long attr_id, long mem_type_id, int[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread_int(attr_id, mem_type_id, buf, true); } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of long from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of long to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of long from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of long to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread_long(long attr_id, long mem_type_id, long[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread_long(attr_id, mem_type_id, buf, true); } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of String from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of String to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of short from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of short to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of shortfrom the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of short to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread_short(long attr_id, long mem_type_id, short[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread_short(attr_id, mem_type_id, buf, true); } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of variable-lenght from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of variable-lenght to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5AreadVL(long attr_id, long mem_type_id, Object[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of String from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of String to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_string(long attr_id, long mem_type_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of variable-lenght strings from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of variable-lenght strings to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_VLStrings(long attr_id, long mem_type_id, Object[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of string from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of string to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5AreadComplex(long attr_id, long mem_type_id, String[] buf) throws HDF5LibraryException, NullPointerException; @@ -1270,12 +1622,48 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buf to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static int H5Awrite(long attr_id, long mem_type_id, byte[] buf) throws HDF5LibraryException, NullPointerException { return H5Awrite(attr_id, mem_type_id, buf, true); } + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buf to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param obj + * IN: Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException { @@ -1353,60 +1741,286 @@ public class H5 implements java.io.Serializable { return status; } + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of double to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of double with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static native int H5Awrite_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of double to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of double with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static int H5Awrite_double(long attr_id, long mem_type_id, double[] buf) throws HDF5LibraryException, NullPointerException { return H5Awrite_double(attr_id, mem_type_id, buf, true); } + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of float to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of float with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static native int H5Awrite_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of float to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of float with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static int H5Awrite_float(long attr_id, long mem_type_id, float[] buf) throws HDF5LibraryException, NullPointerException { return H5Awrite_float(attr_id, mem_type_id, buf, true); } + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of int to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of int with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static native int H5Awrite_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of int to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of int with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static int H5Awrite_int(long attr_id, long mem_type_id, int[] buf) throws HDF5LibraryException, NullPointerException { return H5Awrite_int(attr_id, mem_type_id, buf, true); } + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of long to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of long with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static native int H5Awrite_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of long to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of long with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static int H5Awrite_long(long attr_id, long mem_type_id, long[] buf) throws HDF5LibraryException, NullPointerException { return H5Awrite_long(attr_id, mem_type_id, buf, true); } + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of short to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of short with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static native int H5Awrite_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of short to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of short with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static int H5Awrite_short(long attr_id, long mem_type_id, short[] buf) throws HDF5LibraryException, NullPointerException { return H5Awrite_short(attr_id, mem_type_id, buf, true); } + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of string to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of string with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static native int H5Awrite_string(long attr_id, long mem_type_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of variable-lenght to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of variable-lenght with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ public synchronized static native int H5AwriteVL(long attr_id, long mem_type_id, Object[] buf) throws HDF5LibraryException, NullPointerException; /** * H5Awrite_VLStrings writes a variable length String dataset, specified by its identifier attr_id, from - * the application memory buffer buf into the file. + * the application memory buffer buffer of variable-lenght strings into the file. * * ---- contributed by Rosetta Biosoftware * @@ -1415,7 +2029,7 @@ public class H5 implements java.io.Serializable { * @param mem_type_id * Identifier of the memory datatype. * @param buf - * Buffer with data to be written to the file. + * Buffer of variable-lenght strings with data to be written to the file. * * @return a non-negative value if successful * @@ -1922,12 +2536,60 @@ public class H5 implements java.io.Serializable { long file_space_id, long xfer_plist_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer buf. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException { return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer buf. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException { @@ -2043,65 +2705,411 @@ public class H5 implements java.io.Serializable { return status; } + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of type double. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of type double to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of type double. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException { return H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of float. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of float. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException { return H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of int. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of int. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException { return H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of long. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of long. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException { return H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of string. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of string to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_reg_ref(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of short. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of short. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException { return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of variable-lenght. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-lenght to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of string. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of string to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of variable-lenght strings. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-lenght strings to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_VLStrings(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; @@ -2170,7 +3178,7 @@ public class H5 implements java.io.Serializable { /** * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer - * buf into the file. + * into the file. * * @param dataset_id * Identifier of the dataset read from. @@ -2198,12 +3206,60 @@ public class H5 implements java.io.Serializable { long file_space_id, long xfer_plist_id, byte[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException { @@ -2299,59 +3355,357 @@ public class H5 implements java.io.Serializable { return status; } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of string with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-length with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5DwriteVL(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; @@ -2628,7 +3982,7 @@ public class H5 implements java.io.Serializable { /** - * H5Epush2 pushes a new error record onto the error stack specified by estack_id. + * H5Epush pushes a new error record onto the error stack specified by estack_id. * * @param stack_id * IN: Error stack identifier. @@ -2657,6 +4011,31 @@ public class H5 implements java.io.Serializable { { H5Epush2(stack_id, file, func, line, cls_id, maj_id, min_id, msg); } + /** + * H5Epush2 pushes a new error record onto the error stack specified by estack_id. + * + * @param stack_id + * IN: Error stack identifier. + * @param file + * IN: Name of the file in which the error was detected. + * @param func + * IN: Name of the function in which the error was detected. + * @param line + * IN: Line number within the file at which the error was detected. + * @param cls_id + * IN: Error class identifier. + * @param maj_id + * IN: Major error identifier. + * @param min_id + * IN: Minor error identifier. + * @param msg + * IN: Error description string. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - file, func, or msg is null. + **/ public synchronized static native void H5Epush2(long stack_id, String file, String func, int line, long cls_id, long maj_id, long min_id, String msg) throws HDF5LibraryException, NullPointerException; @@ -2714,6 +4093,24 @@ public class H5 implements java.io.Serializable { { H5Ewalk2(stack_id, direction, func, client_data); } + /** + * H5Ewalk2 walks the error stack specified by estack_id for the current thread and calls the + * function specified in func for each error along the way. + * + * @param stack_id + * IN: Error stack identifier. + * @param direction + * IN: Direction in which the error stack is to be walked. + * @param func + * IN: Function to be called for each error encountered. + * @param client_data + * IN: Data to be passed with func. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - func is null. + **/ public synchronized static native void H5Ewalk2(long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data) throws HDF5LibraryException, NullPointerException; @@ -2950,6 +4347,19 @@ public class H5 implements java.io.Serializable { private synchronized static native long _H5Fget_create_plist(long file_id) throws HDF5LibraryException; + /** + * H5Fget_filesize retrieves the file size of the HDF5 file. This function + * is called after an existing file is opened in order + * to learn the true size of the underlying file. + * + * @param file_id + * IN: File identifier for a currently-open HDF5 file + * + * @return the file size of the HDF5 file + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Fget_filesize(long file_id) throws HDF5LibraryException; /** @@ -3598,37 +5008,118 @@ public class H5 implements java.io.Serializable { return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, tokens, HDF5Constants.H5_INDEX_NAME); } - public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype, + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param tokens + * OUT: Object token of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes, int[] ltype, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException { - return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, tokens, indx_type, -1); + return H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, null, tokens, indx_type, -1); } - public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype, + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param fno + * OUT: File number + * @param tokens + * OUT: Object token of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes, int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException { - return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, indx_type, -1); + return H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, fno, tokens, indx_type, -1); } - public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype, + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param fno + * OUT: File number + * @param tokens + * OUT: Object token of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * @param indx_order + * IN: Index order for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] objNames, int[] objTypes, int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type, int indx_order) throws HDF5LibraryException, NullPointerException { - if (oname == null) { + if (objNames == null) { throw new NullPointerException("H5Gget_obj_info_full(): name array is null"); } - if (otype == null) { + if (objTypes == null) { throw new NullPointerException("H5Gget_obj_info_full(): object type array is null"); } - if (oname.length == 0) { + if (objNames.length == 0) { throw new HDF5LibraryException("H5Gget_obj_info_full(): array size is zero"); } - if (oname.length != otype.length) { + if (objNames.length != objTypes.length) { throw new HDF5LibraryException("H5Gget_obj_info_full(): name and type array sizes are different"); } if (ltype == null) - ltype = new int[otype.length]; + ltype = new int[objTypes.length]; if (fno == null) fno = new long[tokens.length]; @@ -3639,15 +5130,15 @@ public class H5 implements java.io.Serializable { if (indx_order < 0) indx_order = HDF5Constants.H5_ITER_INC; - log.trace("H5Gget_obj_info_full: oname_len={}", oname.length); - int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, oname.length, indx_type, + log.trace("H5Gget_obj_info_full: objNames_len={}", objNames.length); + int status = H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, fno, tokens, objNames.length, indx_type, indx_order); - for (int indx = 0; indx < oname.length; indx++) - log.trace("H5Gget_obj_info_full: oname={}", oname[indx]); + for (int indx = 0; indx < objNames.length; indx++) + log.trace("H5Gget_obj_info_full: objNames={}", objNames[indx]); return status; } - private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype, + private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] objNames, int[] objTypes, int[] ltype, long[] fno, H5O_token_t[] tokens, int n, int indx_type, int indx_order) throws HDF5LibraryException, NullPointerException; @@ -3663,9 +5154,9 @@ public class H5 implements java.io.Serializable { * @param idx * IN: the index of the object to iterate. * @param oname - * the name of the object [OUT] + * OUT: the name of the object * @param type - * the type of the object [OUT] + * OUT: the type of the object * * @return non-negative if successful, -1 if not. * @@ -3866,13 +5357,40 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// + /** + * H5Iget_file_id obtains the file ID specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the file ID. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Iget_file_id(long obj_id) throws HDF5LibraryException; + /** + * H5Iget_name_long retrieves the name of an object specified by the identifier, obj_id. + * @deprecated + * + * @param obj_id + * IN: Identifier of the object. + * @param name + * OUT: Attribute name buffer. + * @param size + * IN: Maximum length of the name to retrieve. + * + * @return the length of the name retrieved. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ @Deprecated public synchronized static native long H5Iget_name_long(long obj_id, String[] name, long size) throws HDF5LibraryException, NullPointerException; /** - * H5Iget_name_str retrieves the name of an object specified by the identifier, obj_id. + * H5Iget_name retrieves the name of an object specified by the identifier, obj_id. * * @param obj_id * IN: Identifier of the object. @@ -3885,10 +5403,44 @@ public class H5 implements java.io.Serializable { public synchronized static native String H5Iget_name(long obj_id) throws HDF5LibraryException; + /** + * H5Iget_ref obtains the number of references outstanding specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the reference count. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Iget_ref(long obj_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Idec_ref decrements the reference count specified by the identifier, obj_id. + * If the reference count for an ID reaches zero, the object will be closed. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the reference count. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Idec_ref(long obj_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Iinc_ref increments the reference count specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the reference count. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Iinc_ref(long obj_id) throws HDF5LibraryException, NullPointerException; /** @@ -5179,7 +6731,7 @@ public class H5 implements java.io.Serializable { return id; } - public synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name, + private synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -5210,8 +6762,30 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException; + /** + * H5Odisable_mdc_flushes corks an object, keeping dirty entries associated with the object in the metadata cache. + * + * @param object_id + * IN: Identifier of the object to be corked. + **/ public synchronized static native void H5Odisable_mdc_flushes(long object_id); + /** + * H5Oenable_mdc_flushes uncorks an object, keeping dirty entries associated with the object in the metadata cache. + * + * @param object_id + * IN: Identifier of the object to be uncorked. + **/ public synchronized static native void H5Oenable_mdc_flushes(long object_id); + /** + * H5Oare_mdc_flushes_disabled retrieve the object's "cork" status. + * + * @param object_id + * IN: Identifier of the object to be flushed. + * + * @return the cork status + * TRUE if mdc flushes for the object is disabled + * FALSE if mdc flushes for the object is not disabled + **/ public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id); // /////// unimplemented //////// @@ -5364,6 +6938,7 @@ public class H5 implements java.io.Serializable { * IN: First property object to be compared * @param plid2 * IN: Second property object to be compared + * * @return positive value if equal; zero if unequal, a negative value if failed * * @exception HDF5LibraryException @@ -5371,6 +6946,19 @@ public class H5 implements java.io.Serializable { */ public synchronized static native int H5Pequal(long plid1, long plid2) throws HDF5LibraryException; + /** + * H5Pequal determines if two property lists or classes are equal + * + * @param plid1 + * IN: First property object to be compared + * @param plid2 + * IN: Second property object to be compared + * + * @return TRUE if equal, FALSE if unequal + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + */ public static boolean H5P_equal(long plid1, long plid2) throws HDF5LibraryException { if (H5Pequal(plid1, plid2) == 1) return true; @@ -5456,7 +7044,7 @@ public class H5 implements java.io.Serializable { return _H5Pclose_class(plid); } - public synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException; + private synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException; /** * H5Pclose terminates access to a property list. @@ -5524,6 +7112,19 @@ public class H5 implements java.io.Serializable { // Define property list iteration function type // typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); + /** + * H5Pcreate_class_nocb creates an new property class with no callback functions. + * + * @param parent_class + * IN: Identifier of the parent property class. + * @param name + * IN: Name of the property class. + * + * @return a property list identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public static long H5Pcreate_class_nocb(long parent_class, String name) throws HDF5LibraryException { long id = _H5Pcreate_class_nocb(parent_class, name); if (id > 0) { @@ -5550,17 +7151,69 @@ public class H5 implements java.io.Serializable { // private synchronized static native long _H5Pcreate_class(long parent_class, String name, H5P_cls_create_func_cb create_op, H5P_cls_create_func_t create_data, // H5P_cls_copy_func_cb copy_op, H5P_cls_copy_func_t copy_data, H5P_cls_close_func_cb close_op, H5P_cls_close_func_t close_data) throws HDF5LibraryException; + /** + * H5Pregister2_nocb registers a property list with no callback functions. + * + * @param plist_class + * IN: Identifier of the property list. + * @param name + * IN: Name of the property. + * @param size + * IN: Size the property value. + * @param def_value + * IN: Defaul value of the property + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pregister2_nocb(long plist_class, String name, long size, byte[] def_value) throws HDF5LibraryException; // public synchronized static native void H5Pregister2(long plist_class, String name, long size, byte[] def_value, H5P_prp_create_func_cb prp_create, H5P_prp_set_func_cb prp_set, // H5P_prp_get_func_cb prp_get, H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException; + /** + * H5Pinsert2_nocb inserts a property list with no callback functions. + * + * @param plist + * IN: Identifier of the property list. + * @param name + * IN: Name of the property. + * @param size + * IN: Size the property value. + * @param value + * IN: Defaul value of the property + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pinsert2_nocb(long plist, String name, long size, byte[] value) throws HDF5LibraryException; // public synchronized static native void H5Pinsert2(long plist, String name, long size, byte[] value, H5P_prp_set_func_cb prp_set, H5P_prp_get_func_cb prp_get, // H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException; + /** + * H5Piterate iterates over the properties in a property list or class + * + * @param plist + * IN: ID of property object to iterate over + * @param idx + * IN/OUT: index of the property to begin with + * @param op + * IN: function to be called with each property iterated over. + * @param op_data + * IN: iteration data from user + * + * @return + * the return value of the last call to op if it was non-zero, + * zero if all properties have been processed + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - size is null. + * + **/ public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; // /////// Object creation property list (OCPL) routines /////// @@ -5573,7 +7226,7 @@ public class H5 implements java.io.Serializable { * @param attributes * The maximun and minimum no. of attributes to be stored. * - * <pre> + * <pre> * attributes[0] = The maximum number of attributes to be stored in compact storage * attributes[1] = The minimum number of attributes to be stored in dense storage * </pre> @@ -5673,6 +7326,51 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_obj_track_times(long ocpl_id, boolean track_times) throws HDF5LibraryException; + /** + * H5Pmodify_filter modifies the specified FILTER in the transient or permanent output filter pipeline + * depending on whether PLIST is a dataset creation or dataset + * transfer property list. The FLAGS argument specifies certain + * general properties of the filter and is documented below. + * The CD_VALUES is an array of CD_NELMTS integers which are + * auxiliary data for the filter. The integer vlues will be + * stored in the dataset object header as part of the filter + * information. + *<p> + * The FLAGS argument is a bit vector of the following fields: + *<p> + * H5Z_FLAG_OPTIONAL(0x0001) + * If this bit is set then the filter is optional. If the + * filter fails during an H5Dwrite() operation then the filter + * is just excluded from the pipeline for the chunk for which it + * failed; the filter will not participate in the pipeline + * during an H5Dread() of the chunk. If this bit is clear and + * the filter fails then the entire I/O operation fails. + * If this bit is set but encoding is disabled for a filter, + * attempting to write will generate an error. + *<p> + * Note: This function currently supports only the permanent filter + * pipeline. That is, PLIST_ID must be a dataset creation + * property list. + * + * @param plist + * IN: Property list identifier. + * @param filter + * IN: Filter to be modified to the pipeline. + * @param flags + * IN: Bit vector specifying certain general properties of the filter. + * @param cd_nelmts + * IN: Number of elements in cd_values + * @param cd_values + * IN: Auxiliary data for the filter. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name or an array is null. + * + **/ public synchronized static native int H5Pmodify_filter(long plist, long filter, int flags, long cd_nelmts, int[] cd_values) throws HDF5LibraryException, NullPointerException; @@ -5844,9 +7542,37 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; + /** + * H5Pall_filters_avail query to verify that all the filters set + * in the dataset creation property list are available currently. + * + * @param dcpl_id + * IN: Property list identifier. + * + * @return + * TRUE if all filters available + * FALSE if one or more filters not currently available. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native boolean H5Pall_filters_avail(long dcpl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Premove_filter deletes a filter from the dataset creation property list; + * deletes all filters if filter is H5Z_FILTER_NONE + * + * @param obj_id + * IN: Property list identifier. + * @param filter + * IN: Filter identifier. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Premove_filter(long obj_id, long filter) throws HDF5LibraryException; /** @@ -5864,6 +7590,18 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Pset_deflate(long plist, int level) throws HDF5LibraryException; + /** + * H5Pset_fletcher32 sets Fletcher32 checksum of EDC for a dataset creation + * property list or group creation property list. + * + * @param plist + * IN: Property list identifier. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; @@ -6334,11 +8072,35 @@ public class H5 implements java.io.Serializable { */ public synchronized static native long H5Pget_driver(long plid) throws HDF5LibraryException; - public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pget_family_offset gets offset for family driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return the offset. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException; - public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_family_offset sets the offset for family driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param offset + * IN: the offset value + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException; /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6389,9 +8151,8 @@ public class H5 implements java.io.Serializable { double rdcc_w0) throws HDF5LibraryException; /** - * 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 config_ptr parameter. This configuration is - * used when the file is opened. + * H5Pget_mdc_config gets the initial metadata cache configuration contained in a file access property list. + * This configuration is used when the file is opened. * * @param plist_id * IN: Identifier of the file access property list. @@ -6403,6 +8164,19 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native H5AC_cache_config_t H5Pget_mdc_config(long plist_id) throws HDF5LibraryException; + /** + * H5Pset_mdc_config sets 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 config_ptr parameter. This configuration is + * used when the file is opened. + * + * @param plist_id + * IN: Identifier of the file access property list. + * @param config_ptr + * IN: H5AC_cache_config_t, the initial metadata cache configuration. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pset_mdc_config(long plist_id, H5AC_cache_config_t config_ptr) throws HDF5LibraryException; @@ -6437,10 +8211,35 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_gc_references(long fapl_id, boolean gc_ref) throws HDF5LibraryException; - public synchronized static native int H5Pget_fclose_degree(long plist_id) throws HDF5LibraryException, + /** + * H5Pget_fclose_degree returns the degree for the file close behavior for a file access + * property list. + * + * @param fapl_id + * IN File access property list + * + * @return the degree for the file close behavior + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pget_fclose_degree(long fapl_id) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Pset_fclose_degree(long plist, int degree) throws HDF5LibraryException, + /** + * H5Pset_fclose_degree sets the degree for the file close behavior. + * + * @param fapl_id + * IN File access property list + * @param degree + * IN the degree for the file close behavior + * + * @return non-negative if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pset_fclose_degree(long fapl_id, int degree) throws HDF5LibraryException, NullPointerException; /** @@ -6471,8 +8270,40 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Pset_meta_block_size(long fapl_id, long size) throws HDF5LibraryException; + /** + * H5Pget_sieve_buf_size retrieves the current settings for the data sieve buffer size + * property from a file access property list. + * + * @param fapl_id + * IN: Identifier for property list to query. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Pget_sieve_buf_size(long fapl_id) throws HDF5LibraryException; + /** + * H5Pset_sieve_buf_size Sets the maximum size of the data seive buffer used for file + * drivers which 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 anough to hold several pieces of the dataset + * being read in for hyperslab selections boosts performance by quite a + * bit. + * <p> + * 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 0 + * with this function will turn off the data sieving + * + * @param fapl_id + * IN: Identifier of property list to modify. + * @param size + * IN: maximum size of the data seive buffer. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pset_sieve_buf_size(long fapl_id, long size) throws HDF5LibraryException; /** @@ -6816,6 +8647,25 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_chunk(long plist, int ndims, byte[] dim) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + /** + * H5Pset_chunk sets the size of the chunks used to store a chunked layout dataset. + * + * @param plist + * IN: Identifier for property list to query. + * @param ndims + * IN: The number of dimensions of each chunk. + * @param dim + * IN: An array containing the size of each chunk. + * + * @return a non-negative value if successful + * + * @exception HDF5Exception + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - dims array is null. + * @exception IllegalArgumentException + * - dims <=0 + **/ public synchronized static int H5Pset_chunk(long plist, int ndims, long[] dim) throws HDF5Exception, NullPointerException, IllegalArgumentException { if (dim == null) { @@ -7051,9 +8901,37 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Pget_external_count(long plist) throws HDF5LibraryException; + /** + * H5Pset_szip Sets up the use of the szip filter. + * + * @param plist + * IN: Dataset creation property list identifier. + * @param options_mask + * IN: Bit vector specifying certain general properties of the filter. + * @param pixels_per_block + * IN: Number of pixels in blocks + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_szip(long plist, int options_mask, int pixels_per_block) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_shuffle Sets up the use of the shuffle filter. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_shuffle(long plist_id) throws HDF5LibraryException, NullPointerException; @@ -7181,20 +9059,91 @@ public class H5 implements java.io.Serializable { return retVal; } + /** + * H5Pset_fill_value checks if the fill value is defined for a dataset creation property list. + * + * @param plist_id + * IN: Property list identifier. + * @param status + * IN: The fill value setting: + * H5D_FILL_VALUE_UNDEFINED + * H5D_FILL_VALUE_DEFAULT + * H5D_FILL_VALUE_USER_DEFINED + * H5D_FILL_VALUE_ERROR + * + * @return a non-negative value if successful + * + * @exception HDF5Exception + * - Error converting data array + **/ public synchronized static native int H5Pfill_value_defined(long plist_id, int[] status) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_alloc_time Gets space allocation time for dataset during creation. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param alloc_time + * OUT: allocation time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_alloc_time(long plist_id, int[] alloc_time) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_alloc_time Sets space allocation time for dataset during creation. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param alloc_time + * IN: allocation time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_alloc_time(long plist_id, int alloc_time) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_fill_time Gets fill value writing time. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param fill_time + * OUT: fill time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException; - public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_fill_time Sets the fill value writing time. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param fill_time + * IN: fill time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException; /** * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. @@ -7494,6 +9443,20 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_buffer(long plist, byte[] tconv, byte[] bkg) throws HDF5LibraryException, IllegalArgumentException; + /** + * H5Pget_buffer_size gets type conversion and background buffer size, in bytes, if successful; + * otherwise 0 on failure. + * + * @param plist + * Identifier for the dataset transfer property list. + * + * @return buffer size, in bytes, if successful; otherwise 0 on failure + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception IllegalArgumentException + * - plist is invalid. + **/ public synchronized static native long H5Pget_buffer_size(long plist) throws HDF5LibraryException, IllegalArgumentException; @@ -7524,11 +9487,33 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_buffer_size(long plist, long size) throws HDF5LibraryException, IllegalArgumentException; - public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pget_edc_check gets the error-detecting algorithm in use. + * + * @param plist + * Identifier for the dataset transfer property list. + * + * @return the error-detecting algorithm + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException; - public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_edc_check sets the error-detecting algorithm. + * + * @param plist + * Identifier for the dataset transfer property list. + * @param check + * the error-detecting algorithm to use. + * + * @return non-negative if succeed + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException; /** * H5Pget_btree_ratio Get the B-tree split ratios for a dataset transfer property list. @@ -7573,9 +9558,46 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_btree_ratios(long plist_id, double left, double middle, double right) throws HDF5LibraryException; + /** + * H5Pget_hyper_vector_size reads values previously set with H5Pset_hyper_vector_size. + * + * @param dxpl_id + * IN: Dataset transfer property list identifier. + * @param vector_size + * OUT: hyper vector size. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_hyper_vector_size(long dxpl_id, long[] vector_size) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_hyper_vector_size sets the number of + * "I/O vectors" (offset and length pairs) which are to be + * accumulated in memory before being issued to the lower levels + * of the library for reading or writing the actual data. + * Increasing the number should give better performance, but use + * more memory during hyperslab I/O. The vector size must be + * greater than 1. + *,p. + * The default is to use 1024 vectors for I/O during hyperslab + * reading/writing. + * + * @param dxpl_id + * IN: Dataset transfer property list identifier. + * @param vector_size + * IN: hyper vestor size. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; @@ -7773,8 +9795,32 @@ public class H5 implements java.io.Serializable { // /////// String creation property list (STRCPL) routines /////// + /** + * H5Pget_char_encoding gets the character encoding of the string. + * + * @param plist_id + * IN: the property list identifier + * + * @return Returns the character encoding of the string. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; + /** + * H5Pset_char_encoding sets the character encoding of the string. + * + * @param plist_id + * IN: the property list identifier + * @param encoding + * IN: the character encoding of the string + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; @@ -7964,20 +10010,51 @@ public class H5 implements java.io.Serializable { // /////// file drivers property list routines /////// + /** + * H5Pget_fapl_core retrieve H5FD_CORE I/O settings. + * + * @param fapl_id + * IN: File access property list identifier + * @param increment + * OUT: how much to grow the memory each time + * @param backing_store + * OUT: write to file name on flush setting + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_core modifies the file access property list to use the H5FD_CORE driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param increment + * IN: how much to grow the memory each time + * @param backing_store + * IN: write to file name on flush setting + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_core(long fapl_id, long increment, boolean backing_store) throws HDF5LibraryException, NullPointerException; /** - * H5Pget_fapl_direct Retrieve direct I/O settings. + * H5Pget_fapl_direct queries properties set by the H5Pset_fapl_direct. * * @param fapl_id * IN: File access property list identifier * @param info - * OUT: Returned property list information info[0] = alignment Required memory alignment boundary info[1] - * = block_size File system block size info[2] = cbuf_size Copy buffer size + * OUT: Returned property list information + * info[0] = increment -how much to grow the memory each time + * info[1] = backing_store - write to file name on flush setting * * @return a non-negative value if successful; otherwise returns a negative value. * @@ -8008,14 +10085,72 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fapl_direct(long fapl_id, long alignment, long block_size, long cbuf_size) throws HDF5LibraryException; + /** + * H5Pget_fapl_family Returns information about the family file access property list. + * + * @param fapl_id + * IN: File access property list identifier + * @param memb_size + * OUT: the size in bytes of each file member (used only when creating a new file) + * @param memb_fapl_id + * OUT: the file access property list to be used for each family member + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_fapl_family(long fapl_id, long[] memb_size, long[] memb_fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_family Sets up use of the direct I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param memb_size + * IN: the size in bytes of each file member (used only when creating a new file) + * @param memb_fapl_id + * IN: the file access property list to be used for each family member + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_hdfs Modify the file access property list to use the H5FD_HDFS driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param fapl_conf + * IN: the properties of the hdfs driver + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; + /** + * H5Pget_fapl_hdfs gets the properties hdfs I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return the properties of the hdfs driver. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native H5FD_hdfs_fapl_t H5Pget_fapl_hdfs(long fapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -8093,17 +10228,99 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_fapl_log(long fapl_id, String logfile, long flags, long buf_size) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_sec2 Sets up use of the sec2 I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_sec2(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_split Sets up use of the split I/O driver. Makes the multi driver act like the + * old split driver which stored meta data in one file and raw + * data in another file + * + * @param fapl_id + * IN: File access property list identifier + * @param meta_ext + * IN: meta filename extension + * @param meta_plist_id + * IN: File access property list identifier for metadata + * @param raw_ext + * IN: raw data filename extension + * @param raw_plist_id + * IN: File access property list identifier raw data + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native void H5Pset_fapl_split(long fapl_id, String meta_ext, long meta_plist_id, String raw_ext, long raw_plist_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_stdio Sets up use of the stdio I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_stdio(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_windows Sets up use of the windows I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_windows(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_ros3 Modify the file access property list to use the H5FD_ROS3 driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param fapl_conf + * IN: the properties of the ros3 driver + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; + /** + * H5Pget_fapl_ros3 gets the properties of the ros3 I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return the properties of the ros3 driver. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native H5FD_ros3_fapl_t H5Pget_fapl_ros3(long fapl_id) throws HDF5LibraryException, NullPointerException; // /////// unimplemented //////// @@ -8811,50 +11028,7 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - /** - * H5Sclose releases a dataspace. - * - * @param space_id - * Identifier of dataspace to release. - * - * @return a non-negative value if successful - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - **/ - public static int H5Sclose(long space_id) throws HDF5LibraryException { - if (space_id < 0) - return 0; // throw new HDF5LibraryException("Negative ID");; - - log.trace("OPEN_IDS: H5Sclose remove {}", space_id); - OPEN_IDS.remove(space_id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - return _H5Sclose(space_id); - } - - private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException; - - /** - * H5Scopy creates a new dataspace which is an exact copy of the dataspace identified by space_id. - * - * @param space_id - * Identifier of dataspace to copy. - * @return a dataspace identifier if successful - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - **/ - public static long H5Scopy(long space_id) throws HDF5LibraryException { - long id = _H5Scopy(space_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Scopy add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; - } - - private synchronized static native long _H5Scopy(long space_id) throws HDF5LibraryException; + /**************** Operations on dataspaces ********************/ /** * H5Screate creates a new dataspace of a particular type. @@ -8911,19 +11085,96 @@ public class H5 implements java.io.Serializable { throws HDF5Exception, NullPointerException; /** - * H5Sdecode reconstructs the HDF5 data space object and returns a new object handle for it. + * H5Sset_extent_simple sets or resets the size of an existing dataspace. * - * @param buf - * IN: Buffer for the data space object to be decoded. + * @param space_id + * Dataspace identifier. + * @param rank + * Rank, or dimensionality, of the dataspace. + * @param current_size + * Array containing current size of dataspace. + * @param maximum_size + * Array containing maximum size of dataspace. * - * @return a new object handle + * @return a dataspace identifier if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. **/ - public synchronized static native long H5Sdecode(byte[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size, + long[] maximum_size) throws HDF5LibraryException, NullPointerException; + + /** + * H5Sset_extent_simple sets or resets the size of an existing dataspace. + * + * @param space_id + * Dataspace identifier. + * @param rank + * Rank, or dimensionality, of the dataspace. + * @param current_size + * Array containing current size of dataspace. + * @param maximum_size + * Array containing maximum size of dataspace. + * + * @return a dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size, + byte[] maximum_size) throws HDF5LibraryException, NullPointerException { + ByteBuffer csbb = ByteBuffer.wrap(current_size); + long[] lacs = (csbb.asLongBuffer()).array(); + ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size); + long[] lamaxs = (maxsbb.asLongBuffer()).array(); + + return H5Sset_extent_simple(space_id, rank, lacs, lamaxs); + } + + /** + * H5Scopy creates a new dataspace which is an exact copy of the dataspace identified by space_id. + * + * @param space_id + * Identifier of dataspace to copy. + * @return a dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Scopy(long space_id) throws HDF5LibraryException { + long id = _H5Scopy(space_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Scopy add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Scopy(long space_id) throws HDF5LibraryException; + + /** + * H5Sclose releases a dataspace. + * + * @param space_id + * Identifier of dataspace to release. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static int H5Sclose(long space_id) throws HDF5LibraryException { + if (space_id < 0) + return 0; // throw new HDF5LibraryException("Negative ID");; + + log.trace("OPEN_IDS: H5Sclose remove {}", space_id); + OPEN_IDS.remove(space_id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + return _H5Sclose(space_id); + } + + private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException; /** * H5Sencode converts a data space description into binary form in a buffer. @@ -8939,154 +11190,139 @@ public class H5 implements java.io.Serializable { public synchronized static native byte[] H5Sencode(long obj_id) throws HDF5LibraryException, NullPointerException; /** - * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the - * dataspace. + * H5Sdecode reconstructs the HDF5 data space object and returns a new object handle for it. * - * @param dest_space_id - * IN: The identifier for the dataspace from which the extent is copied. - * @param source_space_id - * IN: The identifier for the dataspace to which the extent is copied. + * @param buf + * IN: Buffer for the data space object to be decoded. * - * @return a non-negative value if successful + * @return a new object handle * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. **/ - public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id) - throws HDF5LibraryException; + public synchronized static native long H5Sdecode(byte[] buf) throws HDF5LibraryException, NullPointerException; /** - * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal. + * H5Sget_simple_extent_npoints determines the number of elements in a dataspace. * - * @param first_space_id - * IN: The identifier for the first dataspace. - * @param second_space_id - * IN: The identifier for the seconddataspace. + * @param space_id + * ID of the dataspace object to query + * @return the number of elements in the dataspace if successful * - * @return true if successful, else false + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException; + + /** + * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace. + * + * @param space_id + * IN: Identifier of the dataspace + * + * @return the number of dimensions in the dataspace if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id) - throws HDF5LibraryException; + public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places - * them into user-supplied buffers. - * <P> - * The start and end buffers must be large enough to hold the dataspace rank number of coordinates. + * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims + * and maxdims parameters. * - * @param spaceid - * Identifier of dataspace to release. - * @param start - * coordinates of lowest corner of bounding box. - * @param end - * coordinates of highest corner of bounding box. + * @param space_id + * IN: Identifier of the dataspace object to query + * @param dims + * OUT: Pointer to array to store the size of each dimension. + * @param maxdims + * OUT: Pointer to array to store the maximum size of each dimension. * - * @return a non-negative value if successful,with start and end initialized. + * @return the number of dimensions in the dataspace if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - start or end is null. + * - dims or maxdims is null. **/ - public synchronized static native int H5Sget_select_bounds(long spaceid, long[] start, long[] end) + public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims) throws HDF5LibraryException, NullPointerException; /** - * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection. + * H5Sis_simple determines whether a dataspace is a simple dataspace. * - * @param spaceid - * Identifier of dataspace to release. + * @param space_id + * Identifier of the dataspace to query * - * @return a non-negative value if successful + * @return true if is a simple dataspace * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException; + public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point - * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per - * point. + * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace. * - * @param spaceid - * Identifier of dataspace to release. - * @param startpoint - * first point to retrieve - * @param numpoints - * number of points to retrieve - * @param buf - * returns points startblock to startblock+num-1, each points is <i>rank</i> longs. + * @param space_id + * Dataspace identifier. * - * @return a non-negative value if successful + * @return a dataspace class name if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. **/ - public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints, - long[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same - * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows: - * - * <pre> - * <"start" coordinate>, immediately followed by - * <"opposite" corner coordinate>, followed by - * the next "start" and "opposite" coordinates, - * etc. - * until all of the selected blocks have been listed. - * </pre> + * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE. * - * @param spaceid - * Identifier of dataspace to release. - * @param startblock - * first block to retrieve - * @param numblocks - * number of blocks to retrieve - * @param buf - * returns blocks startblock to startblock+num-1, each block is <i>rank</i> * 2 (corners) longs. + * @param space_id + * The identifier for the dataspace from which the extent is to be removed. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. **/ - public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks, - long[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection. + * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the + * dataspace. * - * @param spaceid - * Identifier of dataspace to release. + * @param dest_space_id + * IN: The identifier for the dataspace from which the extent is copied. + * @param source_space_id + * IN: The identifier for the dataspace to which the extent is copied. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException; + public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id) + throws HDF5LibraryException; /** - * H5Sget_select_npoints determines the number of elements in the current selection of a dataspace. + * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal. * - * @param space_id - * IN: Identifier of the dataspace object to query + * @param first_space_id + * IN: The identifier for the first dataspace. + * @param second_space_id + * IN: The identifier for the seconddataspace. * - * @return the number of elements in the selection if successful + * @return true if successful, else false * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_select_npoints(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id) + throws HDF5LibraryException; + + /***************** Operations on dataspace selections *****************/ /** * H5Sget_select_type retrieves the type of selection currently defined for the dataspace space_id. @@ -9102,76 +11338,118 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Sget_select_type(long space_id) throws HDF5LibraryException; /** - * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims - * and maxdims parameters. + * H5Sget_select_npoints determines the number of elements in the current selection of a dataspace. * * @param space_id * IN: Identifier of the dataspace object to query - * @param dims - * OUT: Pointer to array to store the size of each dimension. - * @param maxdims - * OUT: Pointer to array to store the maximum size of each dimension. * - * @return the number of dimensions in the dataspace if successful + * @return the number of elements in the selection if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - dims or maxdims is null. **/ - public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims) - throws HDF5LibraryException, NullPointerException; + public synchronized static native long H5Sget_select_npoints(long space_id) throws HDF5LibraryException; /** - * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace. + * H5Sselect_copy copies all the selection information (including offset) from the source + * dataspace to the destination dataspace. + * @param dst_id ID of the destination dataspace + * @param src_id ID of the source dataspace + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Sselect_copy(long dst_id, long src_id) throws HDF5LibraryException; + + /** + * H5Sselect_valid verifies that the selection for the dataspace. * * @param space_id - * IN: Identifier of the dataspace + * The identifier for the dataspace in which the selection is being reset. * - * @return the number of dimensions in the dataspace if successful + * @return true if the selection is contained within the extent and FALSE if it is not or is an error. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException; /** - * H5Sget_simple_extent_npoints determines the number of elements in a dataspace. + * H5Sselect_adjust moves a selection by subtracting an offset from it. * * @param space_id - * ID of the dataspace object to query - * @return the number of elements in the dataspace if successful + * ID of dataspace to adjust + * @param offset + * Offset to subtract * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - offset is null. **/ - public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException; + public synchronized static native void H5Sselect_adjust(long space_id, long[][] offset) + throws HDF5LibraryException, NullPointerException; /** - * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace. + * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places + * them into user-supplied buffers. + * <P> + * The start and end buffers must be large enough to hold the dataspace rank number of coordinates. * * @param space_id - * Dataspace identifier. + * Identifier of dataspace to release. + * @param start + * coordinates of lowest corner of bounding box. + * @param end + * coordinates of highest corner of bounding box. * - * @return a dataspace class name if successful + * @return a non-negative value if successful,with start and end initialized. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - start or end is null. **/ - public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sget_select_bounds(long space_id, long[] start, long[] end) + throws HDF5LibraryException, NullPointerException; /** - * H5Sis_simple determines whether a dataspace is a simple dataspace. + * H5Sselect_shape_same checks to see if the current selection in the dataspaces are the same + * dimensionality and shape. + * This is primarily used for reading the entire selection in one swoop. + * + * @param space1_id ID of 1st Dataspace pointer to compare + * @param space2_id ID of 2nd Dataspace pointer to compare + * + * @return true if the selection is the same dimensionality and shape; + * false otherwise + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native boolean H5Sselect_shape_same(long space1_id, long space2_id) throws HDF5LibraryException; + + /** + * H5Sselect_intersect_block checks to see if the current selection in the + * dataspace intersects with the block given. * * @param space_id - * Identifier of the dataspace to query + * ID of dataspace pointer to compare + * @param start + * Starting coordinate of block + * @param end + * Opposite ("ending") coordinate of block * - * @return true if is a simple dataspace + * @return a TRUE if the current selection in the dataspace intersects with the block given + * FALSE otherwise * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - offset is null. **/ - public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sselect_intersect_block(long space_id, long[] start, long[] end) + throws HDF5LibraryException, NullPointerException; /** * H5Soffset_simple sets the offset of a simple dataspace space_id. @@ -9191,6 +11469,21 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Soffset_simple(long space_id, byte[] offset) throws HDF5LibraryException, NullPointerException; + /** + * H5Soffset_simple sets the offset of a simple dataspace space_id. + * + * @param space_id + * IN: The identifier for the dataspace object to reset. + * @param offset + * IN: The offset at which to position the selection. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - offset array is null. + **/ public synchronized static int H5Soffset_simple(long space_id, long[] offset) throws HDF5Exception, NullPointerException { if (offset == null) { @@ -9221,6 +11514,18 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Sselect_all(long space_id) throws HDF5LibraryException; /** + * H5Sselect_none resets the selection region for the dataspace space_id to include no elements. + * + * @param space_id + * IN: The identifier of the dataspace to be reset. + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Sselect_none(long space_id) throws HDF5LibraryException; + + /** * H5Sselect_elements selects array elements to be included in the selection for the space_id dataspace. * * @param space_id @@ -9278,6 +11583,43 @@ public class H5 implements java.io.Serializable { } /** + * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection. + * + * @param spaceid + * Identifier of dataspace to release. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException; + + /** + * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point + * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per + * point. + * + * @param spaceid + * Identifier of dataspace to release. + * @param startpoint + * first point to retrieve + * @param numpoints + * number of points to retrieve + * @param buf + * returns points startblock to startblock+num-1, each points is <i>rank</i> longs. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints, + long[] buf) throws HDF5LibraryException, NullPointerException; + + /** * H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace. * @@ -9317,76 +11659,118 @@ public class H5 implements java.io.Serializable { return H5Sselect_hyperslab(space_id, op, lastart, lastride, lacount, lablock); } - public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride, - long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - /** - * H5Sselect_none resets the selection region for the dataspace space_id to include no elements. + * H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified + * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace. * * @param space_id - * IN: The identifier of the dataspace to be reset. + * IN: Identifier of dataspace selection to modify + * @param op + * IN: Operation to perform on current selection. + * @param start + * IN: Offset of start of hyperslab + * @param stride + * IN: Hyperslab stride. + * @param count + * IN: Number of blocks included in hyperslab. + * @param block + * IN: Size of block in hyperslab. + * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. **/ - public synchronized static native int H5Sselect_none(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride, + long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + /** - * H5Sselect_valid verifies that the selection for the dataspace. + * H5Scombine_hyperslab combines a hyperslab selection with the current selection for a dataspace, + * creating a new dataspace to return the generated selection. + * If the current selection is not a hyperslab, it is freed and the hyperslab + * parameters passed in are combined with the H5S_SEL_ALL hyperslab (ie. a + * selection composing the entire current extent). If STRIDE or BLOCK is + * NULL, they are assumed to be set to all '1'. * * @param space_id - * The identifier for the dataspace in which the selection is being reset. + * IN: Dataspace ID of selection to use + * @param op + * IN: Operation to perform on current selection. + * @param start + * IN: Offset of start of hyperslab + * @param stride + * IN: Hyperslab stride. + * @param count + * IN: Number of blocks included in hyperslab. + * @param block + * IN: Size of block in hyperslab. * - * @return true if the selection is contained within the extent and FALSE if it is not or is an error. + * @return a dataspace ID on success / H5I_INVALID_HID on failure * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. **/ - public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException; + public synchronized static native long H5Scombine_hyperslab(long space_id, int op, long[] start, long[] stride, + long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; /** - * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE. + * H5Smodify_select refine an existing hyperslab selection with an operation, using a second + * hyperslab. The first selection is modified to contain the result of + * space1 operated on by space2. * - * @param space_id - * The identifier for the dataspace from which the extent is to be removed. + * @param space1_id + * ID of the destination dataspace + * @param op + * Operation to perform on current selection. + * @param space2_id + * ID of the source dataspace * - * @return a non-negative value if successful + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Smodify_select(long space1_id, int op, long space2_id) throws HDF5LibraryException; + + /** + * H5Scombine_select combines two existing hyperslab selections with an operation, returning + * a new dataspace with the resulting selection. The dataspace extent from + * space1 is copied for the dataspace extent of the newly created dataspace. + * + * @param space1_id + * ID of the first dataspace + * @param op + * Operation to perform on current selection. + * @param space2_id + * ID of the second dataspace + * + * @return a dataspace ID on success / H5I_INVALID_HID on failure * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException; + public synchronized static native long H5Scombine_select(long space1_id, int op, long space2_id) throws HDF5LibraryException; /** - * H5Sset_extent_simple sets or resets the size of an existing dataspace. + * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified + * by space_id. * * @param space_id - * Dataspace identifier. - * @param rank - * Rank, or dimensionality, of the dataspace. - * @param current_size - * Array containing current size of dataspace. - * @param maximum_size - * Array containing maximum size of dataspace. + * IN: Identifier of dataspace selection to query * - * @return a dataspace identifier if successful + * @return a TRUE/FALSE for hyperslab selection if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size, - long[] maximum_size) throws HDF5LibraryException, NullPointerException; - - public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size, - byte[] maximum_size) throws HDF5LibraryException, NullPointerException { - ByteBuffer csbb = ByteBuffer.wrap(current_size); - long[] lacs = (csbb.asLongBuffer()).array(); - ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size); - long[] lamaxs = (maxsbb.asLongBuffer()).array(); - - return H5Sset_extent_simple(space_id, rank, lacs, lamaxs); - } + public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException; /** * H5Sget_regular_hyperslab determines if a hyperslab selection is regular for the dataspace specified @@ -9412,33 +11796,82 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Sget_regular_hyperslab(long space_id, long[] start, long[] stride, long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + /** + * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection. + * + * @param spaceid + * Identifier of dataspace to release. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException; + /** - * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified - * by space_id. + * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same + * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows: * - * @param space_id - * IN: Identifier of dataspace selection to query + * <pre> + * <"start" coordinate>, immediately followed by + * <"opposite" corner coordinate>, followed by + * the next "start" and "opposite" coordinates, + * etc. + * until all of the selected blocks have been listed. + * </pre> * - * @return a TRUE/FALSE for hyperslab selection if successful + * @param spaceid + * Identifier of dataspace to release. + * @param startblock + * first block to retrieve + * @param numblocks + * number of blocks to retrieve + * @param buf + * returns blocks startblock to startblock+num-1, each block is <i>rank</i> * 2 (corners) longs. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. **/ - public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks, + long[] buf) throws HDF5LibraryException, NullPointerException; + + /** + * H5Sselect_project_intersection projects the intersection of the selections of src_space_id and + * src_intersect_space_id within the selection of src_space_id as a + * selection within the selection of dst_space_id. + * + * @param src_space_id + * Selection that is mapped to dst_space_id, and intersected with src_intersect_space_id + * @param dst_space_id + * Selection that is mapped to src_space_id + * @param src_intersect_space_id + * Selection whose intersection with src_space_id is projected to dst_space_id to obtain the result + * + * @return a dataspace with a selection equal to the intersection of + * src_intersect_space_id and src_space_id projected from src_space to dst_space on success + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sselect_project_intersection(long src_space_id, long dst_space_id, + long src_intersect_space_id) throws HDF5LibraryException; - // /////// unimplemented //////// - // #ifdef NEW_HYPERSLAB_API - // hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, - // const hsize_t start[], - // const hsize_t _stride[], - // const hsize_t count[], - // const hsize_t _block[]); - // herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op, - // hid_t space2_id); - // hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, - // hid_t space2_id); - // #endif /* NEW_HYPERSLAB_API */ - // herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id); + + // /////// unimplemented //////// + ///// Operations on dataspace selections ///// + + // + ///// Operations on dataspace selection iterators ///// + //public synchronized static native H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags); + //public synchronized static native H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq, + // size_t *nbytes, hsize_t *off, size_t *len); + //public synchronized static native H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id); + //public synchronized static native H5Ssel_iter_close(hid_t sel_iter_id); @@ -9786,6 +12219,23 @@ public class H5 implements java.io.Serializable { return H5Tenum_insert_int(type, name, value); } + /** + * H5Tenum_insert inserts a new enumeration datatype member into an enumeration datatype. + * + * @param type + * IN: Identifier of datatype. + * @param name + * IN: The name of the member + * @param value + * IN: The value of the member, data of the correct type + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public static int H5Tenum_insert(long type, String name, int value) throws HDF5LibraryException, NullPointerException { int[] val = { value }; @@ -10942,15 +13392,128 @@ public class H5 implements java.io.Serializable { // //////////////////////////////////////////////////////////// /// VOL Connector Functionality + /** + * H5VLregister_connector_by_name registers a new VOL connector as a member of the virtual object layer class. + * + * @param connector_name + * IN: name of the connector. + * @param vipl_id + * IN: VOL initialization property list which must be + * created with H5Pcreate(H5P_VOL_INITIALIZE) (or H5P_DEFAULT). + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLregister_connector_by_name(String connector_name, long vipl_id); + /** + * H5VLregister_connector_by_value registers a new VOL connector as a member of the virtual object layer class. + * + * @param connector_value + * IN: value of the connector. + * @param vipl_id + * IN: VOL initialization property list which must be + * created with H5Pcreate(H5P_VOL_INITIALIZE) (or H5P_DEFAULT). + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLregister_connector_by_value(int connector_value, long vipl_id); + /** + * H5VLis_connector_registered_by_name tests whether a VOL class has been registered. + * + * @param name + * IN: name of the connector. + * + * @return true if a VOL connector with that name has been registered + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native boolean H5VLis_connector_registered_by_name(String name); + /** + * H5VLis_connector_registered_by_value tests whether a VOL class has been registered. + * + * @param connector_value + * IN: value of the connector. + * + * @return true if a VOL connector with that value has been registered + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native boolean H5VLis_connector_registered_by_value(int connector_value); + /** + * H5VLget_connector_id retrieves the ID for a registered VOL connector for a given object. + * + * @param object_id + * IN: Identifier of the object. + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLget_connector_id(long object_id); + /** + * H5VLget_connector_id_by_name retrieves the ID for a registered VOL connector. + * + * @param name + * IN: name of the connector. + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLget_connector_id_by_name(String name); + /** + * H5VLget_connector_id_by_value retrieves the ID for a registered VOL connector. + * + * @param connector_value + * IN: value of the connector. + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLget_connector_id_by_value(int connector_value); + /** + * H5VLget_connector_name returns the connector name for the VOL associated with the + * object or file ID. + * + * @param object_id + * IN: Identifier of the object. + * + * @return the connector name + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native String H5VLget_connector_name(long object_id); + /** + * H5VLclose closes a VOL connector ID. + * + * @param connector_id + * IN: Identifier of the connector. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5VLclose(long connector_id); + /** + * H5VLunregister_connector removes a VOL connector ID from the library. + * + * @param connector_id + * IN: Identifier of the connector. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5VLunregister_connector(long connector_id); // /////// unimplemented //////// @@ -10963,11 +13526,44 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException, NullPointerException; + /** + * H5Zfilter_avail checks if a filter is available. + * + * @param filter + * IN: filter number. + * + * @return a non-negative(TRUE/FALSE) value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException; + /** + * H5Zget_filter_info gets information about a pipeline data filter. + * + * @param filter + * IN: filter number. + * + * @return the filter information flags + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Zget_filter_info(int filter) throws HDF5LibraryException; - public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException, NullPointerException; + /** + * H5Zunregister unregisters a filter. + * + * @param filter + * IN: filter number. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException; // /////// unimplemented //////// diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index beba1d1..7ecfe95 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -35,12 +35,17 @@ public class HDF5Constants { // Get the HDF5 constants from the library // // ///////////////////////////////////////////////////////////////////////// - public static final long H5_QUARTER_HADDR_MAX = H5_QUARTER_HADDR_MAX(); + //public static final long H5_QUARTER_HADDR_MAX = H5_QUARTER_HADDR_MAX(); + /** Special parameters for szip compression */ public static final int H5_SZIP_MAX_PIXELS_PER_BLOCK = H5_SZIP_MAX_PIXELS_PER_BLOCK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_NN_OPTION_MASK = H5_SZIP_NN_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_EC_OPTION_MASK = H5_SZIP_EC_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_ALLOW_K13_OPTION_MASK = H5_SZIP_ALLOW_K13_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_CHIP_OPTION_MASK = H5_SZIP_CHIP_OPTION_MASK(); public static final int H5_INDEX_UNKNOWN = H5_INDEX_UNKNOWN(); public static final int H5_INDEX_NAME = H5_INDEX_NAME(); @@ -92,110 +97,359 @@ public class HDF5Constants { public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); + /** Different kinds of error information - H5E_type_t */ public static final int H5E_MAJOR = H5E_MAJOR(); + /** Different kinds of error information - H5E_type_t */ public static final int H5E_MINOR = H5E_MINOR(); + /** Minor error codes - Object header related errors - Alignment error */ public static final long H5E_ALIGNMENT = H5E_ALIGNMENT(); + /** Minor error codes - Resource errors - Object already exists */ public static final long H5E_ALREADYEXISTS = H5E_ALREADYEXISTS(); + /** Minor error codes - Function entry/exit interface - Object already initialized */ public static final long H5E_ALREADYINIT = H5E_ALREADYINIT(); + /** Major error codes - Invalid arguments to routine */ public static final long H5E_ARGS = H5E_ARGS(); + /** Major error codes - Object atom */ public static final long H5E_ATOM = H5E_ATOM(); + /** Major error codes - Attribute */ public static final long H5E_ATTR = H5E_ATTR(); + /** Minor error codes - Object atom related errors - Unable to find atom information (already closed?) */ public static final long H5E_BADATOM = H5E_BADATOM(); + /** Minor error codes - File accessibility errors - Bad file ID accessed */ public static final long H5E_BADFILE = H5E_BADFILE(); + /** Minor error codes - Object atom related errors - Unable to find ID group information */ public static final long H5E_BADGROUP = H5E_BADGROUP(); + /** Minor error codes - Object header related errors - Iteration failed */ + public static final long H5E_BADITER = H5E_BADITER(); + /** Minor error codes - Object header related errors - Unrecognized message */ public static final long H5E_BADMESG = H5E_BADMESG(); + /** Minor error codes - Argument errors - Out of range */ public static final long H5E_BADRANGE = H5E_BADRANGE(); + /** Minor error codes - Dataspace errors - Invalid selection */ public static final long H5E_BADSELECT = H5E_BADSELECT(); + /** Datatype conversion errors - Bad size for object */ public static final long H5E_BADSIZE = H5E_BADSIZE(); + /** Minor error codes - Argument errors - Inappropriate type */ public static final long H5E_BADTYPE = H5E_BADTYPE(); + /** Minor error codes - Argument errors - Bad value */ public static final long H5E_BADVALUE = H5E_BADVALUE(); + /** Major error codes - B-Tree node */ public static final long H5E_BTREE = H5E_BTREE(); + /** Major error codes - Object cache */ public static final long H5E_CACHE = H5E_CACHE(); + /** I/O pipeline errors - Callback failed */ public static final long H5E_CALLBACK = H5E_CALLBACK(); + /** I/O pipeline errors - Error from filter 'can apply' callback */ public static final long H5E_CANAPPLY = H5E_CANAPPLY(); - // public static final long H5E_CANTALLOC = H5E_CANTALLOC(); + /** Minor error codes - Resource errors - Can't allocate space */ + public static final long H5E_CANTALLOC = H5E_CANTALLOC(); + /** Minor error codes - Dataspace errors - Can't append object */ + public static final long H5E_CANTAPPEND = H5E_CANTAPPEND(); + /** Minor error codes - Heap errors - Can't attach object */ + public static final long H5E_CANTATTACH = H5E_CANTATTACH(); + /** Minor error codes - Cache related errors - Unable to mark metadata as clean */ + public static final long H5E_CANTCLEAN = H5E_CANTCLEAN(); + /** Minor error codes - Dataspace errors - Can't clip hyperslab region */ public static final long H5E_CANTCLIP = H5E_CANTCLIP(); + /** Minor error codes - File accessibility errors - Unable to close file */ public static final long H5E_CANTCLOSEFILE = H5E_CANTCLOSEFILE(); + /** Minor error codes - Group related errors - Can't close object */ + public static final long H5E_CANTCLOSEOBJ = H5E_CANTCLOSEOBJ(); + /** Minor error codes - Dataspace errors - Can't compare objects */ + public static final long H5E_CANTCOMPARE = H5E_CANTCOMPARE(); + /** Minor error codes - Heap errors - Can't compute value */ + public static final long H5E_CANTCOMPUTE = H5E_CANTCOMPUTE(); + /** Datatype conversion errors - Can't convert datatypes */ public static final long H5E_CANTCONVERT = H5E_CANTCONVERT(); + /** Minor error codes - Resource errors - Unable to copy object */ public static final long H5E_CANTCOPY = H5E_CANTCOPY(); + /** Minor error codes - Cache related errors - Unable to cork an object */ + public static final long H5E_CANTCORK = H5E_CANTCORK(); + /** Minor error codes - Dataspace errors - Can't count elements */ public static final long H5E_CANTCOUNT = H5E_CANTCOUNT(); + /** Minor error codes - File accessibility errors - Unable to create file */ public static final long H5E_CANTCREATE = H5E_CANTCREATE(); + /** Minor error codes - Object atom related errors - Unable to decrement reference count */ public static final long H5E_CANTDEC = H5E_CANTDEC(); + /** Minor error codes - B-tree related errors - Unable to decode value */ public static final long H5E_CANTDECODE = H5E_CANTDECODE(); + /** Minor error codes - Object header related errors - Can't delete message */ public static final long H5E_CANTDELETE = H5E_CANTDELETE(); + /** Minor error codes - File accessibility errors - Unable to delete file */ public static final long H5E_CANTDELETEFILE = H5E_CANTDELETEFILE(); + /** Minor error codes - Cache related errors - Unable to create a flush dependency */ + public static final long H5E_CANTDEPEND = H5E_CANTDEPEND(); + /** Minor error codes - Cache related errors - Unable to mark metadata as dirty */ + public static final long H5E_CANTDIRTY = H5E_CANTDIRTY(); + /** Minor error codes - B-tree related errors - Unable to encode value */ public static final long H5E_CANTENCODE = H5E_CANTENCODE(); + /** Minor error codes - Cache related errors - Unable to expunge a metadata cache entry */ + public static final long H5E_CANTEXPUNGE = H5E_CANTEXPUNGE(); + /** Minor error codes - Heap errors - Can't extend heap's space */ + public static final long H5E_CANTEXTEND = H5E_CANTEXTEND(); + /** I/O pipeline errors - Filter operation failed */ + public static final long H5E_CANTFILTER = H5E_CANTFILTER(); + /** Minor error codes - Cache related errors - Unable to flush data from cache */ public static final long H5E_CANTFLUSH = H5E_CANTFLUSH(); + /** Minor error codes - Resource errors - Unable to free object */ public static final long H5E_CANTFREE = H5E_CANTFREE(); + /** Minor error codes - Parallel MPI - Can't gather data */ + public static final long H5E_CANTGATHER = H5E_CANTGATHER(); + /** Minor error codes - Resource errors - Unable to garbage collect */ + public static final long H5E_CANTGC = H5E_CANTGC(); + /** Minor error codes - Property list errors - Can't get value */ public static final long H5E_CANTGET = H5E_CANTGET(); + /** Minor error codes - Resource errors - Unable to compute size */ + public static final long H5E_CANTGETSIZE = H5E_CANTGETSIZE(); + /** Minor error codes - Object atom related errors - Unable to increment reference count */ public static final long H5E_CANTINC = H5E_CANTINC(); + /** Minor error codes - Function entry/exit interface - Unable to initialize object */ public static final long H5E_CANTINIT = H5E_CANTINIT(); + /** Minor error codes - Cache related errors - Unable to insert metadata into cache */ + public static final long H5E_CANTINS = H5E_CANTINS(); + /** Minor error codes - B-tree related errors - Unable to insert object */ public static final long H5E_CANTINSERT = H5E_CANTINSERT(); + /** Minor error codes - B-tree related errors - Unable to list node */ public static final long H5E_CANTLIST = H5E_CANTLIST(); + /** Minor error codes - Cache related errors - Unable to load metadata into cache */ public static final long H5E_CANTLOAD = H5E_CANTLOAD(); + /** Minor error codes - Resource errors - Unable to lock object */ public static final long H5E_CANTLOCK = H5E_CANTLOCK(); + /** Minor error codes - File accessibility errors Unable to lock file */ + public static final long H5E_CANTLOCKFILE = H5E_CANTLOCKFILE(); + /** Minor error codes - Cache related errors - Unable to mark a pinned entry as clean */ + public static final long H5E_CANTMARKCLEAN = H5E_CANTMARKCLEAN(); + /** Minor error codes - Cache related errors - Unable to mark a pinned entry as dirty */ + public static final long H5E_CANTMARKDIRTY = H5E_CANTMARKDIRTY(); + /** Minor error codes - Cache related errors - Unable to mark an entry as unserialized */ + public static final long H5E_CANTMARKSERIALIZED = H5E_CANTMARKSERIALIZED(); + /** Minor error codes - Cache related errors - Unable to mark an entry as serialized */ + public static final long H5E_CANTMARKUNSERIALIZED = H5E_CANTMARKUNSERIALIZED(); + /** Minor error codes - Free space errors - Can't merge objects */ + public static final long H5E_CANTMERGE = H5E_CANTMERGE(); + /** Minor error codes - B-tree related errors - Unable to modify record */ + public static final long H5E_CANTMODIFY = H5E_CANTMODIFY(); + /** Minor error codes - Link related errors - Can't move object */ + public static final long H5E_CANTMOVE = H5E_CANTMOVE(); + /** Minor error codes - Dataspace errors - Can't move to next iterator location */ public static final long H5E_CANTNEXT = H5E_CANTNEXT(); + /** Minor error codes - Cache related errors - Unable to notify object about action */ + public static final long H5E_CANTNOTIFY = H5E_CANTNOTIFY(); + /** Minor error codes - File accessibility errors - Unable to open file */ public static final long H5E_CANTOPENFILE = H5E_CANTOPENFILE(); + /** Minor error codes - Group related errors - Can't open object */ public static final long H5E_CANTOPENOBJ = H5E_CANTOPENOBJ(); - // public static final long H5E_CANTRECV = H5E_CANTRECV(); + /** Minor error codes - Heap errors - Can't operate on object */ + public static final long H5E_CANTOPERATE = H5E_CANTOPERATE(); + /** Minor error codes - Object header related errors - Can't pack messages */ + public static final long H5E_CANTPACK = H5E_CANTPACK(); + /** Minor error codes - Cache related errors - Unable to pin cache entry */ + public static final long H5E_CANTPIN = H5E_CANTPIN(); + /** Minor error codes - Cache related errors - Unable to protect metadata */ + public static final long H5E_CANTPROTECT = H5E_CANTPROTECT(); + /** Minor error codes - Parallel MPI - Can't receive data */ + public static final long H5E_CANTRECV = H5E_CANTRECV(); + /** Minor error codes - B-tree related errors - Unable to redistribute records */ + public static final long H5E_CANTREDISTRIBUTE = H5E_CANTREDISTRIBUTE(); + /** Minor error codes - Object atom related errors - Unable to register new atom */ public static final long H5E_CANTREGISTER = H5E_CANTREGISTER(); + /** Minor error codes - Function entry/exit interface - Unable to release object */ public static final long H5E_CANTRELEASE = H5E_CANTRELEASE(); + /** Minor error codes - B-tree related errors - Unable to remove object */ + public static final long H5E_CANTREMOVE = H5E_CANTREMOVE(); + /** Minor error codes - Object header related errors - Unable to rename object */ + public static final long H5E_CANTRENAME = H5E_CANTRENAME(); + /** Minor error codes - Object header related errors - Can't reset object */ + public static final long H5E_CANTRESET = H5E_CANTRESET(); + /** Minor error codes - Cache related errors - Unable to resize a metadata cache entry */ + public static final long H5E_CANTRESIZE = H5E_CANTRESIZE(); + /** Minor error codes - Heap errors - Can't restore condition */ + public static final long H5E_CANTRESTORE = H5E_CANTRESTORE(); + /** Minor error codes - Free space errors - Can't revive object */ + public static final long H5E_CANTREVIVE = H5E_CANTREVIVE(); + /** Minor error codes - Free space errors - Can't shrink container */ + public static final long H5E_CANTSHRINK = H5E_CANTSHRINK(); + /** Minor error codes - Dataspace errors - Can't select hyperslab */ public static final long H5E_CANTSELECT = H5E_CANTSELECT(); + /** Minor error codes - Cache related errors - Unable to serialize data from cache */ + public static final long H5E_CANTSERIALIZE = H5E_CANTSERIALIZE(); + /** Minor error codes - Property list errors - Can't set value */ public static final long H5E_CANTSET = H5E_CANTSET(); + /** Minor error codes - Link related errors - Can't sort objects */ + public static final long H5E_CANTSORT = H5E_CANTSORT(); + /** Minor error codes - B-tree related errors - Unable to split node */ public static final long H5E_CANTSPLIT = H5E_CANTSPLIT(); + /** Minor error codes - B-tree related errors - Unable to swap records */ + public static final long H5E_CANTSWAP = H5E_CANTSWAP(); + /** Minor error codes - Cache related errors - Unable to tag metadata in the cache */ + public static final long H5E_CANTTAG = H5E_CANTTAG(); + /** Minor error codes - Cache related errors - Unable to uncork an object */ + public static final long H5E_CANTUNCORK = H5E_CANTUNCORK(); + /** Minor error codes - Cache related errors - Unable to destroy a flush dependency */ + public static final long H5E_CANTUNDEPEND = H5E_CANTUNDEPEND(); + /** Minor error codes - Resource errors - Unable to unlock object */ public static final long H5E_CANTUNLOCK = H5E_CANTUNLOCK(); + /** Minor error codes - File accessibility errors Unable to unlock file */ + public static final long H5E_CANTUNLOCKFILE = H5E_CANTUNLOCKFILE(); + /** Minor error codes - Cache related errors - Unable to un-pin cache entry */ + public static final long H5E_CANTUNPIN = H5E_CANTUNPIN(); + /** Minor error codes - Cache related errors - Unable to unprotect metadata */ + public static final long H5E_CANTUNPROTECT = H5E_CANTUNPROTECT(); + /** Minor error codes - Cache related errors - Unable to mark metadata as unserialized */ + public static final long H5E_CANTUNSERIALIZE = H5E_CANTUNSERIALIZE(); + /** Minor error codes - Heap errors - Can't update object */ + public static final long H5E_CANTUPDATE = H5E_CANTUPDATE(); + /** Generic low-level file I/O errors - Close failed */ public static final long H5E_CLOSEERROR = H5E_CLOSEERROR(); + /** Minor error codes - Group related errors - Name component is too long */ public static final long H5E_COMPLEN = H5E_COMPLEN(); + /** Major error codes - API Context */ + public static final long H5E_CONTEXT = H5E_CONTEXT(); + /** Major error codes - Dataset */ public static final long H5E_DATASET = H5E_DATASET(); + /** Major error codes - Dataspace */ public static final long H5E_DATASPACE = H5E_DATASPACE(); + /** Major error codes - Datatype */ public static final long H5E_DATATYPE = H5E_DATATYPE(); + /** Value for the default error stack */ public static final long H5E_DEFAULT = H5E_DEFAULT(); + /** Minor error codes - Property list errors - Duplicate class name in parent class */ public static final long H5E_DUPCLASS = H5E_DUPCLASS(); + /** Major error codes - Extensible Array */ + public static final long H5E_EARRAY = H5E_EARRAY(); + /** Major error codes - External file list */ public static final long H5E_EFL = H5E_EFL(); + /** Major error codes - Error API */ + public static final long H5E_ERROR = H5E_ERROR(); + /** Minor error codes - B-tree related errors - Object already exists */ public static final long H5E_EXISTS = H5E_EXISTS(); + /** Major error codes - Fixed Array */ + public static final long H5E_FARRAY = H5E_FARRAY(); + /** Generic low-level file I/O errors - File control (fcntl) failed */ public static final long H5E_FCNTL = H5E_FCNTL(); + /** Major error codes - File accessibility */ public static final long H5E_FILE = H5E_FILE(); + /** Minor error codes - File accessibility errors - File already exists */ public static final long H5E_FILEEXISTS = H5E_FILEEXISTS(); + /** Minor error codes - File accessibility errors - File already open */ public static final long H5E_FILEOPEN = H5E_FILEOPEN(); + /** Major error codes - Free Space Manager */ + public static final long H5E_FSPACE = H5E_FSPACE(); + /** Major error codes - Function entry/exit */ public static final long H5E_FUNC = H5E_FUNC(); + /** Major error codes - Heap */ public static final long H5E_HEAP = H5E_HEAP(); + /** Minor error codes - Dataspace errors - Internal states are inconsistent */ + public static final long H5E_INCONSISTENTSTATE = H5E_INCONSISTENTSTATE(); + /** Major error codes - Internal error (too specific to document in detail) */ public static final long H5E_INTERNAL = H5E_INTERNAL(); + /** Major error codes - Low-level I/O */ public static final long H5E_IO = H5E_IO(); + /** Major error codes - Links */ public static final long H5E_LINK = H5E_LINK(); + /** Minor error codes - Object header related errors - Bad object header link count */ public static final long H5E_LINKCOUNT = H5E_LINKCOUNT(); + /** Minor error codes - Cache related errors - Failure in the cache logging framework */ + public static final long H5E_LOGGING = H5E_LOGGING(); + /** Major error codes - Map */ + public static final long H5E_MAP = H5E_MAP(); + /** Minor error codes - File accessibility errors - File mount error */ public static final long H5E_MOUNT = H5E_MOUNT(); + /** Minor error codes - Parallel MPI - Some MPI function failed */ public static final long H5E_MPI = H5E_MPI(); + /** Minor error codes - Parallel MPI - MPI Error String */ public static final long H5E_MPIERRSTR = H5E_MPIERRSTR(); + /** Minor error codes - Link related errors - Too many soft links in path */ + public static final long H5E_NLINKS = H5E_NLINKS(); + /** Minor error codes - Parallel MPI - Can't perform independent IO */ + public static final long H5E_NO_INDEPENDENT = H5E_NO_INDEPENDENT(); + /** I/O pipeline errors - Filter present but encoding disabled */ + public static final long H5E_NOENCODER = H5E_NOENCODER(); + /** I/O pipeline errors - Requested filter is not available */ public static final long H5E_NOFILTER = H5E_NOFILTER(); + /** Minor error codes - Object atom related errors - Out of IDs for group */ public static final long H5E_NOIDS = H5E_NOIDS(); + /** Major error codes - No error */ public static final long H5E_NONE_MAJOR = H5E_NONE_MAJOR(); + /** No error */ public static final long H5E_NONE_MINOR = H5E_NONE_MINOR(); + /** Minor error codes - Resource errors - No space available for allocation */ public static final long H5E_NOSPACE = H5E_NOSPACE(); + /** Minor error codes - Cache related errors - Metadata not currently cached */ public static final long H5E_NOTCACHED = H5E_NOTCACHED(); + /** Minor error codes - B-tree related errors - Object not found */ public static final long H5E_NOTFOUND = H5E_NOTFOUND(); + /** Minor error codes - File accessibility errors - Not an HDF5 file */ public static final long H5E_NOTHDF5 = H5E_NOTHDF5(); + /** Minor error codes - Link related errors - Link class not registered */ + public static final long H5E_NOTREGISTERED = H5E_NOTREGISTERED(); + /** Minor error codes - Resource errors - Object is already open */ + public static final long H5E_OBJOPEN = H5E_OBJOPEN(); + /** Major error codes - Object header */ public static final long H5E_OHDR = H5E_OHDR(); + /** Minor error codes - Plugin errors - Can't open directory or file */ + public static final long H5E_OPENERROR = H5E_OPENERROR(); + /** Generic low-level file I/O errors - Address overflowed */ public static final long H5E_OVERFLOW = H5E_OVERFLOW(); + /** Major error codes - Page Buffering */ + public static final long H5E_PAGEBUF = H5E_PAGEBUF(); + /** Minor error codes - Group related errors - Problem with path to object */ + public static final long H5E_PATH = H5E_PATH(); + /** Major error codes - Data filters */ public static final long H5E_PLINE = H5E_PLINE(); + /** Major error codes - Property lists */ public static final long H5E_PLIST = H5E_PLIST(); + /** Major error codes - Plugin for dynamically loaded library */ + public static final long H5E_PLUGIN = H5E_PLUGIN(); + /** Minor error codes - Cache related errors - Protected metadata error */ public static final long H5E_PROTECT = H5E_PROTECT(); + /** Generic low-level file I/O errors - Read failed */ public static final long H5E_READERROR = H5E_READERROR(); + /** Major error codes - References */ public static final long H5E_REFERENCE = H5E_REFERENCE(); + /** Major error codes - Resource unavailable */ public static final long H5E_RESOURCE = H5E_RESOURCE(); + /** Major error codes - Reference Counted Strings */ public static final long H5E_RS = H5E_RS(); + /** Generic low-level file I/O errors - Seek failed */ public static final long H5E_SEEKERROR = H5E_SEEKERROR(); + /** Minor error codes - Property list errors - Disallowed operation */ + public static final long H5E_SETDISALLOWED = H5E_SETDISALLOWED(); + /** I/O pipeline errors - Error from filter 'set local' callback */ public static final long H5E_SETLOCAL = H5E_SETLOCAL(); + /** Major error codes - Skip Lists */ + public static final long H5E_SLIST = H5E_SLIST(); + /** Major error codes - Shared Object Header Messages */ + public static final long H5E_SOHM = H5E_SOHM(); + /** Major error codes - Data storage */ public static final long H5E_STORAGE = H5E_STORAGE(); + /** Major error codes - Symbol table */ public static final long H5E_SYM = H5E_SYM(); + /** Minor error codes - System level errors - System error message */ + public static final long H5E_SYSERRSTR = H5E_SYSERRSTR(); + /** Minor error codes - Cache related errors - Internal error detected */ + public static final long H5E_SYSTEM = H5E_SYSTEM(); + /** Minor error codes - Link related errors - Link traversal failure */ + public static final long H5E_TRAVERSE = H5E_TRAVERSE(); + /** Minor error codes - File accessibility errors - File has been truncated */ public static final long H5E_TRUNCATED = H5E_TRUNCATED(); + /** Major error codes - Ternary Search Trees */ public static final long H5E_TST = H5E_TST(); + /** Minor error codes - Argument errors - Information is uinitialized */ public static final long H5E_UNINITIALIZED = H5E_UNINITIALIZED(); + /** Minor error codes - Argument errors - Feature is unsupported */ public static final long H5E_UNSUPPORTED = H5E_UNSUPPORTED(); + /** Minor error codes - Object header related errors - Wrong version number */ public static final long H5E_VERSION = H5E_VERSION(); + /** Major error codes - Virtual File Layer */ public static final long H5E_VFL = H5E_VFL(); + /** Major error codes - Virtual Object Layer */ public static final long H5E_VOL = H5E_VOL(); + /** Error stack traversal direction - begin at API function, end deep */ public static final long H5E_WALK_DOWNWARD = H5E_WALK_DOWNWARD(); + /** Error stack traversal direction - begin deep, end at API function */ public static final long H5E_WALK_UPWARD = H5E_WALK_UPWARD(); + /** Generic low-level file I/O errors - Write failed */ public static final long H5E_WRITEERROR = H5E_WRITEERROR(); private static final int H5ES_STATUS_IN_PROGRESS = H5ES_STATUS_IN_PROGRESS(); @@ -424,29 +678,53 @@ public class HDF5Constants { public static final int H5R_OBJECT1 = H5R_OBJECT1(); public static final int H5R_OBJECT2 = H5R_OBJECT2(); + /** Define atomic datatypes */ public static final int H5S_ALL = H5S_ALL(); + /** Define user-level maximum number of dimensions */ public static final int H5S_MAX_RANK = H5S_MAX_RANK(); + /** Different types of dataspaces - error */ public static final int H5S_NO_CLASS = H5S_NO_CLASS(); + /** Different types of dataspaces - null dataspace */ public static final int H5S_NULL = H5S_NULL(); + /** Different types of dataspaces - scalar variable */ public static final int H5S_SCALAR = H5S_SCALAR(); + /** Enumerated type for the type of selection - Entire extent selected */ public static final int H5S_SEL_ALL = H5S_SEL_ALL(); + /** Enumerated type for the type of selection - Error */ public static final int H5S_SEL_ERROR = H5S_SEL_ERROR(); + /** Enumerated type for the type of selection - Hyperslab selected */ public static final int H5S_SEL_HYPERSLABS = H5S_SEL_HYPERSLABS(); + /** Enumerated type for the type of selection - LAST */ public static final int H5S_SEL_N = H5S_SEL_N(); + /** Enumerated type for the type of selection - Nothing selected */ public static final int H5S_SEL_NONE = H5S_SEL_NONE(); + /** Enumerated type for the type of selection - Points / elements selected */ public static final int H5S_SEL_POINTS = H5S_SEL_POINTS(); + /** Different ways of combining selections - Binary "and" operation for hyperslabs */ public static final int H5S_SELECT_AND = H5S_SELECT_AND(); + /** Different ways of combining selections - Append elements to end of point selection */ public static final int H5S_SELECT_APPEND = H5S_SELECT_APPEND(); + /** Different ways of combining selections - Invalid upper bound on selection operations */ public static final int H5S_SELECT_INVALID = H5S_SELECT_INVALID(); + /** Different ways of combining selections - error */ public static final int H5S_SELECT_NOOP = H5S_SELECT_NOOP(); + /** Different ways of combining selections - Binary "not" operation for hyperslabs */ public static final int H5S_SELECT_NOTA = H5S_SELECT_NOTA(); + /** Different ways of combining selections - Binary "not" operation for hyperslabs */ public static final int H5S_SELECT_NOTB = H5S_SELECT_NOTB(); + /** Different ways of combining selections - Binary "or" operation for hyperslabs */ public static final int H5S_SELECT_OR = H5S_SELECT_OR(); + /** Different ways of combining selections - Prepend elements to beginning of point selection */ public static final int H5S_SELECT_PREPEND = H5S_SELECT_PREPEND(); + /** Different ways of combining selections - Select "set" operation */ public static final int H5S_SELECT_SET = H5S_SELECT_SET(); + /** Different ways of combining selections - Binary "xor" operation for hyperslabs */ public static final int H5S_SELECT_XOR = H5S_SELECT_XOR(); + /** Different types of dataspaces - simple dataspace */ public static final int H5S_SIMPLE = H5S_SIMPLE(); + /** Define atomic datatypes */ public static final int H5S_UNLIMITED = H5S_UNLIMITED(); + public static final long H5T_ALPHA_B16 = H5T_ALPHA_B16(); public static final long H5T_ALPHA_B32 = H5T_ALPHA_B32(); public static final long H5T_ALPHA_B64 = H5T_ALPHA_B64(); @@ -665,48 +943,96 @@ public class HDF5Constants { public static final int H5_VOL_RESERVED = H5_VOL_RESERVED(); public static final int H5_VOL_MAX = H5_VOL_MAX(); + /** Return values for filter callback function */ public static final int H5Z_CB_CONT = H5Z_CB_CONT(); + /** Return values for filter callback function */ public static final int H5Z_CB_ERROR = H5Z_CB_ERROR(); + /** Return values for filter callback function */ public static final int H5Z_CB_FAIL = H5Z_CB_FAIL(); + /** Return values for filter callback function */ public static final int H5Z_CB_NO = H5Z_CB_NO(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_DISABLE_EDC = H5Z_DISABLE_EDC(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_ENABLE_EDC = H5Z_ENABLE_EDC(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_ERROR_EDC = H5Z_ERROR_EDC(); + /** Filter IDs - deflation like gzip */ public static final int H5Z_FILTER_DEFLATE = H5Z_FILTER_DEFLATE(); + /** Filter IDs - no filter */ public static final int H5Z_FILTER_ERROR = H5Z_FILTER_ERROR(); + /** Filter IDs - fletcher32 checksum of EDC */ public static final int H5Z_FILTER_FLETCHER32 = H5Z_FILTER_FLETCHER32(); + /** Filter IDs - maximum filter id */ public static final int H5Z_FILTER_MAX = H5Z_FILTER_MAX(); + /** Filter IDs - nbit compression */ public static final int H5Z_FILTER_NBIT = H5Z_FILTER_NBIT(); + /** Filter IDs - reserved indefinitely */ public static final int H5Z_FILTER_NONE = H5Z_FILTER_NONE(); + /** Filter IDs - filter ids below this value are reserved for library use */ public static final int H5Z_FILTER_RESERVED = H5Z_FILTER_RESERVED(); + /** Filter IDs - scale+offset compression */ public static final int H5Z_FILTER_SCALEOFFSET = H5Z_FILTER_SCALEOFFSET(); + /** Filter IDs - shuffle the data */ public static final int H5Z_FILTER_SHUFFLE = H5Z_FILTER_SHUFFLE(); + /** Filter IDs - szip compression */ public static final int H5Z_FILTER_SZIP = H5Z_FILTER_SZIP(); + /** Flags for filter definition (stored) + * definition flag mask */ public static final int H5Z_FLAG_DEFMASK = H5Z_FLAG_DEFMASK(); + /** Additional flags for filter invocation (not stored) + * invocation flag mask */ public static final int H5Z_FLAG_INVMASK = H5Z_FLAG_INVMASK(); + /** Flags for filter definition (stored) + * filter is mandatory */ public static final int H5Z_FLAG_MANDATORY = H5Z_FLAG_MANDATORY(); + /** Flags for filter definition (stored) + * filter is optional */ public static final int H5Z_FLAG_OPTIONAL = H5Z_FLAG_OPTIONAL(); + /** Additional flags for filter invocation (not stored) + * reverse direction; read */ public static final int H5Z_FLAG_REVERSE = H5Z_FLAG_REVERSE(); + /** Additional flags for filter invocation (not stored) + * skip EDC filters for read */ public static final int H5Z_FLAG_SKIP_EDC = H5Z_FLAG_SKIP_EDC(); + /** Symbol to remove all filters in H5Premove_filter */ + public static final int H5Z_FILTER_ALL = H5Z_FILTER_ALL(); + /** Maximum number of filters allowed in a pipeline */ public static final int H5Z_MAX_NFILTERS = H5Z_MAX_NFILTERS(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_NO_EDC = H5Z_NO_EDC(); + /** Bit flags for H5Zget_filter_info */ public static final int H5Z_FILTER_CONFIG_ENCODE_ENABLED = H5Z_FILTER_CONFIG_ENCODE_ENABLED(); + /** Bit flags for H5Zget_filter_info */ public static final int H5Z_FILTER_CONFIG_DECODE_ENABLED = H5Z_FILTER_CONFIG_DECODE_ENABLED(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_INT_MINBITS_DEFAULT = H5Z_SO_INT_MINBITS_DEFAULT(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_FLOAT_DSCALE = H5Z_SO_FLOAT_DSCALE(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_FLOAT_ESCALE = H5Z_SO_FLOAT_ESCALE(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_INT = H5Z_SO_INT(); + /** shuffle filter - Number of parameters that users can set */ public static final int H5Z_SHUFFLE_USER_NPARMS = H5Z_SHUFFLE_USER_NPARMS(); + /** shuffle filter - Total number of parameters for filter */ public static final int H5Z_SHUFFLE_TOTAL_NPARMS = H5Z_SHUFFLE_TOTAL_NPARMS(); + /** szip filter - Number of parameters that users can set */ public static final int H5Z_SZIP_USER_NPARMS = H5Z_SZIP_USER_NPARMS(); + /** szip filter - Total number of parameters for filter */ public static final int H5Z_SZIP_TOTAL_NPARMS = H5Z_SZIP_TOTAL_NPARMS(); + /** szip filter - "User" parameter for option mask */ public static final int H5Z_SZIP_PARM_MASK = H5Z_SZIP_PARM_MASK(); + /** szip filter - "User" parameter for pixels-per-block */ public static final int H5Z_SZIP_PARM_PPB = H5Z_SZIP_PARM_PPB(); + /** szip filter - "Local" parameter for bits-per-pixel */ public static final int H5Z_SZIP_PARM_BPP = H5Z_SZIP_PARM_BPP(); + /** szip filter - "Local" parameter for pixels-per-scanline */ public static final int H5Z_SZIP_PARM_PPS = H5Z_SZIP_PARM_PPS(); + /** nbit filter - Number of parameters that users can set */ public static final int H5Z_NBIT_USER_NPARMS = H5Z_NBIT_USER_NPARMS(); + /** scale offset filter - Number of parameters that users can set */ public static final int H5Z_SCALEOFFSET_USER_NPARMS = H5Z_SCALEOFFSET_USER_NPARMS(); - public static final int H5Z_FILTER_ALL = H5Z_FILTER_ALL(); // ///////////////////////////////////////////////////////////////////////// // List of private native variables to get constant values from C // @@ -841,6 +1167,8 @@ public class HDF5Constants { private static native final long H5E_BADGROUP(); + private static native final long H5E_BADITER(); + private static native final long H5E_BADMESG(); private static native final long H5E_BADRANGE(); @@ -861,15 +1189,30 @@ public class HDF5Constants { private static native final long H5E_CANAPPLY(); - // private static native final long H5E_CANTALLOC(); + private static native final long H5E_CANTALLOC(); + + private static native final long H5E_CANTAPPEND(); + + private static native final long H5E_CANTATTACH(); + + private static native final long H5E_CANTCLEAN(); + private static native final long H5E_CANTCLIP(); private static native final long H5E_CANTCLOSEFILE(); + private static native final long H5E_CANTCLOSEOBJ(); + + private static native final long H5E_CANTCOMPARE(); + + private static native final long H5E_CANTCOMPUTE(); + private static native final long H5E_CANTCONVERT(); private static native final long H5E_CANTCOPY(); + private static native final long H5E_CANTCORK(); + private static native final long H5E_CANTCOUNT(); private static native final long H5E_CANTCREATE(); @@ -882,18 +1225,36 @@ public class HDF5Constants { private static native final long H5E_CANTDELETEFILE(); + private static native final long H5E_CANTDEPEND(); + + private static native final long H5E_CANTDIRTY(); + private static native final long H5E_CANTENCODE(); + private static native final long H5E_CANTEXPUNGE(); + + private static native final long H5E_CANTEXTEND(); + + private static native final long H5E_CANTFILTER(); + private static native final long H5E_CANTFLUSH(); private static native final long H5E_CANTFREE(); + private static native final long H5E_CANTGATHER(); + + private static native final long H5E_CANTGC(); + private static native final long H5E_CANTGET(); + private static native final long H5E_CANTGETSIZE(); + private static native final long H5E_CANTINC(); private static native final long H5E_CANTINIT(); + private static native final long H5E_CANTINS(); + private static native final long H5E_CANTINSERT(); private static native final long H5E_CANTLIST(); @@ -902,29 +1263,96 @@ public class HDF5Constants { private static native final long H5E_CANTLOCK(); + private static native final long H5E_CANTLOCKFILE(); + + private static native final long H5E_CANTMARKCLEAN(); + + private static native final long H5E_CANTMARKDIRTY(); + + private static native final long H5E_CANTMARKSERIALIZED(); + + private static native final long H5E_CANTMARKUNSERIALIZED(); + + private static native final long H5E_CANTMERGE(); + + private static native final long H5E_CANTMOVE(); + + private static native final long H5E_CANTMODIFY(); + private static native final long H5E_CANTNEXT(); + private static native final long H5E_CANTNOTIFY(); + private static native final long H5E_CANTOPENFILE(); private static native final long H5E_CANTOPENOBJ(); - // private static native final long H5E_CANTRECV(); + private static native final long H5E_CANTOPERATE(); + + private static native final long H5E_CANTPACK(); + + private static native final long H5E_CANTPIN(); + + private static native final long H5E_CANTPROTECT(); + + private static native final long H5E_CANTRECV(); + + private static native final long H5E_CANTREDISTRIBUTE(); + private static native final long H5E_CANTREGISTER(); private static native final long H5E_CANTRELEASE(); + private static native final long H5E_CANTREMOVE(); + + private static native final long H5E_CANTRENAME(); + + private static native final long H5E_CANTRESET(); + + private static native final long H5E_CANTRESIZE(); + + private static native final long H5E_CANTRESTORE(); + + private static native final long H5E_CANTREVIVE(); + + private static native final long H5E_CANTSHRINK(); + private static native final long H5E_CANTSELECT(); private static native final long H5E_CANTSET(); + private static native final long H5E_CANTSERIALIZE(); + + private static native final long H5E_CANTSORT(); + private static native final long H5E_CANTSPLIT(); + private static native final long H5E_CANTSWAP(); + + private static native final long H5E_CANTTAG(); + + private static native final long H5E_CANTUNCORK(); + + private static native final long H5E_CANTUNDEPEND(); + private static native final long H5E_CANTUNLOCK(); + private static native final long H5E_CANTUNLOCKFILE(); + + private static native final long H5E_CANTUNPIN(); + + private static native final long H5E_CANTUNPROTECT(); + + private static native final long H5E_CANTUNSERIALIZE(); + + private static native final long H5E_CANTUPDATE(); + private static native final long H5E_CLOSEERROR(); private static native final long H5E_COMPLEN(); + private static native final long H5E_CONTEXT(); + private static native final long H5E_DATASET(); private static native final long H5E_DATASPACE(); @@ -935,10 +1363,16 @@ public class HDF5Constants { private static native final long H5E_DUPCLASS(); + private static native final long H5E_EARRAY(); + private static native final long H5E_EFL(); + private static native final long H5E_ERROR(); + private static native final long H5E_EXISTS(); + private static native final long H5E_FARRAY(); + private static native final long H5E_FCNTL(); private static native final long H5E_FILE(); @@ -947,10 +1381,14 @@ public class HDF5Constants { private static native final long H5E_FILEOPEN(); + private static native final long H5E_FSPACE(); + private static native final long H5E_FUNC(); private static native final long H5E_HEAP(); + private static native final long H5E_INCONSISTENTSTATE(); + private static native final long H5E_INTERNAL(); private static native final long H5E_IO(); @@ -959,8 +1397,12 @@ public class HDF5Constants { private static native final long H5E_LINKCOUNT(); + private static native final long H5E_LOGGING(); + private static native final int H5E_MAJOR(); + private static native final long H5E_MAP(); + private static native final int H5E_MINOR(); private static native final long H5E_MOUNT(); @@ -969,6 +1411,12 @@ public class HDF5Constants { private static native final long H5E_MPIERRSTR(); + private static native final long H5E_NLINKS(); + + private static native final long H5E_NO_INDEPENDENT(); + + private static native final long H5E_NOENCODER(); + private static native final long H5E_NOFILTER(); private static native final long H5E_NOIDS(); @@ -985,14 +1433,26 @@ public class HDF5Constants { private static native final long H5E_NOTHDF5(); + private static native final long H5E_NOTREGISTERED(); + + private static native final long H5E_OBJOPEN(); + private static native final long H5E_OHDR(); + private static native final long H5E_OPENERROR(); + private static native final long H5E_OVERFLOW(); + private static native final long H5E_PAGEBUF(); + + private static native final long H5E_PATH(); + private static native final long H5E_PLINE(); private static native final long H5E_PLIST(); + private static native final long H5E_PLUGIN(); + private static native final long H5E_PROTECT(); private static native final long H5E_READERROR(); @@ -1005,12 +1465,24 @@ public class HDF5Constants { private static native final long H5E_SEEKERROR(); + private static native final long H5E_SETDISALLOWED(); + private static native final long H5E_SETLOCAL(); + private static native final long H5E_SLIST(); + + private static native final long H5E_SOHM(); + private static native final long H5E_STORAGE(); private static native final long H5E_SYM(); + private static native final long H5E_SYSERRSTR(); + + private static native final long H5E_SYSTEM(); + + private static native final long H5E_TRAVERSE(); + private static native final long H5E_TRUNCATED(); private static native final long H5E_TST(); diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java index 988c8fb..69c9709 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java @@ -15,7 +15,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5A_info_t; -//Information class for link callback(for H5Aiterate) +/** + * Information class for link callback for H5Aiterate. + * + */ public interface H5A_iterate_cb extends Callbacks { - int callback(long group, String name, H5A_info_t info, H5A_iterate_t op_data); + /** + * application callback for each attribute + * + * @param loc_id the ID for the group or dataset being iterated over + * @param name the name of the current attribute about the object + * @param info the attribute's "info" struct + * @param op_data the operator data passed in to H5Aiterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5A_info_t info, H5A_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java index 51d67d5..bdc96fa 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Aiterate. + * + */ public interface H5A_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java index ead8f73..8ad336f 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pset/get_append_flush) +/** + * Information class for link callback for H5Pset/get_append_flush. + * + */ public interface H5D_append_cb extends Callbacks { + /** + * application callback for each dataset access property list + * + * @param dataset_id the ID for the dataset being iterated over + * @param cur_dims the dimension sizes for determining boundary + * @param op_data the operator data passed in to H5Pset/get_append_flush + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long dataset_id, long[] cur_dims, H5D_append_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java index 8bf6410..795ed1e 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Dappend. + * + */ public interface H5D_append_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java index a911a1c..ca10342 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java @@ -13,7 +13,29 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Diterate) +/** + * Information class for link callback for H5Diterate. + * + */ public interface H5D_iterate_cb extends Callbacks { + /** + * application callback for each dataset element + * + * @param elem the pointer to the element in memory containing the current point + * @param elem_type the datatype ID for the elements stored in elem + * @param ndim the number of dimensions for POINT array + * @param point the array containing the location of the element within the original dataspace + * @param op_data the operator data passed in to H5Diterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(byte[] elem, long elem_type, int ndim, long[] point, H5D_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java index d049711..43fc159 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Diterate. + * + */ public interface H5D_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java index afc04ae..e5914c1 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java @@ -15,7 +15,27 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5E_error2_t; -//Information class for link callback(for H5Ewalk) +/** + * Information class for link callback for H5Ewalk. + * + */ public interface H5E_walk_cb extends Callbacks { + /** + * application callback for each error stack element + * + * @param nidx the index of the current error stack element + * @param info the error stack "info" struct + * @param op_data the operator data passed in to H5Ewalk + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(int nidx, H5E_error2_t info, H5E_walk_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java index 0be8977..3ff09ec 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Ewalk. + * + */ public interface H5E_walk_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java index ad9ad8c..ad28b04 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Lvisit/H5Lvisit_by_name. + * + */ public interface H5L_iterate_opdata_t { } diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java index f92fbc4..d08001a 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java @@ -15,7 +15,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5L_info_t; -// Information class for link callback (for H5Lvisit/H5Lvisit_by_name). +/** + * Information class for link callback for H5Lvisit/H5Lvisit_by_name. + * + */ public interface H5L_iterate_t extends Callbacks { - int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data); + /** + * application callback for each group + * + * @param loc_id the ID for the group being iterated over + * @param name the name of the current link + * @param info the link's "info" struct + * @param op_data the operator data passed in to H5Literate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5L_info_t info, H5L_iterate_opdata_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java index e1c47b5..15eb1a1 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Ovisit/H5Ovisit_by_name. + * + */ public interface H5O_iterate_opdata_t { } diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java index 9a55106..e627775 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java @@ -15,7 +15,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5O_info_t; -// Information class for link callback(for H5Ovisit/H5Ovisit_by_name) +/** + * Information class for link callback for H5Ovisit/H5Ovisit_by_name. + * + */ public interface H5O_iterate_t extends Callbacks { - int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data); + /** + * application callback for each group + * + * @param loc_id the ID for the group or dataset being iterated over + * @param name the name of the current object + * @param info the object's "info" struct + * @param op_data the operator data passed in to H5Oiterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5O_info_t info, H5O_iterate_opdata_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java index e77d386..78a87ad 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java @@ -13,7 +13,26 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_close_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list class being iterated over + * @param close_data the function to call when a property list is closed + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, H5P_cls_close_func_t close_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java index 0d5ad9e..709ee494 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_close_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java index 139f877..878bbd3 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class + * + */ public interface H5P_cls_copy_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param new_prop_id the ID for the property list copy + * @param old_prop_id the ID for the property list class being copied + * @param copy_data the function to call when each property list in this class is copied + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long new_prop_id, long old_prop_id, H5P_cls_copy_func_t copy_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java index 12c2601..b3e7f09 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_copy_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java index e64ec6f..88d0aa6 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java @@ -13,7 +13,26 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_create_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list class being iterated over + * @param create_data the function to call when each property list in this class is created + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, H5P_cls_create_func_t create_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java index 73646f1..8e259cc 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_create_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java index 5ecb88d..60e1884 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Piterate) +/** + * Information class for link callback for H5Piterate. + * + */ public interface H5P_iterate_cb extends Callbacks { + /** + * application callback for each property list + * + * @param plist the ID for the property list being iterated over + * @param name the name of the current property list + * @param op_data the operator data passed in to H5Piterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long plist, String name, H5P_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java index 2e320b4..4c5d222 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Piterate. + * + */ public interface H5P_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java index 103fe5f..40569bc 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_close_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property being closed + * @param size the size of the property value + * @param value the value of the property being closed + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java index 46477b9..cc466a6 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_compare_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param value1 the value of the first property being compared + * @param value2 the value of the second property being compared + * @param size the size of the property value + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(byte[] value1, byte[] value2, long size); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java index 57994bb5..59e4bb8 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_copy_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property being copied + * @param size the size of the property value + * @param value the value of the property being copied + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java index 8791c22..5c6df7a 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_create_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property list being created + * @param size the size of the property value + * @param value the initial value for the property being created + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java index 46cd097..5206d4f 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java @@ -13,7 +13,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_delete_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID of the property list the property is deleted from + * @param name the name of the property being deleted + * @param size the size of the property value + * @param value the value of the property being deleted + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java index 04599a0..8f44497 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java @@ -13,7 +13,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_get_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list being queried + * @param name the name of the property being queried + * @param size the size of the property value + * @param value the value being retrieved for the property + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java index 6ac750f..2a2d3a1 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java @@ -13,7 +13,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_set_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list being modified + * @param name the name of the property being modified + * @param size the size of the property value + * @param value the value being set for the property + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java index 1e4b5fd..70fdd11 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java @@ -31,6 +31,9 @@ package hdf.hdf5lib.exceptions; * */ public class HDF5Exception extends RuntimeException { + /** + * the specified detail message of this exception + */ protected String detailMessage; /** diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java index ea4a89a..fea5b6d 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java @@ -13,6 +13,12 @@ package hdf.hdf5lib.exceptions; +/** + * The class HDF5LibraryException returns errors raised by the HDF5 library. + * <p> + * This sub-class represents HDF-5 major error code <b>H5E_REFERENCE</b> + */ + public class HDF5ReferenceException extends HDF5LibraryException { /** * Constructs an <code>HDF5ReferenceException</code> with no specified 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 20863dc..a118d05 100644 --- a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java +++ b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for H5Pget_mdc_config/H5Pset_mdc_config +/** + * Information struct for H5Pget_mdc_config/H5Pset_mdc_config + * + */ public class H5AC_cache_config_t implements Serializable{ private static final long serialVersionUID = -6748085696476149972L; // general configuration fields: diff --git a/java/src/hdf/hdf5lib/structs/H5A_info_t.java b/java/src/hdf/hdf5lib/structs/H5A_info_t.java index a46a495..cd7a397 100644 --- a/java/src/hdf/hdf5lib/structs/H5A_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5A_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for Attribute (For H5Aget_info/H5Aget_info_by_idx/H5Aget_info_by_name) +/** + * Information struct for Attribute (For H5Aget_info/H5Aget_info_by_idx/H5Aget_info_by_name) + * + */ public class H5A_info_t implements Serializable{ private static final long serialVersionUID = 2791443594041667613L; public boolean corder_valid; // Indicate if creation order is valid diff --git a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java index 257ad05..083537f 100644 --- a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for Attribute (For H5Ewalk) +/** + * Information struct for Attribute (For H5Ewalk) + * + */ public class H5E_error2_t implements Serializable{ private static final long serialVersionUID = 279144359041667613L; 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 9fcff2e..26690ec 100644 --- a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java +++ b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java @@ -16,7 +16,7 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -/* +/** * Java representation of the HDFS VFD file access property list (fapl) * structure. * 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 a899e10..735cc7e 100644 --- a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java +++ b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java @@ -16,7 +16,7 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -/* +/** * Java representation of the ROS3 VFD file access property list (fapl) * structure. * diff --git a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java index 4664b5b..836b683 100644 --- a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for object (for H5Fget_info) +/** + * Information struct for object (for H5Fget_info) + * + */ public class H5F_info2_t implements Serializable{ private static final long serialVersionUID = 4691681162544054518L; public int super_version; // Superblock version # diff --git a/java/src/hdf/hdf5lib/structs/H5G_info_t.java b/java/src/hdf/hdf5lib/structs/H5G_info_t.java index 56c876e..9a5c72e 100644 --- a/java/src/hdf/hdf5lib/structs/H5G_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5G_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) +/** + * Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) + * + */ public class H5G_info_t implements Serializable{ private static final long serialVersionUID = -3746463015312132912L; public int storage_type; // Type of storage for links in group diff --git a/java/src/hdf/hdf5lib/structs/H5L_info_t.java b/java/src/hdf/hdf5lib/structs/H5L_info_t.java index 377e617..16d9bbf 100644 --- a/java/src/hdf/hdf5lib/structs/H5L_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5L_info_t.java @@ -17,7 +17,10 @@ import java.io.Serializable; import hdf.hdf5lib.HDF5Constants; -// Information struct for link (for H5Lget_info/H5Lget_info_by_idx) +/** + * Information struct for link (for H5Lget_info/H5Lget_info_by_idx) + * + */ public class H5L_info_t implements Serializable { private static final long serialVersionUID = -4754320605310155033L; public int type; 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 73aaa47..df76638 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -// Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) +/** + * Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) + * + */ public class H5O_hdr_info_t implements Serializable { private static final long serialVersionUID = 7883826382952577189L; public int version; /* Version number of header format in file */ @@ -56,25 +59,25 @@ public class H5O_hdr_info_t implements Serializable { H5O_hdr_info_t info = (H5O_hdr_info_t) o; if (this.version != info.version) - return false; + return false; if (this.nmesgs != info.nmesgs) - return false; + return false; if (this.nchunks != info.nchunks) - return false; + return false; if (this.flags != info.flags) - return false; + return false; if (this.space_total != info.space_total) - return false; + return false; if (this.space_meta != info.space_meta) - return false; + return false; if (this.space_mesg != info.space_mesg) - return false; + return false; if (this.space_free != info.space_free) - return false; + return false; if (this.mesg_present != info.mesg_present) - return false; + return false; if (this.mesg_shared != info.mesg_shared) - return false; + return false; return true; } diff --git a/java/src/hdf/hdf5lib/structs/H5O_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_info_t.java index 6a26a10..2f76384 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -// Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) +/** + * Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) + * + */ public class H5O_info_t implements Serializable { private static final long serialVersionUID = 4691681163544054518L; public long fileno; /* File number that object is located in */ 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 f410a7f..89a5c5f 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -// Information struct for native HDF5 object info, such as object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx). +/** + * Information struct for native HDF5 object info, such as object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx). + * + */ public class H5O_native_info_t implements Serializable { private static final long serialVersionUID = 7883826382952577189L; @@ -45,7 +48,7 @@ public class H5O_native_info_t implements Serializable { if (!this.hdr_info.equals(info.hdr_info) || !this.obj_info.equals(info.obj_info) || !this.attr_info.equals(info.attr_info)) - return false; + return false; return true; } diff --git a/java/src/hdf/hdf5lib/structs/H5O_token_t.java b/java/src/hdf/hdf5lib/structs/H5O_token_t.java index e6d2474..be934e4 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_token_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_token_t.java @@ -17,7 +17,10 @@ import java.util.Arrays; import hdf.hdf5lib.HDF5Constants; -// Object token, which is a unique and permanent identifier, for an HDF5 object within a container. +/** + * Object token, which is a unique and permanent identifier, for an HDF5 object within a container. + * + */ public class H5O_token_t implements Serializable { private static final long serialVersionUID = -4754320605310155032L; public byte[] data; 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 7159f02..1c3ab80 100644 --- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) +/** + * Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) + * + */ public class H5_ih_info_t implements Serializable { private static final long serialVersionUID = -142238015615462707L; public long index_size; /* btree and/or list */ @@ -38,9 +41,9 @@ public class H5_ih_info_t implements Serializable { H5_ih_info_t info = (H5_ih_info_t) o; if (this.index_size != info.index_size) - return false; + return false; if (this.heap_size != info.heap_size) - return false; + return false; return true; } diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 38f0883..94d5b19 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -355,6 +355,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1BADGROUP(JNIEnv *env, jclass cls) return H5E_BADGROUP; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1BADITER(JNIEnv *env, jclass cls) +{ + return H5E_BADITER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADMESG(JNIEnv *env, jclass cls) { return H5E_BADMESG; @@ -404,8 +409,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANAPPLY(JNIEnv *env, jclass cls) { return H5E_CANAPPLY; } -/*JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) { return H5E_CANTALLOC; }*/ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) +{ + return H5E_CANTALLOC; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTAPPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTAPPEND; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTATTACH(JNIEnv *env, jclass cls) +{ + return H5E_CANTATTACH; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLEAN(JNIEnv *env, jclass cls) +{ + return H5E_CANTCLEAN; +} JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLIP(JNIEnv *env, jclass cls) { @@ -417,6 +440,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEFILE(JNIEnv *env, jclass cls) return H5E_CANTCLOSEFILE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEOBJ(JNIEnv *env, jclass cls) +{ + return H5E_CANTCLOSEOBJ; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOMPARE(JNIEnv *env, jclass cls) +{ + return H5E_CANTCOMPARE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOMPUTE(JNIEnv *env, jclass cls) +{ + return H5E_CANTCOMPUTE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCONVERT(JNIEnv *env, jclass cls) { return H5E_CANTCONVERT; @@ -427,6 +465,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOPY(JNIEnv *env, jclass cls) return H5E_CANTCOPY; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCORK(JNIEnv *env, jclass cls) +{ + return H5E_CANTCORK; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOUNT(JNIEnv *env, jclass cls) { return H5E_CANTCOUNT; @@ -457,11 +500,36 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDELETEFILE(JNIEnv *env, jclass cls) return H5E_CANTDELETEFILE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDEPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTDEPEND; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDIRTY(JNIEnv *env, jclass cls) +{ + return H5E_CANTDIRTY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFILTER(JNIEnv *env, jclass cls) +{ + return H5E_CANTFILTER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTENCODE(JNIEnv *env, jclass cls) { return H5E_CANTENCODE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTEXPUNGE(JNIEnv *env, jclass cls) +{ + return H5E_CANTEXPUNGE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTEXTEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTEXTEND; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFLUSH(JNIEnv *env, jclass cls) { return H5E_CANTFLUSH; @@ -472,11 +540,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFREE(JNIEnv *env, jclass cls) return H5E_CANTFREE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGATHER(JNIEnv *env, jclass cls) +{ + return H5E_CANTGATHER; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGC(JNIEnv *env, jclass cls) +{ + return H5E_CANTGC; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGET(JNIEnv *env, jclass cls) { return H5E_CANTGET; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGETSIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTGETSIZE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINC(JNIEnv *env, jclass cls) { return H5E_CANTINC; @@ -487,6 +570,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINIT(JNIEnv *env, jclass cls) return H5E_CANTINIT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINS(JNIEnv *env, jclass cls) +{ + return H5E_CANTINS; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINSERT(JNIEnv *env, jclass cls) { return H5E_CANTINSERT; @@ -507,11 +595,56 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCK(JNIEnv *env, jclass cls) return H5E_CANTLOCK; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCKFILE(JNIEnv *env, jclass cls) +{ + return H5E_CANTLOCKFILE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKCLEAN(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKCLEAN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKDIRTY(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKDIRTY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKSERIALIZED(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKSERIALIZED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKUNSERIALIZED(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKUNSERIALIZED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMERGE(JNIEnv *env, jclass cls) +{ + return H5E_CANTMERGE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMODIFY(JNIEnv *env, jclass cls) +{ + return H5E_CANTMODIFY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMOVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTMOVE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNEXT(JNIEnv *env, jclass cls) { return H5E_CANTNEXT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNOTIFY(JNIEnv *env, jclass cls) +{ + return H5E_CANTNOTIFY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENFILE(JNIEnv *env, jclass cls) { return H5E_CANTOPENFILE; @@ -521,8 +654,36 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENOBJ(JNIEnv *env, jclass cls) { return H5E_CANTOPENOBJ; } -/*JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) { return H5E_CANTRECV; }*/ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPERATE(JNIEnv *env, jclass cls) +{ + return H5E_CANTOPERATE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPACK(JNIEnv *env, jclass cls) +{ + return H5E_CANTPACK; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPIN(JNIEnv *env, jclass cls) +{ + return H5E_CANTPIN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPROTECT(JNIEnv *env, jclass cls) +{ + return H5E_CANTPROTECT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) +{ + return H5E_CANTRECV; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREDISTRIBUTE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREDISTRIBUTE; +} JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREGISTER(JNIEnv *env, jclass cls) { @@ -534,6 +695,41 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRELEASE(JNIEnv *env, jclass cls) return H5E_CANTRELEASE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREMOVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREMOVE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRENAME(JNIEnv *env, jclass cls) +{ + return H5E_CANTRENAME; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESET(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESET; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESTORE(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESTORE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREVIVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREVIVE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSHRINK(JNIEnv *env, jclass cls) +{ + return H5E_CANTSHRINK; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSELECT(JNIEnv *env, jclass cls) { return H5E_CANTSELECT; @@ -544,16 +740,71 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSET(JNIEnv *env, jclass cls) return H5E_CANTSET; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSERIALIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTSERIALIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSORT(JNIEnv *env, jclass cls) +{ + return H5E_CANTSORT; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSPLIT(JNIEnv *env, jclass cls) { return H5E_CANTSPLIT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSWAP(JNIEnv *env, jclass cls) +{ + return H5E_CANTSWAP; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTTAG(JNIEnv *env, jclass cls) +{ + return H5E_CANTTAG; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNCORK(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNCORK; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNDEPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNDEPEND; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCK(JNIEnv *env, jclass cls) { return H5E_CANTUNLOCK; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCKFILE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNLOCKFILE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNPIN(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNPIN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNPROTECT(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNPROTECT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNSERIALIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNSERIALIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUPDATE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUPDATE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CLOSEERROR(JNIEnv *env, jclass cls) { return H5E_CLOSEERROR; @@ -564,6 +815,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1COMPLEN(JNIEnv *env, jclass cls) return H5E_COMPLEN; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CONTEXT(JNIEnv *env, jclass cls) +{ + return H5E_CONTEXT; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATASET(JNIEnv *env, jclass cls) { return H5E_DATASET; @@ -589,16 +845,31 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1DUPCLASS(JNIEnv *env, jclass cls) return H5E_DUPCLASS; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1EARRAY(JNIEnv *env, jclass cls) +{ + return H5E_EARRAY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EFL(JNIEnv *env, jclass cls) { return H5E_EFL; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1ERROR(JNIEnv *env, jclass cls) +{ + return H5E_ERROR; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EXISTS(JNIEnv *env, jclass cls) { return H5E_EXISTS; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1FARRAY(JNIEnv *env, jclass cls) +{ + return H5E_FARRAY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FCNTL(JNIEnv *env, jclass cls) { return H5E_FCNTL; @@ -619,6 +890,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1FILEOPEN(JNIEnv *env, jclass cls) return H5E_FILEOPEN; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1FSPACE(JNIEnv *env, jclass cls) +{ + return H5E_FSPACE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FUNC(JNIEnv *env, jclass cls) { return H5E_FUNC; @@ -629,6 +905,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1HEAP(JNIEnv *env, jclass cls) return H5E_HEAP; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1INCONSISTENTSTATE(JNIEnv *env, jclass cls) +{ + return H5E_INCONSISTENTSTATE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1INTERNAL(JNIEnv *env, jclass cls) { return H5E_INTERNAL; @@ -648,11 +929,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1LINKCOUNT(JNIEnv *env, jclass cls) { return H5E_LINKCOUNT; } +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1LOGGING(JNIEnv *env, jclass cls) +{ + return H5E_LOGGING; +} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MAJOR(JNIEnv *env, jclass cls) { return H5E_MAJOR; } +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1MAP(JNIEnv *env, jclass cls) +{ + return H5E_MAP; +} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MINOR(JNIEnv *env, jclass cls) { @@ -674,6 +965,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1MPIERRSTR(JNIEnv *env, jclass cls) return H5E_MPIERRSTR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NLINKS(JNIEnv *env, jclass cls) +{ + return H5E_NLINKS; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NO_1INDEPENDENT(JNIEnv *env, jclass cls) +{ + return H5E_NO_INDEPENDENT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NOENCODER(JNIEnv *env, jclass cls) +{ + return H5E_NOENCODER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOFILTER(JNIEnv *env, jclass cls) { return H5E_NOFILTER; @@ -714,16 +1020,41 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTHDF5(JNIEnv *env, jclass cls) return H5E_NOTHDF5; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTREGISTERED(JNIEnv *env, jclass cls) +{ + return H5E_NOTREGISTERED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1OBJOPEN(JNIEnv *env, jclass cls) +{ + return H5E_OBJOPEN; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OHDR(JNIEnv *env, jclass cls) { return H5E_OHDR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1OPENERROR(JNIEnv *env, jclass cls) +{ + return H5E_OPENERROR; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OVERFLOW(JNIEnv *env, jclass cls) { return H5E_OVERFLOW; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PAGEBUF(JNIEnv *env, jclass cls) +{ + return H5E_PAGEBUF; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PATH(JNIEnv *env, jclass cls) +{ + return H5E_PATH; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PLINE(JNIEnv *env, jclass cls) { return H5E_PLINE; @@ -734,6 +1065,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1PLIST(JNIEnv *env, jclass cls) return H5E_PLIST; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PLUGIN(JNIEnv *env, jclass cls) +{ + return H5E_PLUGIN; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PROTECT(JNIEnv *env, jclass cls) { return H5E_PROTECT; @@ -764,11 +1100,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1SEEKERROR(JNIEnv *env, jclass cls) return H5E_SEEKERROR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SETDISALLOWED(JNIEnv *env, jclass cls) +{ + return H5E_SETDISALLOWED; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SETLOCAL(JNIEnv *env, jclass cls) { return H5E_SETLOCAL; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SLIST(JNIEnv *env, jclass cls) +{ + return H5E_SLIST; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SOHM(JNIEnv *env, jclass cls) +{ + return H5E_SOHM; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1STORAGE(JNIEnv *env, jclass cls) { return H5E_STORAGE; @@ -779,6 +1130,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1SYM(JNIEnv *env, jclass cls) return H5E_SYM; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SYSERRSTR(JNIEnv *env, jclass cls) +{ + return H5E_SYSERRSTR; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SYSTEM(JNIEnv *env, jclass cls) +{ + return H5E_SYSTEM; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1TRAVERSE(JNIEnv *env, jclass cls) +{ + return H5E_TRAVERSE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1TRUNCATED(JNIEnv *env, jclass cls) { return H5E_TRUNCATED; diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index 2a9cff5..18255a8 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -1340,6 +1340,389 @@ done: return; } /* end Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_copy + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1copy(JNIEnv *env, jclass clss, jlong dst_id, jlong src_id) +{ + herr_t status = FAIL; + + UNUSED(clss); + + if ((status = H5Sselect_copy((hid_t)dst_id, (hid_t)src_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1copy */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_shape_same + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same(JNIEnv *env, jclass clss, jlong space1_id, jlong space2_id) +{ + htri_t bval = JNI_FALSE; + + UNUSED(clss); + + if ((bval = H5Sselect_shape_same((hid_t)space1_id, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; + +done: + return (jboolean)bval; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_adjust + * Signature: (J[J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *env, jclass clss, jlong space_id, jlongArray offset) +{ + jboolean isCopy; + hssize_t *offst = NULL; + jlong * offsetP = NULL; + jsize offset_rank = -1; + int i, rank = -1; + herr_t status = FAIL; + + UNUSED(clss); + + if (space_id < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: invalid dataspace ID"); + + if ((rank = H5Sget_simple_extent_ndims(space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (NULL == offset) { + offsetP = NULL; + offst = (hssize_t *)offsetP; + } + else { + if ((offset_rank = ENVPTR->GetArrayLength(ENVONLY, offset)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: offset length < 0"); + } + + if (offset_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: offset rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, offset, offsetP, &isCopy, "H5Sselect_adjust: offset not pinned"); + + if (NULL == (offst = (hssize_t *)HDmalloc((size_t)offset_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_adjust: failed to allocate offset buffer"); + } + + if ((status = H5Sselect_adjust(space_id, (hssize_t *)offst)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + for (i = 0; i < offset_rank; i++) { + offsetP[i] = (jlong)offst[i]; + } /* end for */ + +done: + if (offst) + HDfree(offst); + if (offsetP) + UNPIN_LONG_ARRAY(ENVONLY, offset, offsetP, (status < 0) ? JNI_ABORT : 0); + + return; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1adjust */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_intersect_block + * Signature: (J[J[J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *env, jclass clss, jlong space_id, jlongArray start, + jlongArray end) +{ + htri_t bval = JNI_FALSE; + jboolean isCopy; + hsize_t *strt = NULL, *nd = NULL; + jlong * startP = NULL, *endP = NULL; + jsize start_rank = -1, end_rank = -1; + int i, rank = -1; + + UNUSED(clss); + + if (space_id < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: invalid dataspace ID"); + + if ((rank = H5Sget_simple_extent_ndims(space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (NULL == start) { + startP = NULL; + strt = (hsize_t *)startP; + } + else { + if ((start_rank = ENVPTR->GetArrayLength(ENVONLY, start)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: start length < 0"); + } + + if (start_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, + "H5Sselect_intersect_block: start rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sselect_intersect_block: start not pinned"); + + if (NULL == (strt = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate start buffer"); + } + + if (NULL == end) { + endP = NULL; + nd = (hsize_t *)endP; + } + else { + if ((end_rank = ENVPTR->GetArrayLength(ENVONLY, end)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: end array length < 0"); + } + + if (end_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, + "H5Sselect_intersect_block: end rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, end, endP, &isCopy, "H5Sselect_intersect_block: end not pinned"); + + if (NULL == (nd = (hsize_t *)HDmalloc((size_t)end_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate end buffer"); + } + + if ((bval = H5Sselect_intersect_block(space_id, (hsize_t *)strt, (hsize_t *)nd)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; + + for (i = 0; i < start_rank; i++) { + startP[i] = (jlong)strt[i]; + endP[i] = (jlong)nd[i]; + } /* end for */ + +done: + if (strt) + HDfree(strt); + if (startP) + UNPIN_LONG_ARRAY(ENVONLY, start, startP, (bval < 0) ? JNI_ABORT : 0); + if (nd) + HDfree(nd); + if (endP) + UNPIN_LONG_ARRAY(ENVONLY, end, endP, (bval < 0) ? JNI_ABORT : 0); + + return (jboolean)bval; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_project_intersection + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection(JNIEnv *env, jclass clss, jlong src_space_id, + jlong dst_space_id, jlong src_intersect_space_id) +{ + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if ((sid = H5Sselect_project_intersection(src_space_id, dst_space_id, src_intersect_space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_hyperslab + * Signature: (JI[J[J[J[J)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_id, jint op, jlongArray start, + jlongArray stride, jlongArray count, jlongArray block) +{ + jboolean isCopy; + hsize_t *strt = NULL, *strd = NULL, *cnt = NULL, *blk = NULL; + hsize_t *lp = NULL; + jlong * startP = NULL, *strideP = NULL, *countP = NULL, *blockP = NULL; + jlong * jlp = NULL; + jsize start_rank, stride_rank, count_rank, block_rank; + int i; + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if (NULL == start) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: start is NULL"); + if (NULL == count) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count is NULL"); + + if ((start_rank = ENVPTR->GetArrayLength(ENVONLY, start)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: start array length < 0"); + } + if ((count_rank = ENVPTR->GetArrayLength(ENVONLY, count)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count array length < 0"); + } + + if (start_rank != count_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Scombine_hyperslab: start not pinned"); + + if (NULL == (strt = lp = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate start buffer"); + + jlp = (jlong *)startP; + for (i = 0; i < start_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + + PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Scombine_hyperslab: count not pinned"); + + if (NULL == (cnt = lp = (hsize_t *)HDmalloc((size_t)count_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate count buffer"); + + jlp = (jlong *)countP; + for (i = 0; i < count_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + + if (NULL == stride) { + strideP = NULL; + strd = (hsize_t *)strideP; + } + else { + if ((stride_rank = ENVPTR->GetArrayLength(ENVONLY, stride)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: stride array length < 0"); + } + + if (stride_rank != start_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: stride and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Scombine_hyperslab: stride not pinned"); + + if (NULL == (strd = lp = (hsize_t *)HDmalloc((size_t)stride_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate stride buffer"); + + jlp = (jlong *)strideP; + for (i = 0; i < stride_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + } + + if (NULL == block) { + blockP = NULL; + blk = (hsize_t *)blockP; + } + else { + if ((block_rank = ENVPTR->GetArrayLength(ENVONLY, block)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: block array length < 0"); + } + + if (block_rank != start_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: block and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Scombine_hyperslab: block not pinned"); + + if (NULL == (blk = lp = (hsize_t *)HDmalloc((size_t)block_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate block buffer"); + + jlp = (jlong *)blockP; + for (i = 0; i < block_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end for */ + } + + if ((sid = H5Scombine_hyperslab(space_id, (H5S_seloper_t)op, (const hsize_t *)strt, (const hsize_t *)strd, + (const hsize_t *)cnt, (const hsize_t *)blk)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + if (blk) + HDfree(blk); + if (blockP) + UNPIN_LONG_ARRAY(ENVONLY, block, blockP, JNI_ABORT); + if (strd) + HDfree(strd); + if (strideP) + UNPIN_LONG_ARRAY(ENVONLY, stride, strideP, JNI_ABORT); + if (cnt) + HDfree(cnt); + if (countP) + UNPIN_LONG_ARRAY(ENVONLY, count, countP, JNI_ABORT); + if (strt) + HDfree(strt); + if (startP) + UNPIN_LONG_ARRAY(ENVONLY, start, startP, JNI_ABORT); + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Smodify_select + * Signature: (JIJ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Smodify_1select(JNIEnv *env, jclass clss, jlong space1_id, jint op, jlong space2_id) +{ + herr_t status = FAIL; + + UNUSED(clss); + + if ((status = H5Smodify_select((hid_t)space1_id, (H5S_seloper_t)op, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return; +} /* end Java_hdf_hdf5lib_H5_H5Smodify_1select */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_select + * Signature: (JIJ)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *env, jclass clss, jlong space1_id, jint op, jlong space2_id) +{ + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if ((sid = H5Scombine_select((hid_t)space1_id, (H5S_seloper_t)op, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Scombine_1select */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h index ee28b39..83255c1 100644 --- a/java/src/jni/h5sImp.h +++ b/java/src/jni/h5sImp.h @@ -259,6 +259,65 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sis_1regular_1hyperslab(JNIEnv JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *, jclass, jlong, jlongArray, jlongArray, jlongArray, jlongArray); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_copy + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1copy(JNIEnv *, jclass, jlong, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_shape_same + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same(JNIEnv *, jclass, jlong, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_adjust + * Signature: (J[J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *, jclass, jlong, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_intersect_block + * Signature: (J[J[J)Z + */ +JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *, jclass, jlong, + jlongArray, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_project_intersection + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection(JNIEnv *, jclass, jlong, jlong, + jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_hyperslab + * Signature: (JI[J[J[J[J)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *, jclass, jlong, jint, jlongArray, + jlongArray, jlongArray, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Smodify_select + * Signature: (JIJ)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Smodify_1select(JNIEnv *, jclass, jlong, jint, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_select + * Signature: (JIJ)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *, jclass, jlong, jint, jlong); + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index b97ad26..b0a0d53 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -96,7 +96,7 @@ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_ 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}) -if (WIN32 OR MINGW) +if (WIN32) set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") else () set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") diff --git a/java/test/TestH5Sbasic.java b/java/test/TestH5Sbasic.java index 2173647..9874584 100644 --- a/java/test/TestH5Sbasic.java +++ b/java/test/TestH5Sbasic.java @@ -242,4 +242,142 @@ public class TestH5Sbasic { H5.H5Sdecode(null); } + @Test(expected = IllegalArgumentException.class) + public void testH5Sget_regular_hyperslab_invalid() throws Throwable { + long q_start[] = new long[2]; + long q_stride[] = new long[2]; + long q_count[] = new long[2]; + long q_block[] = new long[2]; + + H5.H5Sget_regular_hyperslab(-1, q_start, q_stride, q_count, q_block); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Sselect_copy_invalid() throws Throwable { + H5.H5Sselect_copy(-1, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class) + public void testH5Sselect_shape_same_invalid() throws Throwable { + H5.H5Sselect_shape_same(-1, -1); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_adjust_invalid() throws Throwable { + long offset[][] = {{0,1},{2,4},{5,6}}; + H5.H5Sselect_adjust(-1, offset); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_adjust_rank_offset() throws Throwable { + long sid = -1; + long offset[][] = {{0,1},{2,4},{5,6}}; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_adjust(sid, offset); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_invalid() throws Throwable { + long start[] = new long[2]; + long end[] = new long[2]; + H5.H5Sselect_intersect_block(-1, start, end); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_rank_start() throws Throwable { + long sid = -1; + long start[] = new long[2]; + long end[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_intersect_block(sid, start, end); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_rank_end() throws Throwable { + long sid = -1; + long start[] = null; + long end[] = new long[2]; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_intersect_block(sid, start, end); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class) + public void testH5Sselect_project_intersection_invalid() throws Throwable { + H5.H5Sselect_project_intersection(-1, -1, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Scombine_hyperslab_invalid() throws Throwable { + long start[] = new long[2]; + long count[] = new long[2]; + H5.H5Scombine_hyperslab(-1, 0, start, null, count, null); + } + + @Test(expected = NullPointerException.class) + public void testH5Scombine_hyperslab_null_start() throws Throwable { + long sid = -1; + long start[] = null; + long stride[] = null; + long count[] = new long[2]; + long block[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = NullPointerException.class) + public void testH5Scombine_hyperslab_null_count() throws Throwable { + long sid = -1; + long start[] = new long[2]; + long stride[] = null; + long count[] = null; + long block[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Smodify_select_invalid() throws Throwable { + H5.H5Smodify_select(-1, 0, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Scombine_select_invalid() throws Throwable { + H5.H5Scombine_select(-1, 0, -1); + } + } diff --git a/java/test/testfiles/JUnit-TestH5Sbasic.txt b/java/test/testfiles/JUnit-TestH5Sbasic.txt index 707878e..3422442 100644 --- a/java/test/testfiles/JUnit-TestH5Sbasic.txt +++ b/java/test/testfiles/JUnit-TestH5Sbasic.txt @@ -5,18 +5,32 @@ JUnit version 4.11 .testH5Sdecode_null .testH5Screate_simple_dims_exceed .testH5Screate_simple_unlimted_1d +.testH5Sselect_intersect_block_rank_start +.testH5Sget_regular_hyperslab_invalid +.testH5Sselect_adjust_rank_offset .testH5Screate_simple_dims_invalid .testH5Screate_scalar .testH5Screate_simple +.testH5Sselect_project_intersection_invalid .testH5Screate_simple_rank_invalid .testH5Sget_simple_extent_type_invalid +.testH5Scombine_hyperslab_invalid +.testH5Scombine_hyperslab_null_count +.testH5Scombine_hyperslab_null_start .testH5Sencode_invalid .testH5Screate_null .testH5Screate_simple_extent .testH5Screate_invalid +.testH5Sselect_intersect_block_invalid +.testH5Sselect_adjust_invalid .testH5Screate_simple_unlimted +.testH5Sselect_shape_same_invalid +.testH5Smodify_select_invalid +.testH5Scombine_select_invalid +.testH5Sselect_copy_invalid +.testH5Sselect_intersect_block_rank_end Time: XXXX -OK (16 tests) +OK (30 tests) diff --git a/m4/ax_prog_doxygen.m4 b/m4/ax_prog_doxygen.m4 new file mode 100644 index 0000000..a371f7f --- /dev/null +++ b/m4/ax_prog_doxygen.m4 @@ -0,0 +1,586 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html +# =========================================================================== +# +# SYNOPSIS +# +# DX_INIT_DOXYGEN(PROJECT-NAME, [DOXYFILE-PATH], [OUTPUT-DIR], ...) +# DX_DOXYGEN_FEATURE(ON|OFF) +# DX_DOT_FEATURE(ON|OFF) +# DX_HTML_FEATURE(ON|OFF) +# DX_CHM_FEATURE(ON|OFF) +# DX_CHI_FEATURE(ON|OFF) +# DX_MAN_FEATURE(ON|OFF) +# DX_RTF_FEATURE(ON|OFF) +# DX_XML_FEATURE(ON|OFF) +# DX_PDF_FEATURE(ON|OFF) +# DX_PS_FEATURE(ON|OFF) +# +# DESCRIPTION +# +# The DX_*_FEATURE macros control the default setting for the given +# Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for +# generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML +# help (for MS users), 'CHI' for generating a separate .chi file by the +# .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate +# output formats. The environment variable DOXYGEN_PAPER_SIZE may be +# specified to override the default 'a4wide' paper size. +# +# By default, HTML, PDF and PS documentation is generated as this seems to +# be the most popular and portable combination. MAN pages created by +# Doxygen are usually problematic, though by picking an appropriate subset +# and doing some massaging they might be better than nothing. CHM and RTF +# are specific for MS (note that you can't generate both HTML and CHM at +# the same time). The XML is rather useless unless you apply specialized +# post-processing to it. +# +# The macros mainly control the default state of the feature. The use can +# override the default by specifying --enable or --disable. The macros +# ensure that contradictory flags are not given (e.g., +# --enable-doxygen-html and --enable-doxygen-chm, +# --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each +# feature will be automatically disabled (with a warning) if the required +# programs are missing. +# +# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN +# with the following parameters: a one-word name for the project for use +# as a filename base etc., an optional configuration file name (the +# default is '$(srcdir)/Doxyfile', the same as Doxygen's default), and an +# optional output directory name (the default is 'doxygen-doc'). To run +# doxygen multiple times for different configuration files and output +# directories provide more parameters: the second, forth, sixth, etc +# parameter are configuration file names and the third, fifth, seventh, +# etc parameter are output directories. No checking is done to catch +# duplicates. +# +# Automake Support +# +# The DX_RULES substitution can be used to add all needed rules to the +# Makefile. Note that this is a substitution without being a variable: +# only the @DX_RULES@ syntax will work. +# +# The provided targets are: +# +# doxygen-doc: Generate all doxygen documentation. +# +# doxygen-run: Run doxygen, which will generate some of the +# documentation (HTML, CHM, CHI, MAN, RTF, XML) +# but will not do the post processing required +# for the rest of it (PS, PDF). +# +# doxygen-ps: Generate doxygen PostScript documentation. +# +# doxygen-pdf: Generate doxygen PDF documentation. +# +# Note that by default these are not integrated into the automake targets. +# If doxygen is used to generate man pages, you can achieve this +# integration by setting man3_MANS to the list of man pages generated and +# then adding the dependency: +# +# $(man3_MANS): doxygen-doc +# +# This will cause make to run doxygen and generate all the documentation. +# +# The following variable is intended for use in Makefile.am: +# +# DX_CLEANFILES = everything to clean. +# +# Then add this variable to MOSTLYCLEANFILES. +# +# LICENSE +# +# Copyright (c) 2009 Oren Ben-Kiki <oren@ben-kiki.org> +# Copyright (c) 2015 Olaf Mandel <olaf@mandel.name> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 23 + +## ----------## +## Defaults. ## +## ----------## + +DX_ENV="" +AC_DEFUN([DX_FEATURE_doc], ON) +AC_DEFUN([DX_FEATURE_dot], OFF) +AC_DEFUN([DX_FEATURE_man], OFF) +AC_DEFUN([DX_FEATURE_html], ON) +AC_DEFUN([DX_FEATURE_chm], OFF) +AC_DEFUN([DX_FEATURE_chi], OFF) +AC_DEFUN([DX_FEATURE_rtf], OFF) +AC_DEFUN([DX_FEATURE_xml], OFF) +AC_DEFUN([DX_FEATURE_pdf], ON) +AC_DEFUN([DX_FEATURE_ps], ON) + +## --------------- ## +## Private macros. ## +## --------------- ## + +# DX_ENV_APPEND(VARIABLE, VALUE) +# ------------------------------ +# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen and add it +# as a substitution (but not a Makefile variable). The substitution +# is skipped if the variable name is VERSION. +AC_DEFUN([DX_ENV_APPEND], +[AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])dnl +m4_if([$1], [VERSION], [], [AC_SUBST([$1], [$2])dnl +AM_SUBST_NOTMAKE([$1])])dnl +]) + +# DX_DIRNAME_EXPR +# --------------- +# Expand into a shell expression prints the directory part of a path. +AC_DEFUN([DX_DIRNAME_EXPR], + [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']]) + +# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) +# ------------------------------------- +# Expands according to the M4 (static) status of the feature. +AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])]) + +# DX_REQUIRE_PROG(VARIABLE, PROGRAM) +# ---------------------------------- +# Require the specified program to be found for the DX_CURRENT_FEATURE to work. +AC_DEFUN([DX_REQUIRE_PROG], [ +AC_PATH_TOOL([$1], [$2]) +if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then + AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION]) + AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) +fi +]) + +# DX_TEST_FEATURE(FEATURE) +# ------------------------ +# Expand to a shell expression testing whether the feature is active. +AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1]) + +# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) +# ------------------------------------------------- +# Verify that a required features has the right state before trying to turn on +# the DX_CURRENT_FEATURE. +AC_DEFUN([DX_CHECK_DEPEND], [ +test "$DX_FLAG_$1" = "$2" \ +|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1, + requires, contradicts) doxygen-DX_CURRENT_FEATURE]) +]) + +# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) +# ---------------------------------------------------------- +# Turn off the DX_CURRENT_FEATURE if the required feature is off. +AC_DEFUN([DX_CLEAR_DEPEND], [ +test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) +]) + +# DX_FEATURE_ARG(FEATURE, DESCRIPTION, +# CHECK_DEPEND, CLEAR_DEPEND, +# REQUIRE, DO-IF-ON, DO-IF-OFF) +# -------------------------------------------- +# Parse the command-line option controlling a feature. CHECK_DEPEND is called +# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), +# otherwise CLEAR_DEPEND is called to turn off the default state if a required +# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional +# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and +# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. +AC_DEFUN([DX_ARG_ABLE], [ + AC_DEFUN([DX_CURRENT_FEATURE], [$1]) + AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2]) + AC_ARG_ENABLE(doxygen-$1, + [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1], + [--enable-doxygen-$1]), + DX_IF_FEATURE([$1], [don't $2], [$2]))], + [ +case "$enableval" in +#( +y|Y|yes|Yes|YES) + AC_SUBST([DX_FLAG_$1], 1) + $3 +;; #( +n|N|no|No|NO) + AC_SUBST([DX_FLAG_$1], 0) +;; #( +*) + AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1]) +;; +esac +], [ +AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)]) +$4 +]) +if DX_TEST_FEATURE([$1]); then + $5 + : +fi +if DX_TEST_FEATURE([$1]); then + $6 + : +else + $7 + : +fi +]) + +## -------------- ## +## Public macros. ## +## -------------- ## + +# DX_XXX_FEATURE(DEFAULT_STATE) +# ----------------------------- +AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])]) +AC_DEFUN([DX_DOT_FEATURE], [AC_DEFUN([DX_FEATURE_dot], [$1])]) +AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])]) +AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])]) +AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])]) +AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])]) +AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])]) +AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) +AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])]) +AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])]) +AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])]) + +# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR], ...) +# -------------------------------------------------------------- +# PROJECT also serves as the base name for the documentation files. +# The default CONFIG-FILE is "$(srcdir)/Doxyfile" and OUTPUT-DOC-DIR is +# "doxygen-doc". +# More arguments are interpreted as interleaved CONFIG-FILE and +# OUTPUT-DOC-DIR values. +AC_DEFUN([DX_INIT_DOXYGEN], [ + +# Files: +AC_SUBST([DX_PROJECT], [$1]) +AC_SUBST([DX_CONFIG], ['ifelse([$2], [], [$(srcdir)/Doxyfile], [$2])']) +AC_SUBST([DX_DOCDIR], ['ifelse([$3], [], [doxygen-doc], [$3])']) +m4_if(m4_eval(3 < m4_count($@)), 1, [m4_for([DX_i], 4, m4_count($@), 2, + [AC_SUBST([DX_CONFIG]m4_eval(DX_i[/2]), + 'm4_default_nblank_quoted(m4_argn(DX_i, $@), + [$(srcdir)/Doxyfile])')])])dnl +m4_if(m4_eval(3 < m4_count($@)), 1, [m4_for([DX_i], 5, m4_count($@,), 2, + [AC_SUBST([DX_DOCDIR]m4_eval([(]DX_i[-1)/2]), + 'm4_default_nblank_quoted(m4_argn(DX_i, $@), + [doxygen-doc])')])])dnl +m4_define([DX_loop], m4_dquote(m4_if(m4_eval(3 < m4_count($@)), 1, + [m4_for([DX_i], 4, m4_count($@), 2, [, m4_eval(DX_i[/2])])], + [])))dnl + +# Environment variables used inside doxygen.cfg: +DX_ENV_APPEND(SRCDIR, $srcdir) +DX_ENV_APPEND(PROJECT, $DX_PROJECT) +DX_ENV_APPEND(VERSION, $PACKAGE_VERSION) + +# Doxygen itself: +DX_ARG_ABLE(doc, [generate any doxygen documentation], + [], + [], + [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen) + DX_REQUIRE_PROG([DX_PERL], perl)], + [DX_ENV_APPEND(PERL_PATH, $DX_PERL)]) + +# Dot for graphics: +DX_ARG_ABLE(dot, [generate graphics for doxygen documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_DOT], dot)], + [DX_ENV_APPEND(HAVE_DOT, YES) + DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])], + [DX_ENV_APPEND(HAVE_DOT, NO)]) + +# Man pages generation: +DX_ARG_ABLE(man, [generate doxygen manual pages], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_MAN, YES)], + [DX_ENV_APPEND(GENERATE_MAN, NO)]) + +# RTF file generation: +DX_ARG_ABLE(rtf, [generate doxygen RTF documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_RTF, YES)], + [DX_ENV_APPEND(GENERATE_RTF, NO)]) + +# XML file generation: +DX_ARG_ABLE(xml, [generate doxygen XML documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [], + [DX_ENV_APPEND(GENERATE_XML, YES)], + [DX_ENV_APPEND(GENERATE_XML, NO)]) + +# (Compressed) HTML help generation: +DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_HHC], hhc)], + [DX_ENV_APPEND(HHC_PATH, $DX_HHC) + DX_ENV_APPEND(GENERATE_HTML, YES) + DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], + [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) + +# Separate CHI file generation. +DX_ARG_ABLE(chi, [generate doxygen separate compressed HTML help index file], + [DX_CHECK_DEPEND(chm, 1)], + [DX_CLEAR_DEPEND(chm, 1)], + [], + [DX_ENV_APPEND(GENERATE_CHI, YES)], + [DX_ENV_APPEND(GENERATE_CHI, NO)]) + +# Plain HTML pages generation: +DX_ARG_ABLE(html, [generate doxygen plain HTML documentation], + [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)], + [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)], + [], + [DX_ENV_APPEND(GENERATE_HTML, YES)], + [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)]) + +# PostScript file generation: +DX_ARG_ABLE(ps, [generate doxygen PostScript documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_LATEX], latex) + DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) + DX_REQUIRE_PROG([DX_DVIPS], dvips) + DX_REQUIRE_PROG([DX_EGREP], egrep)]) + +# PDF file generation: +DX_ARG_ABLE(pdf, [generate doxygen PDF documentation], + [DX_CHECK_DEPEND(doc, 1)], + [DX_CLEAR_DEPEND(doc, 1)], + [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex) + DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex) + DX_REQUIRE_PROG([DX_EGREP], egrep)]) + +# LaTeX generation for PS and/or PDF: +if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then + DX_ENV_APPEND(GENERATE_LATEX, YES) +else + DX_ENV_APPEND(GENERATE_LATEX, NO) +fi + +# Paper size for PS and/or PDF: +AC_ARG_VAR(DOXYGEN_PAPER_SIZE, + [a4wide (default), a4, letter, legal or executive]) +case "$DOXYGEN_PAPER_SIZE" in +#( +"") + AC_SUBST(DOXYGEN_PAPER_SIZE, "") +;; #( +a4wide|a4|letter|legal|executive) + DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE) +;; #( +*) + AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE']) +;; +esac + +# Rules: +AS_IF([[test $DX_FLAG_html -eq 1]], +[[DX_SNIPPET_html="## ------------------------------- ## +## Rules specific for HTML output. ## +## ------------------------------- ## + +DX_CLEAN_HTML = \$(DX_DOCDIR)/html]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/html]])[ + +"]], +[[DX_SNIPPET_html=""]]) +AS_IF([[test $DX_FLAG_chi -eq 1]], +[[DX_SNIPPET_chi=" +DX_CLEAN_CHI = \$(DX_DOCDIR)/\$(PACKAGE).chi]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).chi]])["]], +[[DX_SNIPPET_chi=""]]) +AS_IF([[test $DX_FLAG_chm -eq 1]], +[[DX_SNIPPET_chm="## ------------------------------ ## +## Rules specific for CHM output. ## +## ------------------------------ ## + +DX_CLEAN_CHM = \$(DX_DOCDIR)/chm]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/chm]])[\ +${DX_SNIPPET_chi} + +"]], +[[DX_SNIPPET_chm=""]]) +AS_IF([[test $DX_FLAG_man -eq 1]], +[[DX_SNIPPET_man="## ------------------------------ ## +## Rules specific for MAN output. ## +## ------------------------------ ## + +DX_CLEAN_MAN = \$(DX_DOCDIR)/man]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/man]])[ + +"]], +[[DX_SNIPPET_man=""]]) +AS_IF([[test $DX_FLAG_rtf -eq 1]], +[[DX_SNIPPET_rtf="## ------------------------------ ## +## Rules specific for RTF output. ## +## ------------------------------ ## + +DX_CLEAN_RTF = \$(DX_DOCDIR)/rtf]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/rtf]])[ + +"]], +[[DX_SNIPPET_rtf=""]]) +AS_IF([[test $DX_FLAG_xml -eq 1]], +[[DX_SNIPPET_xml="## ------------------------------ ## +## Rules specific for XML output. ## +## ------------------------------ ## + +DX_CLEAN_XML = \$(DX_DOCDIR)/xml]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/xml]])[ + +"]], +[[DX_SNIPPET_xml=""]]) +AS_IF([[test $DX_FLAG_ps -eq 1]], +[[DX_SNIPPET_ps="## ----------------------------- ## +## Rules specific for PS output. ## +## ----------------------------- ## + +DX_CLEAN_PS = \$(DX_DOCDIR)/\$(PACKAGE).ps]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).ps]])[ + +DX_PS_GOAL = doxygen-ps + +doxygen-ps: \$(DX_CLEAN_PS) + +]m4_foreach([DX_i], [DX_loop], +[[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).ps: \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR]DX_i[)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_LATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_LATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_LATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + \$(DX_DVIPS) -o ../\$(PACKAGE).ps refman.dvi + +]])["]], +[[DX_SNIPPET_ps=""]]) +AS_IF([[test $DX_FLAG_pdf -eq 1]], +[[DX_SNIPPET_pdf="## ------------------------------ ## +## Rules specific for PDF output. ## +## ------------------------------ ## + +DX_CLEAN_PDF = \$(DX_DOCDIR)/\$(PACKAGE).pdf]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).pdf]])[ + +DX_PDF_GOAL = doxygen-pdf + +doxygen-pdf: \$(DX_CLEAN_PDF) + +]m4_foreach([DX_i], [DX_loop], +[[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).pdf: \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag + \$(DX_V_LATEX)cd \$(DX_DOCDIR]DX_i[)/latex; \\ + rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\ + \$(DX_PDFLATEX) refman.tex; \\ + \$(DX_MAKEINDEX) refman.idx; \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=5; \\ + while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\ + refman.log > /dev/null 2>&1 \\ + && test \$\$countdown -gt 0; do \\ + \$(DX_PDFLATEX) refman.tex; \\ + countdown=\`expr \$\$countdown - 1\`; \\ + done; \\ + mv refman.pdf ../\$(PACKAGE).pdf + +]])["]], +[[DX_SNIPPET_pdf=""]]) +AS_IF([[test $DX_FLAG_ps -eq 1 -o $DX_FLAG_pdf -eq 1]], +[[DX_SNIPPET_latex="## ------------------------------------------------- ## +## Rules specific for LaTeX (shared for PS and PDF). ## +## ------------------------------------------------- ## + +DX_V_LATEX = \$(_DX_v_LATEX_\$(V)) +_DX_v_LATEX_ = \$(_DX_v_LATEX_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_LATEX_0 = @echo \" LATEX \" \$][@; + +DX_CLEAN_LATEX = \$(DX_DOCDIR)/latex]dnl +m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ + \$(DX_DOCDIR]DX_i[)/latex]])[ + +"]], +[[DX_SNIPPET_latex=""]]) + +AS_IF([[test $DX_FLAG_doc -eq 1]], +[[DX_SNIPPET_doc="## --------------------------------- ## +## Format-independent Doxygen rules. ## +## --------------------------------- ## + +${DX_SNIPPET_html}\ +${DX_SNIPPET_chm}\ +${DX_SNIPPET_man}\ +${DX_SNIPPET_rtf}\ +${DX_SNIPPET_xml}\ +${DX_SNIPPET_ps}\ +${DX_SNIPPET_pdf}\ +${DX_SNIPPET_latex}\ +DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V)) +_DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY)) +_DX_v_DXGEN_0 = @echo \" DXGEN \" \$<; + +.PHONY: doxygen-run doxygen-doc \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +.INTERMEDIATE: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +doxygen-run:]m4_foreach([DX_i], [DX_loop], + [[ \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag]])[ + +doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL) + +]m4_foreach([DX_i], [DX_loop], +[[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag: \$(DX_CONFIG]DX_i[) \$(pkginclude_HEADERS) + \$(A""M_V_at)rm -rf \$(DX_DOCDIR]DX_i[) + \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR]DX_i[) \$(DX_DOXYGEN) \$(DX_CONFIG]DX_i[) + \$(A""M_V_at)echo Timestamp >\$][@ + +]])dnl +[DX_CLEANFILES = \\] +m4_foreach([DX_i], [DX_loop], +[[ \$(DX_DOCDIR]DX_i[)/doxygen_sqlite3.db \\ + \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag \\ +]])dnl +[ -r \\ + \$(DX_CLEAN_HTML) \\ + \$(DX_CLEAN_CHM) \\ + \$(DX_CLEAN_CHI) \\ + \$(DX_CLEAN_MAN) \\ + \$(DX_CLEAN_RTF) \\ + \$(DX_CLEAN_XML) \\ + \$(DX_CLEAN_PS) \\ + \$(DX_CLEAN_PDF) \\ + \$(DX_CLEAN_LATEX)"]], +[[DX_SNIPPET_doc=""]]) +AC_SUBST([DX_RULES], +["${DX_SNIPPET_doc}"])dnl +AM_SUBST_NOTMAKE([DX_RULES]) + +#For debugging: +#echo DX_FLAG_doc=$DX_FLAG_doc +#echo DX_FLAG_dot=$DX_FLAG_dot +#echo DX_FLAG_man=$DX_FLAG_man +#echo DX_FLAG_html=$DX_FLAG_html +#echo DX_FLAG_chm=$DX_FLAG_chm +#echo DX_FLAG_chi=$DX_FLAG_chi +#echo DX_FLAG_rtf=$DX_FLAG_rtf +#echo DX_FLAG_xml=$DX_FLAG_xml +#echo DX_FLAG_pdf=$DX_FLAG_pdf +#echo DX_FLAG_ps=$DX_FLAG_ps +#echo DX_ENV=$DX_ENV +]) diff --git a/release_docs/HISTORY-1_0-1_8_0_rc3.txt b/release_docs/HISTORY-1_0-1_8_0_rc3.txt index 9c1ba12..f23a2c5 100644 --- a/release_docs/HISTORY-1_0-1_8_0_rc3.txt +++ b/release_docs/HISTORY-1_0-1_8_0_rc3.txt @@ -1,7 +1,7 @@ HDF5 HISTORY ============ This file contains history of the HDF5 libraries releases starting with -HDF5-1.0.0 and ending with HDF5-1.8.0-rc3 (the state of the code before i +HDF5-1.0.0 and ending with HDF5-1.8.0-rc3 (the state of the code before the HDF5 1.8.0 release). CONTENTS @@ -90,119 +90,119 @@ New Features -------------- - Removed stream-vfd from the HDF5 library. - AKC 2007/11/19. - Updated versions of autotools. HDF5 now uses automake 1.10.0, - autoconf 2.61, and libtool 1.5.22. MAM - 2007/7/25. + autoconf 2.61, and libtool 1.5.22. MAM - 2007/7/25. - Changed default fortran compiler to g95 when gcc is used. - AKC - 2007/2/17. + 2007/2/17. - 'make check-vfd' can now be run from the top level directory. Not all - tests that 'make check' invokes work with certain Virtual File Drivers, - so those tests have been skipped. - MAM 2006/7/17 + tests that 'make check' invokes work with certain Virtual File Drivers, + so those tests have been skipped. - MAM 2006/7/17 - Added the variable HDF5TestExpress to control how long tests run. - Setting it to a value between 0 and 3 controls how thoroughly the - library is tested, with 0 being an "exhaustive run" and 3 being a - very quick "smoke test." 1 (a "full run") is the default. - -JML 2006/6/21 + Setting it to a value between 0 and 3 controls how thoroughly the + library is tested, with 0 being an "exhaustive run" and 3 being a + very quick "smoke test." 1 (a "full run") is the default. + -JML 2006/6/21 - If both shared and static libraries are installed, now both will be - tested during 'make install'. -MAM 2006/06/21 + tested during 'make install'. -MAM 2006/06/21 - Added support to explicity enable stream_vfd or shared libraries - when using parallel via the '--enable-stream_vfd' and - '--enable-shared' options, respectively. If not explicity defined, - These settings default to enabled when parallel is not used, - and disabled when parallel is used. -MAM 2006/06/17 + when using parallel via the '--enable-stream_vfd' and + '--enable-shared' options, respectively. If not explicity defined, + These settings default to enabled when parallel is not used, + and disabled when parallel is used. -MAM 2006/06/17 - Remove the flexible parallel code and the --enable-fphdf5 - configure option, it was never up to production standards - anyway. -QAK 2006/4/20 + configure option, it was never up to production standards + anyway. -QAK 2006/4/20 - Added a macro hdf5_mpi_special_collective_io_works to filter out - some mpi-io packages that don't support collective IO for no IO - contributions in some processes. -KY 2006/2/16 - - Added -shlib option to link against installed shared libraries to - h5c++ and h5fc. -JML 2005/11/1 - - Added --enable-build-all option to configure, which only developers - should need to use. -JML 2005/10/24 - - Configure uses the 'TR' variable to let the user override the path - to the 'tr' utility. -JML 2005/10/17 - - Configure can recognize -lmpich as a form of MPI library. -AKC- - 2005/9/28. + some mpi-io packages that don't support collective IO for no IO + contributions in some processes. -KY 2006/2/16 + - Added -shlib option to link against installed shared libraries to + h5c++ and h5fc. -JML 2005/11/1 + - Added --enable-build-all option to configure, which only developers + should need to use. -JML 2005/10/24 + - Configure uses the 'TR' variable to let the user override the path + to the 'tr' utility. -JML 2005/10/17 + - Configure can recognize -lmpich as a form of MPI library. -AKC- + 2005/9/28. - MD5 checksumming has been added to snapshot releases. Release - tarballs will be accompanied by .md5 checksum files, which can - be verified using the md5sum utility. -JML 2005/9/6 + tarballs will be accompanied by .md5 checksum files, which can + be verified using the md5sum utility. -JML 2005/9/6 - Some configure flags are incompatible (e.g., the C++ APIs cannot - be built using the parallel version of HDF5). configure will now - output errors when some common incompatible features are used - together. -JML 2005/9/6 + be built using the parallel version of HDF5). configure will now + output errors when some common incompatible features are used + together. -JML 2005/9/6 - A new API function, H5Tis_hard(), was added to the library. It - checks if a conversion function is a compiler (hard) conversion. - SLU - 2005/9/6 - - t_mpi will run the test_mpio_derived_dtype by default unless it is - known not working (indicated by macro H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - not defined.) -AKC- 2005/8/23. - - Test execution has changed in a number of ways: - When make is invoked in parallel (using -j), sequential tests - are now executed as parallel make targets. This should make them - finish more quickly on machines with multiple processors. - Since test output is garbled when they are executed by parallel make, - tests now dump their output to foo.log files and foo.logsh files - (for test scripts). These logs are printed to the screen only - when a test fails or when all tests in the current directory have - completed successfully. - When tests pass, they will create a foo.chkexe file. - This prevents the test from executing again until the test or - main library changes. - All files generated by tests (*.chkexe, *.log, and any *.h5 files - created) can be removed by invoking 'make check-clean'. - Sequential and parallel library tests can now be invoked separately. - 'make check-s' will execute only sequential tests, and 'make check-p' - will execute only parallel tests. 'make check' will still execute - all tests. - -JML 2005/08/03 + checks if a conversion function is a compiler (hard) conversion. + SLU - 2005/9/6 + - t_mpi will run the test_mpio_derived_dtype by default unless it is + known not working (indicated by macro H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS + not defined.) -AKC- 2005/8/23. + - Test execution has changed in a number of ways: + When make is invoked in parallel (using -j), sequential tests + are now executed as parallel make targets. This should make them + finish more quickly on machines with multiple processors. + Since test output is garbled when they are executed by parallel make, + tests now dump their output to foo.log files and foo.logsh files + (for test scripts). These logs are printed to the screen only + when a test fails or when all tests in the current directory have + completed successfully. + When tests pass, they will create a foo.chkexe file. + This prevents the test from executing again until the test or + main library changes. + All files generated by tests (*.chkexe, *.log, and any *.h5 files + created) can be removed by invoking 'make check-clean'. + Sequential and parallel library tests can now be invoked separately. + 'make check-s' will execute only sequential tests, and 'make check-p' + will execute only parallel tests. 'make check' will still execute + all tests. + JML - 2005/08/03 - On windows, all.zip is deprecated. users should read INSTALL_Windows.txt to know the details. Reasons to deprecate all.zip: - 1. Avoid confliction for windows programmers + 1. Avoid confliction for windows programmers 2. Decrease size of CVS tree by adding all.zip - 3. Avoid using winzip as the intermediate step + 3. Avoid using winzip as the intermediate step --KY 2005/04/22 - - When HDF5 is created as a shared library, it now uses libtool's - shared library versioning scheme. -JML 2005/04/18 - - HDF5 now uses automake 1.9.5 to generate Makefiles.in. - This has a number of effects on users: - The Fortran compiler should be set using the environment - variable $FC, not $F9X. F9X still works, but is depreciated. - The output of make may be different. This should be only a - cosmetic effect. - make depened (or make dep) is no longer recognized, since automake - handles dependency tracking. - Some new configure options exist. --enable-dependency-tracking - and --disable-dependency-tracking are used to control automake's - dependency tracking. Dependencies are on by default *on most - platforms and compilers*. If --enable-dependency-tracking is - used, they will be enabled on any platform. However, this can - slow down builds or even cause build errors in some cases. - Likewise, --disable-dependency-tracking can speed up builds and - avoid some build errors. - Some make targets have alternate names. make check-install and - make installcheck do the same thing, for instance. - pmake on IRIX can be invoked from the root directory, but the - -V flag must be used to invoke it in any subdirectory or it - will give an error about undefined variables. - JML 2005/01 - 2005/03 - - Hardware conversion between long double and integers is also added. - SLU 2005/02/10 - - Started to support software conversion between long double and - integers. Hardware conversion will come very soon. SLU - 2005/1/6 - - Intel v8.0 compiler would infinite loop when compiling some test - code with -O3 option. Changed enable-production default compiler - option to -O2. AKC - 2004/12/06 - - Long double is assumed to be a supported C data type. It is a - stanadard C89 type. AKC - 2004/10/22 - - The IA64 will use ecc as the C++ compiler by default. + - When HDF5 is created as a shared library, it now uses libtool's + shared library versioning scheme. -JML 2005/04/18 + - HDF5 now uses automake 1.9.5 to generate Makefiles.in. + This has a number of effects on users: + The Fortran compiler should be set using the environment + variable $FC, not $F9X. F9X still works, but is depreciated. + The output of make may be different. This should be only a + cosmetic effect. + make depened (or make dep) is no longer recognized, since automake + handles dependency tracking. + Some new configure options exist. --enable-dependency-tracking + and --disable-dependency-tracking are used to control automake's + dependency tracking. Dependencies are on by default *on most + platforms and compilers*. If --enable-dependency-tracking is + used, they will be enabled on any platform. However, this can + slow down builds or even cause build errors in some cases. + Likewise, --disable-dependency-tracking can speed up builds and + avoid some build errors. + Some make targets have alternate names. make check-install and + make installcheck do the same thing, for instance. + pmake on IRIX can be invoked from the root directory, but the + -V flag must be used to invoke it in any subdirectory or it + will give an error about undefined variables. + JML 2005/01 - 2005/03 + - Hardware conversion between long double and integers is also added. + SLU 2005/02/10 + - Started to support software conversion between long double and + integers. Hardware conversion will come very soon. SLU - 2005/1/6 + - Intel v8.0 compiler would infinite loop when compiling some test + code with -O3 option. Changed enable-production default compiler + option to -O2. AKC - 2004/12/06 + - Long double is assumed to be a supported C data type. It is a + stanadard C89 type. AKC - 2004/10/22 + - The IA64 will use ecc as the C++ compiler by default. - Added some initial support for making valgrind/Purify (or similar memory checking products) happier by initializing buffers to zero and disabling the internal free list code. To take advantage of this, use the "--enable-using-memchecker" configure option when building the library. QAK - 2004/07/23 - Fixed the long compile time of H5detect.c when v7.x Intel Compiler - is used with optimization NOT off. AKC - 2004/05/20 - - Fixed configure setting of C++ for OSF1 platform. AKC - 2004/01/06 + is used with optimization NOT off. AKC - 2004/05/20 + - Fixed configure setting of C++ for OSF1 platform. AKC - 2004/01/06 - Prefix default is changed from /usr/local to `pwd`/hdf5. AKC - 2003/07/09 @@ -273,7 +273,7 @@ New Features - Added H5Fget_intent to get the "intent" of a file (whether it was opened with read-write access or read-only. -JML 2006/8/23 - - Added Link Access Property Lists. They currently contain two + - Added Link Access Property Lists. They currently contain two properties, nlinks (H5Pget/set_nlinks) and elink_prefix (H5Pget/set_elink_prefix). nlinks controls how many soft and user-defined traversals are allowed before HDF5 assumes it has @@ -281,46 +281,46 @@ New Features The elink_prefix is a filesystem path that is prefixed to the names of any external link files opened using this LAPL. -JML 2006/8/23 - - Add H5L link APIs. Old APIs (H5Glink, H5Gmove, etc.) are still - supported but deprecated. - New APIs are: - H5Llink - create a link to an object given its ID - H5Lmove - just like H5Gmove2 - H5Lcopy - copy a link without copying the underlying object - H5Lcreate_hard - like H5Glink2 for hard links - H5Lcreate_soft - like H5Glink2 for soft links - H5Ldelete - just like H5Gunlink - H5Lget_val - just like H5Gget_linkval - H5Lget_info - gets link-specific info (like H5Gget_objinfo) - - In addition, H5Gcreate_anon, H5Tcommit_anon, and H5Dcreate_anon - no longer create links to objects; objects must be manually linked - using H5Llink or they will be deleted when the ID is closed. - - Link Creation Property Lists can be used to pass character - encoding (ASCII or UTF-8) for link names and to set the Intermediate - Group Creation Flag: - H5Pset_char_encoding, H5Pget_char_encoding - H5Pset_copy_object, H5Pget_copy_object - -JML 2006/7/5 - - Added managements of collective IO supports for chunking storage - inside parallel HDF5 - 1) Implemented One IO with collective mode for all chunks in the - application by building one MPI derived datatype accross all - chunks. - 2) Implemented the decision-making support to do collective IO inside - MPI-IO per chunk. - 3) Added the decision-making support to do one IO accross all chunks - or to do multiple IOs with each IO per chunk. - 4) Added the support to handle the case some processes won't do any IOs in - collectively. - 5) Some MPI-IO package(mpich 1.2.6 or lower, e.g.) cannot handle - collective IO correctly for the case when some processes have no - contributions to IOs, a special macro is added to change - collective IO mode to independent IO mode inside HDF5 library. - - Currently we find that MPICH at Linux and vender MPI-IO package at NCSA - Altix cannot handle this case. + - Add H5L link APIs. Old APIs (H5Glink, H5Gmove, etc.) are still + supported but deprecated. + New APIs are: + H5Llink - create a link to an object given its ID + H5Lmove - just like H5Gmove2 + H5Lcopy - copy a link without copying the underlying object + H5Lcreate_hard - like H5Glink2 for hard links + H5Lcreate_soft - like H5Glink2 for soft links + H5Ldelete - just like H5Gunlink + H5Lget_val - just like H5Gget_linkval + H5Lget_info - gets link-specific info (like H5Gget_objinfo) + + In addition, H5Gcreate_anon, H5Tcommit_anon, and H5Dcreate_anon + no longer create links to objects; objects must be manually linked + using H5Llink or they will be deleted when the ID is closed. + + Link Creation Property Lists can be used to pass character + encoding (ASCII or UTF-8) for link names and to set the Intermediate + Group Creation Flag: + H5Pset_char_encoding, H5Pget_char_encoding + H5Pset_copy_object, H5Pget_copy_object + -JML 2006/7/5 + - Added managements of collective IO supports for chunking storage + inside parallel HDF5 + 1) Implemented One IO with collective mode for all chunks in the + application by building one MPI derived datatype accross all + chunks. + 2) Implemented the decision-making support to do collective IO inside + MPI-IO per chunk. + 3) Added the decision-making support to do one IO accross all chunks + or to do multiple IOs with each IO per chunk. + 4) Added the support to handle the case some processes won't do any IOs in + collectively. + 5) Some MPI-IO package(mpich 1.2.6 or lower, e.g.) cannot handle + collective IO correctly for the case when some processes have no + contributions to IOs, a special macro is added to change + collective IO mode to independent IO mode inside HDF5 library. + + Currently we find that MPICH at Linux and vender MPI-IO package at NCSA + Altix cannot handle this case. "hdf5_mpi_special_collective_io_works=${hdf5_mpi_special_collective_io_works='no'}" has been added at the end of file <ia64-linux-gnui> and @@ -332,25 +332,25 @@ New Features support this. KY - 2006/02/16 - - Added character encoding to attribute creation property lists. + - Added character encoding to attribute creation property lists. JML - 2006/01/02 - - Added H5Gcopy() routine to copy objects between while keeping - data in compressed form. QAK - 2005/11/06 - - Added H5Sextent_equal() routine. QAK - 2005/11/06 - - Added HSYS_ERROR which retrieves the system error message and pushes - it to the error stack. This gives more information of the failed - system call. AKC - 2005/08/04 - - Added H5F_OBJ_LOCAL flag to H5Fget_obj_count() & H5Fget_obj_ids(), to - allow querying for objects in file that were opened with a particular - file ID, instead of all objects opened in file with any file ID. - QAK - 2005/06/01 - - Added H5T_CSET_UTF8 character set to mark datatypes that use the - UTF-8 Unicode character encoding. Added tests to ensure that - library handles UTF-8 object names, attributes, etc. -JL 2005/05/13 - - HDF5 supports collective MPI-IO for irregular selection with HDF5 - dataset. Irregular selection is when users use H5Sselect_hyperslab - more than once for the same dataset. - Currently, not all MPI-IO packages support complicated MPI derived + - Added H5Gcopy() routine to copy objects between while keeping + data in compressed form. QAK - 2005/11/06 + - Added H5Sextent_equal() routine. QAK - 2005/11/06 + - Added HSYS_ERROR which retrieves the system error message and pushes + it to the error stack. This gives more information of the failed + system call. AKC - 2005/08/04 + - Added H5F_OBJ_LOCAL flag to H5Fget_obj_count() & H5Fget_obj_ids(), to + allow querying for objects in file that were opened with a particular + file ID, instead of all objects opened in file with any file ID. + QAK - 2005/06/01 + - Added H5T_CSET_UTF8 character set to mark datatypes that use the + UTF-8 Unicode character encoding. Added tests to ensure that + library handles UTF-8 object names, attributes, etc. -JL 2005/05/13 + - HDF5 supports collective MPI-IO for irregular selection with HDF5 + dataset. Irregular selection is when users use H5Sselect_hyperslab + more than once for the same dataset. + Currently, not all MPI-IO packages support complicated MPI derived datatype used in the implementation of irregular selection INSIDE HDF5. 1) DEC 5.x is not supporting complicated derived datatype. @@ -377,7 +377,7 @@ New Features hdf5_mpi_complex_derived_datatype_works='no' should be added at the end of the config file ia64-linux-gnu. KY - 2005/09/12 - We also found not all MPI-IO packages support collective IO with one + We also found not all MPI-IO packages support collective IO with one or more processes to have no contributions to IO. For mpich version 1.2.6 or lower and all IRIX machine, if the library checks that there are no IO contributions for some @@ -386,30 +386,30 @@ New Features KY - 2006/05/04 - HDF5 N-bit filter - HDF5 support N-bit filter from this version, - The N-Bit filter is used effectively for compressing data of N-Bit - datatype as well as compound and array datatype with N-Bit fields. - KY - 2005/04/15 + HDF5 support N-bit filter from this version, + The N-Bit filter is used effectively for compressing data of N-Bit + datatype as well as compound and array datatype with N-Bit fields. + KY - 2005/04/15 - HDF5 scaleoffset filter - HDF5 supports scaleoffset filter for users to do data - compression through HDF5 library. - Scale-Offset compression performs a scale and/or offset operation - on each data value and truncates the resulting value to a minimum - number of bits and then stores the data. - Scaleoffset filter supports floating-point and integer datatype. - Please check the HDF5 reference manual for this. - KY - 2005/06/06 + HDF5 supports scaleoffset filter for users to do data + compression through HDF5 library. + Scale-Offset compression performs a scale and/or offset operation + on each data value and truncates the resulting value to a minimum + number of bits and then stores the data. + Scaleoffset filter supports floating-point and integer datatype. + Please check the HDF5 reference manual for this. + KY - 2005/06/06 - Retired SRB vfd (--with-srb). Functions H5Pset_fapl_srb and - H5Pget_fapl_srb were removed. EIP - 2005/04/07 - - Retired GASS vfd (--with-gass). Functions H5Pset_fapl_gass and - H5Pget_fapl_gass are removed too. AKC - 2005/3/3 + H5Pget_fapl_srb were removed. EIP - 2005/04/07 + - Retired GASS vfd (--with-gass). Functions H5Pset_fapl_gass and + H5Pget_fapl_gass are removed too. AKC - 2005/3/3 - Pablo was removed from the source code EIP - 2005/01/21 - Modified registration of SZIP to dynamically detect the presence or absence of the encoder. Changed configure and Makefiles, and tests to dynamically detect encoder. BEM - 2004/11/02 - - Added function H5Pget_data_transform, together with the previously - added H5Pset_data_transform, to support the data transform - feature. AKC - 2004/10/26 + - Added function H5Pget_data_transform, together with the previously + added H5Pset_data_transform, to support the data transform + feature. AKC - 2004/10/26 - Compound datatype has been enhanced with a new feature of size adjustment. The size can be increased and decreased(without cutting the last member) as long as it doesn't go down to zero. @@ -442,15 +442,15 @@ New Features - Added support for user defined identifier types. NF/JL - 2004/06/29 - A new API function H5Fget_filesize was added. It returns the actual file size of the opened file. SLU - 2004/06/24 - - New Feature of Data transformation is added. AKC - 2004/05/03. + - New Feature of Data transformation is added. AKC - 2004/05/03. - New exception handler for datatype conversion is put in to replace the old overflow callback function. This exception handler is set through H5Pset_type_conv_cb function. SLU - 2004/4/27 - Added option that if $HDF5_DISABLE_VERSION_CHECK is set to 2, - will suppress all library version mismatch warning messages. - AKC - 2004/4/14 - - A new type of dataspace, null dataspace(dataspace without any + will suppress all library version mismatch warning messages. + AKC - 2004/4/14 + - A new type of dataspace, null dataspace(dataspace without any element) was added. SLU - 2004/3/24 - Data type conversion(software) from integer to float was added. SLU - 2004/3/13 @@ -484,13 +484,13 @@ New Features Parallel Library: ----------------- - - Added mpich2 as a testing "platform" informally. AKC - 2005/9/28. - - A dataset created in serial mode with H5D_ALLOC_TIME_INCR allocation - setting was not extendible, either explicitly by H5Dextend or - implicitly by writing to unallocated chunks. Library now allocates - more space when needed or directed if the file is opened by parallel - mode, independent of what the dataset allocation mode is. - CC/AKC - 2005/08/29. + - Added mpich2 as a testing "platform" informally. AKC - 2005/9/28. + - A dataset created in serial mode with H5D_ALLOC_TIME_INCR allocation + setting was not extendible, either explicitly by H5Dextend or + implicitly by writing to unallocated chunks. Library now allocates + more space when needed or directed if the file is opened by parallel + mode, independent of what the dataset allocation mode is. + CC/AKC - 2005/08/29. - Allow compressed, chunked datasets to be read in parallel. QAK - 2004/10/04 - Add options of using atomicity and file-sync to test_mpio_1wMr. @@ -507,16 +507,16 @@ New Features - added new functions h5fget_name_f and h5fget_filesize_f EIP 2004/07/08 - h5dwrite/read_f and h5awrite/read_f functions only accept dims parameter - of the type INTEGER(HSIZE_T). + of the type INTEGER(HSIZE_T). - added support for native integers of 8 bytes (i.e. when special - compiler flag is specified to set native fortran integers to 8 bytes, - for example, -i8 flag for PGI and Absoft Fortran compilers, - -qintsize=8 flag for IBM xlf compiler). + compiler flag is specified to set native fortran integers to 8 bytes, + for example, -i8 flag for PGI and Absoft Fortran compilers, + -qintsize=8 flag for IBM xlf compiler). EIP 2005/06/20 - added support for "big" REAL and DOUBLE PRECISION types - (usually the size is specified by compilers flags like - -r8, -r16, etc.) - Known problem: multi file test fails when REAL is 16 bytes. + (usually the size is specified by compilers flags like + -r8, -r16, etc.) + Known problem: multi file test fails when REAL is 16 bytes. EIP 2005/09/8 C++ Library: @@ -539,41 +539,41 @@ New Features Tools: ------ - h5repack and h5diff changed command line parameter syntax to be - similar to h5dump, adding also long switch names. PVN - 2008/1/16 + similar to h5dump, adding also long switch names. PVN - 2008/1/16 - h5repack now supports adding multiple filters to all objects. - PVN - 2008/1/16 + PVN - 2008/1/16 - h5dump lists groups and attributes in requested orders (by name and - creation order, both ascending and descending). PVN - 2007/10/5 + creation order, both ascending and descending). PVN - 2007/10/5 - h5import imports string (text) data. PVN - 2007/10/5 - h52gif and gif2h5: Both these tools were revised to include the High - Level Image API support, and tests were added to /hl/tools/gif2h5. - PVN - 2007/04/13 + Level Image API support, and tests were added to /hl/tools/gif2h5. + PVN - 2007/04/13 - h5dump: added support for double long type H5T_NATIVE_LDOUBLE. PVN - 2007/03/13 + 2007/03/13 - h5dump: added support for binary output, see usage. PVN 2007/03/13 - h5repack: added support for the new nbit and scaleoffset filters. - PVN - 2007/05/07 + PVN - 2007/05/07 - h5repack: now uses the API function H5Ocopy (of the tool h5copy) to - recreate objects if there is not a user input for changes. PVN - - 2007/05/07 + recreate objects if there is not a user input for changes. PVN - + 2007/05/07 - h5repack: added support for reading and repacking by hyperslabs for - large files. PVN - 2007/03/01 + large files. PVN - 2007/03/01 - h5repack: a new option allows the copy using the file type (default) - instead of the previous conversion to native type. PVN - 2007/03/01 + instead of the previous conversion to native type. PVN - 2007/03/01 - h5repack: output the percentage of compression used. PVN - 2007/03/01 - h5diff: added support for -p option for unsigned long_long data. PVN - - 2007/02/26 + 2007/02/26 - h5diff: added support for comparing dataset regions. PVN - 2007/02/20 - h5diff: added support for reading and comparing by hyperslabs for large files. - PVN - 2007/02/20 + PVN - 2007/02/20 - h5diff: printing of dataset dimensions along with dataset name. PVN -2007/02/19 - h5dump now uses the new API function H5Rget_name to display the name - of the dataset referenced instead of its ID. PVN - 2007/02/19 + of the dataset referenced instead of its ID. PVN - 2007/02/19 - Added new tool, h5mkgrp. QAK - 2007/02/14 - Added new tool, h5copy. PVN - 2006/7/15 - - Removed obsolete pdb2hdf5 tool from tools/misc -JML 2005/10/24 - - Added build_h5perf_alone.sh that builds h5perf by standalone mode. - AKC - 2005/09/18. + - Removed obsolete pdb2hdf5 tool from tools/misc -JML 2005/10/24 + - Added build_h5perf_alone.sh that builds h5perf by standalone mode. + AKC - 2005/09/18. - Sped up h5dump on files with large numbers of objects. QAK - 2005/08/25 - Added a standalone mode for building h5perf. AKC - 2005/08/12 @@ -584,8 +584,8 @@ New Features available for h5dump and h5ls. RPM & QAK - 2004/02/01 - Added option --vfd= to h5ls to allow a VFL driver to be selected by a user. RPM & QAK - 2004/02/01 - - Added option -showconfig to compiler tools (h5cc,h5fc,h5c++). - AKC - 2004/01/08 + - Added option -showconfig to compiler tools (h5cc,h5fc,h5c++). + AKC - 2004/01/08 - Install the "h5cc" and "h5fc" tools as "h5pcc" and "h5pfc" respectively if library is built in parallel mode. WCW - 2003/11/04 @@ -601,7 +601,7 @@ New Features ------ - Fortran interfaces for the Image, Table and Lite APIs. PVN - 2007/5/1 - New HDF5 Dimension Scale API (H5DS) allows dimension scales to be - created in an HDF5 file and associated with specific datasets. PVN - 2007/5/1 + created in an HDF5 file and associated with specific datasets. PVN - 2007/5/1 - There are two new functions in the Lite library, H5LTtext_to_dtype and H5LTdtype_to_text. H5LTtext_to_dtype creates a HDF5 data type given a text description; H5LTdtype_to_text converts a data type @@ -628,19 +628,19 @@ New Features Support for new platforms, languages and compilers. ======================================= - Added support for Free-BSD on amd64 with GNU C and Fortran compilers - 4.2.1 + 4.2.1 EIP - 2007/06/25 - Added support for sequential and parallel libraries for Intel 64 Linux - cluster (abe.ncsa.uiuc.edu). Among three MPICH packages available on - this machine, only Open MPI works. The VMI has seg fault in hyperslab.c - and bittests.c tests. The MVAPICH2 complained about mpd not running - the parallel test. (see Known Problems section for more info) + cluster (abe.ncsa.uiuc.edu). Among three MPICH packages available on + this machine, only Open MPI works. The VMI has seg fault in hyperslab.c + and bittests.c tests. The MVAPICH2 complained about mpd not running + the parallel test. (see Known Problems section for more info) EIP - 2007/06/25 - Added support for HPUX11.23 for both 32 and 64-bit; HDF5 C++ - Added support for 64-bit Windows with Visual Studio .NET and 2005. SJW - 2007/06/25 - Added suport for HPUX11.23 for both 32 and 64-bit; HDF5 C++ - shared library is not supported with +DD64 flag. + shared library is not supported with +DD64 flag. EIP - 2006/06/22 - Added support for VAX floating numbers for Alpha Open VMS 7.3.2 EIP - 2006/05/05 @@ -746,9 +746,9 @@ Bug Fixes since HDF5-1.6.0 release - Fixed bug where unmounted files could cause the library to go into an infinite loop when shutting down. QAK - 2005/06/30 - The library didn't save the information of family driver in file. - The original file member size was lost after file was closed (see - bug #213). This has been fixed by saving driver name and member - file size in the superblock. SLU - 2005/6/24 + The original file member size was lost after file was closed (see + bug #213). This has been fixed by saving driver name and member + file size in the superblock. SLU - 2005/6/24 - Fixed bug with hyperslab selections that use selection offsets and operate on chunked datasets going into infinite loop or dumping core. QAK - 2005/06/17 @@ -762,20 +762,20 @@ Bug Fixes since HDF5-1.6.0 release particular file ID being closed, instead of operating on all open file IDs for a given file. QAK - 2005/06/01 - For family driver, the library didn't save member size in file. - When file is reopened, the size of 1st member file determine the - member size. Now member size is saved in file and is used to - define member file size. Wrong file access property of member size - will result in a failure. Using any other driver except family - will cause library to return error. So is multi driver. SLU - - 2005/05/24 + When file is reopened, the size of 1st member file determine the + member size. Now member size is saved in file and is used to + define member file size. Wrong file access property of member size + will result in a failure. Using any other driver except family + will cause library to return error. So is multi driver. SLU - + 2005/05/24 - Fixed error in opening object in group that was opened in mounted - file which has been unmounted. QAK - 2005/03/17 + file which has been unmounted. QAK - 2005/03/17 - Fixed a racing condition in MPIPOSIX virtual file drive close - function. Now all processes must completed the close before any - of them is returned. This prevents some "faster" processes start - accessing the file for another purpose (e.g., open with truncate) - while other "slower" processes have not closed the same file with - the previous purpose. AKC - 2005/03/01 + function. Now all processes must completed the close before any + of them is returned. This prevents some "faster" processes start + accessing the file for another purpose (e.g., open with truncate) + while other "slower" processes have not closed the same file with + the previous purpose. AKC - 2005/03/01 - H5Tget_member_value calls for enum datatype didn't return correct value if H5Tenum_valueof was called first. It's fixed. SLU - 2005/02/08 @@ -794,15 +794,15 @@ Bug Fixes since HDF5-1.6.0 release SLU - 2004/10/5 - Fixed address check in Core VFL driver to avoid spurious address/size overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 - - Fixed parallel bug in which some processes attempted collective - I/O while others did independent I/O. Bug appeared when some - processes used point selections, and others didn't. JRM - 2004/9/15 + - Fixed parallel bug in which some processes attempted collective + I/O while others did independent I/O. Bug appeared when some + processes used point selections, and others didn't. JRM - 2004/9/15 - Corrected error where dataset region references were written in an incorrect way on Cray machines. PVN & QAK - 2004/09/13 - The H5Tget_native_type now determines the native type for integers - based on the precision. This is to avoid cases of wrongly converting + based on the precision. This is to avoid cases of wrongly converting an int to a short in machines that have a short of 8 bytes but with - 32bit precision (e.g Cray SV1). PVN - 2004/09/07 + 32bit precision (e.g Cray SV1). PVN - 2004/09/07 - Changed H5Dread() to not overwrite data in an application's buffer with garbage when accessing a chunked dataset with an undefined fill value and an unwritten chunk is uncountered. QAK - 2004/08/25 @@ -852,10 +852,10 @@ Bug Fixes since HDF5-1.6.0 release too large (a value greater than could be represented in 32-bits) could cause the incorrect amount of space to be allocated in a file for the raw data for the dataset. QAK - 2004/06/01 - - Fixed dtypes "sw long double -> double" failure in QSC class + - Fixed dtypes "sw long double -> double" failure in QSC class machines. AKC - 2004/4/16 - Fixed problem with fletcher32 filter when converting data of different - endianess. PVN - 2004/03/10 + endianess. PVN - 2004/03/10 - Fixed problem with H5Tget_native_type() not handling opaque fields correctly. QAK - 2004/01/31 - Fixed several errors in B-tree deletion code which could cause a @@ -970,8 +970,8 @@ Bug Fixes since HDF5-1.6.0 release Configuration ------------- - - Configure can now use any tr command. No more need for - defining variable TR nor is it supported. -AKC 2006/05/19 + - Configure can now use any tr command. No more need for + defining variable TR nor is it supported. -AKC 2006/05/19 - Parallel I/O with the MPI-I/O driver will no longer work if the filesystem is not POSIX compliant. The "HDF5_MPI_1_METAWRITE" environment variable has been removed. QAK - 2004/01/30 @@ -991,27 +991,27 @@ Bug Fixes since HDF5-1.6.0 release Tools ----- - Fixed h5dump regarding the display of blocks in hyperslab - selections. PVN 2008/01/16 + selections. PVN 2008/01/16 - Fixed h5diff regarding the display of NaN (Not a Number) - values. PVN 2008/01/16 - - Fixed h5dump regarding the parsing of binary output parameters. - PVN 2008/01/16 - - Fixed memory problems in h52gif and gif2h5. PVN 2008/01/16 - - Fixed h5repack dealing with NULL references. PVN 2008/01/16 + values. PVN 2008/01/16 + - Fixed h5dump regarding the parsing of binary output parameters. + PVN 2008/01/16 + - Fixed memory problems in h52gif and gif2h5. PVN 2008/01/16 + - Fixed h5repack dealing with NULL references. PVN 2008/01/16 - Fixed h5dump & h5ls to display attributes in "name" order, rather - than the order they are encountered in the object header. - QAK - 2007/10/04 + than the order they are encountered in the object header. + QAK - 2007/10/04 - Fixed h5dump regarding the display of named datatypes - attributes. PVN 2007/03/13 + attributes. PVN 2007/03/13 - Fixed h5dump regarding the display of group comments. PVN - 2007/03/13 + 2007/03/13 - Fixed h5dump regarding the display of hardlinks pointing - to the root group. PVN 2007/03/13 + to the root group. PVN 2007/03/13 - Fixed h5diff percentage option -p. PVN 2007/03/05 - Fixed h5dump that caused array indices greater than 2 ^32-1 - not to be printed correctly - PVN 2007/2/19 + not to be printed correctly - PVN 2007/2/19 - Fixed h5dump to print attributes data in ASCII if -r option is used. - AKC - 2004/11/18 + AKC - 2004/11/18 - Fixed space utilization reported in h5ls to correct error in formula used. QAK - 2004/10/22 - Fixed h5redeploy which sometimes complain too many argument for the @@ -1077,7 +1077,7 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release Intel 9.1 (icc, ifort, icpc) Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, g95 (GCC 4.0.3) (smirom) PGI 6.2-5 (pgcc, pgf90, pgCC) - Intel 9.1 (icc, iort, icpc) + Intel 9.1 (icc, iort, icpc) Linux 2.6.5-7.252.1-rtgfx #1 SMP ia64 Intel(R) C++ Version 9.0 (cobalt) Intel(R) Fortran Itanium(R) Version 9.0 @@ -1092,23 +1092,23 @@ Platforms marked with * were not tested for hdf5-1.8.0-rc* release (linew) f90: Sun Fortran 95 8.2 CC: Sun C++ 5.8 Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre - (tungsten) gcc 3.2.2 20030222 + (tungsten) gcc 3.2.2 20030222 Intel(R) C++ Version 9.0 Intel(R) Fortran Compiler Version 9.0 IA-64 Linux 2.4.21.SuSE_292.til1 ia64 (NCSA tg-login) gcc 3.2.2 Intel(R) C++ Version 8.1 Intel(R) Fortran Compiler Version 8.1 - mpich-gm-1.2.5..10-intel-r2 + mpich-gm-1.2.5..10-intel-r2 Windows XP - Visual Studio .NET + Visual Studio .NET Visual Studio 2005 w/ Intel Fortran 9.1 Cygwin(native gcc compiler and g95) - MinGW(native gcc compiler and g95) + MinGW(native gcc compiler and g95) Windows XP x64 - Visual Studio 2005 w/ Intel Fortran 9.1 + Visual Studio 2005 w/ Intel Fortran 9.1 Windows Vista - Visual Studio 2005 + Visual Studio 2005 MAC OS 10.4 (Intel) gcc i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 G95 (GCC 4.0.3 (g95 0.91!) Nov 21 2006) @@ -1209,7 +1209,7 @@ Alpha OpenVMS 7.3.2 n n n y n (12) AMD Opteron x86_64 (13) ifort (14) Yes with C and Fortran, but not with C++ - (15) Using Visual Studio 2005 or Cygwin + (15) Using Visual Studio 2005 or Cygwin (16) Not tested for this release. Compiler versions for each platform are listed in the preceding "Platforms Tested" table. @@ -1420,13 +1420,13 @@ Known Problems ($* > $STDOUT_FILE) >& $STDERR_FILE - set RETURN_VALUE=$status + set RETURN_VALUE=$status cat $STDOUT_FILE tail +3 $STDERR_FILE - exit $RETURN_VALUE + exit $RETURN_VALUE You get the HDF make files and test scipts to execute your filter script by setting the environment variable "RUNSERIAL" to the full path of the @@ -2068,7 +2068,7 @@ Bug Fixes since HDF5-1.6.5 Release ------- - Fixed several bugs with writing fill values for datasets that have a variable-length datatype or component datatype. QAK - -2007/06/19 + 2007/06/19 - STDIO driver didn't support files bigger than 2GB because the OFFSET parameter of fseek is of type LONG INT, not big enough for big files. Use fseeko instead for big files if it's available on the @@ -2083,7 +2083,7 @@ Bug Fixes since HDF5-1.6.5 Release - Fixed potential file corruption bug which could overwrite a portion of an object's header when an attribute was renamed. If the new name for the attribute was longer than the old name, it was -possible + possible that the attribute would grow enough to overwrite another message in the object's header. QAK - 2007/01/02 - Fixed file corruption bug which could write an incorrect number of @@ -2108,11 +2108,11 @@ possible resembles the following, the object has been affected by this bug: #007: ../../hdf5_v1.6/src/H5C.c line 3887 in H5C_load_entry(): -unable to load entry + unable to load entry major(08): Meta data cache layer minor(40): Unable to load metadata into cache #008: ../../hdf5_v1.6/src/H5Ocache.c line 332 in H5O_load(): -corrupt object header - too few messages + corrupt object header - too few messages major(12): Object header layer minor(40): Unable to load metadata into cache @@ -2175,8 +2175,7 @@ corrupt object header - too few messages - Wrappers of H5Rcreate had incorrect prototypes. Added these overloaded functions: IdComponent::reference(void* ref, const char* name, -DataSpace& - dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) + DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) IdComponent::void reference(void* ref, const char* name) IdComponent::reference(void* ref, const H5std_string& name) and will remove these incorrect member functions: @@ -2621,62 +2620,62 @@ New Features ============ Configuration: ------------------------- - - Added yodconfigure, a configure tool, that patches up the configure - file to allow configure to launch executable via the proper - launching command like "yod -sz 1". AKC - 2005/11/10 - - Configure now recognizes the TR variable as the location of the - tr utility. JML 2005/10/20 + - Added yodconfigure, a configure tool, that patches up the configure + file to allow configure to launch executable via the proper + launching command like "yod -sz 1". AKC - 2005/11/10 + - Configure now recognizes the TR variable as the location of the + tr utility. JML 2005/10/20 Source code distribution: ------------------------- - - Added g95 as a testing "platform" informally. AKC - 2005/10/04. + - Added g95 as a testing "platform" informally. AKC - 2005/10/04. - Added MD5 checksumming to snapshot releases. Releases will now - produce an .md5 file as well as a .tar archive. md5sum can be - used to verify the arvhice with the .md5 checksum. -JL 2005/09/06 + produce an .md5 file as well as a .tar archive. md5sum can be + used to verify the arvhice with the .md5 checksum. -JL 2005/09/06 Library: -------- - Added HSYS_ERROR which retrieves the system error message and pushes - it to the error stack. This provides more information regarding the - failed system call. AKC - 2005/08/04 + it to the error stack. This provides more information regarding the + failed system call. AKC - 2005/08/04 - Added H5F_OBJ_LOCAL flag to H5Fget_obj_count() & H5Fget_obj_ids(), to - allow querying for objects in a file that was opened with a particular - file ID, instead of all objects opened in the file with any file ID. - QAK - 2005/06/01 + allow querying for objects in a file that was opened with a particular + file ID, instead of all objects opened in the file with any file ID. + QAK - 2005/06/01 Parallel Library: ----------------- - - Added mpich2 as a testing "platform" informally. AKC - 2005/10/04. - - HDF5 supports collective MPI-IO for irregular selection with HDF5 - dataset. Irregular selection is when users use API H5Sselect_hyperslab - more than once for the same dataset. - Currently, not all MPI-IO packages support the complicated - MPI derived datatypes used in the implementation of irregular - selections INSIDE HDF5. - 1) DEC 5.x wdoes not support complicated derived datatypes. - 2) For AIX 5.1: - If your poe version number is 3.2.0.20 or lower, - please edit powerpc-ibm-aix5.x in the directory hdf5/config/. - Find the line with - << hdf5_mpi_complex_derived_datatype_works >> - and UNCOMMENT this line before the configure. - check poe version with the following command: - lpp -l all | grep ppe.poe - 3) For Linux cluster,: - If mpich version is 1.2.5 or lower, collective irregular selection - IO is not supported; internally independent IO is used. - 4) For IRIX 6.5: - if C compiler version is 7.3 or lower, collective irregular - selection IO is not supported; internally independent IO is used. - 5) For platforms which internally used mpich: - If the mpich version is 1.2.5 or lower, please find the - corresponding config (in hdf5/config) file and add - hdf5_mpi_complex_derived_datatype_works='no' - at the end of the configuration file. For example, on the - NCSA SGI Altix, the internal mpich library is 1.2.5. So - hdf5_mpi_complex_derived_datatype_works='no' - should be added at the end of the config file ia64-linux-gnu. - KY - 2005/09/12 + - Added mpich2 as a testing "platform" informally. AKC - 2005/10/04. + - HDF5 supports collective MPI-IO for irregular selection with HDF5 + dataset. Irregular selection is when users use API H5Sselect_hyperslab + more than once for the same dataset. + Currently, not all MPI-IO packages support the complicated + MPI derived datatypes used in the implementation of irregular + selections INSIDE HDF5. + 1) DEC 5.x wdoes not support complicated derived datatypes. + 2) For AIX 5.1: + If your poe version number is 3.2.0.20 or lower, + please edit powerpc-ibm-aix5.x in the directory hdf5/config/. + Find the line with + << hdf5_mpi_complex_derived_datatype_works >> + and UNCOMMENT this line before the configure. + check poe version with the following command: + lpp -l all | grep ppe.poe + 3) For Linux cluster,: + If mpich version is 1.2.5 or lower, collective irregular selection + IO is not supported; internally independent IO is used. + 4) For IRIX 6.5: + if C compiler version is 7.3 or lower, collective irregular + selection IO is not supported; internally independent IO is used. + 5) For platforms which internally used mpich: + If the mpich version is 1.2.5 or lower, please find the + corresponding config (in hdf5/config) file and add + hdf5_mpi_complex_derived_datatype_works='no' + at the end of the configuration file. For example, on the + NCSA SGI Altix, the internal mpich library is 1.2.5. So + hdf5_mpi_complex_derived_datatype_works='no' + should be added at the end of the config file ia64-linux-gnu. + KY - 2005/09/12 Tools: ------ @@ -2691,24 +2690,24 @@ New Features C++ API: -------- - Added missing member functions: - H5::CompType::getMemberArrayType - H5::CompType::getMemberVarLenType - H5::AbstractDs::getArrayType - H5::AbstractDs::getVarLenType - H5::CommonFG::openArrayType - H5::CommonFG::openVarLenType - H5::PropList::copyProp -- this will replace the current - H5::PropList::copyProp in later releases due - to incorrect prototype. - BMR - 2005/07/27 + H5::CompType::getMemberArrayType + H5::CompType::getMemberVarLenType + H5::AbstractDs::getArrayType + H5::AbstractDs::getVarLenType + H5::CommonFG::openArrayType + H5::CommonFG::openVarLenType + H5::PropList::copyProp -- this will replace the current + H5::PropList::copyProp in later releases due + to incorrect prototype. + BMR - 2005/07/27 Support for New Platforms, Languages and Compilers ================================================== - - Added support for RedStorm platform (serial only.) AKC 2005/11/10 - - Added support for BG/L platform (serial only.) LA 2005/11/10 - - Added support for HPUX 11.23 (IA64); only C and C++ are supported - with the +DD64 flag + - Added support for RedStorm platform (serial only.) AKC 2005/11/10 + - Added support for BG/L platform (serial only.) LA 2005/11/10 + - Added support for HPUX 11.23 (IA64); only C and C++ are supported + with the +DD64 flag EIP 2005/10/05 @@ -2769,11 +2768,11 @@ Bug Fixes since HDF5-1.6.4 Release Configuration ------------- - - Configure can recognize -lmpich as a form of MPI library. -AKC- - 2005/9/28. - - Changed default C++ compiler for the IA64 platform from icc to - icpc which is the preferred compiler for Intel Compiler version - 8. AKC - 2005/09/02 + - Configure can recognize -lmpich as a form of MPI library. -AKC- + 2005/9/28. + - Changed default C++ compiler for the IA64 platform from icc to + icpc which is the preferred compiler for Intel Compiler version + 8. AKC - 2005/09/02 Performance ------------- @@ -2793,15 +2792,15 @@ Bug Fixes since HDF5-1.6.4 Release C++ API ------- - - Several member functions' prototype changed due to the - "int -> unsigned" change in the main library. They are: - H5::CompType::getMemberDataType(unsigned member_num) - H5::CompType::getMemberCompType(unsigned member_num) - H5::CompType::getMemberEnumType(unsigned member_num) - H5::CompType::getMemberIntType(unsigned member_num) - H5::CompType::getMemberFloatType(unsigned member_num) - H5::CompType::getMemberStrType(unsigned member_num) - BMR - 2005/07/27 + - Several member functions' prototype changed due to the + "int -> unsigned" change in the main library. They are: + H5::CompType::getMemberDataType(unsigned member_num) + H5::CompType::getMemberCompType(unsigned member_num) + H5::CompType::getMemberEnumType(unsigned member_num) + H5::CompType::getMemberIntType(unsigned member_num) + H5::CompType::getMemberFloatType(unsigned member_num) + H5::CompType::getMemberStrType(unsigned member_num) + BMR - 2005/07/27 @@ -2812,14 +2811,14 @@ Platforms Tested AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 xlf 8.1.1.3 - xlC 6.0.0.6 - mpcc_r 6.0.0.6 + xlC 6.0.0.6 + mpcc_r 6.0.0.6 mpxlf_r 8.1.1.3 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 AIX 5.2 (32/64 bit) xlc 6.0.0.8 xlC 6.0.0.9 xlf 8.1.1.7 @@ -2851,30 +2850,30 @@ Platforms Tested IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m F90 MIPSpro 7.3.1.3m (64 only) C++ MIPSpro cc 7.3.1.3m - mpt 1.6 + mpt 1.6 Linux 2.4.20-28.7 gcc 2.96 (eirene, verbena) gcc 3.3.2 PGI compilers (pgcc, pgf90, pgCC) version 5.2-1 Absoft Fortran compiler v9.0 - Intel(R) C++ 32-bit Version 8.1 - Intel(R) Fortran 32-bit Version 8.1 + Intel(R) C++ 32-bit Version 8.1 + Intel(R) Fortran 32-bit Version 8.1 MPIch 1.2.6 Linux 2.4.21-268-smp x86_64 gcc 3.3.1 (SuSE Linux, AMD) (mir) PGI 5.2-1 C and F90 (with k3-32) - Intel(R) C++ 32-bit Version 8.1 - Intel(R) Fortran 32-bit Version 8.1 + Intel(R) C++ 32-bit Version 8.1 + Intel(R) Fortran 32-bit Version 8.1 Linux 2.4.21-sgi306rp21 Altix SMP ia64 Intel(R) C++ Version 8.1 (cobalt) Intel(R) Fortran Itanium(R) Version 8.1 SGI MPI OSF1 V5.1 (QSC) Compaq C V6.5-011 HP Fortran V5.5A-3548 - Compaq C++ V6.5-036 - MPIX200_64_r13.4 + Compaq C++ V6.5-036 + MPIX200_64_r13.4 OSF1 V5.1 (PSC) Compaq C V6.5-303 HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 + Compaq C++ V6.5-040 SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 Sun WorkShop 6 update 2 C++ 5.3 @@ -2886,12 +2885,12 @@ Platforms Tested Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-13 Xeon Linux 2.4.21-32.0.1.ELsmp-perfctr-lustre - (tungsten) Intel(R) C++ Version 9.0 + (tungsten) Intel(R) C++ Version 9.0 Intel(R) Fortran Compiler Version 9.0 IA-64 Linux 2.4.21.SuSE_292.til1 ia64 (NCSA tg-login) Intel(R) C++ Version 8.0 Intel(R) Fortran Compiler Version 8.0 - mpich-gm-1.2.5..10-intel-r2 + mpich-gm-1.2.5..10-intel-r2 Windows XP MSVC++.NET MSVC++ 6.0 Intel 8.1 C++ @@ -2913,7 +2912,7 @@ Key: y = tested and supported Platform C F90 F90 C++ zlib SZIP parallel parallel -IBM BG/L (16) n n n n y y +IBM BG/L (16) n n n n y y Solaris2.8 64-bit y y y(1) y y y Solaris2.8 32-bit y y y(1) y y y Solaris2.9 64-bit y(1) y y(1) y y y @@ -2936,7 +2935,7 @@ FreeBSD 4.11 n n n y y y RedHat 7.3 W (3) y(1) y(11) n y y y RedHat 7.3 W Intel (3) n y n y y y RedHat 7.3 W PGI (3) n y n y y y -RedStorm (16) n y n y y n +RedStorm (16) n y n y y n SuSe x86_64 gcc (3,13) n y(12) n y y y SuSe x86_64 icc (3,13) n y(14) n y y y Linux 2.4 Xeon C Lustre Intel (3,6) n y n y y y @@ -2946,7 +2945,7 @@ Linux 2.4 SGI Altix ia64 Intel (3) y y y y y y Platform Shared static- Thread- STREAM- libraries(4) exec safe VFD -IBM BG/L n y n n +IBM BG/L n y n n Solaris2.8 64-bit y x y y Solaris2.8 32-bit y x y y Solaris2.9 64-bit y x y y @@ -2968,7 +2967,7 @@ FreeBSD 4.11 y y y y RedHat 7.3 W (3) y y y y RedHat 7.3 W Intel (3) n y n y RedHat 7.3 W PGI (3) n y n y -RedStorm n y n y +RedStorm n y n y SuSe x86_64 gcc (3,13) n y n y SuSe x86_64 icc (3,13) y y(15) n y Linux 2.4 Xeon C Lustre Intel (3,6) y y n y @@ -3262,7 +3261,7 @@ New Features Tools: ------ - - New tool, h5jam. See HDF5 Reference Manual. 2004/10/08 + - New tool, h5jam. See HDF5 Reference Manual. 2004/10/08 F90 API: -------- @@ -3270,9 +3269,9 @@ New Features C++ API: -------- - - Started using C library's reference counting in place of the class - RefCounter, which existed before the C mechanism was available. - As a result, RefCounter has been removed. 2005/03/12 BMR + - Started using C library's reference counting in place of the class + RefCounter, which existed before the C mechanism was available. + As a result, RefCounter has been removed. 2005/03/12 BMR Support for new platforms, languages and compilers. @@ -3280,7 +3279,7 @@ Support for new platforms, languages and compilers. Configuration ------------- - - Upgraded from GNU autoconf 2.53 to autoconf 2.59. JML - 2005/01/31 + - Upgraded from GNU autoconf 2.53 to autoconf 2.59. JML - 2005/01/31 Bug Fixes since HDF5-1.6.3 release @@ -3289,54 +3288,54 @@ Bug Fixes since HDF5-1.6.3 release Library ------- - Fixed a racing condition in MPIPOSIX virtual file drive close - function. Now all processes must completed the close before any - of them is returned. This prevents some "faster" processes start - accessing the file for another purpose (e.g., open with truncate) - while other "slower" processes have not closed the same file with - the previous purpose. AKC - 2005/03/01 - - H5Tget_member_value calls for enum datatype didn't return correct - value if H5Tenum_valueof was called first. It's fixed. SLU - - 2005/02/08 + function. Now all processes must completed the close before any + of them is returned. This prevents some "faster" processes start + accessing the file for another purpose (e.g., open with truncate) + while other "slower" processes have not closed the same file with + the previous purpose. AKC - 2005/03/01 + - H5Tget_member_value calls for enum datatype didn't return correct + value if H5Tenum_valueof was called first. It's fixed. SLU - + 2005/02/08 - For variable-length string, H5Tget_class returned H5T_STRING as its - class. But H5Tdetect_class and H5Tget_member_class considered it - as H5T_VLEN. This is fixed to let all these 3 functions treat it - as H5T_STRING. SLU - 2005/02/08 + class. But H5Tdetect_class and H5Tget_member_class considered it + as H5T_VLEN. This is fixed to let all these 3 functions treat it + as H5T_STRING. SLU - 2005/02/08 - The byte order of all 1-byte integer types was fixed as - little-endian even on a big-endian machine. It's corrected. - SLU - 2005/02/07 + little-endian even on a big-endian machine. It's corrected. + SLU - 2005/02/07 - Fixed segmentation fault when calling H5Fflush with an attribute that - hasn't had a value written to it open. QAK - 2004/10/18 + hasn't had a value written to it open. QAK - 2004/10/18 - Backed out support for bitfield and time types in H5Tget_native_type. - Leave it to future support. The function simply returns error - message of "not support" for bitfield and time types. SLU - 2004/10/5 + Leave it to future support. The function simply returns error + message of "not support" for bitfield and time types. SLU - 2004/10/5 - Fixed address check in Core VFL driver to avoid spurious address/size - overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 + overflows for odd valued addresses and/or sizes. QAK - 2004/09/27 - Fixed problem where chunked datasets were not able to be deleted - from a file under certain circumstances. QAK - 2004/09/27/ + from a file under certain circumstances. QAK - 2004/09/27/ Configuration ------------- - - IRIX64 MIPSpro compiler of 7.4.x supports C99 features. Default - to use the 'c99' compiler if available. AKC - 2004/12/13 - - Intel v8.0 compiler would infinite loop when compiling some test - code with -O3 option. Changed enable-production default compiler - option to -O2. AKC - 2004/12/06 - - Long double is assumed to be a supported C data type. It is a - standard C89 type. AKC - 2004/10/22 + - IRIX64 MIPSpro compiler of 7.4.x supports C99 features. Default + to use the 'c99' compiler if available. AKC - 2004/12/13 + - Intel v8.0 compiler would infinite loop when compiling some test + code with -O3 option. Changed enable-production default compiler + option to -O2. AKC - 2004/12/06 + - Long double is assumed to be a supported C data type. It is a + standard C89 type. AKC - 2004/10/22 Performance ------------- - Many changes were made to the library to improve performance, - especially for the variable-length datatypes and metadata cache. + Many changes were made to the library to improve performance, + especially for the variable-length datatypes and metadata cache. Tools ----- - h5fc and h5c++ work correctly when -c compiler flag - is used. EIP - 2005/03/14 - - Fixed h5dump to print attributes data in ASCII if -r option is used. - AKC - 2004/11/18 + is used. EIP - 2005/03/14 + - Fixed h5dump to print attributes data in ASCII if -r option is used. + AKC - 2004/11/18 - Fixed space utilization reported in h5ls to correct error - in formula used. QAK - 2004/10/22 + in formula used. QAK - 2004/10/22 Documentation ------------- @@ -3375,14 +3374,14 @@ Platforms Tested AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 xlf 8.1.1.3 - xlC 6.0.0.6 - mpcc_r 6.0.0.6 + xlC 6.0.0.6 + mpcc_r 6.0.0.6 mpxlf_r 8.1.1.3 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 AIX 5.2 (32/64 bit) xlc 6.0.0.8 xlC 6.0.0.9 xlf 8.1.1.7 @@ -3410,31 +3409,31 @@ Platforms Tested IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m F90 MIPSpro 7.3.1.3m (64 only) C++ MIPSpro cc 7.3.1.3m - mpt 1.6 + mpt 1.6 Linux 2.4.20-28.7 gcc 2.96 (eirene, verbena) gcc 3.3.2 PGI compilers (pgcc, pgf90, pgCC) version 5.2-1 Absoft Fortran compiler v9.0 - Intel(R) C++ 32-bit Version 8.1 - Intel(R) Fortran 32-bit Version 8.1 + Intel(R) C++ 32-bit Version 8.1 + Intel(R) Fortran 32-bit Version 8.1 MPIch 1.2.6 Linux 2.4.21-268-smp x86_64 gcc 3.3.1 (SuSE Linux, AMD) (mir) PGI 5.2-1 C and F90 (with k3-32) - Intel(R) C++ 32-bit Version 8.1 - Intel(R) Fortran 32-bit Version 8.1 + Intel(R) C++ 32-bit Version 8.1 + Intel(R) Fortran 32-bit Version 8.1 Linux 2.4.21-sgi303r2 Altix SMP ia64 Intel(R) C++ Version 8.1 (cobalt) Intel(R) Fortran Itanium(R) Version 8.1 SGI MPI OSF1 V5.1 (QSC) Compaq C V6.5-011 HP Fortran V5.5A-3548 - Compaq C++ V6.5-036 - MPIX200_64_r13.4 + Compaq C++ V6.5-036 + MPIX200_64_r13.4 OSF1 V5.1 (PSC) Compaq C V6.5-303 HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 - MPIX200_64_r13.4 + Compaq C++ V6.5-040 + MPIX200_64_r13.4 FORTRAN 90 2.0 Patch 107356-04 SunOS 5.8 32,46 Sun WorkShop 6 update 2 C 5.3 (Solaris 2.8) Sun WorkShop 6 update 2 Fortran 90 @@ -3445,12 +3444,12 @@ Platforms Tested TFLOPS r1.0.4 v4.5.2 i386 pgcc Rel 3.1-4i with mpich-1.2.4 with local modifications Xeon Linux 2.4.20-31.9smp_perfctr_lustre - (tungsten) Intel(R) C++ Version 8.0 + (tungsten) Intel(R) C++ Version 8.0 Intel(R) Fortran Compiler Version 8.0 IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 (NCSA tg-login) Intel(R) C++ Version 8.0 Intel(R) Fortran Compiler Version 8.0 - mpich-gm-1.2.5..intel + mpich-gm-1.2.5..intel Windows XP MSVC++.NET MSVC++ 6.0 Compaq Visual Fortran 6.6C @@ -3796,33 +3795,33 @@ New Features INSTALL_Windows_Short.txt for details. - On Windows, h5repack,h5diff,h5ls and h5import tool tests have been added. - KY - 2004/9/16 + KY - 2004/9/16 Library: -------- - Modified the way how HDF5 calculates 'pixels_per_scanline' parameter for - SZIP compression. Now there is no restriction on the size and shape of the - chunk except that the total number of elements in the chunk cannot be - bigger than 'pixels_per_block' parameter provided by the user. + SZIP compression. Now there is no restriction on the size and shape of the + chunk except that the total number of elements in the chunk cannot be + bigger than 'pixels_per_block' parameter provided by the user. EIP - 2004/07/21 - HDF5 can now link to SZIP with or without szip's encoder. - The new API function H5Zget_filter_info can be used to check - szip's status. Attempting to assign szip to a dataset property - list or attempting to write with szip will generate an error if - szip's encoder is disabled. JL/NF - 2004/6/30 + The new API function H5Zget_filter_info can be used to check + szip's status. Attempting to assign szip to a dataset property + list or attempting to write with szip will generate an error if + szip's encoder is disabled. JL/NF - 2004/6/30 - SZIP always uses K13 compression. This flag no longer needs to - be set when calling H5Pset_szip. If the flag for CHIP - compression is set, it will be ignored (since the two are mutually - exclusive). JL/NF - 2004/6/30 + be set when calling H5Pset_szip. If the flag for CHIP + compression is set, it will be ignored (since the two are mutually + exclusive). JL/NF - 2004/6/30 - A new API function H5Fget_name was added. It returns the name - of the file by object(file, group, data set, named data type, - attribute) ID. SLU - 2004/06/29 + of the file by object(file, group, data set, named data type, + attribute) ID. SLU - 2004/06/29 - A new API function H5Fget_filesize was added. It returns the - actual file size of the opened file. SLU - 2004/06/24 - - Added option that if $HDF5_DISABLE_VERSION_CHECK is set to 2, - will suppress all library version mismatch warning messages. - AKC - 2004/4/14 + actual file size of the opened file. SLU - 2004/06/24 + - Added option that if $HDF5_DISABLE_VERSION_CHECK is set to 2, + will suppress all library version mismatch warning messages. + AKC - 2004/4/14 Parallel Library: ----------------- @@ -3830,19 +3829,19 @@ New Features Tools: ------ - h5repack was added to the tools suite. h5repack regenerates an HDF5 file - from another HDF5 file, optionally applying HDF5 filters (compression) - and/or chunking to the copied file. The filters options are read from - the command line. See /doc/html/Tools.html for more details. - PVN - 2004/9/13 + from another HDF5 file, optionally applying HDF5 filters (compression) + and/or chunking to the copied file. The filters options are read from + the command line. See /doc/html/Tools.html for more details. + PVN - 2004/9/13 - h5dump includes new features: - 1) Printing of dataset filters, storage layout and fill value information. - 2) Print a list of the file contents. - 3) Escape non printing characters. - 4) Print the content of the boot block. - 5) Print array indices with the data (the default). - These options are all switch controlled. See /doc/html/Tools.html for more details. - PVN - 2004/9/13 + 1) Printing of dataset filters, storage layout and fill value information. + 2) Print a list of the file contents. + 3) Escape non printing characters. + 4) Print the content of the boot block. + 5) Print array indices with the data (the default). + These options are all switch controlled. See /doc/html/Tools.html for more details. + PVN - 2004/9/13 F90 API: @@ -3859,12 +3858,12 @@ New Features C++ API: -------- - - Added wrappers for array and variable length datatypes APIs - - Added wrappers for newly added APIs from H5T, H5F, and H5I - - Added many wrappers that were missing from the H5P API - - Added the ability to reference HDF5 objects to these classes: - DataSet, DataType, Group, and H5File (wrappers for H5R APIs) - BMR 2004/08/04 + - Added wrappers for array and variable length datatypes APIs + - Added wrappers for newly added APIs from H5T, H5F, and H5I + - Added many wrappers that were missing from the H5P API + - Added the ability to reference HDF5 objects to these classes: + DataSet, DataType, Group, and H5File (wrappers for H5R APIs) + BMR 2004/08/04 Support for new platforms, languages and compilers. @@ -3874,12 +3873,12 @@ Support for new platforms, languages and compilers. - Absoft compiler f95 v9.0 is supported on Linux 2.4 32bit EIP - 2004/07/29 - HDF5 Fortran APIs are supported on Mac OSX with IBM XL Fortran - compiler version 8.1. This is a default compiler. + compiler version 8.1. This is a default compiler. - HDF5 Fortran APIs are supported on MAC OSX with Absoft F95 compiler - version 8.2; set F9X environment variable to f95, for example - setenv F9X f95 - Use --disable-shared --enable-static configure flags when Absoft - compiler is used. + version 8.2; set F9X environment variable to f95, for example + setenv F9X f95 + Use --disable-shared --enable-static configure flags when Absoft + compiler is used. EIP - 2004/07/27 Bug Fixes since HDF5-1.6.2 release @@ -3887,72 +3886,72 @@ Bug Fixes since HDF5-1.6.2 release Library ------- - - Fixed parallel bug in which some processes attempted collective - I/O while others did independent I/O. Bug appeared when some - processes used point selections, and others didn't. JRM - 2004/9/15 + - Fixed parallel bug in which some processes attempted collective + I/O while others did independent I/O. Bug appeared when some + processes used point selections, and others didn't. JRM - 2004/9/15 - Corrected error where dataset region references were written in an - incorrect way on Cray machines. PVN & QAK - 2004/09/13 + incorrect way on Cray machines. PVN & QAK - 2004/09/13 - The H5Tget_native_type now determines the native type for integers - based on the precision. This is to avoid cases of wrongly converting - an int to a short in machines that have a short of 8 bytes but with - 32bit precision (e.g Cray SV1). PVN - 2004/09/07 + based on the precision. This is to avoid cases of wrongly converting + an int to a short in machines that have a short of 8 bytes but with + 32bit precision (e.g Cray SV1). PVN - 2004/09/07 - Changed H5Dread() to not overwrite data in an application's buffer - with garbage when accessing a chunked dataset with an undefined fill - value and an unwritten chunk is uncountered. QAK - 2004/08/25 + with garbage when accessing a chunked dataset with an undefined fill + value and an unwritten chunk is uncountered. QAK - 2004/08/25 - Fixed error which could cause a core dump when a type conversion - routine was registered after a compound datatype had been - converted and then an equivalent compound datatype was converted - again. QAK - 2004/08/07 + routine was registered after a compound datatype had been + converted and then an equivalent compound datatype was converted + again. QAK - 2004/08/07 - Fixed memory overwrite when encoding "multi" file driver information - for file's superblock. QAK - 2004/08/05 + for file's superblock. QAK - 2004/08/05 - Fixed obscure bug where a filter which failed during chunk allocation - could allow library to write uncompressed data to disk but think - the data was compressed. QAK - 2004/07/29 + could allow library to write uncompressed data to disk but think + the data was compressed. QAK - 2004/07/29 - Fixed bug where I/O to an extendible chunked dataset with zero-sized - dimensions would cause library to fail an assertion. - QAK - 2004/07/27 + dimensions would cause library to fail an assertion. + QAK - 2004/07/27 - Fixed bug where chunked datasets which have filters defined, - allocation time set to "late" and whose chunks don't align with - the dataspace bounds could have incorrect data stored when - overwriting the entire dataset on the first write. QAK - 2004/07/27 + allocation time set to "late" and whose chunks don't align with + the dataspace bounds could have incorrect data stored when + overwriting the entire dataset on the first write. QAK - 2004/07/27 - Added check to ensure that dataspaces have extents set. JML-2004/07/26 - Fixed bug on some Solaris systems where HDF5 would try to use - gettimeofday() when that function didn't work properly. - JML - 2004/07/23 + gettimeofday() when that function didn't work properly. + JML - 2004/07/23 - Fixed bug in H5Sset_extent_simple where setting maximum size to - non-zero, then to zero would cause an error. JML - 2004/07/20 + non-zero, then to zero would cause an error. JML - 2004/07/20 - Allow NULL pointer for buffer parameter to H5Dread & H5Dwrite - when not writing data ("none" selection or hyperslab or point - selection with no elements defined). QAK - 2004/07/20 + when not writing data ("none" selection or hyperslab or point + selection with no elements defined). QAK - 2004/07/20 - Calling H5Gcreate() on "/" or "." throws an error instead of - failing quietly. JML - 2004/07/19 + failing quietly. JML - 2004/07/19 - Fixed bug where setting file address size to be very small could - trigger an assert if the file grew to more than 64 KB. Now throws - an error and data can be recovered. JL/NF - 2004/07/14 + trigger an assert if the file grew to more than 64 KB. Now throws + an error and data can be recovered. JL/NF - 2004/07/14 - Fixed bug where "resurrecting" a dataset was failing. - QAK - 2004/07/14 + QAK - 2004/07/14 - Fixed bug where incorrect data could be read from a chunked dataset - after it was extended. QAK - 2004/07/12 + after it was extended. QAK - 2004/07/12 - After compound datatype with variable-length string in the fields - is committed to file, the size is messed up when it's read back. - Fixed. SLU - 2004/06/11 + is committed to file, the size is messed up when it's read back. + Fixed. SLU - 2004/06/11 - Fixed potential file corruption bug when a block of metadata could - overlap the end of the internal metadata accumulator buffer and - the buffer would be extended correctly, but would incorrectly - change it's starting address. QAK - 2004/06/09 + overlap the end of the internal metadata accumulator buffer and + the buffer would be extended correctly, but would incorrectly + change it's starting address. QAK - 2004/06/09 - Opaque datatype with no tag failed for some operations. Fixed. - SLU - 2004/6/3 + SLU - 2004/6/3 - Fixed potential file corruption bug where dimensions that were - too large (a value greater than could be represented in 32-bits) - could cause the incorrect amount of space to be allocated in a - file for the raw data for the dataset. QAK - 2004/06/01 - - Fixed dtypes "sw long double -> double" failure in QSC class - machines. AKC - 2004/4/16 + too large (a value greater than could be represented in 32-bits) + could cause the incorrect amount of space to be allocated in a + file for the raw data for the dataset. QAK - 2004/06/01 + - Fixed dtypes "sw long double -> double" failure in QSC class + machines. AKC - 2004/4/16 Configuration ------------- - Fixed the long compile time of H5detect.c when v7.x Intel Compiler - is used with optimization NOT off. AKC - 2004/05/20 + is used with optimization NOT off. AKC - 2004/05/20 Performance ------------- @@ -3960,82 +3959,81 @@ Bug Fixes since HDF5-1.6.2 release Tools ----- - On SGI h5dump displayed only part of the data due to the bug - in the system printf; fixed. + in the system printf; fixed. EIP - 2004/09/21 Documentation ------------- - Several descriptive errors have been fixed throughout the - documentation, particularly in the reference manual (RM). - A selection particularly worthy of note would be these: + documentation, particularly in the reference manual (RM). + A selection particularly worthy of note would be these: - The H5Pset_szip description in the RM has been expanded and - corrected to facilitate use of SZIP compression. + corrected to facilitate use of SZIP compression. - A note has been added to the H5Dcreate description that an - unexplained failure is likely to be due to a property list error - that is detected only at the time of dataset creation. - - - FMB - 2004/09/21 + unexplained failure is likely to be due to a property list error + that is detected only at the time of dataset creation. + FMB - 2004/09/21 F90 API ------- - - Fortran functions h5dwrite/read_f and h5awrite/read_f do not - accept dims parameter of INTEGER type anymore. Code was removed. + - Fortran functions h5dwrite/read_f and h5awrite/read_f do not + accept dims parameter of INTEGER type anymore. Code was removed. 2004/04/15 + C++ API ------- - - H5::Exception's and its subclasses' constructors that were - overloaded to take char pointers are removed and constructors - that passed in reference of 'string' are changed to pass - by value. In addition, the default value of the data member - H5::Exception::detailMessage is changed from 0/NULL to - DEFAULT_MSG ("No detailed information provided".) - - Prototype for DSetCreatPropList::setLayout is changed: 1st parameter - is removed because it was there only by mistake. - BMR 2004/08/04 + - H5::Exception's and its subclasses' constructors that were + overloaded to take char pointers are removed and constructors + that passed in reference of 'string' are changed to pass + by value. In addition, the default value of the data member + H5::Exception::detailMessage is changed from 0/NULL to + DEFAULT_MSG ("No detailed information provided".) + - Prototype for DSetCreatPropList::setLayout is changed: 1st parameter + is removed because it was there only by mistake. + BMR 2004/08/04 Documentation ============= HDF5 Library documentation -------------------------- - HDF5 C++ API Reference Manual - This document has been added to the HDF5 document set. - The predecessor document, "HDF5 C++ Interfaces," has been removed. + This document has been added to the HDF5 document set. + The predecessor document, "HDF5 C++ Interfaces," has been removed. - HDF5 C++ API Design Specification - A first draft of this document has been added to the HDF5 document - set. The draft has been posted on the HDF5 website and a link - has been added to the HDF5 documents index (index.html at the top - level of the document set). + A first draft of this document has been added to the HDF5 document + set. The draft has been posted on the HDF5 website and a link + has been added to the HDF5 documents index (index.html at the top + level of the document set). - Parallel HDF5 - In prior releases, the HDF5 document set included two parallel - HDF5 documents. Those documents have been deleted and the - HDF5 documents index (index.html) now links to a "Parallel HDF5" - page on the HDF5 website (http://hdf.ncsa.uiuc.edu/HDF5/PHDF5/). + In prior releases, the HDF5 document set included two parallel + HDF5 documents. Those documents have been deleted and the + HDF5 documents index (index.html) now links to a "Parallel HDF5" + page on the HDF5 website (http://hdf.ncsa.uiuc.edu/HDF5/PHDF5/). - HDF5 High Level APIs - Links to the HDF5 High Level APIs and to the HDF5 High Level - Reference Manual have been added to the HDF5 documents index - (index.html). + Links to the HDF5 High Level APIs and to the HDF5 High Level + Reference Manual have been added to the HDF5 documents index + (index.html). - HDF5 Reference Manual - Tools: h5repack -- A description of the new h5repack tool has been + Tools: h5repack -- A description of the new h5repack tool has been added to the Tools page. - Tools: h5dump -- Several new options have been added to h5dump. - New functions -- All new functions have been added to the RM. - API changes -- Relevant function descriptions have been updated in + Tools: h5dump -- Several new options have been added to h5dump. + New functions -- All new functions have been added to the RM. + API changes -- Relevant function descriptions have been updated in instances where programming interfaces have changed. - FMB - 2004/09/21 + FMB - 2004/09/21 Windows installation documentation ---------------------------------- - INSTALL_Windows.txt has been enhanced to include instructions building - HDF5 with FORTRAN and C++. + HDF5 with FORTRAN and C++. - Two optional installation documents have been added. They are - INSTALL_Windows_Short.txt and INSTALL_Windows_From_Command_Line.txt. - INSTALL_Windows_Short.txt is supposed to help general users who - only want to build,test and install HDF5 in a quick way. - INSTALL_Windows_From_Command_Line.txt is supposed to help users who - would like to compile,test and install HDF5 in command line environment. + INSTALL_Windows_Short.txt and INSTALL_Windows_From_Command_Line.txt. + INSTALL_Windows_Short.txt is supposed to help general users who + only want to build,test and install HDF5 in a quick way. + INSTALL_Windows_From_Command_Line.txt is supposed to help users who + would like to compile,test and install HDF5 in command line environment. - INSTALL_Windows_withcpp.txt and INSTALL_Windows_withF90.txt became - obsolete. Files are deleted from the release_docs directory. - KY 2004/09/16, EIP 2004/9/21 + obsolete. Files are deleted from the release_docs directory. + KY 2004/09/16, EIP 2004/9/21 @@ -4044,14 +4042,14 @@ Platforms Tested AIX 5.1 (32 and 64-bit) xlc 6.0.0.6 xlf 8.1.1.3 - xlC 6.0.0.6 - mpcc_r 6.0.0.6 + xlC 6.0.0.6 + mpcc_r 6.0.0.6 mpxlf_r 8.1.1.3 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 AIX 5.2 xlc 6.0.0.8 xlC 6.0.0.8 xlf 8.1.1.6 @@ -4072,7 +4070,7 @@ Platforms Tested IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1.3m F90 MIPSpro 7.3.1.3m (64 only) C++ MIPSpro cc 7.3.1.3m - mpt 1.6 + mpt 1.6 Linux 2.4.18 gcc 2.96, 3.3.2 g++ 3.3.2 Intel(R) C++ Version 7.1 @@ -4085,10 +4083,10 @@ Platforms Tested MPIch 1.2.4 Linux 2.4.21-2.9.5ws #3 gcc 3.2.3 (Red Hat Linux 3.2.3-16) SMP x86_64 g++ 3.2.3 - Linux 2.4.21-4.ELsmp Intel(R) C++ 32-bit Version 8.0 - Intel(R) Fortran 32-bit Version 8.0 - gcc 3.4.0 - MPICH 1..5.2 Inmel 8.0 + Linux 2.4.21-4.ELsmp Intel(R) C++ 32-bit Version 8.0 + Intel(R) Fortran 32-bit Version 8.0 + gcc 3.4.0 + MPICH 1..5.2 Inmel 8.0 Linux 2.4.19-SMP x86_64 gcc (GCC) 3.2.2 (SuSE Linux) g++ 3.2.2 Linux 2.6.4-52smp x86_64 gcc 3.3.3 (SuSE Linux 9.1 AMD64)) @@ -4100,8 +4098,8 @@ Platforms Tested SGI MPI OSF1 V5.1 Compaq C V6.5-303 HP Fortran V5.5A-3548 - Compaq C++ V6.5-040 - MPI_64bit_R13 + Compaq C++ V6.5-040 + MPI_64bit_R13 SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 WorkShop Compilers 5.0 98/10/25 @@ -4116,7 +4114,7 @@ Platforms Tested Intel(R) Fortran Compiler Version 7.0 Xeon Linux 2.4.20-31.9smp_perfctr_lustre - Intel(R) C++ Version 8.0 + Intel(R) C++ Version 8.0 Intel(R) Fortran Compiler Version 8.0 IA-64 Linux 2.4.16 ia64 gcc version 3.0.4 @@ -4126,13 +4124,13 @@ Platforms Tested IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 Intel(R) C++ Version 8.0 Intel(R) Fortran Compiler Version 8.0 - mpich-gm-1.2.5..intel + mpich-gm-1.2.5..intel Windows 2000 (NT5.0) MSVC++ 6.0 MSVC++ .NET DEC Visual Fortran 6.0 Intel C and F90 compilers version 7.1 - Code Warrior 8.0 + Code Warrior 8.0 Windows XP MSVC++.NET MSVC++ 6.0 DEC Visual Fortran 6.0 @@ -4435,31 +4433,31 @@ New Features Configuration: -------------- - Default of $prefix is changed to $PWD/hdf5 so that multiple - builds using --srcdir is possible in the same machine. - AKC - 2003/12/1 + builds using --srcdir is possible in the same machine. + AKC - 2003/12/1 Library: -------- - Added H5Iget_ref, H5Iinc_ref and H5Idec_ref routines to the C - library and the FORTRAN wrapper. See the reference manual for a - full description of these new routines. QAK - 2003/12/11 + library and the FORTRAN wrapper. See the reference manual for a + full description of these new routines. QAK - 2003/12/11 Parallel Library: ----------------- - - The parallel tests in testpar/ now provides different levels of - verbosity via the '-v' option. The default is less verbose - than before. AKC - 2004/01/23 + - The parallel tests in testpar/ now provides different levels of + verbosity via the '-v' option. The default is less verbose + than before. AKC - 2004/01/23 - Added parallel test, test_mpio_1wMr, which tests if the - underlaying parallel I/O system is conforming to the POSIX - write/read requirement. This version includes options of using - atomicity and file-sync. AKC - 2003/11/27 + underlaying parallel I/O system is conforming to the POSIX + write/read requirement. This version includes options of using + atomicity and file-sync. AKC - 2003/11/27 Tools: ------ - Added option -showconfig to compiler tools (h5cc,h5fc,h5c++). - AKC - 2004/01/08 - - Install the "h5cc" and "h5fc" tools as "h5pcc" and "h5pfc" - respectively if library is built in parallel mode. AKC - 2004/01/07 + AKC - 2004/01/08 + - Install the "h5cc" and "h5fc" tools as "h5pcc" and "h5pfc" + respectively if library is built in parallel mode. AKC - 2004/01/07 - Added metadata benchmark (perform/perf_meta). SLU - 2003/10/03 C++ API: @@ -4547,9 +4545,9 @@ Bug Fixes since HDF5-1.6.1 release Tools ----- - - Fixed h5redeploy which sometimes complain too many argument for the - test command. (The complain did not hinder the h5redploy to proceed - correctly.) AKC - 2003/11/03 + - Fixed h5redeploy which sometimes complain too many argument for the + test command. (The complain did not hinder the h5redploy to proceed + correctly.) AKC - 2003/11/03 Documentation ------------- @@ -4565,12 +4563,12 @@ Platforms Tested AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 xlf 8.1.0.3 - xlC 6.0.0.4 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 + xlC 6.0.0.4 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 poe 3.2.0.10 Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 Cray Fortran Version 3.6.0.2 @@ -4606,11 +4604,11 @@ Platforms Tested Intel(R) Fortran Itanium(R) Version 7.1 SGI MPI OSF1 V5.1 Compaq C V6.4-014 - Compaq Fortran V5.5-2602 - Compaq Fortran V5.5-1877 - Compaq C++ V6.5-033 - Compaq C++ V6.5-030 - MPI_64bit_R13 + Compaq Fortran V5.5-2602 + Compaq Fortran V5.5-1877 + Compaq C++ V6.5-033 + Compaq C++ V6.5-030 + MPI_64bit_R13 SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 WorkShop Compilers 5.0 98/10/25 @@ -4631,12 +4629,12 @@ Platforms Tested IA-64 Linux 2.4.21.SuSE_128.bef1 ia64 Intel(R) C++ Version 7.1 Intel(R) Fortran Compiler Version 7.1 - mpich-gm-1.2.5..intel + mpich-gm-1.2.5..intel Windows 2000 (NT5.0) MSVC++ 6.0 DEC Visual Fortran 6.0 Intel C and F90 compilers version 7.1 - Code Warrior 8.0 + Code Warrior 8.0 Windows XP MSVC++.NET MAC OS X Darwin 7.2 gcc and g++ Apple Computer, Inc. GCC @@ -5003,7 +5001,7 @@ Bug Fixes since HDF5-1.6.0 release Tools ----- - - Fixed a segmentation fault of h5diff when percentage option is used. + - Fixed a segmentation fault of h5diff when percentage option is used. AKC - 2003/08/27 - Switched away from tools using internal "fixtype" function(s) to use H5Tget_native_type() internally. QAK - 2003/08/25 @@ -5035,12 +5033,12 @@ Platforms Tested AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 xlf 8.1.0.3 - xlC 6.0.0.4 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 + xlC 6.0.0.4 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 poe 3.2.0.10 Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 Cray Fortran Version 3.6.0.2 @@ -5067,9 +5065,9 @@ Platforms Tested Linux 2.4.20-8 gcc 3.2.2 OSF1 V5.1 Compaq C V6.4-014 Compaq C V6.3-027 - Compaq Fortran V5.5-2602 - Compaq C++ V6.5-030 - MPI_64bit_R5 + Compaq Fortran V5.5-2602 + Compaq C++ V6.5-030 + MPI_64bit_R5 g++ version 3.0 for C++ SunOS 5.7(32 and 64 bit) WorkShop Compilers 5.0 98/12/15 C 5.0 (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 @@ -5090,7 +5088,7 @@ Platforms Tested Windows 2000 (NT5.0) MSVC++ 6.0 DEC Visual Fortran 6.0 Intel C and F90 compilers version 7.1 - Code Warrior 8.0 + Code Warrior 8.0 Windows XP MSVC++.NET MAC OS X Darwin 6.8 gcc and g++ Apple Computer, Inc. GCC @@ -5272,6 +5270,8 @@ Known Problems * Information about building with PGI and Intel compilers is available in INSTALL file sections 5.7 and 5.8 + + %%%%1.6.0%%%% Release Information for hdf5-1.6.0 (03/July/03) 14. Release information for HDF5 version 1.6.0 @@ -5585,12 +5585,12 @@ Platforms Tested AIX 5.1 (32 and 64-bit) xlc 6.0.0.2 xlf 8.1.0.3 - xlC 6.0.0.4 - xlc 5.0.2.5 - xlf 7.1.1.2 - xlC 5.0.2.5 - mpcc_r 5.0.2.5 - mpxlf_r 7.1.1.2 + xlC 6.0.0.4 + xlc 5.0.2.5 + xlf 7.1.1.2 + xlC 5.0.2.5 + mpcc_r 5.0.2.5 + mpxlf_r 7.1.1.2 poe 3.2.0.10 Cray T3E sn6606 2.0.6.08 Cray Standard C Version 6.6.0.2 Cray Fortran Version 3.6.0.0.2 @@ -5619,9 +5619,9 @@ Platforms Tested MPIch 1.2.4 OSF1 V5.1 Compaq C V6.4-014 Compaq C V6.3-027 - Compaq Fortran V5.5-1877 - Compaq C++ V6.5-014 - MPI_64bit_R5 + Compaq Fortran V5.5-1877 + Compaq C++ V6.5-014 + MPI_64bit_R5 g++ version 3.0 for C++ SunOS 5.7 WorkShop Compilers 5.0 98/12/15 C 5.0 (Solaris 2.7) WorkShop Compilers 5.0 98/12/15 C++ 5.0 @@ -5645,7 +5645,7 @@ Platforms Tested Windows 2000 (NT5.0) MSVC++ 6.0 DEC Visual Fortran 6.0 Intel C and F90 compilers version 7.1 - Code Warrior 8.0 + Code Warrior 8.0 Windows XP MSVC++.NET MAC OS X Darwin 6.5 gcc and g++ Apple Computer, Inc. GCC @@ -5893,8 +5893,8 @@ New Features output format; function call and return event times can be logged; total time spent in each function can be logged. The following HDF5_DEBUG environment variable words affect tracing: - trace -- turn on/off basic tracing - ttimes -- turn on tracing and report event times and + trace -- turn on/off basic tracing + ttimes -- turn on tracing and report event times and time spent in each API function. ttop -- turn on tracing but display only top-level API calls. @@ -6369,22 +6369,22 @@ Bug Fixes since HDF5-1.4.3 Release Performance Improvements ======================== This release of the HDF5 library has been extensively tuned to improve -performance, especially to improve parallel I/O performance. + performance, especially to improve parallel I/O performance. Most of the specific information for particular performance improvements -is mentioned in the "New Features" and "Bug Fixes since HDF5-1.4.3" sections -of this document, but in general, the library should make fewer and larger -I/O requests when accessing a file. Additionally, improvements to the parallel -I/O portions of the library should have reduced the communications and barriers -used in various internal algorithms, improving the performance of the library. + is mentioned in the "New Features" and "Bug Fixes since HDF5-1.4.3" sections + of this document, but in general, the library should make fewer and larger + I/O requests when accessing a file. Additionally, improvements to the parallel + I/O portions of the library should have reduced the communications and barriers + used in various internal algorithms, improving the performance of the library. However, with the extensive changes to some portions of the library that -were required for these improvements, some errors or unanticipated results may -have been introduced also. Please report any problems encountered to our -support team at hdfhelp@ncsa.uiuc.edu. + were required for these improvements, some errors or unanticipated results may + have been introduced also. Please report any problems encountered to our + support team at hdfhelp@ncsa.uiuc.edu. Hopefully these improvements will benefit all HDF5 applications, but if -there are particular I/O patterns that appear to be slower than necessary, -please send e-mail to hdfhelp@ncsa.uiuc.edu with a sample program showing the -problem behavior; we will look into the issue to see if it is possible to -address it. + there are particular I/O patterns that appear to be slower than necessary, + please send e-mail to hdfhelp@ncsa.uiuc.edu with a sample program showing the + problem behavior; we will look into the issue to see if it is possible to + address it. Documentation @@ -6863,7 +6863,7 @@ Supported Configuration Features Summary Linux 2.4 y y (1) n n y y y y - Platform 1.2 static- Thread- SRB GASS STREAM- + Platform 1.2 static- Thread- SRB GASS STREAM- compatibility exec safe VFD Solaris2.7 n x y n n y Solaris2.8 64 n y n n n y @@ -6896,7 +6896,7 @@ Supported Configuration Features Summary in serial mode. (4) No HDF4-related tools. (5) Shared libraries are provided only for the C library. - (6) Exception of (5): DLL is available for C++ API on Windows + (6) Exception of (5): DLL is available for C++ API on Windows Known Problems @@ -7191,7 +7191,7 @@ Supported Configuration Features Summary Linux 2.4 y y (1) n n y y y y - Platform 1.2 static- Thread- SRB GASS STREAM- + Platform 1.2 static- Thread- SRB GASS STREAM- compatibility exec safe VFD Solaris2.6 y x n n n y Solaris2.7 y x y n n y @@ -8271,23 +8271,23 @@ applicable, are systems that HDF5 1.2.0 was tested on. IRIX 6.5 MIPSpro cc 7.30 IRIX64 6.5 (64 & n32) MIPSpro cc 7.3.1m - mpt.1.3 (SGI MPI 3.2.0.0) + mpt.1.3 (SGI MPI 3.2.0.0) Linux 2.2.10 egcs-2.91.66 configured with - --disable-hsizet + --disable-hsizet lbraries: glibc2 OSF1 V4.0 DEC-V5.2-040 SunOS 5.6 cc WorkShop Compilers 4.2 no optimization - gcc 2.8.1 + gcc 2.8.1 SunOS 5.7 cc WorkShop Compilers 5.0 gcc 2.8.1 TFLOPS 2.7.1 cicc (pgcc Rel 3.0-4i) - mpich-1.1.2 with local changes + mpich-1.1.2 with local changes Windows NT4.0 intel MSVC++ 5.0 and 6.0 @@ -8410,7 +8410,7 @@ C. Changes Since Version 1.0.1 a. Property List Interface: ------------------------ - H5Pset_xfer - set data transfer properties + H5Pset_xfer - set data transfer properties H5Pset_preserve - set dataset transfer property list status H5Pget_preserve - get dataset transfer property list status H5Pset_hyper_cache - indicates whether to cache hyperslab blocks during I/O @@ -8473,11 +8473,11 @@ C. Changes Since Version 1.0.1 g. Ragged Arrays (alpha) (names of those API functions were changed): ------------------------------------------------------------------ - H5RAcreate - create a new ragged array (old name was H5Rcreate) - H5RAopen - open an existing array (old name was H5Ropen) - H5RAclose - close a ragged array (old name was H5Rclose) - H5RAwrite - write to an array (old name was H5Rwrite) - H5RAread - read from an array (old name was H5Rread) + H5RAcreate - create a new ragged array (old name was H5Rcreate) + H5RAopen - open an existing array (old name was H5Ropen) + H5RAclose - close a ragged array (old name was H5Rclose) + H5RAwrite - write to an array (old name was H5Rwrite) + H5RAread - read from an array (old name was H5Rread) 9. Tools @@ -8698,7 +8698,7 @@ C. Changes Since Version 1.0.1 with the correct version of header files. - Parallel HDF5 Changes + Parallel HDF5 Changes * Parallel support for fixed dimension datasets with contiguous or chunked storages. Also, support unlimited dimension datasets which @@ -8724,68 +8724,68 @@ C. Changes Since Version 1.0.1 sizes. - LIST OF API FUNCTIONS + LIST OF API FUNCTIONS The following functions are implemented. Errors are returned if an attempt is made to use some feature which is not implemented and printing the error stack will show `not implemented yet'. Library - H5check - check that lib version matches header version - H5open - initialize library (happens automatically) - H5close - shut down the library (happens automatically) - H5dont_atexit - don't call H5close on exit - H5get_libversion - retrieve library version info - H5check_version - check for specific library version + H5check - check that lib version matches header version + H5open - initialize library (happens automatically) + H5close - shut down the library (happens automatically) + H5dont_atexit - don't call H5close on exit + H5get_libversion - retrieve library version info + H5check_version - check for specific library version Property Lists - H5Pclose - release template resources - H5Pcopy - copy a template - H5Pcreate - create a new template - H5Pget_chunk - get chunked storage properties - H5Pset_chunk - set chunked storage properties - H5Pget_class - get template class - H5Pget_istore_k - get chunked storage properties - H5Pset_istore_k - set chunked storage properties - H5Pget_layout - get raw data layout class - H5Pset_layout - set raw data layout class - H5Pget_sizes - get address and size sizes - H5Pset_sizes - set address and size sizes - H5Pget_sym_k - get symbol table storage properties - H5Pset_sym_k - set symbol table storage properties - H5Pget_userblock - get user-block size - H5Pset_userblock - set user-block size - H5Pget_version - get file version numbers - H5Pget_alignment - get data alignment properties - H5Pset_alignment - set data alignment properties + H5Pclose - release template resources + H5Pcopy - copy a template + H5Pcreate - create a new template + H5Pget_chunk - get chunked storage properties + H5Pset_chunk - set chunked storage properties + H5Pget_class - get template class + H5Pget_istore_k - get chunked storage properties + H5Pset_istore_k - set chunked storage properties + H5Pget_layout - get raw data layout class + H5Pset_layout - set raw data layout class + H5Pget_sizes - get address and size sizes + H5Pset_sizes - set address and size sizes + H5Pget_sym_k - get symbol table storage properties + H5Pset_sym_k - set symbol table storage properties + H5Pget_userblock - get user-block size + H5Pset_userblock - set user-block size + H5Pget_version - get file version numbers + H5Pget_alignment - get data alignment properties + H5Pset_alignment - set data alignment properties H5Pget_external_count- get count of external data files - H5Pget_external - get information about an external data file - H5Pset_external - add a new external data file to the list - H5Pget_driver - get low-level file driver class - H5Pget_stdio - get properties for stdio low-level driver - H5Pset_stdio - set properties for stdio low-level driver - H5Pget_sec2 - get properties for sec2 low-level driver - H5Pset_sec2 - set properties for sec2 low-level driver - H5Pget_core - get properties for core low-level driver - H5Pset_core - set properties for core low-level driver - H5Pget_split - get properties for split low-level driver - H5Pset_split - set properties for split low-level driver - H5P_get_family - get properties for family low-level driver - H5P_set_family - set properties for family low-level driver - H5Pget_cache - get meta- and raw-data caching properties - H5Pset_cache - set meta- and raw-data caching properties - H5Pget_buffer - get raw-data I/O pipe buffer properties - H5Pset_buffer - set raw-data I/O pipe buffer properties - H5Pget_preserve - get type conversion preservation properties - H5Pset_preserve - set type conversion preservation properties - H5Pget_nfilters - get number of raw data filters - H5Pget_filter - get raw data filter properties - H5Pset_filter - set raw data filter properties - H5Pset_deflate - set deflate compression filter properties - H5Pget_mpi - get MPI-IO properties - H5Pset_mpi - set MPI-IO properties - H5Pget_xfer - get data transfer properties - + H5Pset_xfer - set data transfer properties + H5Pget_external - get information about an external data file + H5Pset_external - add a new external data file to the list + H5Pget_driver - get low-level file driver class + H5Pget_stdio - get properties for stdio low-level driver + H5Pset_stdio - set properties for stdio low-level driver + H5Pget_sec2 - get properties for sec2 low-level driver + H5Pset_sec2 - set properties for sec2 low-level driver + H5Pget_core - get properties for core low-level driver + H5Pset_core - set properties for core low-level driver + H5Pget_split - get properties for split low-level driver + H5Pset_split - set properties for split low-level driver + H5P_get_family - get properties for family low-level driver + H5P_set_family - set properties for family low-level driver + H5Pget_cache - get meta- and raw-data caching properties + H5Pset_cache - set meta- and raw-data caching properties + H5Pget_buffer - get raw-data I/O pipe buffer properties + H5Pset_buffer - set raw-data I/O pipe buffer properties + H5Pget_preserve - get type conversion preservation properties + H5Pset_preserve - set type conversion preservation properties + H5Pget_nfilters - get number of raw data filters + H5Pget_filter - get raw data filter properties + H5Pset_filter - set raw data filter properties + H5Pset_deflate - set deflate compression filter properties + H5Pget_mpi - get MPI-IO properties + H5Pset_mpi - set MPI-IO properties + H5Pget_xfer - get data transfer properties + + H5Pset_xfer - set data transfer properties + H5Pset_preserve - set dataset transfer property list status + H5Pget_preserve - get dataset transfer property list status + H5Pset_hyper_cache - indicates whether to cache hyperslab blocks during I/O @@ -8801,89 +8801,89 @@ Property Lists datatype allocation Datasets - H5Dclose - release dataset resources - H5Dcreate - create a new dataset - H5Dget_space - get data space - H5Dget_type - get data type - H5Dget_create_plist - get dataset creation properties - H5Dopen - open an existing dataset - H5Dread - read raw data - H5Dwrite - write raw data - H5Dextend - extend a dataset + H5Dclose - release dataset resources + H5Dcreate - create a new dataset + H5Dget_space - get data space + H5Dget_type - get data type + H5Dget_create_plist - get dataset creation properties + H5Dopen - open an existing dataset + H5Dread - read raw data + H5Dwrite - write raw data + H5Dextend - extend a dataset + H5Diterate - iterate over all selected elements in a dataspace + H5Dget_storage_size - return the amount of storage required for a dataset + H5Dvlen_reclaim - reclaim VL datatype memory buffers Attributes - H5Acreate - create a new attribute - H5Aopen_name - open an attribute by name - H5Aopen_idx - open an attribute by number - H5Awrite - write values into an attribute - H5Aread - read values from an attribute - H5Aget_space - get attribute data space - H5Aget_type - get attribute data type - H5Aget_name - get attribute name - H5Anum_attrs - return the number of attributes for an object - H5Aiterate - iterate over an object's attributes - H5Adelete - delete an attribute - H5Aclose - close an attribute + H5Acreate - create a new attribute + H5Aopen_name - open an attribute by name + H5Aopen_idx - open an attribute by number + H5Awrite - write values into an attribute + H5Aread - read values from an attribute + H5Aget_space - get attribute data space + H5Aget_type - get attribute data type + H5Aget_name - get attribute name + H5Anum_attrs - return the number of attributes for an object + H5Aiterate - iterate over an object's attributes + H5Adelete - delete an attribute + H5Aclose - close an attribute Errors - H5Eclear - clear the error stack - H5Eprint - print an error stack - H5Eget_auto - get automatic error reporting settings - H5Eset_auto - set automatic error reporting - H5Ewalk - iterate over the error stack - H5Ewalk_cb - the default error stack iterator function - H5Eget_major - get the message for the major error number - H5Eget_minor - get the message for the minor error number + H5Eclear - clear the error stack + H5Eprint - print an error stack + H5Eget_auto - get automatic error reporting settings + H5Eset_auto - set automatic error reporting + H5Ewalk - iterate over the error stack + H5Ewalk_cb - the default error stack iterator function + H5Eget_major - get the message for the major error number + H5Eget_minor - get the message for the minor error number Files - H5Fclose - close a file and release resources - H5Fcreate - create a new file - H5Fget_create_plist - get file creation property list - H5Fget_access_plist - get file access property list - H5Fis_hdf5 - determine if a file is an hdf5 file - H5Fopen - open an existing file + H5Fclose - close a file and release resources + H5Fcreate - create a new file + H5Fget_create_plist - get file creation property list + H5Fget_access_plist - get file access property list + H5Fis_hdf5 - determine if a file is an hdf5 file + H5Fopen - open an existing file H5Freopen - reopen an HDF5 file H5Fmount - mount a file H5Funmount - unmount a file H5Fflush - flush all buffers associated with a file to disk Groups - H5Gclose - close a group and release resources - H5Gcreate - create a new group - H5Gopen - open an existing group - H5Giterate - iterate over the contents of a group - H5Gmove - change the name of some object - H5Glink - create a hard or soft link to an object - H5Gunlink - break the link between a name and an object - H5Gget_objinfo - get information about a group entry - H5Gget_linkval - get the value of a soft link - H5Gget_comment - get the comment string for an object - H5Gset_comment - set the comment string for an object + H5Gclose - close a group and release resources + H5Gcreate - create a new group + H5Gopen - open an existing group + H5Giterate - iterate over the contents of a group + H5Gmove - change the name of some object + H5Glink - create a hard or soft link to an object + H5Gunlink - break the link between a name and an object + H5Gget_objinfo - get information about a group entry + H5Gget_linkval - get the value of a soft link + H5Gget_comment - get the comment string for an object + H5Gset_comment - set the comment string for an object Dataspaces - H5Screate - create a new data space - H5Scopy - copy a data space - H5Sclose - release data space - H5Screate_simple - create a new simple data space - H5Sset_space - set simple data space extents - H5Sis_simple - determine if data space is simple - H5Sset_extent_simple - set simple data space dimensionality and size - H5Sget_simple_extent_npoints - get number of points in simple extent + H5Screate - create a new data space + H5Scopy - copy a data space + H5Sclose - release data space + H5Screate_simple - create a new simple data space + H5Sset_space - set simple data space extents + H5Sis_simple - determine if data space is simple + H5Sset_extent_simple - set simple data space dimensionality and size + H5Sget_simple_extent_npoints - get number of points in simple extent H5Sget_simple_extent_ndims - get simple data space dimensionality H5Sget_simple_extent_dims - get simple data space size H5Sget_simple_extent_type - get type of simple extent - H5Sset_extent_none - reset extent to be empty - H5Sextent_copy - copy the extent from one data space to another + H5Sset_extent_none - reset extent to be empty + H5Sextent_copy - copy the extent from one data space to another H5Sget_select_npoints - get number of points selected for I/O - H5Sselect_hyperslab - set hyperslab dataspace selection + H5Sselect_hyperslab - set hyperslab dataspace selection H5Sselect_elements - set element sequence dataspace selection - H5Sselect_all - select entire extent for I/O - H5Sselect_none - deselect all elements of extent - H5Soffset_simple - set selection offset - H5Sselect_valid - determine if selection is valid for extent + H5Sselect_all - select entire extent for I/O + H5Sselect_none - deselect all elements of extent + H5Soffset_simple - set selection offset + H5Sselect_valid - determine if selection is valid for extent + H5Sget_select_hyper_nblocks - get number of hyperslab blocks + H5Sget_select_hyper_blocklist - get the list of hyperslab blocks currently selected @@ -8895,53 +8895,53 @@ Dataspaces the current selection Datatypes - H5Tclose - release data type resources - H5Topen - open a named data type - H5Tcommit - name a data type - H5Tcommitted - determine if a type is named - H5Tcopy - copy a data type - H5Tcreate - create a new data type - H5Tequal - compare two data types - H5Tlock - lock type to prevent changes - H5Tfind - find a data type conversion function - H5Tconvert - convert data from one type to another - H5Tregister - register a conversion function - H5Tunregister - remove a conversion function - H5Tget_overflow - get function that handles overflow conv. cases - H5Tset_overflow - set function to handle overflow conversion cases - H5Tget_class - get data type class - H5Tget_cset - get character set - H5Tget_ebias - get exponent bias - H5Tget_fields - get floating point fields - H5Tget_inpad - get inter-field padding - H5Tget_member_dims - get struct member dimensions - H5Tget_member_name - get struct member name - H5Tget_member_offset - get struct member byte offset - H5Tget_member_type - get struct member type - H5Tget_nmembers - get number of struct members - H5Tget_norm - get floating point normalization - H5Tget_offset - get bit offset within type - H5Tget_order - get byte order - H5Tget_pad - get padding type - H5Tget_precision - get precision in bits - H5Tget_sign - get integer sign type - H5Tget_size - get size in bytes - H5Tget_strpad - get string padding - H5Tinsert - insert scalar struct member - H5Tinsert_array - insert array struct member - H5Tpack - pack struct members - H5Tset_cset - set character set - H5Tset_ebias - set exponent bias - H5Tset_fields - set floating point fields - H5Tset_inpad - set inter-field padding - H5Tset_norm - set floating point normalization - H5Tset_offset - set bit offset within type - H5Tset_order - set byte order - H5Tset_pad - set padding type - H5Tset_precision - set precision in bits - H5Tset_sign - set integer sign type - H5Tset_size - set size in bytes - H5Tset_strpad - set string padding + H5Tclose - release data type resources + H5Topen - open a named data type + H5Tcommit - name a data type + H5Tcommitted - determine if a type is named + H5Tcopy - copy a data type + H5Tcreate - create a new data type + H5Tequal - compare two data types + H5Tlock - lock type to prevent changes + H5Tfind - find a data type conversion function + H5Tconvert - convert data from one type to another + H5Tregister - register a conversion function + H5Tunregister - remove a conversion function + H5Tget_overflow - get function that handles overflow conv. cases + H5Tset_overflow - set function to handle overflow conversion cases + H5Tget_class - get data type class + H5Tget_cset - get character set + H5Tget_ebias - get exponent bias + H5Tget_fields - get floating point fields + H5Tget_inpad - get inter-field padding + H5Tget_member_dims - get struct member dimensions + H5Tget_member_name - get struct member name + H5Tget_member_offset - get struct member byte offset + H5Tget_member_type - get struct member type + H5Tget_nmembers - get number of struct members + H5Tget_norm - get floating point normalization + H5Tget_offset - get bit offset within type + H5Tget_order - get byte order + H5Tget_pad - get padding type + H5Tget_precision - get precision in bits + H5Tget_sign - get integer sign type + H5Tget_size - get size in bytes + H5Tget_strpad - get string padding + H5Tinsert - insert scalar struct member + H5Tinsert_array - insert array struct member + H5Tpack - pack struct members + H5Tset_cset - set character set + H5Tset_ebias - set exponent bias + H5Tset_fields - set floating point fields + H5Tset_inpad - set inter-field padding + H5Tset_norm - set floating point normalization + H5Tset_offset - set bit offset within type + H5Tset_order - set byte order + H5Tset_pad - set padding type + H5Tset_precision - set precision in bits + H5Tset_sign - set integer sign type + H5Tset_size - set size in bytes + H5Tset_strpad - set string padding + H5Tget_super - return the base datatype from which a datatype is derived + H5Tvlen_create - creates a new variable-length dataype @@ -8955,14 +8955,14 @@ Datatypes + H5Tset_tag - tags an opaque datatype + H5Tget_tag - gets the tag associated with an opaque datatype - - H5Tregister_hard - register specific type conversion function - - H5Tregister_soft - register general type conversion function + - H5Tregister_hard - register specific type conversion function + - H5Tregister_soft - register general type conversion function Filters - H5Tregister - register a conversion function + H5Tregister - register a conversion function Compression - H5Zregister - register new compression and uncompression + H5Zregister - register new compression and uncompression functions for a method specified by a method number Identifiers @@ -8976,10 +8976,10 @@ References object reference points to Ragged Arrays (alpha) - H5RAcreate - create a new ragged array - H5RAopen - open an existing array - H5RAclose - close a ragged array - H5RAwrite - write to an array - H5RAread - read from an array + H5RAcreate - create a new ragged array + H5RAopen - open an existing array + H5RAclose - close a ragged array + H5RAwrite - write to an array + H5RAread - read from an array diff --git a/release_docs/HISTORY-1_10.txt b/release_docs/HISTORY-1_10.txt index 2ddbe7a..127b821 100644 --- a/release_docs/HISTORY-1_10.txt +++ b/release_docs/HISTORY-1_10.txt @@ -3,6 +3,9 @@ HDF5 History This file contains development history of the HDF5 1.10 branch +09. Release Information for hdf5-1.10.7 +08. Release Information for hdf5-1.10.6 +07. Release Information for hdf5-1.10.5 06. Release Information for hdf5-1.10.4 05. Release Information for hdf5-1.10.3 04. Release Information for hdf5-1.10.2 @@ -12,6 +15,2172 @@ This file contains development history of the HDF5 1.10 branch [Search on the string '%%%%' for section breaks of each release.] +%%%%1.10.7%%%% + +HDF5 version 1.10.7 released on 2020-09-11 +================================================================================ + + +INTRODUCTION + +This document describes the differences between this release and the previous +HDF5 release. It contains information on the platforms tested and known +problems in this release. For more details check the HISTORY*.txt files in the +HDF5 source. + +Note that documentation in the links below will be updated at the time of each +final release. + +Links to HDF5 documentation can be found on The HDF5 web page: + + https://portal.hdfgroup.org/display/HDF5/HDF5 + +The official HDF5 releases can be obtained from: + + https://www.hdfgroup.org/downloads/hdf5/ + + HDF5 binaries provided are fully tested with ZLIB and the free + Open Source SZIP successor Libaec (with BSD license). + The official ZLIB and SZIP/Libaec pages are at: + + ZLIB: http://www.zlib.net/ + http://www.zlib.net/zlib_license.html + SZIP/Libaec: https://gitlab.dkrz.de/k202009/libaec + https://gitlab.dkrz.de/k202009/libaec/-/blob/master/Copyright.txt + +Changes from Release to Release and New Features in the HDF5-1.10.x release series +can be found at: + + https://portal.hdfgroup.org/display/HDF5/HDF5+Application+Developer%27s+Guide + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.10.6 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems +- CMake vs. Autotools installations + + +New Features +============ + + Configuration: + ------------- + - Disable memory sanity checks in the Autotools in release branches + + The library can be configured to use internal memory sanity checking, + which replaces C API calls like malloc(3) and free(3) with our own calls + which add things like heap canaries. These canaries can cause problems + when external filter plugins reallocate canary-marked buffers. + + For this reason, the default will be to not use the memory allocation + sanity check feature in release branches (e.g., hdf5_1_10_7). + Debug builds in development branches (e.g., develop, hdf5_1_10) will + still use them by default. + + This change only affects Autotools debug builds. Non-debug autotools + builds and all CMake builds do not enable this feature by default. + + (DER - 2020/08/19) + + - Add file locking configure and CMake options + + HDF5 1.10.0 introduced a file locking scheme, primarily to help + enforce SWMR setup. Formerly, the only user-level control of the scheme + was via the HDF5_USE_FILE_LOCKING environment variable. + + This change introduces configure-time options that control whether + or not file locking will be used and whether or not the library + ignores errors when locking has been disabled on the file system + (useful on some HPC Lustre installations). + + In both the Autotools and CMake, the settings have the effect of changing + the default property list settings (see the H5Pset/get_file_locking() + entry, below). + + The yes/no/best-effort file locking configure setting has also been + added to the libhdf5.settings file. + + Autotools: + + An --enable-file-locking=(yes|no|best-effort) option has been added. + + yes: Use file locking. + no: Do not use file locking. + best-effort: Use file locking and ignore "disabled" errors. + + CMake: + + Two self-explanatory options have been added: + + HDF5_USE_FILE_LOCKING + HDF5_IGNORE_DISABLED_FILE_LOCKS + + Setting both of these to ON is the equivalent to the Autotools' + best-effort setting. + + NOTE: + The precedence order of the various file locking control mechanisms is: + + 1) HDF5_USE_FILE_LOCKING environment variable (highest) + + 2) H5Pset_file_locking() + + 3) configure/CMake options (which set the property list defaults) + + 4) library defaults (currently best-effort) + + (DER - 2020/07/30, HDFFV-11092) + + - CMake option to link the generated Fortran MOD files into the include + directory. + + The Fortran generation of MOD files by a Fortran compile can produce + different binary files between SHARED and STATIC compiles with different + compilers and/or different platforms. Note that it has been found that + different versions of Fortran compilers will produce incompatible MOD + files. Currently, CMake will locate these MOD files in subfolders of + the include directory and add that path to the Fortran library target + in the CMake config file, which can be used by the CMake find library + process. For other build systems using the binary from a CMake install, + a new CMake configuration can be used to copy the pre-chosen version + of the Fortran MOD files into the install include directory. + + The default will depend on the configuration of + BUILD_STATIC_LIBS and BUILD_SHARED_LIBS: + YES YES Default to SHARED + 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 + HDF5_INSTALL_MOD_FORTRAN to one of NO, SHARED, or STATIC + + (ADB - 2020/07/09, HDFFV-11116) + + - CMake option to use AEC (open source SZip) library instead of SZip + + The open source AEC library is a replacement library for SZip. In + order to use it for hdf5, the libaec CMake source was changed to add + "-fPIC" and exclude test files. A new option USE_LIBAEC is required + to compensate for the different files produced by AEC build. + + Autotools does not build the compression libraries within hdf5 builds, + but will use an installed libaec when configured as before with the + option --with-libsz=<path to libaec directory>. + + (ADB - 2020/04/22, OESS-65) + + - CMake ConfigureChecks.cmake file now uses CHECK_STRUCT_HAS_MEMBER + + Some handcrafted tests in HDFTests.c have been removed and the CMake + CHECK_STRUCT_HAS_MEMBER module has been used. + + (ADB - 2020/03/24, TRILAB-24) + + - Both build systems use same set of warnings flags + + GNU C, C++ and gfortran warnings flags were moved to files in a config + sub-folder named gnu-warnings. Flags that only are available for a specific + version of the compiler are in files named with that version. + Clang C warnings flags were moved to files in a config sub-folder + named clang-warnings. + Intel C, Fortran warnings flags were moved to files in a config sub-folder + named intel-warnings. + + There are flags in named "error-xxx" files with warnings that may + be promoted to errors. Some source files may still need fixes. + + There are also pairs of files named "developer-xxx" and "no-developer-xxx" + that are chosen by the CMake option:HDF5_ENABLE_DEV_WARNINGS or the + configure option:--enable-developer-warnings. + + In addition, CMake no longer applies these warnings for examples. + + (ADB - 2020/03/24, TRILAB-192) + + - Update CMake minimum version to 3.12 + + Updated CMake minimum version to 3.12 and added version checks + for Windows features. + + (ADB - 2020/02/05, TRILABS-142) + + - Fixed CMake include properties for Fortran libraries + + Corrected the library properties for Fortran to use the + correct path for the Fortran module files. + + (ADB - 2020/02/04, HDFFV-11012) + + - Added common warnings files for gnu and intel + + Added warnings files to use one common set of flags + during configure for both autotools and CMake build + systems. The initial implementation only affects a + general set of flags for gnu and intel compilers. + + (ADB - 2020/01/17) + + - Added new options to CMake for control of testing + + Added CMake options (default ON); + HDF5_TEST_SERIAL AND/OR HDF5_TEST_PARALLEL + combined with: + HDF5_TEST_TOOLS + HDF5_TEST_EXAMPLES + HDF5_TEST_SWMR + HDF5_TEST_FORTRAN + HDF5_TEST_CPP + HDF5_TEST_JAVA + + (ADB - 2020/01/15, HDFFV-11001) + + - Added Clang sanitizers to CMake for analyzer support if compiler is clang. + + Added CMake code and files to execute the Clang sanitizers if + HDF5_ENABLE_SANITIZERS is enabled and the USE_SANITIZER option + is set to one of the following: + Address + Memory + MemoryWithOrigins + Undefined + Thread + Leak + 'Address;Undefined' + + (ADB - 2019/12/12, TRILAB-135) + + + Library: + -------- + - Add metadata cache optimization to reduce skip list usage + + On file flush or close, the metadata cache attempts to write out + all dirty entries in increasing address order. To do this, it needs + an address sorted list of metadata entries. Further, since flushing + one metadata cache entry can dirty another, this list must support + efficient insertion and deletion. + + The metadata cache uses a skip list of all dirty entries for this + purpose. Before this release, this skip list was maintained at all + times. However, since profiling indicates that this imposes a + significant cost, we now construct and maintain the skip list only + when needed. Specifically, we enable the skip list and load it with + a list of all dirty entries in the metadata cache just before a flush, + and disable it after the flush. + + (JRM - 2020/08/17, HDFFV-11034) + + - Add BEST_EFFORT value to HDF5_USE_FILE_LOCKING environment variable + + This change adds a BEST_EFFORT to the TRUE/FALSE, 1/0 settings that + were previously accepted. This option turns on file locking but + ignores locking errors when the library detects that file locking + has been disabled on a file system (useful on some HPC Lustre + installations). + + The capitalization of BEST_EFFORT is mandatory. + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + + + - Add H5Pset/get_file_locking() API calls + + This change adds new API calls which can be used to set or get the + file locking parameters. The single API call sets both the "use file + locking" flag and the "ignore disabled file locking" flag. + + When opening a file multiple times without closing, the file MUST be + opened with the same file locking settings. Opening a file with different + file locking settings will fail (this is similar to the behavior of + H5Pset_fclose_degree()). + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + + - Add Mirror VFD + + Use TCP/IP sockets to perform write-only (W/O) file I/O on a remote + machine. Must be used in conjunction with the Splitter VFD. + + (JOS - 2020/03/13, TBD) + + - Add Splitter VFD + + Maintain separate R/W and W/O channels for "concurrent" file writes + to two files using a single HDF5 file handle. + + (JOS - 2020/03/13, TBD) + + - Fixed an assertion failure in the parallel library when collectively + filling chunks. As it is required that chunks be written in + monotonically non-decreasing order of offset in the file, this assertion + was being triggered when the list of chunk file space allocations being + passed to the collective chunk filling routine was not sorted according + to this particular requirement. + + The addition of a sort of the out of order chunks trades a bit of + performance for the elimination of this assertion and of any complaints + from MPI implementations about the file offsets used being out of order. + + (JTH - 2019/10/07) + + Fortran Library: + ---------------- + - Add wrappers for H5Pset/get_file_locking() API calls + + h5pget_file_locking_f() + h5pset_file_locking_f() + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + + - Added new Fortran parameters: + + H5F_LIBVER_ERROR_F + H5F_LIBVER_NBOUNDS_F + H5F_LIBVER_V18_F + H5F_LIBVER_V110_F + + - Added new Fortran API: h5pget_libver_bounds_f + + (MSB - 2020/02/11, HDFFV-11018) + + C++ Library: + ------------ + - Add wrappers for H5Pset/get_file_locking() API calls + + FileAccPropList::setFileLocking() + FileAccPropList::getFileLocking() + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + + Java Library: + ---------------- + - Add wrappers for H5Pset/get_file_locking() API calls + + H5Pset_file_locking() + H5Pget_use_file_locking() + H5Pget_ignore_disabled_file_locking() + + Unlike the C++ and Fortran wrappers, there are separate getters for the + two file locking settings, each of which returns a boolean value. + + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. + + (DER - 2020/07/30, HDFFV-11092) + + Tools: + ------ + - h5repack added options to control how external links are handled. + + Currently h5repack preserves external links and cannot copy and merge + data from the external files. Two options, merge and prune, were added to + control how to merge data from an external link into the resulting file. + --merge Follow external soft link recursively and merge data. + --prune Do not follow external soft links and remove link. + --merge --prune Follow external link, merge data and remove dangling link. + + (ADB - 2020/08/05, HDFFV-9984) + + High-Level APIs: + --------------- + - None + + C Packet Table API + ------------------ + - None + + Internal header file + -------------------- + - None + + Documentation + ------------- + - None + + +Support for new platforms, languages and compilers. +======================================= + - None + + +Bug Fixes since HDF5-1.10.6 release +================================== + + Library + ------- + - Fix bug and simplify collective metadata write operation when some ranks + have no entries to contribute. This fixes parallel regression test + failures with IBM SpectrumScale MPI on the Summit system at ORNL. + + (QAK - 2020/09/02) + + - Avoid setting up complex MPI types with 0-length vectors, which some + MPI implementations don't handle well. (In particular, IBM + SpectrumScale MPI on the Summit system at ORNL) + + (QAK - 2020/08/21) + + - Fixed use-of-uninitialized-value error + + Appropriate initialization of local structs was added to remove the + use-of-uninitialized-value errors reported by MemorySanitizer. + + (BMR - 2020/8/13, HDFFV-11101) + + - Creation of dataset with optional filter + + When the combination of type, space, etc doesn't work for filter + and the filter is optional, it was supposed to be skipped but it was + not skipped and the creation failed. + + A fix is applied to allow the creation of a dataset in such + situation, as specified in the user documentation. + + (BMR - 2020/8/13, HDFFV-10933) + + - Explicitly declared dlopen to use RTLD_LOCAL + + dlopen documentation states that if neither RTLD_GLOBAL nor + RTLD_LOCAL are specified, then the default behavior is unspecified. + The default on linux is usually RTLD_LOCAL while macos will default + to RTLD_GLOBAL. + + (ADB - 2020/08/12, HDFFV-11127) + + - Fixed issues CVE-2018-13870 and CVE-2018-13869 + + When a buffer overflow occurred because a name length was corrupted + and became very large, h5dump crashed on memory access violation. + + A check for reading past the end of the buffer was added to multiple + locations to prevent the crashes and h5dump now simply fails with an + error message when this error condition occurs. + + (BMR - 2020/7/31, HDFFV-11120 and HDFFV-11121) + + - H5Sset_extent_none() sets the dataspace class to H5S_NO_CLASS which + causes asserts/errors when passed to other dataspace API calls. + + 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. + + The new library behavior is for H5Sset_extent_none() to convert + the dataspace into one of type H5S_NULL, which is better handled + by the library and easier for developers to reason about. + + (DER - 2020/07/27, HDFFV-11027) + + - Fixed the segmentation fault when reading attributes with multiple threads + + It was reported that the reading of attributes with variable length string + datatype will crash with segmentation fault particularly when the number + of threads is high (>16 threads). The problem was due to the file pointer + that was set in the variable length string datatype for the attribute. + That file pointer was already closed when the attribute was accessed. + + The problem was fixed by setting the file pointer to the current opened + file pointer when the attribute was accessed. Similar patch up was done + before when reading dataset with variable length string datatype. + + (VC - 2020/07/13, HDFFV-11080) + + - Fixed issue CVE-2018-17438 + + A division by zero was discovered in H5D__select_io() of H5Dselect.c. + https://security-tracker.debian.org/tracker/CVE-2018-17438 + + A check was added to protect against division by zero. When such + situation occurs again, the normal HDF5 error handling will be invoked, + instead of segmentation fault. + + (BMR, DER - 2020/07/09, HDFFV-10587) + + - Fixed CVE-2018-17435 + + The tool h52gif produced a segfault when the size of an attribute message + was corrupted and caused a buffer overflow. + + The problem was fixed by verifying the attribute message's size against the + buffer size before accessing the buffer. h52gif was also fixed to display + the failure instead of silently exiting after the segfault was eliminated. + + (BMR - 2020/6/19, HDFFV-10591) + + - Don't allocate an empty (0-dimensioned) chunked dataset's chunk + index, until the dataset's dimensions are increased. + + (QAK - 2020/05/07) + + Configuration + ------------- + - Stopped addition of szip header and include directory path for + incompatible libsz + + szlib.h is the same for both 32-bit and 64-bit szip, and the header file + and its path were added to the HDF5 binary even though the configure + check of a function in libsz later failed and szip compression was not + enabled. The header file and include path are now added only when the + libsz function passes the configure check. + + (LRK - 2020/08/17, HDFFV-10830) + + - Added -fsanitize=address autotools configure option for Clang compiler + + Clang sanitizer options were also added for Clang compilers with CMake. + + (LRK, 2020/08/05, HDFFV-10836) + + - Updated testh5cc.sh.in for functions versioned in HDF5 1.10. + + testh5cc.sh previously tested that the correct version of a function + versioned in HDF5 1.6 or 1.8 was compiled when one of + H5_NO_DEPRECATED_SYMBOLS or H5_USE_16_API_DEFAULT were defined. This + test was extended for additional testing with H5_USE_18_API_DEFAULT. + + (LRK, 2020/06/22, HDFFV-11000) + + - Fixed CMake include properties for Fortran libraries + + Corrected the library properties for Fortran to use the + correct path for the Fortran module files. + + (ADB - 2020/02/04, HDFFV-11012) + + Performance + ------------- + - None + + Java Library: + ---------------- + - None + + Fortran + -------- + - Corrected INTERFACE INTENT(IN) to INTENT(OUT) for buf_size in h5fget_file_image_f. + + (MSB - 2020/2/18, HDFFV-11029) + + - Fixed configure issue when building HDF5 with NAG Fortran 7.0. + + HDF5 now accounts for the addition of half-precision floating-point + in NAG 7.0 with a KIND=16. + + (MSB - 2020/02/28, HDFFV-11033) + + Tools + ----- + - The tools library was updated by standardizing the error stack process. + + General sequence is: + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + h5tools_init(); + ... process the command-line (check for error-stack enable) ... + h5tools_error_report(); + ... (do work) ... + h5diff_exit(ret); + + (ADB - 2020/07/20, HDFFV-11066) + + - h5diff fixed a command line parsing error. + + h5diff would ignore the argument to -d (delta) if it is smaller than DBL_EPSILON. + The macro H5_DBL_ABS_EQUAL was removed and a direct value comparision was used. + + (ADB - 2020/07/20, HDFFV-10897) + + - 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. + + (ADB - 2020/07/20, HDFFV-5935) + + - h5diff added another level to the verbose argument to print filenames. + + Added verbose level 3 that is level 2 plus the filenames. The levels are: + 0 : Identical to '-v' or '--verbose' + 1 : All level 0 information plus one-line attribute status summary + 2 : All level 1 information plus extended attribute status report + 3 : All level 2 information plus file names + + (ADB - 2020/07/20, HDFFV-10005) + + - h5repack was fixed to repack the reference attributes properly. + The code line that checks if the update of reference inside a compound + datatype is misplaced outside the code block loop that carries out the + check. In consequence, the next attribute that is not the reference + type was repacked again as the reference type and caused the failure of + repacking. The fix is to move the corresponding code line to the correct + code block. + + (KY -2020/02/10, HDFFV-11014) + + High-Level APIs: + ------ + - The H5DSis_scale function was updated to return "not a dimension scale" (0) + instead of failing (-1), when CLASS or DIMENSION_SCALE attributes are + not written according to Dimension Scales Specification. + + (EIP - 2020/08/12, HDFFV-10436) + + Fortran High-Level APIs: + ------ + - None + + Documentation + ------------- + - None + + F90 APIs + -------- + - None + + C++ APIs + -------- + - None + + Testing + ------- + - Stopped java/test/junit.sh.in installing libs for testing under ${prefix} + + Lib files needed are now copied to a subdirectory in the java/test + directory, and on Macs the loader path for libhdf5.xxxs.so is changed + in the temporary copy of libhdf5_java.dylib. + + (LRK, 2020/7/2, HDFFV-11063) + + +Supported Platforms +=================== + + Linux 3.10.0-1127.10.1.el7 gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) + (echidna) GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) + + Linux 2.6.32-754.31.1.el6 IBM XL C/C++ V13.1 + #1 SMP ppc64 GNU/Linux IBM XL Fortran V15.1 + (ostrich) + + Linux 3.10.0-327.18.2.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (jelly/kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.3.0, Version 6.3.0, + Version 7.2.0, Version 8.3.0, Version 9.1.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.0.098 Build 20160721 + MPICH 3.3 compiled with GCC 7.2.0 + OpenMPI 4.0.0 compiled with GCC 7.2.0 + + SunOS 5.11 11.4.5.12.5.0 Sun C 5.15 SunOS_sparc 2017/05/30 + 32- and 64-bit Studio 12.6 Fortran 95 8.8 SunOS_sparc 2017/05/30 + (hedgehog) Sun C++ 5.15 SunOS_sparc 2017/05/30 + + Windows 7 x64 Visual Studio 2015 w/ Intel C, Fortran 2018 (cmake) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + Visual Studio 2017 w/ Intel Fortran 19 (cmake) + Visual Studio 2019 w/ Intel Fortran 19 (cmake) + Visual Studio 2019 w/ MSMPI 10.1 (cmake) + + macOS Mojave 10.14.6 Apple LLVM version 10.0.1 (clang-1001.0.46.4) + 64-bit gfortran GNU Fortran (GCC) 6.3.0 + (swallow) Intel icc/icpc/ifort version 19.0.4.233 20190416 + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y +Windows 7 x64 y y/y y y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +MacOS Sierra 10.12.6 64-bit n y/y n y y y +MacOS High Sierra 10.13.6 64-bit n y/y n y y y +MacOS Mojave 10.14.6 64-bit n y/y n y y y +CentOS 7.2 Linux 3.10.0 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.2 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-754.31.1.el6.ppc64 XL n y/y n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 x64 y y y y +Windows 10 y y y y +Windows 10 x64 y y y y +MacOS Sierra 10.12.6 64-bit y n y y +MacOS High Sierra 10.13.6 64-bit y n y y +MacOS Mojave 10.14.6 64-bit y n y y +CentOS 7.2 Linux 3.10.0 x86_64 PGI y y y n +CentOS 7.2 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.2 Linux 3.10.0 x86_64 Intel y y y n +Linux 2.6.32-754.31.1.el6.ppc64 XL y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus) Version 4.4.7 20120313 + Version 4.9.3, 5.3.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 19.10-0 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 2.6.32-754.31.1.el6 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.1(Tozai) + GCC Version 7.1.0 + OpenMPI 2.1.6-GCC-7.2.0-2.29, + 3.1.3-GCC-7.2.0-2.29 + Intel(R) C (icc) and C++ (icpc) compilers + Version 17.0.0.098 Build 20160721 + with NAG Fortran Compiler Release 6.1(Tozai) + + Linux 3.10.0-327.10.1.el7 MPICH 3.1.4 compiled with GCC 4.9.3 + #1 SMP x86_64 GNU/Linux + (moohan) + + Linux-3.10.0-1127.0.0.1chaos openmpi-4.0.0 + #1 SMP x86_64 GNU/Linux clang/3.9.0, 8.0.1 + (quartz) gcc/7.3.0, 8.1.0 + intel/16.0.4 + + Linux-4.14.0-115.10.1.1 spectrum-mpi/rolling-release + #1 SMP ppc64le GNU/Linux clang/coral-2018.08.08 + (lassen) gcc/7.3.1 + xl/2019.02.07 + + Linux-4.12.14-150.52-default cray-mpich/7.7.10 + #1 SMP x86_64 GNU/Linux gcc/7.3.0, 8.2.0 + (cori) intel/19.0.3 + + Linux-4.4.180-94.107-default cray-mpich/7.7.6 + # 1SMP x86_64 GNU/Linux gcc/7.2.0, 8.2.0 + (mutrino) intel/17.0.4, 18.0.2, 19.0.4 + + Fedora 32 5.7.15-200.fc32.x86_64 Clang version 10.0.0 (Fedora 10.0.0-2.fc32) + #1 SMP x86_64 GNU/Linux GNU gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1) + GNU Fortran (GCC) 10.2.1 20200723 (Red Hat 10.2.1) + (cmake and autotools) + + Mac OS X El Capitan 10.11.6 Apple clang version 7.3.0 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1011test) Intel icc/icpc/ifort version 16.0.2 + + macOS Sierra 10.12.6 Apple LLVM version 9.0.0 (clang-900.39.2) + 64-bit gfortran GNU Fortran (GCC) 7.4.0 + (kite) Intel icc/icpc/ifort version 17.0.2 + + macOS High Sierra 10.13.6 Apple LLVM version 10.0.0 (clang-1000.10.44.4) + 64-bit gfortran GNU Fortran (GCC) 6.3.0 + (bear) Intel icc/icpc/ifort version 19.0.4.233 20190416 + + SunOS 5.11 11.3 Sun C 5.15 SunOS_sparc + 32- and 64-bit Sun Fortran 95 8.8 SunOS_sparc + (emu) Sun C++ 5.15 SunOS_sparc + + +Known Problems +============== + 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. + ADB - 2019/05/07 + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + + Two tests fail attempting collective writes with OpenMPI 3.0.0/GCC-7.2.0-2.29: + testphdf5 (ecdsetw, selnone, cchunk1, cchunk3, cchunk4, and actualio) + t_shapesame (sscontig2) + + 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. + + 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. + + +CMake vs. Autotools installations +================================= +While both build systems produce similar results, there are differences. +Each system produces the same set of folders on linux (only CMake works +on standard Windows); bin, include, lib and share. Autotools places the +COPYING and RELEASE.txt file in the root folder, CMake places them in +the share folder. + +The bin folder contains the tools and the build scripts. Additionally, CMake +creates dynamic versions of the tools with the suffix "-shared". Autotools +installs one set of tools depending on the "--enable-shared" configuration +option. + build scripts + ------------- + Autotools: h5c++, h5cc, h5fc + CMake: h5c++, h5cc, h5hlc++, h5hlcc + +The include folder holds the header files and the fortran mod files. CMake +the share folder. + +The bin folder contains the tools and the build scripts. Additionally, CMake +places the fortran mod files into separate shared and static subfolders, +while Autotools places one set of mod files into the include folder. Because +CMake produces a tools library, the header files for tools will appear in +the include folder. + +The lib folder contains the library files, and CMake adds the pkgconfig +subfolder with the hdf5*.pc files used by the bin/build scripts created by +the CMake build. CMake separates the C interface code from the fortran code by +creating C-stub libraries for each Fortran library. In addition, only CMake +installs the tools library. The names of the szip libraries are different +between the build systems. + +The share folder will have the most differences because CMake builds include +a number of CMake specific files for support of CMake's find_package and support +for the HDF5 Examples CMake project. + + + +%%%%1.10.6%%%% + +HDF5 version 1.10.6 released on 2019-12-23 +================================================================================ + + +INTRODUCTION + +This document describes the differences between this release and the previous +HDF5 release. It contains information on the platforms tested and known +problems in this release. For more details check the HISTORY*.txt files in the +HDF5 source. + +Note that documentation in the links below will be updated at the time of each +final release. + +Links to HDF5 documentation can be found on The HDF5 web page: + + https://portal.hdfgroup.org/display/HDF5/HDF5 + +The official HDF5 releases can be obtained from: + + https://www.hdfgroup.org/downloads/hdf5/ + +Changes from Release to Release and New Features in the HDF5-1.10.x release series +can be found at: + + https://portal.hdfgroup.org/display/HDF5/HDF5+Application+Developer%27s+Guide + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.10.5 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems +- CMake vs. Autotools installations + + +New Features +============ + + Configuration: + ------------- + - Update CMake for VS2019 support + + CMake added support for VS2019 in version 3.15. Changes to the CMake + generator setting required changes to scripts. Also updated version + references in CMake files as necessary. + + (ADB - 2019/11/18, HDFFV-10962) + + - Update CMake options to match new autotools options + + Add configure options (autotools - CMake): + enable-asserts HDF5_ENABLE_ASSERTS + enable-symbols HDF5_ENABLE_SYMBOLS + enable-profiling HDF5_ENABLE_PROFILING + enable-optimization HDF5_ENABLE_OPTIMIZATION + In addition NDEBUG is no longer forced defined and relies on the CMake + process. + + (ADB - 2019/10/07, HDFFV-100901, HDFFV-10637, TRILAB-97) + + - Update CMake tests to use FIXTURES + + CMake test fixtures allow setup/cleanup tests and other dependency + requirements as properties for tests. This is more flexible for + modern CMake code. + + (ADB - 2019/07/23, HDFFV-10529) + + - Windows PDB files are always installed + + There are build configuration or flag settings for Windows that may not + generate PDB files. If those files are not generated then the install + utility will fail because those PDB files are not found. An optional + variable, DISABLE_PDB_FILES, was added to not install PDB files. + + (ADB - 2019/07/17, HDFFV-10424) + + - Add mingw CMake support with a toolchain file + + There have been a number of mingw issues that have been linked under + HDFFV-10845. It has been decided to implement the CMake cross-compiling + technique of toolchain files. We will use a linux platform with the mingw + compiler stack for testing. Only the C language is fully supported, and + the error tests are skipped. The C++ language works for static but shared + builds have a shared library issue with the mingw Standard Exception Handling + library, which is not available on Windows. Fortran has a common cross-compile + problem with the fortran configure tests. + + (ADB - 2019/07/12, HDFFV-10845, HDFFV-10595) + + - Windows PDB files are installed incorrectly + + For static builds, the PDB files for windows should be installed next + to the static libraries in the lib folder. Also the debug versions of + libraries and PDB files are now correctly built using the default + CMAKE_DEBUG_POSTFIX setting. + + (ADB - 2019/07/09, HDFFV-10581) + + - Add option to build only shared libs + + A request was made to prevent building static libraries and only build + shared. A new option was added to CMake, ONLY_SHARED_LIBS, which will + skip building static libraries. Certain utility functions will build with + static libs but are not published. Tests are adjusted to use the correct + libraries depending on SHARED/STATIC settings. + + (ADB - 2019/06/12, HDFFV-10805) + + - Add options to enable or disable building tools and tests + + Configure options --enable-tests and --enable-tools were added for + autotools configure. These options are enabled by default, and can be + disabled with either --disable-tests (or tools) or --enable-tests=no + (or --enable-tools=no). Build time is reduced ~20% when tools are + disabled, 35% when tests are disabled, 45% when both are disabled. + Re-enabling them after the initial build requires running configure + again with the option(s) enabled. + + (LRK - 2019/06/12, HDFFV-9976) + + - Change tools tests to search the error stack + + There are some use cases which can cause the error stack of tools to be + different then the expected output. These tests now use grepTest.cmake; + this was changed to allow the error file to be searched for an expected string. + + (ADB - 2019/04/15, HDFFV-10741) + + + Library: + -------- + - Added S3 and HDFS Virtual File Drivers (VFDs) to HDF5 + + These new VFDs have been introduced in HDF5-1.10.6. Instructions to + enable them when configuring HDF5 on Linux and Mac may be found at + https://portal.hdfgroup.org/display/HDF5/Virtual+File+Drivers+-+S3+and+HDFS. + + Installing on Windows requires CMake 3.13 and the following additional setup. + Install openssl library (with dev files); + from "Shining Light Productions". msi package preferred. + + PATH should have been updated with the installation dir. + set ENV variable OPENSSL_ROOT_DIR to the installation dir. + set ENV variable OPENSSL_CONF to the cfg file, likely %OPENSSL_ROOT_DIR%\bin\openssl.cfg + Install libcurl library (with dev files); + download the latest released version using git: https://github.com/curl/curl.git + + Open a Visual Studio Command prompt + change to the libcurl root folder + run the "buildconf.bat" batch file + change to the winbuild directory + nmake /f Makefile.vc mode=dll MACHINE=x64 + copy libcurl-vc-x64-release-dll-ipv6-sspi-winssl dir to C:\curl (installation dir) + set ENV variable CURL_ROOT to C:\curl (installation dir) + update PATH ENV variable to %CURL_ROOT%\bin (installation bin dir). + the aws credentials file should be in %USERPROFILE%\.aws folder + set the ENV variable "HDF5_ROS3_TEST_BUCKET_URL=https://s3.us-east-2.amazonaws.com/hdf5ros3" + + (ADB - 2019/09/12, HDFFV-10854) + + C++ Library: + ------------ + - Added new wrappers for H5Pset/get_create_intermediate_group() + LinkCreatPropList::setCreateIntermediateGroup() + LinkCreatPropList::getCreateIntermediateGroup() + + (BMR - 2019/04/22, HDFFV-10622) + + + Java Library: + ---------------- + - Fixed a failure in JUnit-TestH5P on 32-bit architectures + + (JTH - 2019/04/30) + + +Support for new platforms, languages and compilers. +======================================= + - CMake added support for VS2019 in version 3.15. Updated scripts. + + - macOS 10.13.6 Darwin 17.7.0 with Apple clang LLVM version 10.0.0 + + - macOS 10.14.6 Darwin 18.7.0 with Apple clang LLVM version 10.0.1 + + +Bug Fixes since HDF5-1.10.5 release +================================== + + Library + ------- + - Improved performance when creating a large number of small datasets by + retrieving default property values from the API context instead of doing + skip list searches. More work is required to achieve parity with HDF5 1.8. + + (CJH - 2019/12/10, HDFFV-10658) + + - Fixed user-created data access properties not existing in the property list + returned by H5Dget_access_plist. Thanks to Steven Varga for submitting a + reproducer and a patch. + + (CJH - 2019/12/9, HDFFV-10934) + + - Inappropriate linking with deprecated MPI C++ libraries + + HDF5 does not define *_SKIP_MPICXX in the public headers, so applications + can inadvertently wind up linking to the deprecated MPI C++ wrappers. + + MPICH_SKIP_MPICXX and OMPI_SKIP_MPICXX have both been defined in H5public.h + so this should no longer be an issue. HDF5 makes no use of the deprecated + MPI C++ wrappers. + + (DER - 2019/09/17, HDFFV-10893) + + - fcntl(2)-based file locking incorrectly passed the lock argument struct + instead of a pointer to the struct, causing errors on systems where + flock(2) is not available. + + File locking is used when files are opened to enforce SWMR semantics. A + lock operation takes place on all file opens unless the + HDF5_USE_FILE_LOCKING environment variable is set to the string "FALSE". + flock(2) is preferentially used, with fcntl(2) locks as a backup if + flock(2) is unavailable on a system (if neither is available, the lock + operation fails). On these systems, the file lock will often fail, which + causes HDF5 to not open the file and report an error. + + This bug only affects POSIX systems. Win32 builds on Windows use a no-op + locking call which always succeeds. Systems which exhibit this bug will + have H5_HAVE_FCNTL defined but not H5_HAVE_FLOCK in the configure output. + + This bug affects HDF5 1.10.0 through 1.10.5. + + fcntl(2)-based file locking now correctly passes the struct pointer. + + (DER - 2019/08/27, HDFFV-10892) + + - Fixed a bug caused by a bad tag value when condensing object header + messages + + There was an assertion failure when moving messages from running a + user test program with library release HDF5 1.10.4. It was because + the tag value (object header's address) was not set up when entering + the library routine H5O__chunk_update_idx(), which eventually + verifies the metadata tag value when protecting the object header. + + The problem was fixed by replacing FUNC_ENTER_PACKAGE in H5O__chunk_update_idx() + with FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) to set up the metadata tag. + + (VC - 2019/08/23, HDFFV-10873) + + - Fixed the test failure from test_metadata_read_retry_info() in + test/swmr.c + + The test failure is due to an incorrect number of bins returned for + retry info (info.nbins). The # of bins expected for 101 read attempts + is 3 instead of 2. The routine H5F_set_retries() in src/H5Fint.c + calculates the # of bins by first obtaining the log10 value for + (read attempts - 1). For PGI/19, the log10 value for 100 read attempts + is 1.9999999999999998 instead of 2.00000. When casting the log10 value + to unsigned later on, the decimal part is chopped off causing the test + failure. + + This was fixed by obtaining the rounded integer value (HDceil) for the + log10 value of read attempts first before casting the result to unsigned. + + (VC - 2019/8/14, HDFFV-10813) + + - Fixed an issue when creating a file with non-default file space info + together with library high bound setting to H5F_LIBVER_V18. + + When setting non-default file space info in fcpl via + H5Pset_file_space_strategy() and then creating a file with both high and + low library bounds set to H5F_LIBVER_V18 in fapl, the library succeeds in + creating the file. File creation should fail because the feature of + setting non-default file space info does not exist in library release 1.8 + or earlier. + + This was fixed by setting and checking the proper version in the file + space info message based on the library low and high bounds when creating + and opening the HDF5 file. + + (VC - 2019/6/25, HDFFV-10808) + + - Fixed an issue where copying a version 1.8 dataset between files using + H5Ocopy fails due to an incompatible fill version + + When using the HDF5 1.10.x H5Ocopy() API call to copy a version 1.8 + dataset to a file created with both high and low library bounds set to + H5F_LIBVER_V18, the H5Ocopy() call will fail with the error stack indicating + that the fill value version is out of bounds. + + This was fixed by changing the fill value message version to H5O_FILL_VERSION_3 + (from H5O_FILL_VERSION_2) for H5F_LIBVER_V18. + + (VC - 2019/6/14, HDFFV-10800) + + - Fixed a bug that would cause an error or cause fill values to be + incorrectly read from a chunked dataset using the "single chunk" index if + the data was held in cache and there was no data on disk. + + (NAF - 2019/03/06) + + - Fixed a bug that could cause an error or cause fill values to be + incorrectly read from a dataset that was written to using H5Dwrite_chunk + if the dataset was not closed after writing. + + (NAF - 2019/03/06, HDFFV-10716) + + - Fixed memory leak in scale offset filter + + In a special case where the MinBits is the same as the number of bits in + the datatype's precision, the filter's data buffer was not freed, causing + the memory usage to grow. In general the buffer was freed correctly. The + Minbits are the minimal number of bits to store the data values. Please + see the reference manual for H5Pset_scaleoffset for the details. + + (RL - 2019/3/4, HDFFV-10705) + + + Configuration + ------------- + - Correct option for default API version + + CMake options for default API version are not mutually exclusive. + Change the multiple BOOL options to a single STRING option with the + strings; v16, v18, v110. + + (ADB - 2019/08/12, HDFFV-10879) + + Tools + ----- + - h5repack was fixed to repack datasets with external storage + to other types of storage. + + New test added to repack files and verify the correct data using h5diff. + + (JS - 2019/09/25, HDFFV-10408) + (ADB - 2019/10/02, HDFFV-10918) + + +Supported Platforms +=================== + + Linux 2.6.32-696.20.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (jelly/kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.0.098 Build 20160721 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + + Windows 7 x64 Visual Studio 2015 w/ Intel C, Fortran 2018 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + Visual Studio 2017 w/ Intel Fortran 19 (cmake) + Visual Studio 2019 w/ Intel Fortran 19 (cmake) + + macOS 10.13.6, Darwin, Apple clang LLVM version 10.0.0 + 17.7.0, x86_64 gfortran GNU Fortran (GCC) 6.3.0 + (bear) Intel icc/icpc/ifort version 19.0.4 + + macOS 10.14.6, Darwin Apple clang LLVM version 10.0.1 + 18.7.0, x86_64 gfortran GNU Fortran (GCC) 6.3.0 + (bobcat) Intel icc/icpc/ifort version 19.0.4 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y y y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y +MacOS High Sierra 10.13.6 64-bit n y/y n y y y +CentOS 7.2 Linux 3.10.0 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.2 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-573.18.1.el6.ppc64 n y/y n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Yosemite 10.10.5 64-bit y y y y +Mac OS X El Capitan 10.11.6 64-bit y y y y +MacOS High Sierra 10.13.6 64-bit y y y y +CentOS 7.2 Linux 3.10.0 x86_64 PGI y y y n +CentOS 7.2 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.2 Linux 3.10.0 x86_64 Intel y y y n +Linux 2.6.32-573.18.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following configurations are not supported but have been tested for this release. + + Linux 2.6.32-754.11.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.9.3, 5.3.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 17.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.2(Chiyoda) + GCC Version 7.1.0 + MPICH 3.2-GCC-4.9.3 + MPICH 3.2.1-GCC-7.2.0-2.29 + OpenMPI 2.1.5-GCC-7.2.0-2.29 + Intel(R) C (icc) and C++ (icpc) compilers + Version 17.0.0.098 Build 20160721 + with NAG Fortran Compiler Release 6.2(Chiyoda) + + Linux 3.10.0-327.10.1.el7 MPICH 3.2 compiled with GCC 5.3.0 + #1 SMP x86_64 GNU/Linux + (moohan) + + Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with + #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 + (ostrich) and IBM XL Fortran for Linux, V15.1 + + Fedora30 5.3.11-200.fc30.x86_64 + #1 SMP x86_64 GNU/Linux GNU gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1 20190827) + GNU Fortran (GCC) 9.2.1 20190827 (Red Hat 9.2.1 20190827) + (cmake and autotools) + + Mac OS X 10.11.6, Darwin, Apple clang version 7.3.0 from Xcode 7.3 + 15.6.0, x86-64 gfortran GNU Fortran (GCC) 5.2.0 + (osx1011test) Intel icc/icpc/ifort version 16.0.2 + + macOS 10.12.6, Darwin, Apple clang LLVM version 8.1.0 from Xcode 8.3 + 16.6.0, x86_64 gfortran GNU Fortran (GCC) 7.1.0 + (kite) Intel icc/icpc/ifort version 17.0.2 + + Windows 7 x64 Visual Studio 2008 + + +Known Problems +============== + 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. + ADB - 2019/05/07 + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + + Three tests fail with OpenMPI 3.0.0/GCC-7.2.0-2.29: + testphdf5 (ecdsetw, selnone, cchunk1, cchunk3, cchunk4, and actualio) + t_shapesame (sscontig2) + t_pflush1/fails on exit + The first two tests fail attempting collective writes. + + Parallel builds using OpenMPI 3.03 or later and romio fail several tests + with collective writes or compression that will not fail when ompio is used + instead of romio. This can be done by adding "--mca io ompio" to the mpirun + command. For example, in autotools builds RUNPARALLEL can be set to + "mpirun --mca io ompio -n 6" provided ompio is installed. + + CPP ptable test fails on VS2017 with Intel compiler, JIRA issue: HDFFV-10628. + This test will pass with VS2015 with Intel compiler. + + Older MPI libraries such as OpenMPI 2.0.1 and MPICH 2.1.5 were tested + while attempting to resolve the Jira issue: HDFFV-10540. + The known problems of reading or writing > 2GBs when using MPI-2 was + partially resolved with the MPICH library. The proposed support recognizes + IO operations > 2GB and if the datatype is not a derived type, the library + breaks the IO into chunks which can be input or output with the existing + MPI 2 limitations, i.e. size reporting and function API size/count + arguments are restricted to be 32 bit integers. For derived types larger + than 2GB, MPICH 2.1.5 fails while attempting to read or write data. + OpenMPI in contrast, implements MPI-3 APIs even in the older releases + and thus does not suffer from the 32 bit size limitation described here. + OpenMPI releases prior to v3.1.3 appear to have other datatype issues however, + e.g. within a single parallel test (testphdf5) the subtests (cdsetr, eidsetr) + report data verfication errors before eventually aborting. + The most recent versions of OpenMPI (v3.1.3 or newer) have evidently + resolved these isses and parallel HDF5 testing does not currently report + errors though occasional hangs have been observed. + + 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. + + +CMake vs. Autotools installations +================================= +While both build systems produce similar results, there are differences. +Each system produces the same set of folders on linux (only CMake works +on standard Windows); bin, include, lib and share. Autotools places the +COPYING and RELEASE.txt file in the root folder, CMake places them in +the share folder. + +The bin folder contains the tools and the build scripts. Additionally, CMake +creates dynamic versions of the tools with the suffix "-shared". Autotools +installs one set of tools depending on the "--enable-shared" configuration +option. + build scripts + ------------- + Autotools: h5c++, h5cc, h5fc + CMake: h5c++, h5cc, h5hlc++, h5hlcc + +The include folder holds the header files and the fortran mod files. CMake +places the fortran mod files into separate shared and static subfolders, +while Autotools places one set of mod files into the include folder. Because +CMake produces a tools library, the header files for tools will appear in +the include folder. + +The lib folder contains the library files, and CMake adds the pkgconfig +subfolder with the hdf5*.pc files used by the bin/build scripts created by +the CMake build. CMake separates the C interface code from the fortran code by +creating C-stub libraries for each Fortran library. In addition, only CMake +installs the tools library. The names of the szip libraries are different +between the build systems. + +The share folder will have the most differences because CMake builds include +a number of CMake specific files for support of CMake's find_package and support +for the HDF5 Examples CMake project. + +%%%%1.10.5%%%% + +HDF5 version 1.10.5 released on 2019-02-25 +================================================================================ + + +INTRODUCTION + +This document describes the differences between this release and the previous +HDF5 release. It contains information on the platforms tested and known +problems in this release. For more details check the HISTORY*.txt files in the +HDF5 source. + +Note that documentation in the links below will be updated at the time of each +final release. + +Links to HDF5 documentation can be found on The HDF5 web page: + + https://portal.hdfgroup.org/display/HDF5/HDF5 + +The official HDF5 releases can be obtained from: + + https://www.hdfgroup.org/downloads/hdf5/ + +Changes from Release to Release and New Features in the HDF5-1.10.x release series +can be found at: + + https://portal.hdfgroup.org/display/HDF5/HDF5+Application+Developer%27s+Guide + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.10.4 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems +- CMake vs. Autotools installations + + +New Features +============ + + Configuration: + ------------- + - Cross compile on mutrino and other Cray XC40 systems. + + Added support for CMake options to use CrayLinuxEnvironment, craype-mic-knl + module for building with craype-haswell module for configuration, and + batch scripts in bin/batch for use with sbatch or bsub to run tests in + batch jobs on compute nodes. An instruction file README_HPC describing + the use of these options was added in release_docs. + + (LRK - 2019/02/18, TRILABS-34) + + - Rework CMake command files to fix MPI testing. + + Added setup fixture to remove any test generated files and added DEPENDS + to test properties to execute tests in order expected. + + (ADB - 2019/02/14, TRILABS-111) + + - Disable SZIP or ZLIB options if TGZ files are not available. + + Changed the TGZ option for SZip and ZLib to disable the options + if the source tar.gz files are not found. + + (ADB - 2019/02/05, HDFFV-10697) + + - Added a new option to enable/disable using pread/pwrite instead of + read/write in the sec2, log, and core VFDs. + + This option is enabled by default when pread/pwrite are detected. + + Autotools: --enable-preadwrite + CMake: HDF5_ENABLE_PREADWRITE + + (DER - 2019/02/03, HDFFV-10696) + + - Rework CMake versioning for OSX platforms. + + Changed the current_version and compatibility_version flags from optional + with HDF5_BUILD_WITH_INSTALL_NAME to always setting the flags for OSX. + + (ADB - 2019/01/22, HDFFV-10685) + + - Rework CMake command files to eliminate developer CMP005 warning + + Use variables without quotes in if () statements. + + (ADB - 2019/01/18, TILABS-105) + + - Rework CMake configure files to eliminate developer CMP0075 warning + + Renamed varname to HDF5_REQUIRED_LIBRARIES as the contents were not + required for configuration. Also moved check includes calls to top of + files. + + (ADB - 2019/01/03, HDFFV-10546) + + - Keep stderr and stdout separate in tests + + Changed test handling of output capture. Tests now keep the stderr + output separate from the stdout output. It is up to the test to decide + which output to check against a reference. Also added the option + to grep for a string in either output. + + (ADB - 2018/12/12, HDFFV-10632) + + - Incorrectly installed private header files were removed from + CMake installs. + + The CMake build files incorrectly flagged the following header files + as public and installed them. They are private and will no longer be + installed. + + HDF5 library private package files (H5Xpkg.h) + H5Edefin.h + H5Einit.h + H5Eterm.h + H5LTparse.h + h5diff.h + h5tools_dump.h + h5tools.h + h5tools_ref.h + h5tools_str.h + h5tools_utils.h + h5trav.h + + (DER - 2018/10/26, HDFFV-10614, 10609) + + - Autotools installs now install H5FDwindows.h + + This is simply to align the installed header files between the + autotools and CMake. H5FDwindows.h has no functionality on + non-Windows systems. + + (DER - 2018/10/26, HDFFV-10614) + + + Library: + -------- + - The sec2, log, and core VFDs can now use pread/pwrite instead of + read/write. + + pread and pwrite do not change the file offset, a feature that was + requested by a user working with a multi-threaded application. + + The option to configure this feature is described above. + + (DER - 2019/02/03, HDFFV-10696) + + - Add ability to minimze dataset object headers. + + Creation of many, very small datasets resulted in extensive file bloat + due to extra space in the dataset object headers -- this space is + allocated by default to allow for the insertion of a small number of + attributes within the object header and not require a continuation + block, an unnecessary provision in the target use case. + + Inform the library to expect no attributes on created datasets, and to + allocate the least space possible for the object headers. + NOTE: A continuation block is created if attributes are added to a + 'minimized' dataset, which can reduce performance. + NOTE: Some extra space is allocated for attributes essential to the + correct behavior of the object header (store creation times, e.g.). This + does not violate the design principle, as the space is calculated and + allocated as needed at the time of dataset object header creation -- + unused space is not generated. + New API calls: + H5Fget_dset_no_attrs_hint + H5Fset_dset_no_attrs_hint + H5Pget_dset_no_attrs_hint + H5Pset_dset_no_attrs_hint + + (JOS - 2019/01/04, TRILAB-45) + + - Added new chunk query functions + + The following public functions were added to discover information about + the chunks in an HDF5 file. + herr_t H5Dget_num_chunks(dset_id, fspace_id, *nchunks) + herr_t H5Dget_chunk_info_by_coord(dset_id, *coord, *filter_mask, *addr, *size) + herr_t H5Dget_chunk_info(dset_id, fspace_id, index, *coord, *filter_mask, *addr, *size) + + (BMR - 2018/11/07, HDFFV-10615) + + - Several empty public header files where removed from the distribution + + The following files were empty placeholders. They are for internal + packages that are unlikely to ever have public functionality and have + thus been removed. + + H5Bpublic.h + H5B2public.h + H5FSpublic.h + H5HFpublic.h + H5HGpublic.h + H5HLpublic.h + + They were only installed in CMake builds. + + (DER - 2018/10/26, HDFFV-10614) + + + Parallel Library: + ----------------- + - Changed the default behavior in parallel when reading the same dataset in its entirety + (i.e. H5S_ALL dataset selection) which is being read by all the processes collectively. + The dataset must be contiguous, less than 2GB, and of an atomic datatype. + The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from + the disk by the root process to the remain processes in the MPI communicator associated + with the HDF5 file. + + (MSB - 2019/01/02, HDFFV-10652) + + - All MPI-1 API calls have been replaced with MPI-2 equivalents. + + This was done to better support OpenMPI, as default builds no longer + include MPI-1 support (as of OpenMPI 4.0). + + (DER - 2018/12/30, HDFFV-10566) + + Fortran Library: + ---------------- + - Added wrappers for dataset object header minimization calls. + (see the note for TRILAB-45, above) + + New API calls: + + h5fget_dset_no_attrs_hint_f + h5fset_dset_no_attrs_hint_f + h5pget_dset_no_attrs_hint_f + h5pset_dset_no_attrs_hint_f + + (DER - 2019/01/09, TRILAB-45) + + - Added new Fortran derived type, c_h5o_info_t, which is interoperable with + C's h5o_info_t. This is needed for callback functions which + pass C's h5o_info_t data type definition. + + (MSB, 2019/01/08, HDFFV-10443) + + - Added new Fortran API, H5gmtime, which converts (C) 'time_t' structure + to Fortran DATE AND TIME storage format. + + (MSB, 2019/01/08, HDFFV-10443) + + - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f, + h5oget_info, h5oget_info_by_idx and h5ovisit_by_name_f. + + (MSB, 2019/01/08, HDFFV-10443) + + C++ Library: + ------------ + - Added new function to the C++ interface + + Added wrapper for H5Ovisit2: + H5Object::visit() + + (BMR - 2019/02/14, HDFFV-10532) + + + Java Library: + ---------------- + - Rewrote the JNI error handling to be much cleaner + + (JTH - 2019/02/12) + + - Add new functions to java interface + + Added wrappers for: + H5Fset_libver_bounds + H5Fget_dset_no_attrs_hint/H5Fset_dset_no_attrs_hint + H5Pget_dset_no_attrs_hint/H5Pset_dset_no_attrs_hint + + (ADB - 2019/01/07, HDFFV-10664) + + - Fix java unit tests when Time is a natural number + + Time substitution in java/test/junit.sh.in doesn't + handle the case when Time is a natural number. Fixed + the regular expression. + + (ADB - 2019/01/07, HDFFV-10674) + + - Duplicate the data read/write functions of Datasets for Attributes. + + Region references could not be displayed for attributes as they could + for datasets. Datasets had overloaded read and write functions for different + datatypes that were not available for attributes. After adding similar + functions, attribute region references work normally. + + (ADB - 2018/12/12, HDFVIEW-4) + + + Tools: + ------ + - The h5repart -family-to-sec2 argument was changed to -family-to-single + + In order to better support other single-file VFDs which could work with + h5repart, the -family-to-sec2 argument was renamed to -family-to-single. + This is just a name change and the functionality of the argument has not + changed. + + The -family-to-sec2 argument has been kept for backwards-compatibility. + This argument should be considered deprecated. + + (DER - 2018/11/14, HDFFV-10633) + + +Bug Fixes since HDF5-1.10.4 release +================================== + + Library + ------- + - Fix hangs with collective metadata reads during chunked dataset I/O + + In the parallel library, it was discovered that when a particular + sequence of operations following a pattern of: + + "write to chunked dataset" -> "flush file" -> "read from dataset" + + occurred with collective metadata reads enabled, hangs could be + observed due to certain MPI ranks not participating in the collective + metadata reads. + + To fix the issue, collective metadata reads are now disabled during + chunked dataset raw data I/O. + + (JTH - 2019/02/11, HDFFV-10563, HDFFV-10688) + + - Performance issue when closing an object + + The slow down is due to the search of the "tag_list" to find + out the "corked" status of an object and "uncork" it if so. + + Improve performance by skipping the search of the "tag_list" + if there are no "corked" objects when closing an object. + + (VC - 2019/02/06) + + - Uninitialized bytes from a type conversion buffer could be written + to disk in H5Dwrite calls where type conversion takes place + and the type conversion buffer was created by the HDF5 library. + + When H5Dwrite is called and datatype conversion must be performed, + the library will create a temporary buffer for type conversion if + one is not provided by the user via H5Pset_buffer. This internal + buffer is allocated via malloc and contains uninitialized data. In + some datatype conversions (float to long double, possibly others), + some of this uninitialized data could be written to disk. + + This was flagged by valgrind in the dtransform test and does not + appear to be a common occurrence (it is flagged in one test out + of the entire HDF5 test suite). + + Switching to calloc fixed the problem. + + (DER - 2019/02/03, HDFFV-10694) + + - There was missing protection against division by zero reported to + The HDF Group as issue #CVE-2018-17434. + + Protection against division by zero was added to address the issue + #CVE-2018-17434. + + (BMR - 2019/01/29, HDFFV-10586) + + - The issue CVE-2018-17437 was reported to The HDF Group + + Although CVE-2018-17437 reported a memory leak, the actual issue + was invalid read. It was found that the attribute name length + in an attribute message was corrupted, which caused the buffer + pointer to be advanced too far and later caused an invalid read. + + A check was added to detect when the attribute name or its length + was corrupted and report the potential of data corruption. + + (BMR - 2019/01/29, HDFFV-10588) + + - H5Ewalk did not stop when it was supposed to + + H5Ewalk was supposed to stop when the callback function stopped + even though the errors in the stack were not all visited, but it + did not. This problem is now fixed. + + (BMR - 2019/01/29, HDFFV-10684) + + - Revert H5Oget_info* and H5Ovisit* functions + + In 1.10.3 new H5Oget_info*2 and H5Ovisit*2 functions were + added for performance. Inadvertently, the original functions; + H5Oget_info, + H5Oget_info_by_name, + H5Oget_info_by_idx, + H5Ovisit, + H5Ovisit_by_name + were versioned to H5Oget_info*1 and H5Ovisit*1. This + broke the API compatibility for a maintenance release. The + original functions have been restored. + + (ADB - 2019/01/24, HDFFV-10686) + + - Fixed a potential invalid memory access and failure that could occur when + decoding an unknown object header message (from a future version of the + library). + + (NAF - 2019/01/07) + + - Deleting attributes in dense storage + + The library aborts with "infinite loop closing library" after + attributes in dense storage are created and then deleted. + + When deleting the attribute nodes from the name index v2 B-tree, + if an attribute is found in the intermediate B-tree nodes, + which may be merged/redistributed in the process, we need to + free the dynamically allocated spaces for the intermediate + decoded attribute. + + (VC - 2018/12/26, HDFFV-10659) + + - There was missing protection against division by zero reported to + The HDF Group as issue #CVE-2018-17233. + + Protection against division by zero was added to address the issue + #CVE-2018-17233. In addition, several similar occurrences in the same + file were fixed as well. + + (BMR - 2018/12/23, HDFFV-10577) + + - Fixed an issue where the parallel filters tests would fail + if zlib was not available on the system. Until support can + be added in the tests for filters beyond gzip/zlib, the tests + will be skipped if zlib is not available. + + (JTH - 2018/12/05) + + - A bug was discovered in the parallel library where an application + would eventually consume all of the available MPI communicators + when continually writing to a compressed dataset in parallel. This + was due to internal copies of an HDF5 File Access Property List, + which each contained a copy of the MPI communicator, not being + closed at the end of each write operation. This problem was + exacerbated by larger numbers of processors. + + (JTH - 2018/12/05, HDFFV-10629) + + + Fortran + -------- + - Fixed issue with Fortran not returning h5o_info_t field values + meta_size%attr%index_size and meta_size%attr%heap_size. + + (MSB, 2019/01/08, HDFFV-10443) + + - Added symbolic links libhdf5_hl_fortran.so to libhdf5hl_fortran.so and + libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for + autotools installs. These were added to match the name of the files + installed by cmake and the general pattern of hl lib files. We will + change the names of the installed lib files to the matching name in + the next major release. + + (LRK - 2019/01/04, HDFFV-10596) + + - Made Fortran specific subroutines PRIVATE in generic procedures. + + Affected generic procedures were functions in H5A, H5D, H5P, H5R and H5T. + + (MSB, 2018/12/04, HDFFV-10511) + + + Testing + ------- + - Fixed a test failure in testpar/t_dset.c caused by + the test trying to use the parallel filters feature + on MPI-2 implementations. + + (JTH, 2019/2/7) + + +Supported Platforms +=================== + + Linux 2.6.32-696.16.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.0.098 Build 20160721 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 7 x64 Visual Studio 2013 + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ Intel C, Fortran 2018 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + Visual Studio 2017 w/ Intel Fortran 18 (cmake) + + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3.0 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + MacOS High Sierra 10.13.6 Apple LLVM version 10.0.0 (clang/clang++-1000.10.44.4) + 64-bit gfortran GNU Fortran (GCC) 8.3.0 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y y y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y +MacOS High Sierra 10.13.6 64-bit n y/y n y y y +CentOS 7.2 Linux 3.10.0 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.2 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-573.18.1.el6.ppc64 n y/y n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Yosemite 10.10.5 64-bit y y y y +Mac OS X El Capitan 10.11.6 64-bit y y y y +MacOS High Sierra 10.13.6 64-bit y y y y +CentOS 7.2 Linux 3.10.0 x86_64 PGI y y y n +CentOS 7.2 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.2 Linux 3.10.0 x86_64 Intel y y y n +Linux 2.6.32-573.18.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following configurations are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.9.3, 5.3.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 17.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.1(Tozai) + GCC Version 7.1.0 + MPICH 3.2-GCC-4.9.3 + MPICH 3.2.1-GCC-7.2.0-2.29 + OpenMPI 2.1.5-GCC-7.2.0-2.29 + Intel(R) C (icc) and C++ (icpc) compilers + Version 17.0.0.098 Build 20160721 + with NAG Fortran Compiler Release 6.1(Tozai) + + Linux 3.10.0-327.10.1.el7 MPICH 3.2 compiled with GCC 5.3.0 + #1 SMP x86_64 GNU/Linux + (moohan) + + Fedora 29 4.20.10-200.fc29.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc, g++ (GCC) 8.2.1 20181215 + (Red Hat 8.2.1-6) + GNU Fortran (GCC) 8.2.1 20181215 + (Red Hat 8.2.1-6) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2008 + + +Known Problems +============== + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + + Three tests fail with OpenMPI 3.0.0/GCC-7.2.0-2.29: + testphdf5 (ecdsetw, selnone, cchunk1, cchunk3, cchunk4, and actualio) + t_shapesame (sscontig2) + t_pflush1/fails on exit + The first two tests fail attempting collective writes. + + CPP ptable test fails on VS2017 with Intel compiler, JIRA issue: HDFFV-10628. + This test will pass with VS2015 with Intel compiler. + + Older MPI libraries such as OpenMPI 2.0.1 and MPICH 2.1.5 were tested + while attempting to resolve the Jira issue: HDFFV-10540. + The known problems of reading or writing > 2GBs when using MPI-2 was + partially resolved with the MPICH library. The proposed support recognizes + IO operations > 2GB and if the datatype is not a derived type, the library + breaks the IO into chunks which can be input or output with the existing + MPI 2 limitations, i.e. size reporting and function API size/count + arguments are restricted to be 32 bit integers. For derived types larger + than 2GB, MPICH 2.1.5 fails while attempting to read or write data. + OpenMPI in contrast, implements MPI-3 APIs even in the older releases + and thus does not suffer from the 32 bit size limitation described here. + OpenMPI releases prior to v3.1.3 appear to have other datatype issues however, + e.g. within a single parallel test (testphdf5) the subtests (cdsetr, eidsetr) + report data verfication errors before eventually aborting. + The most recent versions of OpenMPI (v3.1.3 or newer) have evidently + resolved these isses and parallel HDF5 testing does not currently report + errors though occasional hangs have been observed. + + 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. + + +CMake vs. Autotools installations +================================= +While both build systems produce similar results, there are differences. +Each system produces the same set of folders on linux (only CMake works +on standard Windows); bin, include, lib and share. Autotools places the +COPYING and RELEASE.txt file in the root folder, CMake places them in +the share folder. + +The bin folder contains the tools and the build scripts. Additionally, CMake +creates dynamic versions of the tools with the suffix "-shared". Autotools +installs one set of tools depending on the "--enable-shared" configuration +option. + build scripts + ------------- + Autotools: h5c++, h5cc, h5fc + CMake: h5c++, h5cc, h5hlc++, h5hlcc + +The include folder holds the header files and the fortran mod files. CMake +places the fortran mod files into separate shared and static subfolders, +while Autotools places one set of mod files into the include folder. Because +CMake produces a tools library, the header files for tools will appear in +the include folder. + +The lib folder contains the library files, and CMake adds the pkgconfig +subfolder with the hdf5*.pc files used by the bin/build scripts created by +the CMake build. CMake separates the C interface code from the fortran code by +creating C-stub libraries for each Fortran library. In addition, only CMake +installs the tools library. The names of the szip libraries are different +between the build systems. + +The share folder will have the most differences because CMake builds include +a number of CMake specific files for support of CMake's find_package and support +for the HDF5 Examples CMake project. + %%%%1.10.4%%%% HDF5 version 1.10.4 released on 2018-10-05 diff --git a/release_docs/HISTORY-1_10_0-1_12_0.txt b/release_docs/HISTORY-1_10_0-1_12_0.txt new file mode 100644 index 0000000..60516fc --- /dev/null +++ b/release_docs/HISTORY-1_10_0-1_12_0.txt @@ -0,0 +1,1183 @@ +HDF5 HISTORY +============= + + +INTRODUCTION + +This document describes the differences between the HDF5-1.10.0 and +HDF5 1.12.0 releases. For more details check the HISTORY*.txt files in the +HDF5 source. + +Information about supported and tested platforms is provided for historical +reasons only and may not be accurate. + + +For more information, see the HDF5 home page: + + http://www.hdfgroup.org/HDF5/ + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.10.3 +- Bug Fixes since HDF5-1.10.2 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems +- CMake vs. Autotools installations + + +New Features +============ + + Configuration: + ------------- + - Update CMake tests to use FIXTURES + + CMake test fixtures allow setup/cleanup tests and other dependency + requirements as properties for tests. This is more flexible for + modern CMake code. + + (ADB - 2019/07/23, HDFFV-10529) + + - Windows PDB files are always installed + + There are build configuration or flag settings for Windows that may not + generate PDB files. If those files are not generated then the install + utility will fail because those PDB files are not found. An optional + variable, DISABLE_PDB_FILES, was added to not install PDB files. + + (ADB - 2019/07/17, HDFFV-10424) + + - Add mingw CMake support with a toolchain file + + There has been a number of mingw issues that has been linked under + HDFFV-10845. It has been decided to implement the CMake cross-compiling + technique of toolchain files. We will use a linux platform with the mingw + compiler stack for testing. Only the C language is fully supported, and + the error tests are skipped. The C++ language works for static but shared + builds has a shared library issue with the mingw Standard Exception Handling + library, which is not available on Windows. Fortran has a common cross-compile + problem with the fortran configure tests. + + (ADB - 2019/07/12, HDFFV-10845, HDFFV-10595) + + - Windows PDB files are installed incorrectly + + For static builds, the PDB files for windows should be installed next + to the static libraries in the lib folder. Also the debug versions of + libraries and PDB files are now correctly built using the default + CMAKE_DEBUG_POSTFIX setting. + + (ADB - 2019/07/09, HDFFV-10581) + + - Add option to build only shared libs + + A request was made to prevent building static libraries and only build + shared. A new option was added to CMake, ONLY_SHARED_LIBS, which will + skip building static libraries. Certain utility functions will build with + static libs but are not published. Tests are adjusted to use the correct + libraries depending on SHARED/STATIC settings. + + (ADB - 2019/06/12, HDFFV-10805) + + - Add options to enable or disable building tools and tests + + Configure options --enable-tests and --enable-tools were added for + autotools configure. These options are enabled by default, and can be + disabled with either --disable-tests (or tools) or --enable-tests=no + (or --enable-tools=no). Build time is reduced ~20% when tools are + disabled, 35% when tests are disabled, 45% when both are disabled. + Reenabling them after the initial build requires running configure + again with the option(s) enabled. + + (LRK - 2019/06/12, HDFFV-9976) + + - Change tools test that test the error stack + + There are some use cases which can cause the error stack of tools to be + different then the expected output. These tests now use grepTest.cmake, + this was changed to allow the error file to be searched for an expected string. + + (ADB - 2019/04/15, HDFFV-10741) + + - Keep stderr and stdout separate in tests + + Changed test handling of output capture. Tests now keep the stderr + output separate from the stdout output. It is up to the test to decide + which output to check against a reference. Also added the option + to grep for a string in either output. + + (ADB - 2018/12/12, HDFFV-10632) + + - Add toolchain and cross-compile support + + Added info on using a toolchain file to INSTALL_CMAKE.txt. A + toolchain file is also used in cross-compiling, which requires + CMAKE_CROSSCOMPILING_EMULATOR to be set. To help with cross-compiling + the fortran configure process, the HDF5UseFortran.cmake file macros + were improved. Fixed a Fortran configure file issue that incorrectly + used #cmakedefine instead of #define. + + (ADB - 2018/10/04, HDFFV-10594) + + - Add warning flags for Intel compilers + + Identified Intel compiler specific warnings flags that should be used + instead of GNU flags. + + (ADB - 2018/10/04, TRILABS-21) + + - Add default rpath to targets + + Default rpaths should be set in shared executables and + libraries to allow the use of loading dependent libraries + without requiring LD_LIBRARY_PATH to be set. The default + path should be relative using @rpath on osx and $ORIGIN + on linux. Windows is not affected. + + (ADB - 2018/09/26, HDFFV-10594) + + - Add missing USE_110_API_DEFAULT option. + + Option USE_110_API_DEFAULT sets the default version of + versioned APIs. The bin/makevers perl script did not set + the maxidx variable correctly when the 1.10 branch was + created. This caused the versioning process to always use + the latest version of any API. + + (ADB - 2018/08/17, HDFFV-10552) + + - Added configuration checks for the following MPI functions: + + MPI_Mprobe - Used for the Parallel Compression feature + MPI_Imrecv - Used for the Parallel Compression feature + + MPI_Get_elements_x - Used for the "big Parallel I/O" feature + MPI_Type_size_x - Used for the "big Parallel I/O" feature + + (JTH - 2018/08/02, HDFFV-10512) + + - Added section to the libhdf5.settings file to indicate + the status of the Parallel Compression and "big Parallel I/O" + features. + + (JTH - 2018/08/02, HDFFV-10512) + + - Add option to execute swmr shell scripts from CMake. + + Option TEST_SHELL_SCRIPTS redirects processing into a + separate ShellTests.cmake file for UNIX types. The tests + execute the shell scripts if a SH program is found. + + (ADB - 2018/07/16) + + + Library: + -------- + - Add new H5R_ref_t type for object, dataset region and _attribute_ + references. This new type will deprecate the current hobj_ref_t + and hdset_reg_ref_t types for references. Added H5T_REF datatype + to read and write new reference types. As opposed to previous + reference types, reference creation no longer modifies existing + files. New reference types also now support references to external + files. + + (JS - 2019/10/08) + + - Add S3 and HDFS VFDs to HDF5 maintenance + + Fix windows requirements and java tests. Windows requires CMake 3.13. + Install openssl library (with dev files); + from "Shining Light Productions". msi package preferred. + + PATH should have been updated with the installation dir. + set ENV variable OPENSSL_ROOT_DIR to the installation dir. + set ENV variable OPENSSL_CONF to the cfg file, likely %OPENSSL_ROOT_DIR%\bin\openssl.cfg + Install libcurl library (with dev files); + download the latest released version using git: https://github.com/curl/curl.git + + Open a Visual Studio Command prompt + change to the libcurl root folder + run the "buildconf.bat" batch file + change to the winbuild directory + nmake /f Makefile.vc mode=dll MACHINE=x64 + copy libcurl-vc-x64-release-dll-ipv6-sspi-winssl dir to C:\curl (installation dir) + set ENV variable CURL_ROOT to C:\curl (installation dir) + update PATH ENV variable to %CURL_ROOT%\bin (installation bin dir). + the aws credentials file should be in %USERPROFILE%\.aws folder + set the ENV variable "HDF5_ROS3_TEST_BUCKET_URL=https://s3.us-east-2.amazonaws.com/hdf5ros3" + + (ADB - 2019/09/12, HDFFV-10854) + + - Added new chunk query functions + + The following public functions were added to discover information about + the chunks in an HDF5 file. + herr_t H5Dget_num_chunks(dset_id, fspace_id, *nchunks) + herr_t H5Dget_chunk_info_by_coord(dset_id, *coord, *filter_mask, *addr, *size) + herr_t H5Dget_chunk_info(dset_id, fspace_id, index, *coord, *filter_mask, *addr, *size) + + (BMR - 2019/06/11, HDFFV-10677) + + - Improved the performance of virtual dataset I/O + + Refactored the internal dataspace routines used by the virtual dataset + code to improve performance, especially when one of the selections + involved is very long and non-contiguous. + + (NAF - 2019/05/31, HDFFV-10693) + + - Added the ability to open files with UTF-8 file names on Windows. + + The POSIX open(2) API call on Windows is limited to ASCII + file names. The library has been updated to convert incoming file + names to UTF-16 (via MultiByteToWideChar(CP_UTF8, ...) and use + _wopen() instead. + + (DER - 2019/03/15, HDFFV-2714, HDFFV-3914, HDFFV-3895, HDFFV-8237, HDFFV-10413, HDFFV-10691) + + - Add new API H5M for map objects. Currently not supported by native + library, can be supported by VOL connectors. + + (NAF - 2019/03/01) + + - Remove H5I_REFERENCE from the library + + This ID class was never used by the library and has been removed. + + (DER - 2018/12/08, HDFFV-10252) + + - Allow pre-generated H5Tinit.c and H5make_libsettings.c to be used. + + Rather than always running H5detect and generating H5Tinit.c and + H5make_libsettings.c, supply a location for those files. + + (ADB - 2018/09/18, HDFFV-10332) + + + Parallel Library: + ----------------- + - Changed the default behavior in parallel when reading the same dataset in its entirely + (i.e. H5S_ALL dataset selection) which is being read by all the processes collectively. + The dataset mush be contiguous, less than 2GB, and of an atomic datatype. + The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from + the disk by the root process to the remain processes in the MPI communicator associated + with the HDF5 file. + + (MSB - 2019/01/02, HDFFV-10652) + + Fortran Library: + ---------------- + - Added new Fortran derived type, c_h5o_info_t, which is interoperable with + C's h5o_info_t. This is needed for callback functions which + pass C's h5o_info_t data type definition. + + (MSB, 2019/01/08, HDFFV-10443) + + - Added new Fortran API, H5gmtime, which converts (C) 'time_t' structure + to Fortran DATE AND TIME storage format. + + (MSB, 2019/01/08, HDFFV-10443) + + - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f, + h5oget_info, h5oget_info_by_idx and h5ovisit_by_name_f. + + (MSB, 2019/01/08, HDFFV-10443) + + C++ Library: + ------------ + - Added new wrappers for H5Pset/get_create_intermediate_group() + LinkCreatPropList::setCreateIntermediateGroup() + LinkCreatPropList::getCreateIntermediateGroup() + + (BMR - 2019/04/22, HDFFV-10622) + + - Added new wrapper for H5Ovisit2() + H5Object::visit() + + (BMR - 2019/02/14, HDFFV-10532) + + + Java Library: + ---------------- + - Fix a failure in JUnit-TestH5P on 32-bit architectures + + (JTH - 2019/04/30) + + - Duplicate the data read/write functions of Datasets for Attributes. + + Region references could not be displayed for attributes as they could + for datasets. Datasets had overloaded read and write functions for different + datatypes that were not available for attributes. After adding similar + functions, attribute region references work normally. + + (ADB - 2018/12/12, HDFVIEW-4) + + - Removed H5I_REFERENCE from the Java wrappers + + This ID class was never used by the library and has been removed + from the Java wrappers. + + (DER - 2018/12/08, HDFFV-10252) + + + Tools: + ------ + - h5repack was fixed to repack datasets with external storage + to other types of storage. + + New test added to repack files and verify the correct data using h5diff. + + (JS - 2019/09/25, HDFFV-10408) + (ADB - 2019/10/02, HDFFV-10918) + + - h5dump was fixed for 128-bit floats, but was missing a test. + + New test greps for the first 15 numbers of the 128-bit value. + + (ADB - 2019/06/23, HDFFV-9407) + + + High-Level APIs: + --------------- + - + + C Packet Table API + ------------------ + - + + Internal header file + -------------------- + - + + Documentation + ------------- + - + +Support for new platforms, languages and compilers. +======================================= + - + +Bug Fixes since HDF5-1.10.3 release +================================== + + Library + ------- + - Improved performance when creating a large number of small datasets by + retrieving default property values from the API context instead of doing + skip list searches. + + (CJH - 2019/12/10, HDFFV-10658) + + - Fixed user-created data access properties not existing in the property list + returned by H5Dget_access_plist. Thanks to Steven Varga for submitting a + reproducer and a patch. + + (CJH - 2019/12/9, HDFFV-10934) + + - Fixed the iteration error in test_versionbounds() in test/dtypes.c + + The test was supposed to loop through all valid combinations of + low and high bounds in the array versions[], but they were set to + H5F_LIBVER_EARLIEST always without changing. + + The problem was fixed by indexing low and high into the array versions[]. + + (VC - 2019/09/30) + + - Fixed the slowness of regular hyperslab selection in a chunked dataset + + It was reported that the selection of every 10th element from a 20G + chunked dataset was extremely slow and sometimes could hang the system. + The problem was due to the iteration and the building of the span tree + for all the selected elements in file space. + + As the selected elements are going to a 1-d contiguous single block + memory space, the problem was fixed by building regular hyperslab selections + in memory space for the selected elements in file space. + + (VC - 2019/09/26, HDFFV-10585) + + - Fixed a bug caused by bad tag value when condensing object header + messages + + There was an assertion failure when moving meessages from running a + user test program with library release hdf5.1.10.4. It was because + the tag value (object header's address) was not set up when entering + the library routine H5O__chunk_update_idx(), which will eventually + verifies the metadata tag value when protecting the object header. + + The problem was fixed by replacing FUNC_ENTER_PACKAGE in H5O__chunk_update_idx() + with FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) to set up the metadata tag. + + (VC - 2019/08/23, HDFFV-10873) + + - Fixed the test failure from test_metadata_read_retry_info() in + test/swmr.c + + The test failure is due to the incorrect number of bins returned for + retry info (info.nbins). The # of bins expected for 101 read attempts + is 3 instead of 2. The routine H5F_set_retries() in src/H5Fint.c + calculates the # of bins by first obtaining the log10 value for + (read attempts - 1). For PGI/19, the log10 value for 100 read attempts + is 1.9999999999999998 instead of 2.00000. When casting the log10 value + to unsigned later on, the decimal part is chopped off causing the test + failure. + + This was fixed by obtaining the rounded integer value (HDceil) for the + log10 value of read attempts first before casting the result to unsigned. + + (VC - 2019/8/14, HDFFV-10813) + + - Fixed an issue where creating a file with non-default file space info + together with library high bound setting to H5F_LIBVER_V18. + + When setting non-default file space info in fcpl via + H5Pset_file_space_strategy() and then creating a file with + both high and low library bounds set to + H5F_LIBVER_V18 in fapl, the library succeeds in creating the file. + File creation should fail because the feature of setting non-default + file space info does not exist in library release 1.8 or earlier. + + This was fixed by setting and checking the proper version in the + file space info message based on the library low and high bounds + when creating and opening the HDF5 file. + + (VC - 2019/6/25, HDFFV-10808) + + - When iterating over an old-style group (i.e., when not using the latest + file format) of size 0, a NULL pointer representing the empty links + table would be sent to qsort(3) for sorting, which is undefined behavior. + + Iterating over an empty group is explicitly tested in the links test. + This has not caused any failures to date and was flagged by gcc's + -fsanitize=undefined. + + The library no longer attempts to sort an empty array. + + (DER - 2019/06/18, HDFFV-10829) + + - Fixed an issue where copying a version 1.8 dataset between files using + H5Ocopy fails due to an incompatible fill version + + When using the HDF5 1.10.x H5Ocopy() API call to copy a version 1.8 + dataset to a file created with both high and low library bounds set to + H5F_LIBVER_V18, the H5Ocopy() call will fail with the error stack indicating + that the fill value version is out of bounds. + + This was fixed by changing the fill value message version to H5O_FILL_VERSION_3 + (from H5O_FILL_VERSION_2) for H5F_LIBVER_V18. + + (VC - 2019/6/14, HDFFV-10800) + + - Some oversights in the index iterating area of the library caused + a callback function to continue iterating even though it's supposed + to stop. + + Added the returned value check to the for loop's conditions in + H5EA_iterate(), H5FA_iterate(), and H5D__none_idx_iterate(). The + iteration now stops when it should. + + (BMR - 2019/06/11, HDFFV-10661) + + - Fixed a bug that would cause an error or cause fill values to be + incorrectly read from a chunked dataset using the "single chunk" index if + the data was held in cache and there was no data on disk. + + (NAF - 2019/03/06) + + - Fixed a bug that could cause an error or cause fill values to be + incorrectly read from a dataset that was written to using H5Dwrite_chunk + if the dataset was not closed after writing. + + (NAF - 2019/03/06, HDFFV-10716) + + - Fixed memory leak in scale offset filter + + In a special case where the MinBits is the same as the number of bits in + the datatype's precision, the filter's data buffer was not freed, causing + the memory usage to grow. In general the buffer was freed correctly. The + Minbits are the minimal number of bits to store the data values. Please + see the reference manual for H5Pset_scaleoffset for the detail. + + (RL - 2019/3/4, HDFFV-10705) + + - Fix hangs with collective metadata reads during chunked dataset I/O + + In the parallel library, it was discovered that when a particular + sequence of operations following a pattern of: + + "write to chunked dataset" -> "flush file" -> "read from dataset" + + occurred with collective metadata reads enabled, hangs could be + observed due to certain MPI ranks not participating in the collective + metadata reads. + + To fix the issue, collective metadata reads are now disabled during + chunked dataset raw data I/O. + + (JTH - 2019/02/11, HDFFV-10563, HDFFV-10688) + + - Performance issue when closing an object + + The slow down is due to the search of the "tag_list" to find + out the "corked" status of an object and "uncork" it if so. + + Improve porformance by skipping the search of the "tag_list" + if there are no "corked" objects when closing an object. + + (VC - 2019/2/6) + + - Fixed a potential invalid memory access and failure that could occur when + decoding an unknown object header message (from a future version of the + library). + + (NAF - 2019/01/07) + + - Deleting attributes in dense storage + + The library aborts with "infinite loop closing library" after + attributes in dense storage are created and then deleted. + + When deleting the attribute nodes from the name index v2 B-tree, + if an attribute is found in the intermediate B-tree nodes, + which may be merged/redistributed in the process, we need to + free the dynamically allocated spaces for the intermediate + decoded attribute. + + (VC - 2018/12/26, HDFFV-10659) + + - Allow H5detect and H5make_libsettings to take a file as an argument. + + Rather than only writing to stdout, add a command argument to name + the file that H5detect and H5make_libsettings will use for output. + Without an argument, stdout is still used, so backwards compatibility + is maintained. + + (ADB - 2018/09/05, HDFFV-9059) + + - A bug was discovered in the parallel library where an application + would hang if a collective read/write of a chunked dataset occurred + when collective metadata reads were enabled and some of the ranks + had no selection in the dataset's dataspace. The ranks which had no + selection in the dataset's dataspace called H5D__chunk_addrmap() to + retrieve the lowest chunk address in the dataset. This is because we + require reads/writes to be performed in strictly non-decreasing order + of chunk address in the file. + + When the chunk index used was a version 1 or 2 B-tree, these + non-participating ranks would issue a collective MPI_Bcast() call + that the participating ranks would not issue, causing the hang. Since + the non-participating ranks are not actually reading/writing anything, + the H5D__chunk_addrmap() call can be safely removed and the address used + for the read/write can be set to an arbitrary number (0 was chosen). + + (JTH - 2018/08/25, HDFFV-10501) + + - fcntl(2)-based file locking incorrectly passed the lock argument struct + instead of a pointer to the struct, causing errors on systems where + flock(2) is not available. + + File locking is used when files are opened to enforce SWMR semantics. A + lock operation takes place on all file opens unless the + HDF5_USE_FILE_LOCKING environment variable is set to the string "FALSE". + flock(2) is preferentially used, with fcntl(2) locks as a backup if + flock(2) is unavailable on a system (if neither is available, the lock + operation fails). On these systems, the file lock will often fail, which + causes HDF5 to not open the file and report an error. + + This bug only affects POSIX systems. Win32 builds on Windows use a no-op + locking call which always succeeds. Systems which exhibit this bug will + have H5_HAVE_FCNTL defined but not H5_HAVE_FLOCK in the configure output. + + This bug affects HDF5 1.10.0 through 1.10.5. + + fcntl(2)-based file locking now correctly passes the struct pointer. + + (DER - 2019/08/27, HDFFV-10892) + + + Java Library: + ---------------- + - JNI native library dependencies + + The build for the hdf5_java native library used the wrong + hdf5 target library for CMake builds. Correcting the hdf5_java + library to build with the shared hdf5 library required testing + paths to change also. + + (ADB - 2018/08/31, HDFFV-10568) + - Java iterator callbacks + + Change global callback object to a small stack structure in order + to fix a runtime crash. This crash was discovered when iterating + through a file with nested group members. The global variable + visit_callback is overwritten when recursion starts. When recursion + completes, visit_callback will be pointing to the wrong callback method. + + (ADB - 2018/08/15, HDFFV-10536) + + - Java HDFLibraryException class + + Change parent class from Exception to RuntimeException. + + (ADB - 2018/07/30, HDFFV-10534) + + - JNI Read and Write + + Refactored variable-length functions, H5DreadVL and H5AreadVL, + to correct dataset and attribute reads. New write functions, + H5DwriteVL and H5AwriteVL, are under construction. + + (ADB - 2018/06/02, HDFFV-10519) + + + Configuration + ------------- + - Correct option for default API version + + CMake options for default API version are not mutually exclusive. + Change the multiple BOOL options to a single STRING option with the + strings; v16, v18, v110, v112. + + (ADB - 2019/08/12, HDFFV-10879) + + + Fortran + -------- + - Added symbolic links libhdf5_hl_fortran.so to libhdf5hl_fortran.so and + libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for + autotools installs. These were added to match the name of the files + installed by cmake and the general pattern of hl lib files. We will + change the names of the installed lib files to the matching name in + the next major release. + + (LRK - 2019/01/04, HDFFV-10596) + + - Made Fortran specific subroutines PRIVATE in generic procedures. + + Effected generic procedures were functions in H5A, H5D, H5P, H5R and H5T. + + (MSB, 2018/12/04, HDFFV-10511) + + - Fixed issue with Fortran not returning h5o_info_t field values + meta_size%attr%index_size and meta_size%attr%heap_size. + + (MSB, 2018/1/8, HDFFV-10443) + + + Tools + ----- + - + + High-Level APIs: + ------ + - + + Fortran High-Level APIs: + ------ + - + + Documentation + ------------- + - + + F90 APIs + -------- + - + + C++ APIs + -------- + - + + Testing + ------- + - Fixed a test failure in testpar/t_dset.c caused by + the test trying to use the parallel filters feature + on MPI-2 implementations. + + (JTH, 2019/2/7) + +Bug Fixes since HDF5-1.10.2 release +================================== + + Library + ------- + - Java HDF5LibraryException class + + The error minor and major values would be lost after the + constructor executed. + + Created two local class variables to hold the values obtained during + execution of the constructor. Refactored the class functions to retrieve + the class values rather then calling the native functions. + The native functions were renamed and called only during execution + of the constructor. + Added error checking to calling class constructors in JNI classes. + + (ADB - 2018/08/06, HDFFV-10544) + + - Added checks of the defined MPI_VERSION to guard against usage of + MPI-3 functions in the Parallel Compression and "big Parallel I/O" + features when HDF5 is built with MPI-2. Previously, the configure + step would pass but the build itself would fail when it could not + locate the MPI-3 functions used. + + As a result of these new checks, HDF5 can again be built with MPI-2, + but the Parallel Compression feature will be disabled as it relies + on the MPI-3 functions used. + + (JTH - 2018/08/02, HDFFV-10512) + + - User's patches: CVEs + + The following patches have been applied: + + CVE-2018-11202 - NULL pointer dereference was discovered in + H5S_hyper_make_spans in H5Shyper.c (HDFFV-10476) + https://security-tracker.debian.org/tracker/CVE-2018-11202 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11202 + + CVE-2018-11203 - A division by zero was discovered in + H5D__btree_decode_key in H5Dbtree.c (HDFFV-10477) + https://security-tracker.debian.org/tracker/CVE-2018-11203 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11203 + + CVE-2018-11204 - A NULL pointer dereference was discovered in + H5O__chunk_deserialize in H5Ocache.c (HDFFV-10478) + https://security-tracker.debian.org/tracker/CVE-2018-11204 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11204 + + CVE-2018-11206 - An out of bound read was discovered in + H5O_fill_new_decode and H5O_fill_old_decode in H5Ofill.c + (HDFFV-10480) + https://security-tracker.debian.org/tracker/CVE-2018-11206 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11206 + + CVE-2018-11207 - A division by zero was discovered in + H5D__chunk_init in H5Dchunk.c (HDFFV-10481) + https://security-tracker.debian.org/tracker/CVE-2018-11207 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11207 + + (BMR - 2018/7/22, PR#s: 1134 and 1139, + HDFFV-10476, HDFFV-10477, HDFFV-10478, HDFFV-10480, HDFFV-10481) + + - H5Adelete + + H5Adelete failed when deleting the last "large" attribute that + is stored densely via fractal heap/v2 b-tree. + + After removing the attribute, update the ainfo message. If the + number of attributes goes to zero, remove the message. + + (VC - 2018/07/20, HDFFV-9277) + + - A bug was discovered in the parallel library which caused partial + parallel reads of filtered datasets to return incorrect data. The + library used the incorrect dataspace for each chunk read, causing + the selection used in each chunk to be wrong. + + The bug was not caught during testing because all of the current + tests which do parallel reads of filtered data read all of the data + using an H5S_ALL selection. Several tests were added which exercise + partial parallel reads. + + (JTH - 2018/07/16, HDFFV-10467) + + - A bug was discovered in the parallel library which caused parallel + writes of filtered datasets to trigger an assertion failure in the + file free space manager. + + This occurred when the filter used caused chunks to repeatedly shrink + and grow over the course of several dataset writes. The previous chunk + information, such as the size of the chunk and the offset in the file, + was being cached and not updated after each write, causing the next write + to the chunk to retrieve the incorrect cached information and run into + issues when reallocating space in the file for the chunk. + + (JTH - 2018/07/16, HDFFV-10509) + + - A bug was discovered in the parallel library which caused the + H5D__mpio_array_gatherv() function to allocate too much memory. + + When the function is called with the 'allgather' parameter set + to a non-true value, the function will receive data from all MPI + ranks and gather it to the single rank specied by the 'root' + parameter. However, the bug in the function caused memory for + the received data to be allocated on all MPI ranks, not just the + singular rank specified as the receiver. In some circumstances, + this would cause an application to fail due to the large amounts + of memory being allocated. + + (JTH - 2018/07/16, HDFFV-10467) + + - Error checks in h5stat and when decoding messages + + h5stat exited with seg fault/core dumped when + errors are encountered in the internal library. + + Add error checks and --enable-error-stack option to h5stat. + Add range checks when decoding messages: old fill value, old + layout and refcount. + + (VC - 2018/07/11, HDFFV-10333) + + - If an HDF5 file contains a malformed compound datatype with a + suitably large offset, the type conversion code can run off + the end of the type conversion buffer, causing a segmentation + fault. + + This issue was reported to The HDF Group as issue #CVE-2017-17507. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + THE HDF GROUP WILL NOT FIX THIS BUG AT THIS TIME + + Fixing this problem would involve updating the publicly visible + H5T_conv_t function pointer typedef and versioning the API calls + which use it. We normally only modify the public API during + major releases, so this bug will not be fixed at this time. + + (DER - 2018/02/26, HDFFV-10356) + + - Inappropriate linking with deprecated MPI C++ libraries + + HDF5 does not define *_SKIP_MPICXX in the public headers, so applications + can inadvertently wind up linking to the deprecated MPI C++ wrappers. + + MPICH_SKIP_MPICXX and OMPI_SKIP_MPICXX have both been defined in H5public.h + so this should no longer be an issue. HDF5 makes no use of the deprecated + MPI C++ wrappers. + + (DER - 2019/09/17, HDFFV-10893) + + + + Configuration + ------------- + - Applied patches to address Cywin build issues + + There were three issues for Cygwin builds: + - Shared libs were not built. + - The -std=c99 flag caused a SIG_SETMASK undeclared error. + - Undefined errors when buildbing test shared libraries. + + Patches to address these issues were received and incorporated in this version. + + (LRK - 2018/07/18, HDFFV-10475) + + - Moved the location of gcc attribute. + + The gcc attribute(no_sanitize), named as the macro HDF_NO_UBSAN, + was located after the function name. Builds with GCC 7 did not + indicate any problem, but GCC 8 issued errors. Moved the + attribute before the function name, as required. + + (ADB - 2018/05/22, HDFFV-10473) + + - Reworked java test suite into individual JUnit tests. + + Testing the whole suite of java unit tests in a single JUnit run + made it difficult to determine actual failures when tests would fail. + Running each file set of tests individually, allows individual failures + to be diagnosed easier. A side benefit is that tests for optional components + of the library can be disabled if not configured. + + (ADB - 2018/05/16, HDFFV-9739) + + - Converted CMake global commands ADD_DEFINITIONS and INCLUDE_DIRECTORIES + to use target_* type commands. This change modernizes the CMake usage + in the HDF5 library. + + In addition, there is the intention to convert to generator expressions, + where possible. The exception is Fortran FLAGS on Windows Visual Studio. + The HDF macros TARGET_C_PROPERTIES and TARGET_FORTRAN_PROPERTIES have + been removed with this change in usage. + + The additional language (C++ and Fortran) checks have also been localized + to only be checked when that language is enabled. + + (ADB - 2018/05/08) + + Performance + ------------- + - + + Fortran + -------- + - + + Tools + ----- + - + + High-Level APIs: + ------ + - + + Fortran High-Level APIs: + ------ + - + + Documentation + ------------- + - + + F90 APIs + -------- + - + + C++ APIs + -------- + - Adding default arguments to existing functions + + Added the following items: + + Two more property list arguments are added to H5Location::createDataSet: + const DSetAccPropList& dapl = DSetAccPropList::DEFAULT + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT + + + One more property list argument is added to H5Location::openDataSet: + const DSetAccPropList& dapl = DSetAccPropList::DEFAULT + + (BMR - 2018/07/21, PR# 1146) + + - Improvement C++ documentation + + Replaced the table in main page of the C++ documentation from mht to htm format + for portability. + + (BMR - 2018/07/17, PR# 1141) + + Testing + ------- + - The dt_arith test failed on IBM Power8 and Power9 machines when testing + conversions from or to long double types, especially when special values + such as infinity or NAN were involved. In some cases the results differed + by extremely small amounts from those on other machines, while some other + tests resulted in segmentation faults. These conversion tests with long + double types have been disabled for ppc64 machines until the problems are + better understood and can be properly addressed. + + (SRL - 2019/01/07, TRILAB-98) + +Supported Platforms +=================== + + Linux 2.6.32-696.16.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, Version 5.2.0, + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.0.098 Build 20160721 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 7 x64 Visual Studio 2013 + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ Intel C, Fortran 2018 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + Visual Studio 2017 w/ Intel Fortran 18 (cmake) + + Mac OS X Yosemite 10.10.5 Apple clang/clang++ version 6.1 from Xcode 7.0 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.6 Apple clang/clang++ version 7.3.0 from Xcode 7.3 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + Mac OS Sierra 10.12.6 Apple LLVM version 8.1.0 (clang/clang++-802.0.42) + 64-bit gfortran GNU Fortran (GCC) 7.1.0 + (swallow/kite) Intel icc/icpc/ifort version 17.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y y y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y ? +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y ? +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y ? +CentOS 6.7 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 6.7 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y +Linux 2.6.32-573.18.1.el6.ppc64 n y/n n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +Mac OS X El Capitan 10.11.6 64-bit y n y y +CentOS 6.7 Linux 2.6.18 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y n +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y n +CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n +Linux 2.6.32-573.18.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.9.3, 5.3.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 17.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.1(Tozai) + GCC Version 7.1.0 + OpenMPI 3.0.0-GCC-7.2.0-2.29 + Intel(R) C (icc) and C++ (icpc) compilers + Version 17.0.0.098 Build 20160721 + with NAG Fortran Compiler Release 6.1(Tozai) + + Linux 3.10.0-327.10.1.el7 MPICH 3.2 compiled with GCC 5.3.0 + #1 SMP x86_64 GNU/Linux + (moohan) + + Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with + #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 + (ostrich) and IBM XL Fortran for Linux, V15.1 + + Debian 8.4 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc, g++ (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 + (cmake and autotools) + + Fedora 24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc, g++ (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 + (Red Hat 6.1.1-3) + (cmake and autotools) + + Ubuntu 16.04.1 4.4.0-38-generic #57-Ubuntu SMP x86_64 GNU/Linux + gcc, g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) + 5.4.0 20160609 + (cmake and autotools) + + +Known Problems +============== + 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. + ADB - 2019/05/07 + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + + 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. + + +CMake vs. Autotools installations +================================= +While both build systems produce similar results, there are differences. +Each system produces the same set of folders on linux (only CMake works +on standard Windows); bin, include, lib and share. Autotools places the +COPYING and RELEASE.txt file in the root folder, CMake places them in +the share folder. + +The bin folder contains the tools and the build scripts. Additionally, CMake +creates dynamic versions of the tools with the suffix "-shared". Autotools +installs one set of tools depending on the "--enable-shared" configuration +option. + build scripts + ------------- + Autotools: h5c++, h5cc, h5fc + CMake: h5c++, h5cc, h5hlc++, h5hlcc + +The include folder holds the header files and the fortran mod files. CMake +places the fortran mod files into separate shared and static subfolders, +while Autotools places one set of mod files into the include folder. Because +CMake produces a tools library, the header files for tools will appear in +the include folder. + +The lib folder contains the library files, and CMake adds the pkgconfig +subfolder with the hdf5*.pc files used by the bin/build scripts created by +the CMake build. CMake separates the C interface code from the fortran code by +creating C-stub libraries for each Fortran library. In addition, only CMake +installs the tools library. The names of the szip libraries are different +between the build systems. + +The share folder will have the most differences because CMake builds include +a number of CMake specific files for support of CMake's find_package and support +for the HDF5 Examples CMake project. + diff --git a/release_docs/HISTORY-1_12.txt b/release_docs/HISTORY-1_12.txt new file mode 100644 index 0000000..6d0c1e2 --- /dev/null +++ b/release_docs/HISTORY-1_12.txt @@ -0,0 +1,628 @@ +HDF5 History +============ + +This file contains development history of the HDF5 1.12 branch + +01. Release Information for hdf5-1.12.0 + +[Search on the string '%%%%' for section breaks of each release.] + +%%%%1.12.0%%%% + +HDF5 version 1.12.0 released on 2020-02-28 +================================================================================ + + +INTRODUCTION + +This document describes the new features introduced in the HDF5 1.12.0 release. +It contains information on the platforms tested and known problems in this +release. For more details check the HISTORY*.txt files in the HDF5 source. + +Note that documentation in the links below will be updated at the time of the +release. + +Links to HDF5 documentation can be found on The HDF5 web page: + + https://portal.hdfgroup.org/display/HDF5/HDF5 + +The official HDF5 releases can be obtained from: + + https://www.hdfgroup.org/downloads/hdf5/ + +More information about the new features can be found at: + + https://portal.hdfgroup.org/display/HDF5/New+Features+in+HDF5+Release+1.12 + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS + +- New Features +- Support for new platforms and languages +- Bug Fixes since HDF5-1.12.0-alpha1 +- Major Bug Fixes since HDF5-1.10.0 +- Supported Platforms +- Tested Configuration Features Summary +- More Tested Platforms +- Known Problems +- CMake vs. Autotools installations + + +New Features +============ + + Configuration: + ------------- + - Added test script for file size compare + + If CMake minimum version is at least 3.14, the fileCompareTest.cmake + script will compare file sizes. + + (ADB - 2020/02/24, HDFFV-11036) + + - Update CMake minimum version to 3.12 + + Updated CMake minimum version to 3.12 and added version checks + for Windows features. + + (ADB - 2020/02/05, TRILABS-142) + + - Fixed CMake include properties for Fortran libraries + + Corrected the library properties for Fortran to use the + correct path for the Fortran module files. + + (ADB - 2020/02/04, HDFFV-11012) + + - Added common warnings files for gnu and intel + + Added warnings files to use one common set of flags + during configure for both autotools and CMake build + systems. The initial implementation only affects a + general set of flags for gnu and intel compilers. + + (ADB - 2020/01/17) + + - Added new options to CMake for control of testing + + Added CMake options (default ON); + HDF5_TEST_SERIAL AND/OR HDF5_TEST_PARALLEL + combined with: + HDF5_TEST_TOOLS + HDF5_TEST_EXAMPLES + HDF5_TEST_SWMR + HDF5_TEST_FORTRAN + HDF5_TEST_CPP + HDF5_TEST_JAVA + + (ADB - 2020/01/15, HDFFV-11001) + + - Added Clang sanitizers to CMake for analyzer support if compiler is clang. + + Added CMake code and files to execute the Clang sanitizers if + HDF5_ENABLE_SANITIZERS is enabled and the USE_SANITIZER option + is set to one of the following: + Address + Memory + MemoryWithOrigins + Undefined + Thread + Leak + 'Address;Undefined' + + (ADB - 2019/12/12, TRILAB-135) + + - Update CMake for VS2019 support + + CMake added support for VS2019 in version 3.15. Changes to the CMake + generator setting required changes to scripts. Also updated version + references in CMake files as necessary. + + (ADB - 2019/11/18, HDFFV-10962) + + + Library: + -------- + - Refactored public exposure of haddr_t type in favor of "object tokens" + + To better accommodate HDF5 VOL connectors where "object addresses in a file" + may not make much sense, the following changes were made to the library: + + * Introduced new H5O_token_t "object token" type, which represents a + unique and permanent identifier for referencing an HDF5 object within + a container; these "object tokens" are meant to replace object addresses. + Along with the new type, a new H5Oopen_by_token API call was introduced + to open an object by a token, similar to how object addresses were + previously used with H5Oopen_by_addr. + + * Introduced new H5Lget_info2, H5Lget_info_by_idx2, H5Literate2, H5Literate_by_name2, + H5Lvisit2 and H5Lvisit_by_name2 API calls, along with their associated H5L_info2_t + struct and H5L_iterate2_t callback function, which work with the newly-introduced + object tokens, instead of object addresses. The original functions have been + renamed to version 1 functions and are deprecated in favor of the new version 2 + functions. The H5L_info_t and H5L_iterate_t types have been renamed to version 1 + types and are now deprecated in favor of their version 2 counterparts. For each of + the functions and types, compatibility macros take place of the original symbols. + + * Introduced new H5Oget_info3, H5Oget_info_by_name3, H5Oget_info_by_idx3, + H5Ovisit3 and H5Ovisit_by_name3 API calls, along with their associated H5O_info2_t + struct and H5O_iterate2_t callback function, which work with the newly-introduced + object tokens, instead of object addresses. The version 2 functions are now + deprecated in favor of the version 3 functions. The H5O_info_t and H5O_iterate_t + types have been renamed to version 1 types and are now deprecated in favor of their + version 2 counterparts. For each, compatibility macros take place of the original + symbols. + + * Introduced new H5Oget_native_info, H5Oget_native_info_by_name and + H5Oget_native_info_by_idx API calls, along with their associated H5O_native_info_t + struct, which are used to retrieve the native HDF5 file format-specific information + about an object. This information (such as object header info and B-tree/heap info) + has been removed from the new H5O_info2_t struct so that the more generic + H5Oget_info(_by_name/_by_idx)3 routines will not try to retrieve it for non-native + VOL connectors. + + * Added new H5Otoken_cmp, H5Otoken_to_str and H5Otoken_from_str routines to compare + two object tokens, convert an object token into a nicely-readable string format and + to convert an object token string back into a real object token, respectively. + + (DER, QAK, JTH - 2020/01/16) + + - Virtual Object Layer (VOL) + + In this major HDF5 release we introduce HDF5 Virtual Object Layer (VOL). + VOL is an abstraction layer within the HDF5 library that enables different + methods for accessing data and objects that conform to the HDF5 data model. + The VOL layer intercepts all HDF5 API calls that potentially modify data + on disk and forwards those calls to a plugin "object driver". The data on + disk can be a different format than the HDF5 format. For more information + about VOL we refer the reader to the following documents (under review): + + VOL HDF5 APIs + https://portal.hdfgroup.org/display/HDF5/Virtual+Object++Layer + + VOL Documentation + https://bitbucket.hdfgroup.org/projects/HDFFV/repos/hdf5doc/browse/RFCs/HDF5/VOL + + Repository with VOL plugins + https://bitbucket.hdfgroup.org/projects/HDF5VOL + + - Enhancements to HDF5 References + + HDF5 references were extended to support attributes, and object and dataset + selections that reside in another HDF5 file. For more information including + a list of new APIs, see + + https://portal.hdfgroup.org/display/HDF5/Update+to+References + + - Add new public function H5Sselect_adjust. + + This function shifts a dataspace selection by a specified logical offset + within the dataspace extent. This can be useful for VOL developers to + implement chunked datasets. + + (NAF - 2019/11/18) + + - Add new public function H5Sselect_project_intersection. + + This function computes the intersection between two dataspace selections + and projects that intersection into a third selection. This can be useful + for VOL developers to implement chunked or virtual datasets. + + (NAF - 2019/11/13, ID-148) + + - Add new public function H5VLget_file_type. + + 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. + + (NAF - 2019/11/08, ID-127) + + - New S3 and HDFS Virtual File Drivers (VFDs) + + This release has two new VFDs. The S3 VFD allows accessing HDF5 files on + AWS S3 buckets. HDFS VFD allows accessing HDF5 files stored on Apache HDFS. + See https://portal.hdfgroup.org/display/HDF5/Virtual+File+Drivers+-+S3+and+HDFS + for information on enabling those drivers and using those APIs. + + Below are specific instructions for enabling S3 VFD on Windows: + + Fix windows requirements and java tests. Windows requires CMake 3.13. + - Install openssl library (with dev files); + from "Shining Light Productions". msi package preferred. + - PATH should have been updated with the installation dir. + - set ENV variable OPENSSL_ROOT_DIR to the installation dir. + - set ENV variable OPENSSL_CONF to the cfg file, likely %OPENSSL_ROOT_DIR%\bin\openssl.cfg + - Install libcurl library (with dev files); + - download the latest released version using git: https://github.com/curl/curl.git + - Open a Visual Studio Command prompt + - change to the libcurl root folder + - run the "buildconf.bat" batch file + - change to the winbuild directory + - nmake /f Makefile.vc mode=dll MACHINE=x64 + - copy libcurl-vc-x64-release-dll-ipv6-sspi-winssl dir to C:\curl (installation dir) + - set ENV variable CURL_ROOT to C:\curl (installation dir) + - update PATH ENV variable to %CURL_ROOT%\bin (installation bin dir). + - the aws credentials file should be in %USERPROFILE%\.aws folder + - set the ENV variable HDF5_ROS3_TEST_BUCKET_URL to the s3 url for the + s3 bucket containing the HDF5 files to be accessed. + + FORTRAN Library: + ---------------- + - Added new Fortran parameters: + + H5F_LIBVER_ERROR_F + H5F_LIBVER_NBOUNDS_F + H5F_LIBVER_V18_F + H5F_LIBVER_V110_F + H5F_LIBVER_V112_F + + - Added new Fortran API: h5pget_libver_bounds_f + + (MSB - 2020/02/11, HDFFV-11018) + + Java Library: + ---------------- + - Added ability to test java library with VOLs. + + Created new CMake script that combines the java and vol test scripts. + + (ADB - 2020/02/03, HDFFV-10996) + + - Tests fail for non-English locale. + + 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 + error. Changed the regex for the Time substitution. + + (ADB - 2020/01/09, HDFFV-10995) + + + Tools: + ------ + - h5diff was updated to use the new reference APIs. + + h5diff uses the new reference APIs to compare references. + Attribute references can also be compared. + + (ADB - 2019/12/19, HDFFV-10980) + + - h5dump and h5ls were updated to use the new reference APIs. + + The tools library now use the new reference APIs to inspect a + file. Also the DDL spec was updated to reflect the format + changes produced with the new APIs. The export API and support + functions in the JNI were updated to match. + + + Other improvements and changes: + + - Hyperslab selection code was reworked to improve performance, getting more + than 10x speedup in some cases. + + - The HDF5 Library was enhanced to open files with Unicode names on Windows. + + - Deprecated H5Dvlen_reclaim() and replaced it with H5Treclaim(). + This routine is meant to be used when resources are internally allocated + when reading data, i.e. when using either vlen or new reference types. + This is applicable to both attribute and dataset reads. + + - h5repack was fixed to repack datasets with external storage + to other types of storage. + + +Support for new platforms, languages and compilers. +======================================= + - Added spectrum-mpi with clang, gcc and xl compilers on Linux 3.10.0 + - Added OpenMPI 3.1 and 4.0 with clang, gcc and Intel compilers on Linux 3.10.0 + - Added cray-mpich/PrgEnv with gcc and Intel compilers on Linux 4.14.180 + - Added spectrum mpi with clang, gcc and xl compilers on Linux 4.14.0 + + +Bug Fixes since HDF5-1.12.0-alpha1 release +========================================== + Library + ------- + - Improved performance when creating a large number of small datasets by + retrieving default property values from the API context instead of doing + skip list searches. + + (CJH - 2019/12/10, HDFFV-10658) + + - Fixed user-created data access properties not existing in the property list + returned by H5Dget_access_plist. Thanks to Steven Varga for submitting a + reproducer and a patch. + + (CJH - 2019/12/09, HDFFV-10934) + + - Fixed an assertion failure in the parallel library when collectively + filling chunks. As it is required that chunks be written in + monotonically non-decreasing order of offset in the file, this assertion + was being triggered when the list of chunk file space allocations being + passed to the collective chunk filling routine was not sorted according + to this particular requirement. + + The addition of a sort of the out of order chunks trades a bit of + performance for the elimination of this assertion and of any complaints + from MPI implementations about the file offsets used being out of order. + + (JTH - 2019/10/07, HDFFV-10792) + + FORTRAN library: + ---------------- + + - Corrected INTERFACE INTENT(IN) to INTENT(OUT) for buf_size in h5fget_file_image_f. + + (MSB - 2020/2/18, HDFFV-11029) + + Java Library: + ---------------- + - Added ability to test java library with VOLs. + + Created new CMake script that combines the java and vol test scripts. + + (ADB - 2020/02/03, HDFFV-10996) + + - Tests fail for non-English locale. + + 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 + error. Changed the regex for the Time substitution. + + (ADB - 2020/01/09, HDFFV-10995) + + Tools: + ------ + - h5repack was fixed to repack the reference attributes properly. + The code line that checks if the update of reference inside a compound + datatype is misplaced outside the code block loop that carries out the + check. In consequence, the next attribute that is not the reference + type was repacked again as the reference type and caused the failure of + repacking. The fix is to move the corresponding code line to the correct + code block. + + (KY -2020/02/10, HDFFV-11014) + + - h5diff was updated to use the new reference APIs. + + h5diff uses the new reference APIs to compare references. + Attribute references can also be compared. + + (ADB - 2019/12/19, HDFFV-10980) + + - h5dump and h5ls were updated to use the new reference APIs. + + The tools library now use the new reference APIs to inspect a + file. Also the DDL spec was updated to reflect the format + changes produced with the new APIs. The export API and support + functions in the JNI were updated to match. + + (ADB - 2019/12/06, HDFFV-10876 and HDFFV-10877) + + +Major Bug Fixes since HDF5-1.10.0 release +========================================= + + - For major bug fixes please see HISTORY-1_10_0-1_12_0.txt file + + +Supported Platforms +=================== + + Linux 2.6.32-696.16.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Version 4.9.3, 5.2.0, 7.1.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.0.098 Build 20160721 + MPICH 3.1.4 + + Linux-3.10.0- spectrum-mpi/rolling-release with cmake>3.10 and + 862.14.4.1chaos.ch6.ppc64le clang/3.9,8.0 + #1 SMP ppc64le GNU/Linux gcc/7.3 + (ray) xl/2016,2019 + + Linux 3.10.0- openmpi/3.1,4.0 with cmake>3.10 and + 957.12.2.1chaos.ch6.x86_64 clang 5.0 + #1 SMP x86_64 GNU/Linux gcc/7.3,8.2 + (serrano) intel/17.0,18.0/19.0 + + Linux 3.10.0- openmpi/3.1/4.0 with cmake>3.10 and + 1062.1.1.1chaos.ch6.x86_64 clang/3.9,5.0,8.0 + #1 SMP x86_64 GNU/Linux gcc/7.3,8.1,8.2 + (chama,quartz) intel/16.0,18.0,19.0 + + Linux 4.4.180-94.100-default cray-mpich/7.7.6 with PrgEnv-*/6.0.5, cmake>3.10 and + #1 SMP x86_64 GNU/Linux gcc/7.2.0,8.2.0 + (mutrino) intel/17.0,18.0 + + Linux 4.14.0- spectrum-mpi/rolling-release with cmake>3.10 and + 49.18.1.bl6.ppc64le clang/6.0,8.0 + #1 SMP ppc64le GNU/Linux gcc/7.3 + (lassen) xl/2019 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 x64 Visual Studio 2015 w/ Intel C, Fortran 2018 (cmake) + Visual Studio 2015 w/ MSMPI 10 (cmake) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 18 (cmake) + Visual Studio 2017 w/ Intel Fortran 19 (cmake) + Visual Studio 2019 w/ Intel Fortran 19 (cmake) + + macOS 10.13.6 High Sierra Apple LLVM version 10.0.0 (clang/clang++-1000.10.44.4) + 64-bit gfortran GNU Fortran (GCC) 6.3.0 + (bear) Intel icc/icpc/ifort version 19.0.4 + + macOS 10.14.6 Mohave Apple LLVM version 10.0.1 (clang/clang++-1001.0.46.4) + 64-bit gfortran GNU Fortran (GCC) 6.3.0 + (bobcat) Intel icc/icpc/ifort version 19.0.4 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/n n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y y y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +macOS 10.13.6 64-bit n y/y n y y ? +macOS 10.14.6 64-bit n y/y n y y ? +CentOS 6.7 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 6.7 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y +Linux 2.6.32-573.18.1.el6.ppc64 n y/n n y y y + + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +macOS 10.13.6 64-bit y n y y +macOS 10.14.6 64-bit y n y y +CentOS 6.7 Linux 2.6.18 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y n +CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y n +CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n +Linux 2.6.32-573.18.1.el6.ppc64 y y y n + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.9.3, 5.3.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 17.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 3.10.0-327.18.2.el7 GNU C (gcc) and C++ (g++) compilers + #1 SMP x86_64 GNU/Linux Version 4.8.5 20150623 (Red Hat 4.8.5-4) + (jelly) with NAG Fortran Compiler Release 6.1(Tozai) + GCC Version 7.1.0 + OpenMPI 3.0.0-GCC-7.2.0-2.29 + Intel(R) C (icc) and C++ (icpc) compilers + Version 17.0.0.098 Build 20160721 + with NAG Fortran Compiler Release 6.1(Tozai) + PGI C (pgcc), C++ (pgc++), Fortran (pgf90) + compilers: + Version 18.4, 19.4 + MPICH 3.3 + OpenMPI 2.1.5, 3.1.3, 4.0.0 + + Fedora30 5.3.11-200.fc30.x86_64 + #1 SMP x86_64 GNU/Linux GNU gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1 20190827) + GNU Fortran (GCC) 9.2.1 20190827 (Red Hat 9.2.1 20190827) + (cmake and autotools) + + Mac OS X El Capitan 10.11.6 Apple LLVM version 7.3.0 (clang/clang++-703.0.29) + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + macOS 10.12.6 Sierra Apple LLVM version 9.0.0 (clang/clang++-900.0.39.2) + 64-bit gfortran GNU Fortran (GCC) 7.4.0 + (kite) Intel icc/icpc/ifort version 17.0.8 + + +Known Problems +============== + 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. + ADB - 2019/05/07 + + At present, metadata cache images may not be generated by parallel + applications. Parallel applications can read files with metadata cache + images, but since this is a collective operation, a deadlock is possible + if one or more processes do not participate. + + Known problems in previous releases can be found in the HISTORY*.txt files + in the HDF5 source, and in the HDF5 Jira database, available at + https://jira.hdfgroup.org/. Please register at https://www.hdfgroup.org to + create a free account for accessing the Jira database. Please report any + new problems found to help@hdfgroup.org. + + +CMake vs. Autotools installations +================================= +While both build systems produce similar results, there are differences. +Each system produces the same set of folders on linux (only CMake works +on standard Windows); bin, include, lib and share. Autotools places the +COPYING and RELEASE.txt file in the root folder, CMake places them in +the share folder. + +The bin folder contains the tools and the build scripts. Additionally, CMake +creates dynamic versions of the tools with the suffix "-shared". Autotools +installs one set of tools depending on the "--enable-shared" configuration +option. + build scripts + ------------- + Autotools: h5c++, h5cc, h5fc + CMake: h5c++, h5cc, h5hlc++, h5hlcc + +The include folder holds the header files and the fortran mod files. CMake +places the fortran mod files into separate shared and static subfolders, +while Autotools places one set of mod files into the include folder. Because +CMake produces a tools library, the header files for tools will appear in +the include folder. + +The lib folder contains the library files, and CMake adds the pkgconfig +subfolder with the hdf5*.pc files used by the bin/build scripts created by +the CMake build. CMake separates the C interface code from the fortran code by +creating C-stub libraries for each Fortran library. In addition, only CMake +installs the tools library. The names of the szip libraries are different +between the build systems. + +The share folder will have the most differences because CMake builds include +a number of CMake specific files for support of CMake's find_package and support +for the HDF5 Examples CMake project. + diff --git a/release_docs/HISTORY-1_8.txt b/release_docs/HISTORY-1_8.txt index e6df15b..da3d849 100644 --- a/release_docs/HISTORY-1_8.txt +++ b/release_docs/HISTORY-1_8.txt @@ -3,6 +3,10 @@ HDF5 History This file contains development history of HDF5 1.8 branch +23. Release Information for hdf5-1.8.21 +22. Release Information for hdf5-1.8.20 +21. Release Information for hdf5-1.8.19 +20. Release Information for hdf5-1.8.18 19. Release Information for hdf5-1.8.17 18. Release Information for hdf5-1.8.16 17. Release Information for hdf5-1.8.15 @@ -25,6 +29,2097 @@ This file contains development history of HDF5 1.8 branch [Search on the string '%%%%' for section breaks of each release.] +%%%%1.8.21%%%% + + +HDF5 version 1.8.21 released on 2018-06-04 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.20 and +HDF5-1.8.21, and contains information on the platforms tested and +known problems in HDF5-1.8.21. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.21 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + https://support.hdfgroup.org/HDF5/ + +The HDF5 1.8.21 release can be obtained from: + + https://support.hdfgroup.org/HDF5/release/obtain518.html + +User documentation for 1.8.21 can be accessed directly at this location: + + https://support.hdfgroup.org/HDF5/doc1.8/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.21 (current +release) versus Release 1.8.20 + + https://support.hdfgroup.org/HDF5/doc1.8/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.20 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + - CMake + + Change minimum version to 3.10. + + This change removes the need to support a copy of the FindMPI.cmake module, + which has been removed, along with its subfolder in the config/cmake_ext_mod + location. + + (ADB - 2018/03/09) + + - CMake + + Add pkg-config file generation + + Added pkg-config file generation for the C, C++, HL, and HL C++ libraries. + In addition, builds on linux will create h5cXXX scripts that use the pkg-config + files. This is a limited implementation of a script like autotools h5cc. + + (ADB - 2018/03/08, HDFFV-4359) + + - CMake + + Refactor use of CMAKE_BUILD_TYPE for new variable, which understands + the type of generator in use. + + Added new configuration macros to use new HDF_BUILD_TYPE variable. This + variable is set correctly for the type of generator being used for the build. + + (ADB - 2018/01/08, HDFFV-10385, HDFFV-10296) + + C++ API + ------- + - The following C++ API wrappers have been added to class H5Location + + H5Lcreate_soft: + // Creates a soft link from link_name to target_name. + void link(const char *target_name, const char *link_name,...) + void link(const H5std_string& target_name,...) + + + H5Lcreate_hard: + // Creates a hard link from new_name to curr_name. + void link(const char *curr_name, const Group& new_loc,...) + void link(const H5std_string& curr_name, const Group& new_loc,...) + + // Creates a hard link from new_name to curr_name in the same location. + void link(const char *curr_name, const hid_t same_loc,...) + void link(const H5std_string& curr_name, const hid_t same_loc,...) + + Note: previous version CommonFG::link will be deprecated. + + + H5Lcopy: + // Copy an object from a group of file to another. + void copyLink(const char *src_name, const Group& dst,...) + void copyLink(const H5std_string& src_name, const Group& dst,...) + + // Copy an object from a group of file to the same location. + void copyLink(const char *src_name, const char *dst_name,...) + void copyLink(const H5std_string& src_name,...) + + + H5Lmove: + // Rename an object in a group or file to a new location. + void moveLink(const char* src_name, const Group& dst,...) + void moveLink(const H5std_string& src_name, const Group& dst,...) + + // Rename an object in a group or file to the same location. + void moveLink(const char* src_name, const char* dst_name,...) + void moveLink(const H5std_string& src_name,...) + + Note: previous version CommonFG::move will be deprecated. + + + H5Ldelete: + // Removes the specified link from this location. + void unlink(const char *link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) + void unlink(const H5std_string& link_name, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) + + Note: An additional parameter is added to CommonFG::unlink and it + is moved to H5Location. + + (BMR - 2018/05/11 - HDFFV-10445) + + - New property list subclasses + + Property list subclasses StrCreatPropList, LinkCreatPropList, and + AttrCreatPropList are added for the C property list classes + H5P_STRING_CREATE, H5P_LINK_CREATE, and H5P_ATTRIBUTE_CREATE. + + (BMR - 2018/05/11 - HDFFV-10445) + + - Another argument, LinkCreatPropList& lcpl, is added to the following + functions for the use of link creation property list. + Group createGroup(const char* name, size_t size_hint = 0, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT) + Group createGroup(const H5std_string& name, size_t size_hint = 0, + const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT) + + (BMR - 2018/05/11 - HDFFV-10445) + + + +Support for New Platforms, Languages, and Compilers +=================================================== + + - Added support for Visual Studio 2017 w/ Intel Fortran 18 on Windows 10 x64. + + +Bug Fixes since HDF5-1.8.20 +=========================== + + - If an HDF5 file contains a filter pipeline message with a 'number of + filters' field that exceeds the maximum number of allowed filters, + the error handling code will attempt to dereference a NULL pointer. + + This issue was reported to The HDF Group as issue #CVE-2017-17505. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + This problem arose because the error handling code assumed that + the 'number of filters' field implied that a dynamic array of that + size had already been created and that the cleanup code should + iterate over that array and clean up each element's resources. If + an error occurred before the array has been allocated, this will + not be true. + + This has been changed so that the number of filters is set to + zero on errors. Additionally, the filter array traversal in the + error handling code now requires that the filter array not be NULL. + + (DER - 2018/02/06, HDFFV-10354) + + - If an HDF5 file contains a filter pipeline message which contains + a 'number of filters' field that exceeds the actual number of + filters in the message, the HDF5 C library will read off the end of + the read buffer. + + This issue was reported to The HDF Group as issue #CVE-2017-17506. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + The problem was fixed by passing the buffer size with the buffer + and ensuring that the pointer cannot be incremented off the end + of the buffer. A mismatch between the number of filters declared + and the actual number of filters will now invoke normal HDF5 + error handling. + + (DER - 2018/02/26, HDFFV-10355) + + - If an HDF5 file contains a malformed compound datatype with a + suitably large offset, the type conversion code can run off + the end of the type conversion buffer, causing a segmentation + fault. + + This issue was reported to The HDF Group as issue #CVE-2017-17507. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + THE HDF GROUP WILL NOT FIX THIS BUG AT THIS TIME + + Fixing this problem would involve updating the publicly visible + H5T_conv_t function pointer typedef and versioning the API calls + which use it. We normally only modify the public API during + major releases, so this bug will not be fixed at this time. + + (DER - 2018/02/26, HDFFV-10356) + + - If an HDF5 file contains a malformed compound type which contains + a member of size zero, a division by zero error will occur while + processing the type. + + This issue was reported to The HDF Group as issue #CVE-2017-17508. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + Checking for zero before dividing fixes the problem. Instead of the + division by zero, the normal HDF5 error handling is invoked. + + (DER - 2018/02/26, HDFFV-10357) + + - If an HDF5 file contains a malformed symbol table node that declares + it contains more symbols than it actually contains, the library + can run off the end of the metadata cache buffer while processing + the symbol table node. + + This issue was reported to The HDF Group as issue #CVE-2017-17509. + + NOTE: The HDF5 C library cannot produce such a file. This condition + should only occur in a corrupt (or deliberately altered) file + or a file created by third-party software. + + Performing bounds checks on the buffer while processing fixes the + problem. Instead of the segmentation fault, the normal HDF5 error + handling is invoked. + + (DER - 2018/03/12, HDFFV-10358) + + + Configuration + ------------- + - Library + + Moved the location of gcc attribute. + + The gcc attribute(no_sanitize), named as the macro HDF_NO_UBSAN, + was located after the function name. Builds with GCC 7 did not + indicate any problem, but GCC 8 issued errors. Moved the + attribute before the function name, as required. + + (ADB 2018/05/22, HDFFV-10473) + + - CMake + + Update CMake commands configuration. + + A number of improvements were made to the CMake commands. Most + changes simplify usage or eliminate unused constructs. Also, + some changes support better cross-platform support. + + (ADB - 2018/02/01, HDFFV-10398) + + - CMake + + Correct usage of CMAKE_BUILD_TYPE variable. + + The use of the CMAKE_BUILD_TYPE is incorrect for multi-config + generators (Visual Studio and XCode) and is optional for single + config generators. Created a new macro to check + GLOBAL PROPERTY -> GENERATOR_IS_MULTI_CONFIG + Created two new HDF variable, HDF_BUILD_TYPE and HDF_CFG_BUILD_TYPE. + Defaults for these variables is "Release". + + (ADB - 2018/01/10, HDFFV-10385) + + - CMake + + Add replacement of fortran flags if using static CRT. + + Added TARGET_STATIC_CRT_FLAGS call to HDFUseFortran.cmake file in + config/cmake_ext_mod folder. + + (ADB - 2018/01/08, HDFFV-10334) + + + Library + ------- + - Utility function can not handle lowercase Windows drive letters + + Added call to toupper function for drive letter. + + (ADB - 2017/12/18, HDFFV-10307) + + + Tools + ----- + - h5repack + + h5repack changes the chunk parameters when a change of layout is not + specified and a filter is applied. + + HDFFV-10297, HDFFV-10319 reworked code for h5repack and h5diff code + in the tools library. The check for an existing layout was incorrectly + placed into an if block and not executed. The check was moved into + the normal path of the function. + + (ADB - 2018/02/21, HDFFV-10412) + + - h5dump + + the tools library will hide the error stack during file open. + + While this is preferable almost always, there are reasons to enable + display of the error stack when a tool will not open a file. Adding an + optional argument to the --enable-error-stack will provide this use case. + As an optional argument it will not affect the operation of the + --enable-error-stack. h5dump is the only tool to implement this change. + + (ADB - 2018/02/15, HDFFV-10384) + + - h5dump + + h5dump would output an indented blank line in the filters section. + + h5dump overused the h5tools_simple_prefix function, which is a + function intended to account for the data index (x,y,z) option. + Removed the function call for header information. + + (ADB - 2018/01/25, HDFFV-10396) + + - h5repack + + h5repack incorrectly searched internal object table for name. + + h5repack would search the table of objects for a name, if the + name did not match it tried to determine if the name without a + leading slash would match. The logic was flawed! The table + stored names(paths) without a leading slash and did a strstr + of the table path to the name. + The assumption was that if there was a difference of one then + it was a match, however "pressure" would match "/pressure" as + well as "/pressure1", "/pressure2", etc. Changed logic to remove + any leading slash and then do a full compare of the name. + + (ADB - 2018/01/18, HDFFV-10393) + + - h5repack + + h5repack failed to handle command line parameters for customer filters. + + User defined filter parameter conversions would fail when integers + were represented on the command line with character strings + larger than 9 characters. Increased local variable array for storing + the current command line parameter to prevent buffer overflows. + + (ADB - 2018/01/17, HDFFV-10392) + + - h5diff + + h5diff seg faulted if comparing VL strings against fixed strings. + + Reworked solution for HDFFV-8625 and HDFFV-8639. Implemented the check + for string objects of same type in the diff_can_type function by + adding an if(tclass1 == H5T_STRING) block. This "if block" moves the + same check that was added for attributes to this function, which is + used by all object types. This function handles complex type structures. + Also added a new test file in h5diffgentest for testing this issue + and removed the temporary files used in the test scripts. + + (ADB - 2018/01/04, HDFFV-8745) + + + C++ API + ------- + - Removal of memory leaks + + A private function was inadvertently called, causing memory leaks. This + is now fixed. + + (BMR - 2018/04/12 - User reported in email) + + - Changes in exception classes + + Some exception classes are reorganized to reflect the HDF5 object + hierarchy and allow customization. + DataSetIException -> LocationException -> Exception + DataTypeIException -> LocationException -> Exception + GroupIException -> LocationException -> Exception + AttributeIException -> LocationException -> Exception + FileIException -> GroupIException -> LocationException -> Exception + Member functions in H5Location and H5Object now throw specific exceptions + associated with the invoking objects. + + (BMR - 2018/05/11) + + - H5Location::closeObjId is made static + (BMR - 2018/05/11) + + - H5A wrappers in H5Location are removed as they have been in H5Object. + (BMR - 2018/05/11) + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus/mayll) Version 4.4.7 20120313 + Versions 4.9.3, 5.3.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 17.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20160721 + MPICH 3.1.4 compiled with GCC 4.9.3 + OpenMPI 2.0.1 compiled with GCC 4.9.3 + + Linux 2.6.32-573.18.1.el6 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan/jelly Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Versions 4.9.3, 5.3.0, 6.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + MPICH 3.1.4 compiled with GCC 4.9.3 + NAG Fortran Compiler Release 6.1(Tozai) Build 6116 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ Intel C, Fortran 2017 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2017 w/ Intel Fortran 18 (cmake) + + Mac OS X Mavericks 10.9.5 Apple LLVM version 6.0 (clang-600.0.57) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple LLVM version 6.1 (clang-602.0.53) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.6 Apple LLVM version 7.3.0 (clang-703.0.29) + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (VM osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + Mac OS Sierra 10.12.6 Apple LLVM version 8.1 (clang-802.0.42) + 64-bit gfortran GNU Fortran (GCC) 7.1.0 + (kite) Intel icc/icpc/ifort version 17.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y +Mac OS Sierra 10.12.6 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-573.18.1.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +Mac OS X El Capitan 10.11.6 64-bit y n y y +Mac OS Sierra 10.12.6 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-573.18.1.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (mayll) + + Debian8.4.0 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 + (cmake and autotools) + + Fedora24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + (cmake and autotools) + + CentOS 7.2 3.10.0-327.28.2.el7.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + (cmake and autotools) + + Ubuntu 16.04 4.4.0-38-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + (cmake and autotools) + + +Known Problems +============== + + The dynamically loaded plugin test libraries require undefined references + to HDF5 functions to be resolved at runtime in order to function properly. + With autotools on CYGWIN this results in build errors, and we have not + found a solution that satisfies both. Therefore the dynamically loaded + plugin tests have been disabled on CYGWIN. + + Mac OS X 10.13 added additional subdirectory structure in .libs for shared + libraries. Consequently "make check" will fail testing java and dynamically + loaded plugin test libraries attempting to copy files from the previous + locations in .libs directories. This will be addressed in the next release + when support for the Mac OS X 10.13 platform is added. + + 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. + + +%%%%1.8.20%%%% + + +HDF5 version 1.8.20 released on 2017-11-28 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.19 and +HDF5-1.8.20, and contains information on the platforms tested and +known problems in HDF5-1.8.20. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.20 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + https://support.hdfgroup.org/HDF5/ + +The HDF5 1.8.20 release can be obtained from: + + https://support.hdfgroup.org/HDF5/release/obtain518.html + +User documentation for 1.8.20 can be accessed directly at this location: + + https://support.hdfgroup.org/HDF5/doc1.8/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.20 (current +release) versus Release 1.8.19 + + https://support.hdfgroup.org/HDF5/doc1.8/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.20 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Tools + ----- + - h5diff + + h5diff has new option enable-error-stack. + + Updated h5diff with the --enable-error-stack argument, which + enables the display of the hdf5 error stack. This completes the + improvement to the main tools; h5copy, h5diff, h5dump, h5ls and + h5repack. + + (ADB - 2017/08/30, HDFFV-9774) + + + C++ API + ------- + - The following C++ API wrappers have been added to the C++ Library: + + // Creates a binary object description of this datatype. + void DataType::encode() - C API H5Tencode() + + // Returns the decoded type from the binary object description. + DataType::decode() - C API H5Tdecode() + ArrayType::decode() - C API H5Tdecode() + CompType::decode() - C API H5Tdecode() + DataType::decode() - C API H5Tdecode() + EnumType::decode() - C API H5Tdecode() + FloatType::decode() - C API H5Tdecode() + IntType::decode() - C API H5Tdecode() + StrType::decode() - C API H5Tdecode() + VarLenType::decode() - C API H5Tdecode() + + // Three overloaded functions to retrieve information about an object + H5Location::getObjectInfo() - H5Oget_info()/H5Oget_info_by_name() + + (BMR - 2017/10/17, HDFFV-10175) + + - New constructors to open existing datatypes added in ArrayType, + CompType, DataType, EnumType, FloatType, IntType, StrType, and + VarLenType. + + (BMR - 2017/10/17, HDFFV-10175) + + - A document is added to the HDF5 C++ API Reference Manual to show the + mapping from a C API to C++ wrappers. It can be found from the main + page of the C++ API Reference Manual. + + (BMR - 2017/10/17, HDFFV-10151) + + + High-Level APIs + --------------- + - H5DOread_chunk + + Users wanted to read compressed data directly from a file without any + processing by the HDF5 data transfer pipeline, just as they were able + to write it directly to a file with H5DOwrite_chunk. + + New API function, corresponding to existing function H5DOwrite_chunk. + H5DOread_chunk reads a raw data chunk directly from a chunked dataset + in the file into the application buffer, bypassing the library’s internal + data transfer pipeline, including filters. + + (VC - 2017/05/02, HDFFV-9934) + + +Support for New Platforms, Languages, and Compilers +=================================================== + + - Added NAG compiler + + +Bug Fixes since HDF5-1.8.19 +=========================== + + Configuration + ------------- + - cmake + + The hdf5 library used shared szip and zlib, which needlessly required + applications to link with the same szip and zlib libraries. + + Changed the target_link_libraries commands to use the static libs. + Removed improper link duplication of szip and zlib. + Adjusted the link dependencies and the link interface values of + the target_link_libraries commands. + + (ADB - 2017/11/14, HDFFV-10329) + + - cmake MPI + + CMake implementation for MPI was problematic and would create incorrect + MPI library references in the hdf5 libraries. + + Reworked the CMake MPI code to properly create CMake targets.Also merged + the latest CMake FindMPI.cmake changes to the local copy. This is necessary + until HDF changes the CMake minimum to 3.9 or greater. + + (ADB - 2017/11/02, HDFFV-10321) + + + - Fixed Fortran linker flags when using the NAG Fortran compiler (autotools). + + (HDFFV-10037, MSB, 2017/10/21) + + - cmake + + Too many commands for POST_BUILD step caused command line to be + too big on windows. + + Changed foreach of copy command to use a custom command with the + use of the HDFTEST_COPY_FILE macro. + + (ADB - 2017/07/12, HDFFV-10254) + + + Library + ------- + - filter plugin handling in H5PL.c and H5Z.c + + It was discovered that the dynamic loading process used by + filter plugins had issues with library dependencies. + + CMake build process changed to use LINK INTERFACE keywords, which + allowed HDF5 C library to make dependent libraries private. The + filter plugin libraries no longer require dependent libraries + (such as szip or zlib) to be available. + (ADB - 2017/11/16, HDFFV-10328) + + - Fix rare object header corruption bug + + In certain cases, such as when converting large attributes to dense + storage, an error could occur which would either fail an assertion or + cause file corruption. Fixed and added test. + + (NAF - 2017/11/14, HDFFV-10274) + + - H5Zfilter_avail in H5Z.c + + The public function checked for plugins, while the private + function did not. + + Modified H5Zfilter_avail and private function, H5Z_filter_avail. + Moved check for plugin from public to private function. Updated + H5P__set_filter due to change in H5Z_filter_avail. Updated tests. + + (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) + + - Fix H5Sencode bug when num points selected is >2^32 + + Modified to fail if the 32 bit limit is exceeded when encoding either + offsets or counts in the selection. + + (HDFFV-10323, VC, 2017/09/07) + + - Fix H5HL_offset_into() + + (1) Fix H5HL_offset_into() to return error when offset exceeds heap data + block size. + (2) Fix other places in the library that call this routine to detect + error routine. + + (HDFFV-10216, VC, 2017/09/05) + + + Tools + ----- + - h5repack + + h5repack failed to copy a dataset with existing filter. + + Reworked code for h5repack and h5diff code in tools library. Added + improved error handling, cleanup of resources and checks of calls. + Modified H5Zfilter_avail and private function, H5Z_filter_avail. + Moved check for plugin from public to private function. Updated + H5P__set_filter due to change in H5Z_filter_avail. Updated tests. + Note, h5repack output display has changed to clarify the individual + steps of the repack process. The output indicates if an operation + applies to all objects. Lines with notation and no information + have been removed. + + (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) + + - h5repack + + h5repack always set the User Defined filter flag to H5Z_FLAG_MANDATORY. + + Added another parameter to the 'UD=' option to set the flag by default + to '0' or H5Z_FLAG_MANDATORY, the other choice is '1' or H5Z_FLAG_OPTIONAL. + + (ADB - 2017/08/31, HDFFV-10269) + + - h5ls + + h5ls generated error on stack when it encountered a H5S_NULL + dataspace. + + Adding checks for H5S_NULL before calling H5Sis_simple (located + in the h5tools_dump_mem function) fixed the issue. + + (ADB - 2017/08/17, HDFFV-10188) + + - h5dump + + h5dump segfaulted on output of XML file. + + Function that escape'd strings used the full buffer length + instead of just the length of the replacement string in a + strncpy call. Using the correct length fixed the issue. + + (ADB - 2017/08/01, HDFFV-10256) + + - h5diff + + h5diff segfaulted on compare of a NULL variable length string. + + Improved h5diff compare of strings by adding a check for + NULL strings and setting the lengths to zero. + + (ADB - 2017/07/25, HDFFV-10246) + + - h5import + + h5import crashed trying to import data from a subset of a dataset. + + Improved h5import by adding the SUBSET keyword. h5import understands + to use the Count times the Block as the size of the dimensions. + Added INPUT_B_ORDER keyword to old-style configuration files. + The import from h5dump function expects the binary files to use native + types (FILE '-b' option) in the binary file. + + (ADB - 2017/06/15, HDFFV-10219) + + + C++ API + ------- + - Marked the following functions deprecated because they were moved to + class H5Object: + H5Location::createAttribute() + H5Location::openAttribute() + H5Location::attrExists() + H5Location::removeAttr() + H5Location::renameAttr() + H5Location::getNumAttrs() + + (BMR - 2017/10/17) + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus/mayll) Version 4.4.7 20120313 + Versions 4.9.3, 5.3.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.0.196 Build 20160721 + MPICH 3.1.4 compiled with GCC 4.9.3 + OpenMPI 2.0.1 compiled with GCC 4.9.3 + + Linux 2.6.32-573.18.1.el6 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan/jelly Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Versions 4.9.3, 5.3.0, 6.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + MPICH 3.1.4 compiled with GCC 4.9.3 + NAG Fortran Compiler Release 6.1(Tozai) Build 6116 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ Intel C, Fortran 2017 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Mac OS X Mavericks 10.9.5 Apple LLVM version 6.0 (clang-600.0.57) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple LLVM version 6.1 (clang-602.0.53) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.6 Apple LLVM version 7.3.0 (clang-703.0.29) + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (VM osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + Mac OS Sierra 10.12.6 Apple LLVM version 8.1 (clang-802.0.42) + 64-bit gfortran GNU Fortran (GCC) 7.1.0 + (kite) Intel icc/icpc/ifort version 17.0.2 + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y +Mac OS Sierra 10.12.6 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +Mac OS X El Capitan 10.11.6 64-bit y n y y +Mac OS Sierra 10.12.6 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-431.11.2.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (mayll) + + Debian8.4.0 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 + (cmake and autotools) + + Fedora24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + (cmake and autotools) + + CentOS 7.2 3.10.0-327.28.2.el7.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + (cmake and autotools) + + Ubuntu 16.04 4.4.0-38-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + (cmake and autotools) + + +Known Problems +============== + + The dynamically loaded plugin test libraries require undefined references + to HDF5 functions to be resolved at runtime in order to function properly. + With autotools on CYGWIN this results in build errors, and we have not + found a solution that satisfies both. Therefore the dynamically loaded + plugin tests have been disabled on CYGWIN. + + Mac OS X 10.13 added additional subdirectory structure in .libs for shared + libraries. Consequently "make check" will fail testing java and dynamically + loaded plugin test libraries attempting to copy files from the previous + locations in .libs directories. This will be addressed in the next release + when support for the Mac OS X 10.13 platform is added. + + 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. + + +%%%%1.8.19%%%% + + +HDF5 version 1.8.19 released on 2017-06-15 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.18 and +HDF5-1.8.19, and contains information on the platforms tested and +known problems in HDF5-1.8.19. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.19 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + https://support.hdfgroup.org/HDF5/ + +The HDF5 1.8.19 release can be obtained from: + + https://support.hdfgroup.org/HDF5/release/obtain518.html + +User documentation for 1.8.19 can be accessed directly at this location: + + https://support.hdfgroup.org/HDF5/doc1.8/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.19 (current +release) versus Release 1.8.18 + + https://support.hdfgroup.org/HDF5/doc1.8/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.19 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + -------------- + - CMake in the Tools + + User-defined filters on Windows require that tools be built + with shared libraries. + + CMake command code added to build tools with + shared libraries as well as with static libraries. + + (ADB - 2017/02/07, HDFFV-10123) + + + Library + ------- + - H5PL package + + Users would like to be able to set the plugin path programmatically + instead of through the environment variable. + + H5PL package obtained new APIs for manipulating the entries of + the plugin path table. The new APIs are; + H5PLappend - Insert a plugin path at the end of the list. + H5PLprepend - Insert a plugin path at the beginning of the list. + H5PLreplace - Replace the path at the specified index. + H5PLinsert - Insert a plugin path at the specified index, moving + other paths after the index. + H5PLremove - Remove the plugin path at the specifed index and + compacting the list. + H5PLget - Query the plugin path at the specified index. + H5PLsize - Query the size of the current list of plugin paths. + + (ADB - 2017/04/04, HDFFV-10143) + + - H5Dget_chunk_storage_size + + The storage size of a chunk in the file is needed to determine the size + of the buffer to be allocated for reading a chunk directly from a file. + + New API function gets the size in bytes currently allocated within a + file for a raw data chunk in a dataset. This function was added to get + the chunk size in support of the implementation of H5DOread_chunks, but + may also be useful for other purposes. + + (VC - 2017/05/02, HDFFV-9934) + + C++ API + ------- + - The following C++ API wrappers have been added to the C++ Library: + // Determines if a name exists. + H5Location::nameExists() - C API H5Lexists() + + // Checks if an ID is valid. + IdComponent::isValid() - C API H5Iis_valid() + + // Sets the number of soft or user-defined links that can be + // traversed before a failure occurs. + LinkAccPropList::setNumLinks() - C API H5Pset_nlinks() + + // Gets the number of soft or user-defined link traversals allowed + LinkAccPropList::getNumLinks() - C API H5Pget_nlinks() + + // Returns a copy of the creation property list of a datatype. + DataType::getCreatePlist() - C API H5Tget_create_plist() + + // Opens an object within a location, regarless its type. + H5Location::openObjId() - C API H5Oopen() + H5Location::openObjId() - C API H5Oopen() + + // Closes an object opened by openObjId(). + H5Location::closeObjId() - C API H5Oclose() + + // Gets general information about a file. + H5File::getFileInfo() - C API H5Fget_info() + + // Returns the header version of an HDF5 object. + H5Object::objVersion() - C API H5Oget_info() + + (BMR, 2017/05/13, HDFFV-10004, HDFFV-10156) + + - New class LinkAccPropList is added for link access proprety list + + (BMR, 2017/05/13, HDFFV-10156) + + High-Level APIs + --------------- + - H5DOread_chunk + + Users wanted to read compressed data directly from a file without any + processing by the HDF5 data transfer pipeline, just as they were able + to write it directly to a file with H5DOwrite_chunk. + + New API function, corresponding to existing function H5DOwrite_chunk. + H5DOread_chunk reads a raw data chunk directly from a chunked dataset + in the file into the application buffer, bypassing the library’s internal + data transfer pipeline, including filters. + + (VC - 2017/05/02, HDFFV-9934) + + +Support for New Platforms, Languages, and Compilers +=================================================== + + - Added OpenMPI 2.0.1 compiled with GCC 4.9.3 + + +Bug Fixes since HDF5-1.8.18 +=========================== + + Configuration + ------------- + - Support for Fortran shared libraries on OS X with autotools now + works. Cmake builds still disables Fortran shared libraries on OS X. + (MSB - 2017/04/30, HDFFV-2772) + + + Library + ------- + - bitfield datatypes + + bitfield datatypes did not fully support endianness of the data. + + Improved the endianness of bitfield datatypes by adding missing functional + code. This code used integer types as a template. + + (ADB - 2017/05/12, HDFFV-10186) + + - Newly created datasets with H5D_COMPACT layout failed to open after + several H5Dopen/H5Dclose cycles. + + The layout "dirty" flag for a compact dataset is now properly reset + before flushing the message. + + (VC - 2017/05/11, HDFFV-10051) + - Missing #ifdef __cplusplus macros were added to the generated H5Epubgen.h file. + + (DER - 2017/04/25, HDFFV-9638) + + + Tools + ----- + - h5repack + + h5repack did not maintain the creation order flag of the root + group. + + Improved h5repack by reading the creation order and applying the + flag to the new root group. Also added arguments to set the + order and index direction, which applies to the traversing of the + original file, on the command line. + + (ADB - 2017/05/26, HDFFV-8611) + + - h5diff + + h5diff failed to account for strpad type and null terminators + of char strings. Also, h5diff failed to account for string length + differences and would give a different result depending on file + order in the command line. + + Improved h5diff compare of strings and arrays by adding a check for + string lengths and if the strpad was null filled. + + (ADB - 2017/05/18, HDFFV-9055, HDFFV-10128) + + - h5diff + + h5diff help text about epsilon comparison was confusing. + + Changed h5diff help text to indicate that the 'a' refers to the + datapoint in file1 and 'b' refers to the datapoint value in file2. + + (ADB - 2017/05/16, HDFFV-9995) + + - h5diff + + h5diff did not report user-defined filter data differences correctly. + + Improved h5diff compare of user-defined filter data by reporting an + error if the user-defined filter plugin cannot be found. + + (ADB - 2017/01/18, HDFFV-9994) + C++ API + ------- + - The class hierarchy is revised to better reflect the HDF5 model. + Class H5File is now derived from class Group instead of H5Location. + Class Attribute is now derived from H5Location instead of IdComponent. + Wrappers of H5A APIs in H5Location are now duplicated in H5Object, + the original wrappers in H5Location will be deprecated in future + releases. + + (BMR - 2017/05/15, HDFFV-10156) + + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus/mayll) Version 4.4.7 20120313 + Versions 4.9.3, 5.2.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.0.098 Build 20160721 + MPICH 3.1.4 compiled with GCC 4.9.3 + OpenMPI 2.0.1 compiled with GCC 4.9.3 + + Linux 2.6.32-573.18.1.el6 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Versions 4.9.3, 5.3.0, 6.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ Intel C, Fortran 2017 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple LLVM version 5.1 (clang-503.0.40) + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple LLVM version 6.0 (clang-600.0.57) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple LLVM version 6.1 (clang-602.0.53) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.4 Apple LLVM version 7.3.0 (clang-703.0.29) + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (VM osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-431.11.2.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (mayll) + + Debian8.4.0 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 + (cmake and autotools) + + Fedora24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + (cmake and autotools) + + CentOS 7.2 3.10.0-327.28.2.el7.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + (cmake and autotools) + + Ubuntu 16.04 4.4.0-38-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + (cmake and autotools) + + +Known Problems +============== + + The dynamically loaded plugin test libraries require undefined references + to HDF5 functions to be resolved at runtime in order to function properly. + With autotools on CYGWIN this results in build errors, and we have not + found a solution that satisfies both. Therefore the dynamically loaded + plugin tests have been disabled on CYGWIN. + + 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. + + +%%%%1.8.18%%%% + + +HDF5 version 1.8.18 released on 2016-11-14 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.17 and +HDF5-1.8.18, and contains information on the platforms tested and +known problems in HDF5-1.8.18. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.18 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + https://support.hdfgroup.org/HDF5/ + +The HDF5 1.8.18 release can be obtained from: + + https://support.hdfgroup.org/HDF5/release/obtain518.html + +User documentation for 1.8.18 can be accessed directly at this location: + + https://support.hdfgroup.org/HDF5/doc1.8/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.18 (current +release) versus Release 1.8.17 + + https://support.hdfgroup.org/HDF5/doc1.8/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.17 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + ------------- + + - CMake: Added NAMESPACE hdf5:: to package configuration files to allow + projects using installed HDF5 binaries built with CMake to link with + them without specifying the HDF5 library location via IMPORTED_LOCATION. + + (ADB, 2016/10/17, HDFFV-10003) + + + - CMake: Changed the CTEST_BUILD_CONFIGURATION option to + CTEST_CONFIGURATION_TYPE as recommended by the CMake documentation. + + (ADB, 2016/10/17, HDFFV-9971) + + - CMake: Added support for GIT + + (ADB, 2016/07/12) + + + Library + ------- + - None + + + Parallel Library + ---------------- + - None + + + Tools + ----- + - None + + + High-Level APIs + --------------- + - None + + + Fortran API + ----------- + - None + + + C++ API + ------- + - None + + +Support for New Platforms, Languages, and Compilers +=================================================== + + + +Bug Fixes since HDF5-1.8.17 +=========================== + + Configuration + ------------- + + - Fixed a problem preventing HDF5 to be built on 32-bit CYGWIN by + condensing cygwin configuration files into a single file and + removing outdated compiler settings. + + (ABD, 2016/07/12, HDFFV-9946) + + + - CMake: Fixed a command length overflow error by converting custom + commands inside CMakeTest.cmake files into regular dependencies and + targets. + + (ABD, 2016/07/12, HDFFV-9939) + + + - CMake: Fixed a timeout error that would occasionally occur when running + the virtual file driver tests simultaneously due to test directory and file + name collisions. + + (ABD, 2016/09/19, HDFFV-9431) + + + Library + ------- + + - Fixed a memory leak that would occur when the library allocated memory + for an external file prefix (H5Pset_efile_prefix) and failed to free it. + + (DER, 2016/04/29) + + + - Fixed an error that would occur when calling H5Adelete on an attribute + which is attached to an externally linked object in the target file and + whose datatype is a committed datatype in the main file. + + (VC, 2016-07-04, HDFFV-9940) + + + - Fixed a problem where a plugin compiled into a DLL in the default plugin + directory could not be found by the HDF5 library at runtime on Windows + when the HDF5_PLUGIN_PATH environment variable was not set. + + (ABD, 2016/08/01, HDFFV-9706) + + + - Fixed an issue where H5Pset_alignment could result in misaligned blocks + with some input combinations, causing an assertion failure in debug mode. + + (NAF, 2016/08/11, HDFFV-9948) + + + - A number of issues were fixed when reading/writing from/to corrupted + files to ensure that the library fails gracefully in these cases: + + * Writing to a corrupted file that has an object message which is + incorrectly marked as sharable on disk results in a buffer overflow / + invalid write instead of a clean error message. + + * Decoding data from a corrupted file with a dataset encoded with the + H5Z_NBIT decoding can result in a code execution vulnerability under + the context of the application using the HDF5 library. + + * When decoding an array datatype from a corrupted file, the HDF5 library + fails to return an error in production if the number of dimensions + decoded is greater than the maximum rank. + + * When decoding an "old style" array datatype from a corrupted file, the + HDF5 library fails to return an error in production if the number of + dimensions decoded is greater than the maximum rank. + + (NAF, 2016/10/06, HDFFV-9950, HDFFV-9951, HDFFV-9992, HDFFV-9993) + + + - Fixed an error that would occur when copying an object with an attribute + which is a compound datatype consisting of a variable length string. + + (VC, 2016-10-17, HDFFV-7991) + + + Parallel Library + ---------------- + + - Fixed a bug that could occur when allocating a chunked dataset in parallel + with an alignment set and an alignment threshold greater than the chunk + size but less than or equal to the raw data aggregator size. + + (NAF, 2016/08/11, HDFFV-9969) + + + Performance + ------------- + - None + + + Tools + ----- + + - Fixed an error in the compiler wrapper scripts (h5cc, h5fc, et al.) + in which they would erroneously drop the file argument specified via + the -o flag when the -o flag was specified before the -c flag on the + command line, resulting in a failure to compile. + + (LRK, 2016/06/08, HDFFV-9938, HDFFV-9530) + + + - h5repack User Defined (UD) filter parameters were not parsed correctly. + + The UD filter parameters were not being parsed correctly. Reworked coding + section to parse the correct values and verify number of parameters. + + (ADB, 2016/10/19, HDFFV-9996, HDFFV-9974, HDFFV-9515, HDFFV-9039) + + + Fortran API + ----------- + + - Fortran library fails to compile and fails tests with NAG compiler. + + * Removed the non-standard assumption that KIND=SIZEOF, in the HDF5 + configure programs. + * Removed Fortran 66 character/integer conversions from tests. + * Removed the use of C_SIZEOF in the test programs + * Changed to using STORAGE_SIZE in the test programs if available. Otherwise, + uses C_SIZEOF or SIZEOF. + + (MSB, 2016/9/22, HDFFV-9973) + + + - Fortran segfaults for F03 tests with NAG compiler + + * Removed INTENT(OUT) from 'fillvalue' in F2003 interface + for H5Pget_fill_value_f. + + (MSB, 2016/9/22, HDFFV-9980) + + + C++ API + ------- + + - The macro H5_NO_NAMESPACE is deprecated from the HDF5 C++ API library. + In future releases, the macros H5_NO_STD and OLD_HEADER_FILENAME may + also be removed. + + (BMR, 2016/10/27, HDFFV-9532) + + + High-Level APIs: + --------------- + + - The high-level API Packet Table (PT) did not write data correctly when + the datatype is a compound type that has string type as one of the + members. This problem started in 1.8.15, after the fix of HDFFV-9042 + was applied, which caused the Packet Table to use native type to access + the data. It should be up to the application to specify whether the + buffer to be read into memory in the machine’s native architecture. + Thus, the PT is fixed to not use native type but to make a copy of the + user's provided datatype during creation or the packet table's datatype + during opening. If an application wishes to use native type to read the + data, then the application will request that. However, the Packet Table + doesn't provide a way to specify memory datatype in this release. This + feature will be available in future releases, HDFFV-10023. + + (BMR, 2016/10/27, HDFFV-9758) + + + Fortran High-Level APIs: + ------------------------ + - None + + + Testing + ------- + - None + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus/mayll) Version 4.4.7 20120313 + Versions 4.8.4, 4.9.3, 5.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 15.7-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + Linux 2.6.32-573.18.1.el6 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Versions 4.9.3, 5.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 Build 20150407 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.2.1(0.289/5/3) gcc(4.9.3) compiler and gfortran) + (cmake and autotools) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple LLVM version 5.1 (clang-503.0.40) + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple LLVM version 6.0 (clang-600.0.57) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple LLVM version 6.1 (clang-602.0.53) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.4 Apple LLVM version 7.3.0 (clang-703.0.29) + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (VM osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + <blank> = testing incomplete on this feature or platform + +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/y n y y n +Windows 10 n y/y n y y y +Windows 10 x64 n y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-431.11.2.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (platypus) + + Debian8.4.0 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 + (cmake and autotools) + + Fedora24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + (cmake and autotools) + + CentOS 7.2 3.10.0-327.28.2.el7.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + (cmake and autotools) + + Ubuntu 16.04 4.4.0-38-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + (cmake and autotools) + + +Known Problems +============== +* On windows platforms in debug configurations, the VFD flush1 tests will fail + with the split and multi VFD drivers. These tests will display a modal debug + dialog which must be answered or wait for the test timeout to expire. + (ADB - 2014/06/23 - HDFFV-8851) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro DETECT_I + in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for + H5detect.c. In the future, we can separate flags for H5detect.c from the rest of + the library. (SLU - 2013/10/16) + +* Make provided by Solaris fails in "make check". Solaris users should use + gmake to build and install the HDF5 software. (AKC - 2013/10/08 - HDFFV-8534) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* The following h5dump test case fails in BG/P machines (and potentially other + machines that use a command script to launch executables): + + h5dump --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" + tno-subset.h5 + + This is due to the embedded spaces in the dataset name being interpreted + by the command script launcher as meta-characters, thus passing three + arguments to h5dump's -d flag. The command passes if run by hand, just + not via the test script. + (AKC - 2012/05/03) + +* The STDIO VFD does not work on some architectures, possibly due to 32/64 + bit or large file issues. The basic STDIO VFD test is known to fail on + 64-bit SunOS 5.10 on SPARC when built with -m64 and 32-bit OS X/Darwin + 10.7.0. The STDIO VFD test has been disabled while we investigate and + a fix should appear in a future release. + (DER - 2011/10/14 - HDFFV-8235) + +* h5diff can report inconsistent results when comparing datasets of enum type + that contain invalid values. This is due to how enum types are handled in + the library and will be addressed in a future release. + (DER - 2011/10/14 - HDFFV-7527) + +* The links test can fail under the stdio VFD due to some issues with external + links. This will be investigated and fixed in a future release. + (DER - 2011/10/14 - HDFFV-7768) + +* After the shared library support was fixed for some bugs, it was discovered + that "make prefix=XXX install" no longer works for shared libraries. It + still works correctly for static libraries. Therefore, if you want to + install the HDF5 shared libraries in a location such as /usr/local/hdf5, + you need to specify the location via the --prefix option during configure + time. E.g, ./configure --prefix=/usr/local/hdf5 ... + (AKC - 2011/05/07 - HDFFV-7583) + +* The parallel test, t_shapesame, in testpar/, may run for a long time and may + be terminated by the alarm signal. If that happens, one can increase the + alarm seconds (default is 1200 seconds = 20 minutes) by setting the + environment variable, $HDF5_ALARM_SECONDS, to a larger value such as 3600 + (60 minutes). Note that the t_shapesame test may fail in some systems + (see the "While working on the 1.8.6 release..." problem below). If + it does, it will waste more time if $HDF5_ALARM_SECONDS is set + to a larger value. + (AKC - 2011/05/07) + +* Shared Fortran libraries are not quite working on AIX. While they are + generated when --enable-shared is specified, the fortran and hl/fortran + tests fail. the issue. HL and C++ shared libraries should now be + working as intended, however. + (MAM - 2011/04/20) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or file systems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + (NAF - 2011/01/19) + +* All the VFL drivers aren't backward compatible. In H5FDpublic.h, the + structure H5FD_class_t changed in 1.8. There is new parameter added to + get_eoa and set_eoa callback functions. A new callback function + get_type_map was added in. The public function H5FDrealloc was taken + out in 1.8. The problem only happens when users define their own driver + for 1.6 and try to plug in 1.8 library. Because there's only one user + complaining about it, we (Elena, Quincey, and I) decided to leave it as + it is (see bug report #1279). Quincey will make a plan for 1.10. + (SLU - 2010/02/02) + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + (MAM - 2009/11/04) + +* A dataset created or rewritten with a v1.6.3 library or after cannot be read + with the v1.6.2 library or before when the Fletcher32 EDC filter is enabled. + There was a bug in the calculation of the Fletcher32 checksum in the + library before v1.6.3; the checksum value was not consistent between big- + endian and little-endian systems. This bug was fixed in Release 1.6.3. + However, after fixing the bug, the checksum value was no longer the same as + before on little-endian system. Library releases after 1.6.4 can still read + datasets created or rewritten with an HDF5 library of v1.6.2 or before. + (SLU - 2005/06/30) + + %%%%1.8.17%%%% @@ -2155,15 +4250,15 @@ They are built with the configure process unless specified otherwise. Visual Studio 2013 w/ Intel Fortran 15 (cmake) Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 - 64-bit gfortran GNU Fortran (GCC) 4.8.2 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 (swallow/kite) Intel icc/icpc/ifort version 14.0.2 Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.1.1 - 64-bit gfortran GNU Fortran (GCC) 4.8.2 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 (wren/quail) Intel icc/icpc/ifort version 14.0.2 Mac OS X Yosemite 10.10.2 Apple clang/clang++ version 6.0 from Xcode 6.1.1 - 64-bit gfortran GNU Fortran (GCC) 4.9.2 + 64-bit gfortran GNU Fortran (GCC) 4.9.2 (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.1 @@ -2902,11 +4997,11 @@ They are built with the configure process unless specified otherwise. (duck) Intel icc/icpc/ifort version 13.0.3 Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.1 from Xcode 5.1 - 64-bit gfortran GNU Fortran (GCC) 4.8.2 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 (swallow/kite) Intel icc/icpc/ifort version 14.0.2 Mac OS X Mavericks 10.9.5 Apple clang/clang++ version 6.0 from Xcode 6.0.1 - 64-bit gfortran GNU Fortran (GCC) 4.8.2 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 (wren) Intel icc/icpc/ifort version 14.0.2 @@ -3308,10 +5403,10 @@ New Features ssize_t getName(H5std_string& attr_name, size_t buf_size=0) (BMR, 2014/04/15) + A static wrapper to Exception for printing the error stack without an - instance of Exception - static void printErrorStack(FILE* stream = stderr, - hid_t err_stack = H5E_DEFAULT); - (BMR, 2014/04/25) + instance of Exception + static void printErrorStack(FILE* stream = stderr, + hid_t err_stack = H5E_DEFAULT); + (BMR, 2014/04/25) Support for New Platforms, Languages, and Compilers @@ -3505,7 +5600,7 @@ They are built with the configure process unless specified otherwise. AIX 5.3 xlc 10.1.0.5 (NASA G-ADA) xlC 10.1.0.5 xlf90 12.1.0.6 - gmake v3.82 + gmake v3.82 Linux 2.6.18-308.13.1.el5PAE GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP i686 i686 i386 compilers for 32-bit applications; @@ -3569,11 +5664,11 @@ They are built with the configure process unless specified otherwise. (duck) Intel icc/icpc/ifort version 13.0.3 Mac OS X Mt. Lion 10.8.5 Apple clang/clang++ version 5.0 from Xcode 5.0.2 - 64-bit gfortran GNU Fortran (GCC) 4.8.2 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 (swallow/kite) Intel icc/icpc/ifort version 14.0.2 Mac OS X Mavericks 10.9.2 Apple clang/clang++ version 5.1 from Xcode 5.1 - 64-bit gfortran GNU Fortran (GCC) 4.8.2 + 64-bit gfortran GNU Fortran (GCC) 4.8.2 (wren/quail) Intel icc/icpc/ifort version 14.0.2 @@ -4015,11 +6110,11 @@ New Features an attribute. (BMR - 2013/09/27) - Added wrappers for H5Rget_obj_type2 to retrieve the type of the object that an object reference points to. (BMR - 2013/09/27) - H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) + H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) - Added wrappers for H5Aexist to check whether an attribute exists given a name. (BMR - 2013/09/27) - bool H5::H5Location::attrExists(const char* name) - bool H5::H5Location::attrExists(const H5std_string& name) + bool H5::H5Location::attrExists(const char* name) + bool H5::H5Location::attrExists(const H5std_string& name) - Added a number of overloaded functions for convenience. (BMR - 2013/09/27) @@ -4672,11 +6767,11 @@ Bug Fixes since HDF5-1.8.10 Tools ----- - h5redeploy is changed to do this by default: - Installation directories: - prefix architecture-independent files. - exec_prefix architecture-dependent files, default is <prefix>. - libdir libraries, default is <exec_prefix>/lib. - includedir header files, default is <prefix/include>. + Installation directories: + prefix architecture-independent files. + exec_prefix architecture-dependent files, default is <prefix>. + libdir libraries, default is <exec_prefix>/lib. + includedir header files, default is <prefix/include>. This allows users to just change the first line of prefix=<...> and the effect will change libdir and includedir too. (AKC 2013/04/05 HDFFV-8358) - h5repack: Fixed failure to convert the layout of a small chunked @@ -4822,7 +6917,7 @@ They are built with the configure process unless specified otherwise. (duck) Intel icc/icpc/ifort version 13.0 Mac OS X Mountain Lion 10.8.1 Apple clang/clang++ version 4.2 from Xcode 4.6.1 - 64-bit gfortran GNU Fortran (GCC) 4.6.2 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 (wren) Intel icc/icpc/ifort version 13.0.1.119 @@ -5472,9 +7567,9 @@ Supported Platforms Mac OS X Mountain Lion 10.8.1 cc Apple clang version 4.0 from Xcode 4.5.1 (owl) c++ Apple clang version 4.0 from Xcode 4.5.1 - gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 - g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 - gfortran GNU Fortran (GCC) 4.6.2 + gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + gfortran GNU Fortran (GCC) 4.6.2 Tested Configuration Features Summary @@ -6062,9 +8157,9 @@ Supported Platforms Mac OS X Mountain Lion 10.8.1 cc Apple clang version 4.0 from Xcode 4.5.1 (owl) c++ Apple clang version 4.0 from Xcode 4.5.1 - gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 - g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 - gfortran GNU Fortran (GCC) 4.6.2 + gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.5.1 + gfortran GNU Fortran (GCC) 4.6.2 Tested Configuration Features Summary @@ -8138,7 +10233,7 @@ The following platforms and compilers have been tested for this release. Mac OS X 10.7.0 (Intel 32-bit) i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) Darwin Kernel Version 10.7.0 GNU Fortran (GCC) version 4.4.0 20090123 (experimental) - [trunk revision 143587] + [trunk revision 143587] Fedora 12 2.6.32.16-150.fc12.ppc64 #1 SMP ppc64 GNU/Linux gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) @@ -10418,7 +12513,7 @@ The following platforms and compilers have been tested for this release. Linux 2.6.18-63chaos #1 SMP Intel(R) C, C++, Fortran Compilers for SMP x86_64 GNU/Linux applications running on Intel(R) 64, (LLNL Zeus) Versions 9.1. - gcc/gfortran/g++ (GCC) 4.1.2. + gcc/gfortran/g++ (GCC) 4.1.2. Windows XP Visual Studio .NET Visual Studio 2005 w/ Intel Fortran 9.1 @@ -10703,8 +12798,8 @@ New Features Library ------- - - Added two new public routines: H5Pget_elink_fapl() and - H5Pset_elink_fapl(). (see bug #1247) (VC - 2008/10/13) + - Added two new public routines: H5Pget_elink_fapl() and + H5Pset_elink_fapl(). (see bug #1247) (VC - 2008/10/13) - Improved free space tracking in file to be faster. (QAK - 2008/10/06) - Added 'mounted' field to H5G_info_t struct. (QAK - 2008/07/15) @@ -10735,9 +12830,9 @@ New Features F90 API ------ - - Added optional parameter 'mounted' to H5Gget_info_f, - H5Gget_info_by_idx_f, H5Gget_info_by_name_f (MSB - 2008/09/24) - - Added H5Tget_native_type_f (MSB - 2008/09/30) + - Added optional parameter 'mounted' to H5Gget_info_f, + H5Gget_info_by_idx_f, H5Gget_info_by_name_f (MSB - 2008/09/24) + - Added H5Tget_native_type_f (MSB - 2008/09/30) C++ API @@ -10789,8 +12884,8 @@ Bug Fixes since HDF5-1.8.1 - When using shared szip, it is no longer necessary to specify the path to the shared szip libraries in LD_LIBRARY_PATH. (MAM - 2008/10/15). - - The file libhdf5_fortran.settings is not installed since its content - is included in libhdf5.settings now. (AKC - 2008/10/21) + - The file libhdf5_fortran.settings is not installed since its content + is included in libhdf5.settings now. (AKC - 2008/10/21) - "make DESTDIR=xxx install" failed to install some tools and files (e.g., h5cc and fortran modules). Fixed. (AKC - 2008/10/8). @@ -10856,9 +12951,9 @@ Bug Fixes since HDF5-1.8.1 (NAF - 2008/10/15) - Fixed unnecessary indentation of committed datatypes in h5dump. (NAF - 2008/10/15) - - Fixed bugs in h5stat: segmemtation fault when printing groups and - print warning message when traversal of objects is unsuccessful. - (see bug #1253) (VC- 2008/10/13) + - Fixed bugs in h5stat: segmemtation fault when printing groups and + print warning message when traversal of objects is unsuccessful. + (see bug #1253) (VC- 2008/10/13) - Fixed bug in h5ls that prevented relative group listings (like "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) - h5dump: when doing binary output (-b), the stdout printing of @@ -10870,24 +12965,24 @@ Bug Fixes since HDF5-1.8.1 ------ - h5sselect_elements_f: Added additional operators H5S_SELECT_APPEND and H5S_SELECT_PREPEND (MSB - 2008/09/30) - - h5sget_select_elem_pointlist: Fixed list of returned points by + - h5sget_select_elem_pointlist: Fixed list of returned points by rearranging the point list correctly by accounting for C conventions. (MSB - 2008/09/30) - h5sget_select_hyper_blocklist_f: Fixed error in transposed dimension of arrays.(MSB - 2008/9/30) - h5sget_select_bounds_f: Swapped array bounds to account for C and Fortran reversed array notation (MSB - 2008/9/30) - - Changed to initializing string to a blank character instead of a + - Changed to initializing string to a blank character instead of a null type in tH5P.f90 to fix compiling error using AIX 5.3.0 (MSB - 2008/7/29) - Fixed missing commas in H5test_kind.f90 detected by NAG compiler (MSB - 2008/7/29) - Fixed passing and array to a scalar in tH5A_1_8.f90 detected by NAG compiler (MSB - 2008/7/29) - - Added the ability of the test programs to use the status of + - Added the ability of the test programs to use the status of HDF5_NOCLEANUP to determine if the *.h5 files should be removed or not after the tests are completed (MSB - 2008/10/1) - - In nh5tget_offset_c: (MSB 9/12/2008) + - In nh5tget_offset_c: (MSB 9/12/2008) If offset was equal to 0 it returned the error code of -1, this was changed to return an error code of -1 when the offset value is < 0. @@ -10923,15 +13018,15 @@ Platforms Tested ================ The following platforms and compilers have been tested for this release. - AIX 5.3 xlc 7.0.0.8 - xlf 09.01.0000.0008 - xlC 7.0.0.8 - mpcc_r 7.0.0.8 - mpxlf_r 09.01.0000.0008 + AIX 5.3 xlc 7.0.0.8 + xlf 09.01.0000.0008 + xlC 7.0.0.8 + mpcc_r 7.0.0.8 + mpxlf_r 09.01.0000.0008 Cray XT3 (2.0.41) cc (pgcc) 7.1-4 (red storm) ftn (pgf90) 7.1-4 - CC (pgCC) 7.1-4 + CC (pgCC) 7.1-4 FreeBSD 6.3-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 (duty) g++ 3.4.6 [FreeBSD] 20060305 @@ -11326,11 +13421,11 @@ New Features F90 API ------ - New H5A, H5G, H5L, H5O, and H5P APIs to enable 1.8 features were - added. See "Release 1.8.1 (current release) versus Release 1.8.0" in - the document "HDF5 Software Changes from Release to Release" - (http://hdfgroup.org/HDF5/doc/ADGuide/Changes.html) for the - complete list of the new APIs. + - New H5A, H5G, H5L, H5O, and H5P APIs to enable 1.8 features were + added. See "Release 1.8.1 (current release) versus Release 1.8.0" in + the document "HDF5 Software Changes from Release to Release" + (http://hdfgroup.org/HDF5/doc/ADGuide/Changes.html) for the + complete list of the new APIs. C++ API ------ @@ -11405,12 +13500,12 @@ Bug Fixes since HDF5-1.8.0 In addition, data member IdComponent::id was moved into subclasses: Attribute, DataSet, DataSpace, DataType, H5File, Group, and PropList. (BMR - 2008/05/20) - - IdComponent::dereference was incorrect; it was changed from: - void IdComponent::dereference(IdComponent& obj, void* ref) - to: - void H5Object::dereference(H5File& h5file, void* ref) - void H5Object::dereference(H5Object& obj, void* ref) - (BMR - 2008/05/20) + - IdComponent::dereference was incorrect; it was changed from: + void IdComponent::dereference(IdComponent& obj, void* ref) + to: + void H5Object::dereference(H5File& h5file, void* ref) + void H5Object::dereference(H5Object& obj, void* ref) + (BMR - 2008/05/20) - Revised Attribute::write and Attribute::read wrappers to handle memory allocation/deallocation properly. (bugzilla 1045) (BMR - 2008/05/20) @@ -11422,7 +13517,7 @@ The following platforms and compilers have been tested for this release. Cray XT3 (2.0.41) cc (pgcc) 7.1-4 (red storm) ftn (pgf90) 7.1-4 - CC (pgCC) 7.1-4 + CC (pgCC) 7.1-4 mpicc 1.0.2 mpif90 1.0.2 @@ -12135,7 +14230,7 @@ compilers (12) AMD Opteron x86_64 (13) ifort (14) Yes with C and Fortran, but not with C++ - (15) Using Visual Studio 2005 or Cygwin + (15) Using Visual Studio 2005 or Cygwin (16) Not tested for this release. Compiler versions for each platform are listed in the preceding "Platforms Tested" table. diff --git a/release_docs/HISTORY-1_8_0-1_10_0.txt b/release_docs/HISTORY-1_8_0-1_10_0.txt index b0377b1..616aa24 100644 --- a/release_docs/HISTORY-1_8_0-1_10_0.txt +++ b/release_docs/HISTORY-1_8_0-1_10_0.txt @@ -5,7 +5,7 @@ HDF5 HISTORY INTRODUCTION This document describes the development history between the HDF5-1.8.0 and -HDF5 1.10.0 releases. For more iformation see the SVN log. +HDF5 1.10.0 releases. For more information see the SVN log. Information about supported and tested platforms is provided for historical reasons only and may not be accurate. @@ -240,7 +240,7 @@ New Features using --enable-fortran --enable-fortran2003 configure flags AND if fortran compiler is Fortran2003 compliant: - - Subroutines overloaded with the C_PTR derived type: + - Subroutines overloaded with the C_PTR derived type: h5pget_f h5pget_fill_value_f h5pinsert_f @@ -251,53 +251,52 @@ New Features h5rderefrence_f h5rget_name_f h5rget_obj_type_f - - Subroutines overloaded with the C_PTR derived type - and simplified signatures: + - Subroutines overloaded with the C_PTR derived type and simplified signatures: h5aread_f h5awrite_f h5dread_f h5dwrite_f - - New subroutines + - New subroutines h5dvlen_reclaim_f h5literate_by_name_f h5literate_f h5ovisit_f h5tconvert_f - - Subroutines with additional optional parameters: + - Subroutines with additional optional parameters: h5pcreate_class_f (EIP - 2011/10/14) - - Added for the C APIs the Fortran wrappers: - h5dget_access_plist_f - h5iis_valid_f - h5pset_chunk_cache_f - h5pget_chunk_cache_f - (MSB - 2009/04/17) + - Added for the C APIs the Fortran wrappers: + h5dget_access_plist_f + h5iis_valid_f + h5pset_chunk_cache_f + h5pget_chunk_cache_f + (MSB - 2009/04/17) C++ Library: ------------ - - New member function added + - New member function added - The assignment operator ArrayType::operator= is added because ArrayType - has pointer data members. + The assignment operator ArrayType::operator= is added because ArrayType + has pointer data members. - (BMR, 2016/03/07, HDFFV-9562) + (BMR, 2016/03/07, HDFFV-9562) - - New member functions - + Overloaded CommonFG::getObjnameByIdx to take char* for name - + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. - (BMR - 2010/05/02) - + DataSet::getInMemDataSize() to simplify getting the dataset's - data size in memory. (BMR - 2009/07/26) - - These member functions were added as wrapper for H5Rdereference to - replace the incorrect IdComponent::dereference(). + - New member functions + + Overloaded CommonFG::getObjnameByIdx to take char* for name + + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. + (BMR - 2010/05/02) + + DataSet::getInMemDataSize() to simplify getting the dataset's + data size in memory. (BMR - 2009/07/26) + - These member functions were added as wrapper for H5Rdereference to + replace the incorrect IdComponent::dereference(). void H5Object::dereference(H5File& h5file, void* ref) void H5Object::dereference(H5Object& obj, void* ref) - In addition, these constructors were added to create the associated - objects by way of dereference: + In addition, these constructors were added to create the associated + objects by way of dereference: Attribute(H5Object& obj, void* ref); Attribute(H5File& file, void* ref); DataSet(H5Object& obj, void* ref); @@ -306,140 +305,140 @@ New Features DataType(H5File& file, void* ref); Group(H5Object& obj, void* ref); Group(H5File& obj, void* ref); - (BMR - 2008/08/10) + (BMR - 2008/08/10) Tools: ------ - - h5repack: Added ability to use plugin filters. HDFFV-8345 (ADB - 2013/09/04). - - h5dump: Added option -N --any_path, which searches the file for paths that + - h5repack: Added ability to use plugin filters. HDFFV-8345 (ADB - 2013/09/04). + - h5dump: Added option -N --any_path, which searches the file for paths that match the search path. HDFFV-7989 (ADB - 2013/08/12). - - h5dump: Added optional arg 0 to -A, which excludes attributes from display. + - h5dump: Added optional arg 0 to -A, which excludes attributes from display. HDFFV-8134 (ADB - 2013/08/01). - - h5dump: Fixed displaying compression ratio for unknown or user-defined + - h5dump: Fixed displaying compression ratio for unknown or user-defined filters. HDFFV-8344 (XCAO 2013/03/19) - - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined filter. + - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined filter. HDFFV-8346 (XCAO 2013/03/19) - - h5dump: Added capability for "-a" option to show attributes containing "/" + - h5dump: Added capability for "-a" option to show attributes containing "/" by using an escape character. For example, for a dataset "/dset" containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" to show the content of the attribute. See details at HDFFV-7523 (PC -- 2012/03/12) - - h5dump: Added ability to apply command options across multiple files using a + - h5dump: Added ability to apply command options across multiple files using a wildcard in the filename. Example; "h5dump -H -d Dataset1 tarr*.h5". HDFFV-7876 (ADB - 2012/03/12). - - h5repack: Improved performance for big chunked datasets (size > 128MB) + - h5repack: Improved performance for big chunked datasets (size > 128MB) when used with layout (-l) or compression (-f) option. It would perform much better prior to the improvement, especially for cases that chunk dimentions looks like "1024x5x1" (compare to "1x5x1024"). When bigger numbers are toward front and smaller number is toward back in chunk dimentions. HDFFV-7862 (JKM - 2012/03/01) - - h5dump: Added new option --no-compact-subset. This option will not + - h5dump: Added new option --no-compact-subset. This option will not interpret the '[' character as starting the compact form of subsetting. This is useful when the "h5dump error: unable to open dataset "datset_name"" message is output because a dataset name contains a '[' character. HDFFV-7689 (ADB - 2012/01/31) - - h5dump: Corrected schema location: + - h5dump: Corrected schema location: <hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd"> (ADB - 2011/08/10) - - h5diff: Added new level for -v (verbose) option. The new levels are + - h5diff: Added new level for -v (verbose) option. The new levels are 1 and 2. So -v1 and -v2 can be specified to view more information about attributes differences. Bug#2121 (JKM 2011/3/23) - - h5dump: Added new option --enable-error-stack. This option will display + - h5dump: Added new option --enable-error-stack. This option will display error stack information in the output stream. This is useful when the "h5dump: Unable to print data" message is output. (ADB - 2011/02/24) - - h5diff: Add a new flag --exclude-path. Specified path to an object will + - h5diff: Add a new flag --exclude-path. Specified path to an object will be excluded from comparing the two files or two groups. If group is specified all the member objects will be excluded. (JKM - 2010/09/16). - - h5ls: Add new flag --no-dangling-links. (refer to --help for details) + - h5ls: Add new flag --no-dangling-links. (refer to --help for details) (JKM - 2010/06/15) - - h5ls: Add new flag --follow-symlinks. (refer to --help for details) + - h5ls: Add new flag --follow-symlinks. (refer to --help for details) (JKM - 2010/05/25) - - h5diff: Add new flag --no-dangling-links. (refer to --help for details) + - h5diff: Add new flag --no-dangling-links. (refer to --help for details) (JKM - 2010/02/10) - - h5diff: Add new flag --follow-symlinks. (refer to --help for details) + - h5diff: Add new flag --follow-symlinks. (refer to --help for details) (JKM - 2010/01/25) - - h5diff: fix for displaying garbage value on LE machine for BE data. + - h5diff: fix for displaying garbage value on LE machine for BE data. (JKM - 2009/11/20) - - h5dump: subsetting now allows default for count. Also trailing ; in short form + - h5dump: subsetting now allows default for count. Also trailing ; in short form can be omitted after last specified value. (ADB - 2009/09/04) - - h5dump/h5ls: now can display data in region references + - h5dump/h5ls: now can display data in region references using new -R, --region flag. (ADB - 2009/09/04) - - h5diff: new flag, -c, --compare, list objects that are not comparable. + - h5diff: new flag, -c, --compare, list objects that are not comparable. (PVN - 2009/4/10 - 1368) - - h5diff new flag, -N, --nan, avoids NaNs detection. (PVN - 2009/4/10) - - h5dump correctly specifies XML dtd / schema urls (ADB - 2009/4/3 - 1519) - - h5repack now handles group creation order. (PVN - 2009/4/2 - 1402) - - h5dump: added a printing of the compression ratio of uncompressed and compressed + - h5diff new flag, -N, --nan, avoids NaNs detection. (PVN - 2009/4/10) + - h5dump correctly specifies XML dtd / schema urls (ADB - 2009/4/3 - 1519) + - h5repack now handles group creation order. (PVN - 2009/4/2 - 1402) + - h5dump: added a printing of the compression ratio of uncompressed and compressed sizes for cases where compression filters are present. (PVN - 2008/05/01) - - h5dump: added an option to allow a user defined formatting string for printf + - h5dump: added an option to allow a user defined formatting string for printf regarding floating point numbers. (PVN - 2008/05/06) - - h5dump: support for external links, display the object that the external link + - h5dump: support for external links, display the object that the external link points to. (PVN - 2008/05/12) - - h5repack: add a userblock to an HDF5 file during the repack. (PVN - 2008/08/26) - - h5repack: add 2 options that call H5Pset_alignment in the repacked file. (PVN - 2008/08/29) - - h5ls: added capability to traverse through external links when the -r + - h5repack: add a userblock to an HDF5 file during the repack. (PVN - 2008/08/26) + - h5repack: add 2 options that call H5Pset_alignment in the repacked file. (PVN - 2008/08/29) + - h5ls: added capability to traverse through external links when the -r (recursive) flag is given. (NAF - 2008/09/16) - - h5ls: added -E option to enable traversal of external links. h5ls will + - h5ls: added -E option to enable traversal of external links. h5ls will not traverse external links without this flag being set. (NAF - 2008/10/06) - - h5diff: added support for long double (PVN - 2008/10/28) - - h5dump: binary output defaults to NATIVE with -b optionally accepting + - h5diff: added support for long double (PVN - 2008/10/28) + - h5dump: binary output defaults to NATIVE with -b optionally accepting the form of binary output (NATIVE, FILE, BE, LE). (PVN - 2008/10/30) - - h5diff: return 1 for file differences when both file graphs differ by any object. + - h5diff: return 1 for file differences when both file graphs differ by any object. Error return code was changed to 2 from -1. (PVN - 2008/10/30) - - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP + - h5import: TEXTFPE (scientific format) was deprecated. Use TEXTFP instead (PVN - 2008/10/30) - - h5repack: When user doesn't specify a chunk size, h5repack now defines a default + - h5repack: When user doesn't specify a chunk size, h5repack now defines a default chunk size as the same size of the size of the hyperslab used to read the chunks. The size of the hyperslabs are defined as the size of each dimension or a predefined constant, whatever is smaller. This assures that the chunk read fits in the chunk cache. (PVN - 2008/11/21) - - h5diff: h5diff treats two INFINITY values different. Fixed by checking (value==expect) + - h5diff: h5diff treats two INFINITY values different. Fixed by checking (value==expect) before call ABS(...) at h5diff_array.c This will make that (INF==INF) is true (INF is treated as an number instead of NaN) (PC -- 2009/07/28) - - h5diff: add option "--use-system-epsilon" to print difference if (|a-b| > EPSILON) + - h5diff: add option "--use-system-epsilon" to print difference if (|a-b| > EPSILON) Change default to use strict equality (PC -- 2009/09/12) High-Level APIs: --------------- - C Packet Table API - ------------------ - - Replacement of a public function + C Packet Table API + ------------------ + - Replacement of a public function The existing function H5PTcreate_fl limits applications to deflate compression only. The public function H5PTcreate is added to replace H5PTcreate_fl. H5PTcreate takes a property list ID to provide flexibility on creation properties. - hid_t H5PTcreate(hid_t loc_id, const char *dset_name, + hid_t H5PTcreate(hid_t loc_id, const char *dset_name, hid_t dtype_id, hsize_t chunk_size, hid_t plist_id); (BMR, 2016/03/04, HDFFV-8623) - - New public functions + - New public functions Two accessor functions were added per HDFFV-8623/patch 003. - /* Returns the ID of the dataset associated with the packet table */ - hid_t H5PTget_dataset(hid_t table_id); + /* Returns the ID of the dataset associated with the packet table */ + hid_t H5PTget_dataset(hid_t table_id); - /* Returns the ID of the datatype the packet table uses */ - hid_t H5PTget_type(hid_t table_id); + /* Returns the ID of the datatype the packet table uses */ + hid_t H5PTget_type(hid_t table_id); (BMR, 2016/03/04, HDFFV-8623) - - Regarding #ifdef VLPT_REMOVED + - Regarding #ifdef VLPT_REMOVED The #ifdef VLPT_REMOVED blocks are removed from the PT library source except the following cases: @@ -447,54 +446,54 @@ New Features + H5PTfree_vlen_readbuff() now became H5PTfree_vlen_buff() (BMR, 2016/03/04, HDFFV-442) - C++ Packet Table API - -------------------- - - New constructor + C++ Packet Table API + -------------------- + - New constructor An overloaded constructor is added to FL_PacketTable and takes a property list ID to provide flexibility on creation properties. - FL_PacketTable(hid_t fileID, hid_t plist_id, const char* name, hid_t dtypeID, hsize_t chunkSize); + FL_PacketTable(hid_t fileID, hid_t plist_id, const char* name, hid_t dtypeID, hsize_t chunkSize); (BMR, 2016/03/08, HDFFV-8623) - - New public functions + - New public functions Two accessor wrappers to class PacketTable, per HDFFV-8623/patch 004. - /* Returns the ID of the dataset associated with the packet table */ - hid_t PacketTable::GetDataset() + /* Returns the ID of the dataset associated with the packet table */ + hid_t PacketTable::GetDataset() - /* Returns the ID of the datatype the packet table uses */ - hid_t PacketTable::GetDataset() + /* Returns the ID of the datatype the packet table uses */ + hid_t PacketTable::GetDataset() (BMR, 2016/03/04, HDFFV-8623) - - Member functions having "char*" as an argument + - Member functions having "char*" as an argument Overloaded functions were added to provide "const char*" argument, the existing version will be deprecated. (BMR, 2016/03/04) - - Regarding #ifdef VLPT_REMOVED + - Regarding #ifdef VLPT_REMOVED The #ifdef VLPT_REMOVED blocks are removed from the PT library source except the following cases: - + VL_PacketTable::IsVariableLength() is moved to PacketTable - + VL_PacketTable::FreeReadBuff() now became PacketTable::FreeBuff() + + VL_PacketTable::IsVariableLength() is moved to PacketTable + + VL_PacketTable::FreeReadBuff() now became PacketTable::FreeBuff() (BMR, 2016/03/04, HDFFV-442) - Internal header file + Internal header file -------------------- - - A new API function H5DOwrite_chunk. It writes a data chunk directly + - A new API function H5DOwrite_chunk. It writes a data chunk directly into a file bypassing hyperslab selection, data conversion, and filter pipeline. The user must be careful with the function and clearly understand the I/O process of the library. (SLU - 2013/2/11) - - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks + - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks if a path is correct and determines if a link resolves to a valid object and checks that the link does not dangle. (MSB- 2012/3/15) - - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 + - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 h5dsset_scale_f h5dsattach_scale_f h5dsdetach_scale_f @@ -506,7 +505,7 @@ New Features h5dsget_num_scales_f (EIP for SB - 2011/10/13) - - Table: In version 3.0 of Table, "NROWS" (used to store number of records) was + - Table: In version 3.0 of Table, "NROWS" (used to store number of records) was deprecated (PVN - 2008/11/24) Documentation @@ -525,68 +524,68 @@ Bug Fixes since HDF5-1.8.0 release Library ------- - - Incorrect usage of list in CMake COMPILE_DEFINITIONS set_property + - Incorrect usage of list in CMake COMPILE_DEFINITIONS set_property - The CMake command, set_property with COMPILE_DEFINITIONS property - needs a quoted semi-colon separated list of values. CMake will - transform the list to a series of -D{value} for the compile. + The CMake command, set_property with COMPILE_DEFINITIONS property + needs a quoted semi-colon separated list of values. CMake will + transform the list to a series of -D{value} for the compile. - (ADB - 2014/12/09, HDFV-9041) + (ADB - 2014/12/09, HDFV-9041) - - H5Z.c: H5Zfilter_avail(H5Z_filter_t id) + - H5Z.c: H5Zfilter_avail(H5Z_filter_t id) Added else block if the call to the internal H5Z_filter_avail(id) does not fail and returns FALSE. This block calls the H5PL_load(H5PL_TYPE_FILTER, (int)id) function to attempt to dynamically load the filter plugin. (ADB - 2014/03/03 HDFFV-8629) - - Added const qualifier to source buffer parameters in H5Dgather and + - Added const qualifier to source buffer parameters in H5Dgather and H5D_scatter_func_t (H5Dscatter callback). (NAF - 2013/7/02) - - Fixed an error involving failure to write fill values to the user's + - Fixed an error involving failure to write fill values to the user's buffer when reading unallocated chunks from datasets that have a fill value set to H5D_FILL_VALUE_DEFAULT. A consequence of this was the reporting of spurious data values in h5dump and h5diff output. (HDFFV-8247; JP - 2013/05/03) - - Fixed an error that could occur when calling H5Ocopy within an + - Fixed an error that could occur when calling H5Ocopy within an H5Literate callback (and possibly other situations). (NAF - 2012/7/25 - HDFFV-5853) - - Fixed an error that would occur when copying an object with attribute + - Fixed an error that would occur when copying an object with attribute creation order tracked and indexed. (NAF - 2012/3/28 - HDFFV-7762) - - Fixed a bug in H5Ocopy(): When copying an opened object, call the - object's flush class action to ensure that cached data is flushed + - Fixed a bug in H5Ocopy(): When copying an opened object, call the + object's flush class action to ensure that cached data is flushed so that H5Ocopy will get the correct data. - (VC - 2012/3/27 - HDFFV-7853) - - When an application tries to write or read many small data chunks and + (VC - 2012/3/27 - HDFFV-7853) + - When an application tries to write or read many small data chunks and runs out of memory, the library had a seg fault. The fix is to return the error stack with proper information. (SLU - 2012/3/23. Issue 7785) - - H5Pset_data_transform had seg fault in some cases like x*-100. It + - H5Pset_data_transform had seg fault in some cases like x*-100. It works correctly now and handles other cases like 100-x or 2/x. (SLU - 2012/3/15. Issue 7922) - - Fixed rare corruption bugs that could occur when using the new object + - Fixed rare corruption bugs that could occur when using the new object header format. (NAF - 2012/3/15 - HDFFV-7879) - - Creating a dataset in a read-only file caused seg fault when the file + - Creating a dataset in a read-only file caused seg fault when the file is closed. It's fixed. The attemp to create a dataset will fail with the error stack indicating the file is read-only. (SLU - 2012/1/25. Issue 7756) - - Fixed a seg fault that could occur when shrinking a dataset with chunks + - Fixed a seg fault that could occur when shrinking a dataset with chunks larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) - - Fixed a bug that could cause file corruption when copying named + - Fixed a bug that could cause file corruption when copying named datatypes to a file using shared messages. (NAF - 2011/11/14) - - Fixed a bug that could cause H5Oget_info to return the wrong address + - Fixed a bug that could cause H5Oget_info to return the wrong address after copying a named datatype. (NAF - 2011/11/14) - - The library allowed the conversion of strings between ASCII and UTF8 + - The library allowed the conversion of strings between ASCII and UTF8 (Issue 7582). We have corrected it to report an error under this situation. (SLU - 2011/11/8) - - The library had seg fault when it tried to shrink the size of compound type + - The library had seg fault when it tried to shrink the size of compound type through H5Tset_size immediately after the type was created (Issue 7618). It's fixed now. (SLU - 2011/10/26) - - Fixed a bug that occurred when using H5Ocopy on a committed datatype + - Fixed a bug that occurred when using H5Ocopy on a committed datatype containing an attribute using that committed datatype. (NAF - 2011/10/13 - Issue 5854) - - #ifdef _WIN32 instances changed to #ifdef H5_HAVE_WIN32_API and added + - #ifdef _WIN32 instances changed to #ifdef H5_HAVE_WIN32_API and added H5_HAVE_VISUAL_STUDIO checks where necessary. CMake only as configure never set _WIN32. - - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv discovered 3 problems in tests and tools' library (Issue 7674): 1. In dsets.c, left shifting an unsigned int for 32 bits or more caused undefined behavior. @@ -595,193 +594,193 @@ Bug Fixes since HDF5-1.8.0 release 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits or more caused undefined behavior. All the problems have been corrected. (SLU - 2011/9/2) - - In v1.6 library, there was EOA for the whole MULTI file saved in the + - In v1.6 library, there was EOA for the whole MULTI file saved in the super block. We took it out in v1.8 library because it's meaningless for the MULTI file. v1.8 library saves the EOA for the metadata file, instead. But this caused some backward compatibility problem. v1.8 library couldn't open the file created with v1.6 library. We fixed the problem by checking the EOA value to detect the file created with v1.6 library. (SLU - 2011/6/22) - - When a dataset had filters and reading data failed, the error message + - When a dataset had filters and reading data failed, the error message didn't say which filter isn't registered. It's fixed now. (SLU - 2011/6/3) - - The datatype handler created with H5Tencode/decode used to have the + - The datatype handler created with H5Tencode/decode used to have the reference count 0 (zero). I have fixed it. It is 1 (one) now. (SLU - 2011/2/18) - - Fixed a bug that caused big endian machines to generate corrupt files + - Fixed a bug that caused big endian machines to generate corrupt files when using the scale-offset filter with floating point data or fill values. Note that such datasets will no longer be readable by any machine after this patch. (NAF - 2010/02/02 - Bug 2131) - - Retrieving a link's name by index in the case where the link is + - Retrieving a link's name by index in the case where the link is external and the file that the link refers to doesn't exist will now fail gracefully rather than cause a segmentation fault. (MAM - 2010/11/17) - - Modified library to always cache symbol table information. Libraries + - Modified library to always cache symbol table information. Libraries version 1.6.3 have a bug which causes them to require this information for some operations. (NAF - 2010/09/21 - 1864) - - Fixed a bug that could occur when getting information for a new-style + - Fixed a bug that could occur when getting information for a new-style group that was previously opened through a file handle that was later closed. (NAF - 2010/09/15) - - Added define check in H5public.h if stdint.h is supported by the C++ + - Added define check in H5public.h if stdint.h is supported by the C++ compiler. This define is only available on Windows with VS2010 and using CMake to build the library. (ADB - 2010/09/13 - Bug 1938) - - H5Eset_current_stack now also closes the error stack to be set as the + - H5Eset_current_stack now also closes the error stack to be set as the default. This is to avoid a potential problem (Bug 1799). (SLU - 2010/9/7) - - Fixed the bug in the filter's public CAN_APPLY function. The return + - Fixed the bug in the filter's public CAN_APPLY function. The return value should be htri_t not herr_t (Bug #1239). (SLU - 2010/8/5) - - Fixed a bug in the direct I/O driver that could render files with + - Fixed a bug in the direct I/O driver that could render files with certain kinds of unaligned data unreadable or corrupt them. (NAF - 2010/07/28) - - valgrind reported an error of copying data to itself when a new attribute + - valgrind reported an error of copying data to itself when a new attribute is written (Bug #1956). I fixed it by taking out the memcpy step in the attribute code. (SLU - 2010/07/28) - - Fixed a bug that could cause file corruption when using non-default + - Fixed a bug that could cause file corruption when using non-default sizes of addresses and/or lengths. This bug could also cause uncorrupted files with this property to be unreadable. This bug was introduced in 1.8.5. (NAF - 2010/07/16 - 1951) - - Fixed a file corruption bug that could happen when shrinking a + - Fixed a file corruption bug that could happen when shrinking a compressed dataset. (NAF - 2010/05/20) - - Fixed some memory leaks in VL datatype conversion when strings are + - Fixed some memory leaks in VL datatype conversion when strings are used as fill values. (MAM - 2010/05/12 - BZ# 1826) - - Fixed a bug when copying objects with NULL references with the + - Fixed a bug when copying objects with NULL references with the H5O_COPY_EXPAND_REFERENCE_FLAG flag set. (NAF - 2010/04/08 - 1815) - - Files can now be concurrently opened more than once using the core file + - Files can now be concurrently opened more than once using the core file driver, as long as the backing store is used. (NAF - 2010/03/09) - - Added support for H5O_COPY_EXPAND_EXT_LINK_FLAG to H5Ocopy. External + - Added support for H5O_COPY_EXPAND_EXT_LINK_FLAG to H5Ocopy. External links will now be expanded if this flag is set. (NAF - 2010/03/05 - 1733) - - Fixed a bug where the library, when traversing an external link, would + - Fixed a bug where the library, when traversing an external link, would reopen the source file if nothing else worked. (NAF - 2010/03/05) - - Fixed an intermittent bug in the b-tree code which could be triggered + - Fixed an intermittent bug in the b-tree code which could be triggered by expanding and shrinking chunked datasets in certain ways. (NAF - 2010/02/16) - - H5Tdetect_class said a VL string is a string type. But when it's + - H5Tdetect_class said a VL string is a string type. But when it's in a compound type, it said it's a VL type (Bug #1584). I fixed it to be consistent. It always return string type. (SLU - 2009/12/10) - - Fixed a bug where writing and deleting many global heap objects (i.e. + - Fixed a bug where writing and deleting many global heap objects (i.e. variable length data) would render the file unreadable. Previously created files exhibiting this problem should now be readable. (NAF - 2009/10/27 - 1483) - - Fixed incorrect return value for H5Pget_preserve. (AKC - 2009/10/08 - 1628) - - Fixed an assertion failure that occurred when H5Ocopy was called on a + - Fixed incorrect return value for H5Pget_preserve. (AKC - 2009/10/08 - 1628) + - Fixed an assertion failure that occurred when H5Ocopy was called on a dataset using a vlen inside a compound. (NAF - 2009/10/02 - 1597) - - Fixed incorrect return value for H5Pget_filter_by_id1/2 in H5Ppublic.h. + - Fixed incorrect return value for H5Pget_filter_by_id1/2 in H5Ppublic.h. (NAF - 2009/09/25 - 1620) - - Fixed a bug where properties weren't being compared with the registered + - Fixed a bug where properties weren't being compared with the registered compare callback. (NAF - 2009/09/25 - 1555) - - Fixed a bug where H5Pget_fitler_by_id would succeed when called for a + - Fixed a bug where H5Pget_fitler_by_id would succeed when called for a filter that wasn't present. (NAF - 2009/06/25 - 1250) - - Fixed an issue with committed compound datatypes containing a vlen. + - Fixed an issue with committed compound datatypes containing a vlen. Also fixed memory leaks involving committed datatypes. (NAF - 2009/06/10 - 1593) - - Added versioning to H5Z_class_t struct to allow compatibility with 1.6 + - Added versioning to H5Z_class_t struct to allow compatibility with 1.6 API. (NAF - 2009/04/20 - 1533) - - Fixed a problem with using data transforms with non-native types in the + - Fixed a problem with using data transforms with non-native types in the file. (NAF - 2009/04/20 - 1548) - - Added direct.h include file to windows section of H5private.h + - Added direct.h include file to windows section of H5private.h to fix _getcwd() warning. (ADB - 2009/04/14 - 1536) - - Fixed a bug that prevented external links from working after calling + - Fixed a bug that prevented external links from working after calling H5close(). (NAF - 2009/04/10 - 1539) - - Modified library to write cached symbol table information to the + - Modified library to write cached symbol table information to the superblock, to allow library versions 1.3.0 to 1.6.3 to read files created by this version. (NAF - 2009/04/08 - 1423) - - Changed skip lists to use a deterministic algorithm. The library should + - Changed skip lists to use a deterministic algorithm. The library should now never call rand() or srand(). (NAF - 2009/04/08 - 503) - - Fixed a bug where H5Lcopy and H5Lmove wouldn't create intermediate + - Fixed a bug where H5Lcopy and H5Lmove wouldn't create intermediate groups when that property was set. (NAF - 2009/04/07 - 1526) - - Fixed a bug that caused files with a user block to grow by the size of + - Fixed a bug that caused files with a user block to grow by the size of the user block every time they were opened. (NAF - 2009/03/26 - 1499) - - Fixed a rare problem that could occur with files using the old (pre 1.4) + - Fixed a rare problem that could occur with files using the old (pre 1.4) array datatype. (NAF - 2009/03/23) - - Modified library to be able to open files with corrupt root group symbol + - Modified library to be able to open files with corrupt root group symbol table messages, and correct these errors if they are found. Such files can only be successfully opened with write access. (NAF - 2009/03/23 - 1189) - - Removed the long_long #define and replaced all instances with + - Removed the long_long #define and replaced all instances with "long long". This caused problems with third party products. All currently supported compliers support the type. (ADB - 2009/03/05) - - Fixed various bugs that could prevent the fill value from being written + - Fixed various bugs that could prevent the fill value from being written in certain rare cases. (NAF - 2009/02/26 - 1469) - - Fixed a bug that prevented more than one dataset chunk from being cached + - Fixed a bug that prevented more than one dataset chunk from being cached at a time. (NAF - 2009/02/12 - 1015) - - Fixed an assertion failure caused by opening an attribute multiple times + - Fixed an assertion failure caused by opening an attribute multiple times through multiple file handles. (NAF - 2009/02/12 - 1420) - - Fixed a problem that could prevent the user from adding attributes (or + - Fixed a problem that could prevent the user from adding attributes (or any object header message) in some circumstances. (NAF - 2009/02/12 - 1427) - - Fixed a bug that could cause problems when an attribute was added to a + - Fixed a bug that could cause problems when an attribute was added to a committed datatype using the committed datatype's datatype. (NAF - 2009/02/12) - - Fixed a bug that could cause problems when copying an object with a + - Fixed a bug that could cause problems when copying an object with a shared message in its own object header. (NAF - 2009/01/29) - - Changed H5Tset_order to properly reject H5T_ORDER_NONE for most + - Changed H5Tset_order to properly reject H5T_ORDER_NONE for most datatypes. (NAF - 2009/01/27 - 1443) - - Fixed a bug where H5Tpack wouldn't remove trailing space from an + - Fixed a bug where H5Tpack wouldn't remove trailing space from an otherwise packed compound type. (NAF - 2009/01/14) - - Fixed up some old v2 btree assertions that get run in debug mode that + - Fixed up some old v2 btree assertions that get run in debug mode that were previously failing on compilation, and removed some of the more heavily outdated and non-rewritable ones. (MAM - 2008/12/15) - - Fixed a bug that could cause problems when "automatically" unmounting + - Fixed a bug that could cause problems when "automatically" unmounting multiple files. (NAF - 2008/11/17) - - H5Ovisit and H5Ovisit_by_name will now properly terminate when the + - H5Ovisit and H5Ovisit_by_name will now properly terminate when the callback function returns a positive value on the starting object. (NAF - 2008/11/03) - - Fixed an error where a null message could be created that was larger + - Fixed an error where a null message could be created that was larger than could be written to the file. (NAF - 2008/10/23) - - Corrected error with family/split/multi VFD not updating driver info + - Corrected error with family/split/multi VFD not updating driver info when "latest" version of the file format used. (QAK - 2008/10/14) - - Corrected alignment+threshold errors to work correctly when metadata + - Corrected alignment+threshold errors to work correctly when metadata aggregation is enabled. (QAK - 2008/10/06) - - Changed H5Fget_obj_count and H5Fget_obj_ids to ignore objects registered + - Changed H5Fget_obj_count and H5Fget_obj_ids to ignore objects registered by the library for internal library use. (NAF - 2008/10/06) - - Fixed potential memory leak during compound conversion. + - Fixed potential memory leak during compound conversion. (NAF - 2008/10/06) - - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. Also + - Changed the return value of H5Fget_obj_count from INT to SSIZE_T. Also changed the return value of H5Fget_obj_ids from HERR_T to SSIZE_T and the type of the parameter MAX_OBJS from INT to SIZE_T. (SLU - 2008/09/26) - - Fixed an issue that could cause data to be improperly overwritten + - Fixed an issue that could cause data to be improperly overwritten during compound type conversion. (NAF - 2008/09/19) - - Fixed pointer alignment violations that could occur during vlen + - Fixed pointer alignment violations that could occur during vlen conversion. (NAF - 2008/09/16) - - Fixed problem where library could cause a segmentation fault when + - Fixed problem where library could cause a segmentation fault when an invalid location ID was given to H5Giterate(). (QAK - 2008/08/19) - - Fixed improper shutdown when objects have reference count > 1. The + - Fixed improper shutdown when objects have reference count > 1. The library now tracks reference count due to the application separately from that due to internal library routines. (NAF - 2008/08/19) - - Fixed assertion failure caused by incorrect array datatype version. + - Fixed assertion failure caused by incorrect array datatype version. (NAF - 2008/08/08) - - Fixed an issue where mount point traversal would fail when using + - Fixed an issue where mount point traversal would fail when using multiple handles for the child. (NAF - 2008/08/07) - - Fixed an issue where mount points were inaccessible when using multiple + - Fixed an issue where mount points were inaccessible when using multiple file handles for the parent. The mount table is now in the shared file structure (the parent pointer is still in the top structure). (NAF - 2008/08/07) - - when an attribute was opened twice and data was written with one of the handles, + - when an attribute was opened twice and data was written with one of the handles, the file didn't have the data. It happened because each handle had its own object structure, and the empty one overwrote the data with fill value. This is fixed by making some attribute information like the data be shared in the attribute structure. SLU - 2008/07/22 - - Fixed issue where a group could have a file mounted on it twice. + - Fixed issue where a group could have a file mounted on it twice. (QAK - 2008/07/15) - - Fixed a Windows-specific issue in the ohdr test which was causing users - in some timezones to get false errors. This a deficiency in the Windows - mktime() function, and has been handled properly. SJW - 2008/06/19 - - Fixed the problem with the searching of target file for H5Lcreate_external(). - The searching pattern will depend on whether the target file's - pathname is an absolute or a relative path. Please see the description - in the RM for H5Lcreate_external(). (VC - 2008/04/08) - - Fixed possible file corruption bug when encoding datatype + - Fixed a Windows-specific issue in the ohdr test which was causing users + in some timezones to get false errors. This a deficiency in the Windows + mktime() function, and has been handled properly. SJW - 2008/06/19 + - Fixed the problem with the searching of target file for H5Lcreate_external(). + The searching pattern will depend on whether the target file's + pathname is an absolute or a relative path. Please see the description + in the RM for H5Lcreate_external(). (VC - 2008/04/08) + - Fixed possible file corruption bug when encoding datatype descriptions for compound datatypes whose size was between 256 & 511 bytes and the file was opened with the "use the latest format" property enabled (with H5Pset_libver_bounds). (QAK - 2008/03/13) - - Fixed bug in H5Aget_num_attrs() routine to handle invalid location + - Fixed bug in H5Aget_num_attrs() routine to handle invalid location ID correctly. (QAK - 2008/03/11) - - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. + - H5Dset_extent: when shrinking dimensions, some chunks were not deleted. (PVN - 2009/01/8) - - Added code to maintain a min_clean_fraction in the metadata cache when + - Added code to maintain a min_clean_fraction in the metadata cache when in serial mode. (MAM - 2009/01/9) @@ -880,62 +879,63 @@ Bug Fixes since HDF5-1.8.0 release Performance ------------- - - Removed program perform/benchpar from the enable-build-all list. The - program will be retired or moved to another location. HDFFV-8156 - (AKC 2012/10/01) - - Retired program perform/mpi-perf. Its purpose has been incorporated - into h5perf before. (AKC 2012/09/20) - - ifdefs added to tests around include unistd.h and function to simulate + - Removed program perform/benchpar from the enable-build-all list. The + program will be retired or moved to another location. HDFFV-8156 + (AKC 2012/10/01) + - Retired program perform/mpi-perf. Its purpose has been incorporated + into h5perf before. (AKC 2012/09/20) + - ifdefs added to tests around include unistd.h and function to simulate getlogin() on Windows. (ADB - 2011/08/15) - - perf_serial test added to Windows projects and check batch file. + - perf_serial test added to Windows projects and check batch file. (ADB - 2009/06/11) + Fortran -------- - - Fixed a typo in return value of the nh5dread_f_c function ( was 1 + - Fixed a typo in return value of the nh5dread_f_c function ( was 1 instead of 0 on success); fixed the return value to make it consistent with other Fortran functions; cleaned the code from debug statements. (EIP - 2012/06/23) - - Fixed problem writing/reading control characters to a dataset; writing + - Fixed problem writing/reading control characters to a dataset; writing a string containing: alerts, backspace, carriage_return, form_feed, horizontal_tab, vertical_tab, new_line is now tested and working. (MSB - 2012/09/01) - - Corrected the integer type of H5S_UNLIMITED_F to HSIZE_T (MSB - 2012/09/01) + - Corrected the integer type of H5S_UNLIMITED_F to HSIZE_T (MSB - 2012/09/01) - - Corrected the number of continuation lines in the src files + - Corrected the number of continuation lines in the src files to be less then 32 lines for F95 compliance. (MSB - 2012/10/01) Tools ----- - - h5dump subsetting fixed for dims greater then two + - h5dump subsetting fixed for dims greater then two When a dataset has more then two dimensions, subsetting would incorrectly calculate the data that needed to be displayed. Added in block and stride calculation that account for dimensions greater then two. NOTE: lines that have line breaks inserted because of display length calculations, may have index info that is incorrect until the next dimension break. (ADB, 2016/03/04, HDFFV-9698) - - h5repack: h5repack would not attempt to remove UD filters. Added a + - h5repack: h5repack would not attempt to remove UD filters. Added a check to h5repack for UD filters that checks if the filter can be dynamically loaded. This will require a change in the library to add the H5PL_load() to the H5Zfilter_avail(). (ADB - 2014/03/03 HDFFV-8629) - - h5repack: Fixed failure for converting a layout of small chunked dataset + - h5repack: Fixed failure for converting a layout of small chunked dataset (size < 1K) to contiguous layout. HDFFV-8214 (JKM 2013/03/18) - - h5diff: Fixed to return correct exit code 1 when detect unique extra + - h5diff: Fixed to return correct exit code 1 when detect unique extra attribute. Prior to this fix, h5diff returned exit code 0 indicating two files are identical. HDFFV-7643 (JKM 2013/02/15) - - h5diff: Improved speed when comparing HDF5 files with lots of + - h5diff: Improved speed when comparing HDF5 files with lots of attributes. Much slower performance was identified with release version from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) - - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if + - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if source file contains chunked dataset and a chunk dim is bigger than the dataset dim. Another issue is that the command changed max dims if chunk dim is smaller than the dataset dim. These issue occurred when dataset size is smaller than 64k (compact size limit) Fixed both. HDFFV-8012 (JKM 2012/09/24) - - h5diff: Fixed not to accumulate attribute difference to dataset + - h5diff: Fixed not to accumulate attribute difference to dataset difference in verbose mode (-v, -r), which caused incorrect difference between dataset and group/datatype object if attribute exist with any differences. This also lead to fix inconsistent @@ -948,214 +948,214 @@ Bug Fixes since HDF5-1.8.0 release parallel mode. It was detected by daily test for comparing non-comparable objects, but it could have occurred in other operations depend on machine condition. HDFFV-8003 (JKM 2012/08/01) - - h5diff: Fixed test failure for "make check" due to failure of + - h5diff: Fixed test failure for "make check" due to failure of copying test files when performed in HDF5 source tree. Also applied to other tools. HDFFV-8107 (JKM 2012/08/01) - - h5diff: Fixed the Function COPY_TESTFILES_TO_TESTDIR() of - testh5diff.sh to better report when there is an error in the file - copying. HDFFV-8105 (AKC -2012/07/22) - - h5diff: Fixed not to check and display dangling link status without + - h5diff: Fixed the Function COPY_TESTFILES_TO_TESTDIR() of + testh5diff.sh to better report when there is an error in the file + copying. HDFFV-8105 (AKC -2012/07/22) + - h5diff: Fixed not to check and display dangling link status without --follow-symlinks option. This also improved performance when comparing lots of external links without the --follow-symlinks option. HDFFV-7998 (JKM 2012/04/26) - - h5unjam: Fixed sefgault when used -V (show version) option. + - h5unjam: Fixed sefgault when used -V (show version) option. HDFFV-8001 (JKM 2012/04/19) - - h5repack: Fixed a failure when change the chunk size of a specified + - h5repack: Fixed a failure when change the chunk size of a specified chunked dataset with unlimited max dims. HDFFV-7993 (JKM 2012/04/11) - - h5diff: Fixed failure for comparing same named object with different + - h5diff: Fixed failure for comparing same named object with different object types in comparing groups. Prior to the fix, h5diff resulted in error. After the fix, h5diff detects such case as non-comparable and display messages accordingly. HDFFV-7664 (JKM 2012/03/28) - - h5diff: If unique objects exists only in one file and try to exclude + - h5diff: If unique objects exists only in one file and try to exclude the unique objects with --exclude-path option, h5diff missed excluding some objects. Fixed to exclude objects correctly in such case. HDFFV-7837 (JKM 2012/03/20) - - h5dump: Added tools library error stack to properly catch error + - h5dump: Added tools library error stack to properly catch error information generated within the library. HDFFV-7958 (ADB 2012/03/12) - - h5dump: Dangling links no longer throw error message, change process + - h5dump: Dangling links no longer throw error message, change process when open link fails. HDFFV-7839 (ADB 2012/03/12) - - h5diff: When two symbolic dangling links are compared with + - h5diff: When two symbolic dangling links are compared with --follow-symlinks option, the result should be same. It worked for comparing two files, but didn't work for comparing two objects. HDFFV-7835 (JKM 2012/03/09) - - h5dump: Refactored code to remove duplicated functions. Split XML + - h5dump: Refactored code to remove duplicated functions. Split XML functions from DDL functions. Corrected indentation and formatting errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified all tools call tools_init() in main. HDFFV-7560 (ADB 2012/02/17) - - h5diff: fixed to prevent from displaying error stack message when + - h5diff: fixed to prevent from displaying error stack message when comparing the two dangling symlinks with follow-symlinks option. HDFFV-7836 (JKM 2012/01/13) - - h5repack: fixed memory leak for handling variable length string in + - h5repack: fixed memory leak for handling variable length string in attribute. HDFFV-7840 (JKM 2012/01/06) - - h5ls: fixed segfault when access region reference data in an + - h5ls: fixed segfault when access region reference data in an attribute. HDFFV-7838 (JKM 2011/12/29) - - h5diff: fixed segfault over non-comparable attribute with different + - h5diff: fixed segfault over non-comparable attribute with different dimention or rank, along with '-c' option to display details. HDFFV-7770 (JKM 2011/10/24) - - Fixed h5diff to display all the comparable object and attribute + - Fixed h5diff to display all the comparable object and attribute regardless of non-comparables. HDFFV-7693 (JKM 2011/09/16) - - Fixed h5repack to update values of references(object and region) of + - Fixed h5repack to update values of references(object and region) of attributes in h5repack for 1) references, 2) ARRAY of references, 3) VLEN of references, and 4) COMPOUND of references. (JIRA HDF5 5932) PC -2011/09/14 - - h5diff: fixed segfault over dataset with container types + - h5diff: fixed segfault over dataset with container types (array,lven) with multiple nested compound types. (ex: compound->array->compound, compound->vlen->compound) HDFFV-7712 JKM (2011/09/01) - - h5repack: added macro to handle failure in H5Dread/write when memory + - h5repack: added macro to handle failure in H5Dread/write when memory allocation failed inside the library. (PC -- 2011/08/19) - - Fixed h5jam not to allow specifying an HDF5 formatted file as input + - Fixed h5jam not to allow specifying an HDF5 formatted file as input file for -u (user block file) option, because the original HDF5 file will not be accessible if allows. HDFFV-5941 (JKM 2011/08/15) - - Revised command help pages of h5jam and h5unjam. The descriptions + - Revised command help pages of h5jam and h5unjam. The descriptions were not up to date and some were missing. HDFFV-7515 (JKM 2011/08/15) - - h5repack: h5repack failed to copy dataset if the layout is changed + - h5repack: h5repack failed to copy dataset if the layout is changed from chunked with unlimited dims to contiguous. HDFFV-7649 (PC -- 2011/07/15) - - h5diff: "--delta" option considers two NaN of the same type are + - h5diff: "--delta" option considers two NaN of the same type are different, which is wrong based on h5diff description in Reference Manual. HDFFV-7656 (PC -- 2011/07/15) - - Fixed h5diff to display instructive error message and exit with 1 + - Fixed h5diff to display instructive error message and exit with 1 when mutually exclusive options (-d, -p and --use-system-epsilon) are used together. HDFFV-7600 (JKM 2011/07/07) - - Fixed h5dump to display the first line of each element into correct + - Fixed h5dump to display the first line of each element into correct position for multiple dimention array type. Before this fix, the first line of each element in array were displayed after the last line of previous element without moving to the next line (+indentation). Bug #HDFFV-5878 (JKM 2011/06/15) - - Fixed h5dump to display correct value for H5T_STD_I8LE dataset + - Fixed h5dump to display correct value for H5T_STD_I8LE dataset on a system (ppc64, linux, Big-Endian, clustering). Bug #HDFFV-7594 (ABERT & JKM 2011/05/12) - - Fixed h5diff to compare file itself correctly. Previously h5diff + - Fixed h5diff to compare file itself correctly. Previously h5diff reported either different or not compatible in certain cases even comparing file itself. This fix also improve performance when comparing same target objects through verifying the obj&file addresses before comparing the details in the objects (ex: datasets or attributes) Bug #HDFFV-5928 (XCAO & JKM 2011/05/06) - - Updated h5dump test case script to prevent entire test failure upon + - Updated h5dump test case script to prevent entire test failure upon source directory is read-only. Bug# HDFFV-4342 (JKM 2011/4/12) - - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in + - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in attribute on Big-Endian machine. H5T_STD_I8BE is unsigned 8bit type, so h5dump is supposed to display -2 instead of 254. It worked correctly on Little-Endian system , but not on Big-Endian system. Bug #HDFFV-4358 (JKM 2011/04/08) - - Updated to unify option name to '--enable-error-stack' for printing + - Updated to unify option name to '--enable-error-stack' for printing HDF5 error stack messages for HDF5 tools. h5ls and h5dump for now. For h5ls, this replaces "-e/--errors" option, which is deprecated. Bug#2182 (JKM 2011/3/30) - - Fix h5diff for --use-system-epsilon option: the calculation changed + - Fix h5diff for --use-system-epsilon option: the calculation changed from ( |a - b| / b ) to ( |a - b| ). This was decided for better performance. Bug#2184 (JKM 2011/3/24) - - Fixed output for H5T_REFERENCE in h5dump. According to the BNF document + - Fixed output for H5T_REFERENCE in h5dump. According to the BNF document the output of a H5T_REFERENCE should be followed by the type; <reference> ::= H5T_REFERENCE { <ref_type> } <ref_type> ::= H5T_STD_REF_OBJECT | H5T_STD_REF_DSETREG Previously this was only displayed if the -R option was used. Bug#1725 (ADB 2011/3/28) - - Fix h5diff issues for #1: h5diff compared attributes correctly only + - Fix h5diff issues for #1: h5diff compared attributes correctly only when two objects have the same number of attributes and attribute names are identical, #2: didn't display useful information about attribute difference. Bug#2121 (JKM 2011/3/17) - - Fixed memory leak for h5diff when accessing symbolic links with + - Fixed memory leak for h5diff when accessing symbolic links with --follow-symlink option. Bug#2214 (JKM 2011/3/18) - - Fixed memory leak for h5diff when access variable length string + - Fixed memory leak for h5diff when access variable length string data. Bug#2216 (JKM 2011/3/18) - - Fixed and improved help page for -a option of h5ls. + - Fixed and improved help page for -a option of h5ls. Bug#1904 (JKM 2011/3/11) - - Fixed h5dump not to include attribute values in the output file when + - Fixed h5dump not to include attribute values in the output file when h5dump "-y -o output_file" options were used. The problem was introduced in HDF5 1.8.6 by showing data pointed by region references. (XCAO 2011/3/9) - - Fixed h5copy to be able to copy any object into the same HDF5 file. + - Fixed h5copy to be able to copy any object into the same HDF5 file. Previously h5copy displayed error message when target file is same as source file. (XCAO 2011/3/8) - - Fixed h5dump for skipping some values for long array type dataset on + - Fixed h5dump for skipping some values for long array type dataset on Windows. This issue only occurred on Windows due to the different return behavior from _vsnprintf() funtion. Bug#2161 (JKM 2011/3/3) - - Fixed h5dump for skipping array indices every certain number + - Fixed h5dump for skipping array indices every certain number when the array type dataset is relatively big. The certain number varies according to the size of array. Bug#2092 (JKM 2011/2/15). - - Fixed h5diff for the segfault when compares compound datasets + - Fixed h5diff for the segfault when compares compound datasets with combination of fixed length string types and vlen string types in certain orders. bug#2089 (JKM 2010/12/28) - - Improve h5diff performance. 1) use HDmemcmp() before comparing each + - Improve h5diff performance. 1) use HDmemcmp() before comparing each elements. 2) replace expensive H5Tequals() calls 3) retrieve datatype information at dataset level not each element level for compound datasets - - Fixed h5ls to display nested compound type with curly bracket + - Fixed h5ls to display nested compound type with curly bracket when -S (--simple) option is used with -l (--label), so it shows which member (in curly bracket) belong to which nested compound type and make the output make sense. bug#1979 (JKM 2010/11/09) - - Fixed h5diff to handle variable-length strings in a compound dataset + - Fixed h5diff to handle variable-length strings in a compound dataset correctly. (also variable-length string array in a compound dataset) Garbage values were displayed when h5diff compared multiple variable-length strings in a compound type dataset. Bug#1989 (JKM 2010/10/28) - - Fixed h5copy to fail gracefully when copying object to non-exist + - Fixed h5copy to fail gracefully when copying object to non-exist group without -p option. Bug#2040 (JKM 2010/10/18) - - Fixed to compare member objects and groups recursively when two + - Fixed to compare member objects and groups recursively when two files or groups are specified to be compared. Bug#1975 (JKM 2010/9/16) - - Make h5repack be able to convert a layout to COMPACT for small size + - Make h5repack be able to convert a layout to COMPACT for small size dataset as default. bug#1896 (JKM 2010/09/15) - - Change h5ls not to manipulate special characters in object name or + - Change h5ls not to manipulate special characters in object name or attribute name for smart display. bug#1784 (JKM 2010/06/28) - - Fixed h5ls to return exit code 1 (error) when non-existent file is + - Fixed h5ls to return exit code 1 (error) when non-existent file is specified. bug#1793. (JKM 2010/04/27) - - h5copy failed to copy dangling link when the link is specified + - h5copy failed to copy dangling link when the link is specified directly. bug#1817. (JKM 2010/04/22) - - h5repack lost attributes from a dataset of reference type. bug#1726. + - h5repack lost attributes from a dataset of reference type. bug#1726. (JKM 2010/3/25) - - h5repack sets NULL for object reference value for group or + - h5repack sets NULL for object reference value for group or named datatype. bug#1814. (JKM 2010/03/19) - - h5diff: fixed incorrect behavior (hang) in parallel mode when - specify invalid options (ex: -v and -q) (JKM 2010/02/17) - - h5dump/h5ls display buffer resize fixed in tools library. - (ADB - 2009/07/21 - 1520) - - Fixed many problems that could occur when using h5repack with named - datatypes. (NAF - 2009/4/20 - 1516/1466) - - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets - that have a datatype datum size greater than H5TOOLS_BUFSIZE, a - constant defined as 1024Kb, such as array types with large - dimensions (PVN - 2009/4/1 - 1501) - - h5import: By selecting a compression type, a big endian byte order was being - selected (PVN - 2009/3/11 - 1462) - - zip_perf.c had missing argument on one of the open() calls. Fixed. - (AKC - 2008/12/9) - - h5dump now checks for uniqueness of committed datatypes. - (NAF - 2008/10/15) - - Fixed unnecessary indentation of committed datatypes in h5dump. - (NAF - 2008/10/15) - - Fixed bugs in h5stat:segmemtation fault when printing groups and + - h5diff: fixed incorrect behavior (hang) in parallel mode when + specify invalid options (ex: -v and -q) (JKM 2010/02/17) + - h5dump/h5ls display buffer resize fixed in tools library. + (ADB - 2009/07/21 - 1520) + - Fixed many problems that could occur when using h5repack with named + datatypes. (NAF - 2009/4/20 - 1516/1466) + - h5dump, h5diff, h5repack were not reading (by hyperslabs) datasets + that have a datatype datum size greater than H5TOOLS_BUFSIZE, a + constant defined as 1024Kb, such as array types with large + dimensions (PVN - 2009/4/1 - 1501) + - h5import: By selecting a compression type, a big endian byte order was being + selected (PVN - 2009/3/11 - 1462) + - zip_perf.c had missing argument on one of the open() calls. Fixed. + (AKC - 2008/12/9) + - h5dump now checks for uniqueness of committed datatypes. + (NAF - 2008/10/15) + - Fixed unnecessary indentation of committed datatypes in h5dump. + (NAF - 2008/10/15) + - Fixed bugs in h5stat:segmemtation fault when printing groups and print warning message when traversal of objects is unsuccessful. (see bug #1253) (VC- 2008/10/13) - - Fixed bug in h5ls that prevented relative group listings (like - "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) - - Fixed bug in h5diff that prevented datasets & attributes with - variable-length string elements from comparing correctly. - (QAK - 2008/02/28) - - h5import bug on Windows w/binary datasets. fread in windows needs a - binary file to be open with 'rb' instead of 'r' otherwise it - terminates execution if an end of file character is found on the - input file. Besides that the binary file generated needs to be open - with 'wb' , otherwise an end of line character is read twice. - (PVN - 2008/02/19) - - Fixed bug in h5dump that caused binary output to be made only for the first - dataset, when several datasets were requested. (PVN - 2008/04/07) - - h5dump: when doing binary output (-b), the stdout printing of attributes - was done incorrectly. Removed printing of attributes when doing binary - output. PVN - 2008/06/05 + - Fixed bug in h5ls that prevented relative group listings (like + "h5ls foo.h5/bar") from working correctly (QAK - 2008/06/03) + - Fixed bug in h5diff that prevented datasets & attributes with + variable-length string elements from comparing correctly. + (QAK - 2008/02/28) + - h5import bug on Windows w/binary datasets. fread in windows needs a + binary file to be open with 'rb' instead of 'r' otherwise it + terminates execution if an end of file character is found on the + input file. Besides that the binary file generated needs to be open + with 'wb' , otherwise an end of line character is read twice. + (PVN - 2008/02/19) + - Fixed bug in h5dump that caused binary output to be made only for the first + dataset, when several datasets were requested. (PVN - 2008/04/07) + - h5dump: when doing binary output (-b), the stdout printing of attributes + was done incorrectly. Removed printing of attributes when doing binary + output. PVN - 2008/06/05 High-Level APIs: - ------ - - Packet Table is updated. + ------ + - Packet Table is updated. In the Packet Table C API, there are changes with the following functions, which had been ifdef'ed out with VLPT_REMOVED since 2006 @@ -1166,60 +1166,57 @@ Bug Fixes since HDF5-1.8.0 release Various cleanup: replacing 0/-1 with SUCCEED/FAIL and H5I_BADID with H5I_INVALID_HID. (BMR, 2016/03/04, HDFFV-442) - - Fixed problem with H5DSget_scale_name including the NULL terminator in + - Fixed problem with H5DSget_scale_name including the NULL terminator in the size calculation returned by the function. The API does not include the NULL terminator in the size returned (MSB- 2013/2/10) - - Fixed problem with H5TBdelete_record destroying all data following the deletion + - Fixed problem with H5TBdelete_record destroying all data following the deletion of a row. (MSB- 2012/7/26) - - Fixed H5LTget_attribute_string not closing an object identifier when an + - Fixed H5LTget_attribute_string not closing an object identifier when an error occurs. (MSB- 2012/7/21) - - Fixed the H5LTdtype_to_text function. It had some memory problems when + - Fixed the H5LTdtype_to_text function. It had some memory problems when dealing with some complicated data types. HDFFVI-7701 (SLU - 2011/10/19) - - Fixed a bug in H5DSattach_scale, H5DSis_attached and H5DSdetach_scale + - Fixed a bug in H5DSattach_scale, H5DSis_attached and H5DSdetach_scale caused by using H5Tget_native_type function to determine the native type for reading REFERENCE_LIST attribute. The bug was exposed on Mac PPC. (EIP - 2010/05/22 -1851) - - Fixed a bug in the H5DSdetach_scale function when 0 bytes + - Fixed a bug in the H5DSdetach_scale function when 0 bytes were allocated after the last reference to a dim. scale was removed from the list of references in a VL element of the DIMENSION_LIST attribute; modified the function to comply with the Spec: DIMENSION_LIST attribute is deleted now when no dimension scales left attached. (EIP - 2010/05/14 -1822) - - Fixed a bug where the H5TB API would forget the order of fields when + - Fixed a bug where the H5TB API would forget the order of fields when added out of offset order. (NAF - 2009/10/27 - 1582) - - H5DSis_attached failed to account for different platform types. Added a + - H5DSis_attached failed to account for different platform types. Added a get native type call. (ADB - 2009/9/29 - 1562) - - Dimension scales: The scale index return value in H5DSiterate_scales was not always + - Dimension scales: The scale index return value in H5DSiterate_scales was not always incremented. (PVN - 2009/4/8 - 1538) Fortran High-Level APIs: - ------ + ------ - - Lite: The h5ltget_attribute_string_f used to return the C NULL character in the + - Lite: The h5ltget_attribute_string_f used to return the C NULL character in the returned character buffer. The returned Fortran charactor buffer now does not return the C NULL character. (MSB - 2012/3/23) - - Lite: The h5ltget_dataset_info_f function (gets information about a dataset) + - Lite: The h5ltget_dataset_info_f function (gets information about a dataset) was not correctly returning the dimension array. (PVN - 2009/3/23) - - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions + - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions had memory problems with the g95 fortran compiler. (PVN � 5/13/2009) 1522 - - - Documentation ------------- F90 APIs -------- - - Modified the h5open_f and h5close_f subroutines to not to call H5open + - Modified the h5open_f and h5close_f subroutines to not to call H5open and H5close correspodningly. While the H5open call just adds overhead, the H5close call called by an Fortran application shuts down the HDF5 library making it unaccessible to the application. diff --git a/release_docs/INSTALL b/release_docs/INSTALL index d1addc9..9546615 100644 --- a/release_docs/INSTALL +++ b/release_docs/INSTALL @@ -354,7 +354,7 @@ CONTENTS `--enable-build-mode=debug'; to compile with optimizations (the default for supported public releases), say `--enable-build-mode=production'. For a 'clean slate' configuration - with optimization disabled and nothing turned on, + with optimization disabled and nothing turned on, say `--enable-build-mode=clean'. On some systems the library can also be compiled for profiling with gprof by saying `--enable-profiling'. diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 478e2eb..f42f780 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -570,12 +570,12 @@ These five steps are described in detail below. #set (BUILD_MAFISC_LIBRARY_SOURCE OFF CACHE BOOL "build the mafisc library within the plugin" FORCE) #set (MAFISC_PACKAGE_NAME "mafisc" CACHE STRING "Name of MAFISC package" FORCE) ###### - # sz + # szf ###### - set (SZ_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ from github repository" FORCE) - set (SZ_GIT_BRANCH "master" CACHE STRING "" FORCE) - set (SZ_TGZ_NAME "sz.tar.gz" CACHE STRING "Use SZ from compressed file" FORCE) - set (SZ_PACKAGE_NAME "sz" CACHE STRING "Name of SZ package" FORCE) + set (SZF_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ from github repository" FORCE) + set (SZF_GIT_BRANCH "master" CACHE STRING "" FORCE) + set (SZF_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ from compressed file" FORCE) + set (SZF_PACKAGE_NAME "szf" CACHE STRING "Name of SZ package" FORCE) ###### # zfp ###### @@ -777,6 +777,8 @@ HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF +HDF5_MSVC_NAMING_CONVENTION "Use MSVC Naming conventions for Shared Libraries" OFF +HDF5_MINGW_STATIC_GCC_LIBS "Statically link libgcc/libstdc++" OFF if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF if (CMAKE_BUILD_TYPE MATCHES Debug) @@ -789,6 +791,10 @@ if (HDF5_BUILD_FORTRAN) if (BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) default HDF5_INSTALL_MOD_FORTRAN is SHARED if (NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) default HDF5_INSTALL_MOD_FORTRAN is STATIC if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) default HDF5_INSTALL_MOD_FORTRAN is SHARED +HDF5_BUILD_DOC "Build documentation" OFF +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 ---------------- External Library Options --------------------- HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO" diff --git a/release_docs/README_HPC b/release_docs/README_HPC index 513064c..6b31ce6 100644 --- a/release_docs/README_HPC +++ b/release_docs/README_HPC @@ -32,7 +32,7 @@ II. Obtain HDF5 source Obtain HDF5 source code from the HDF5 repository using a git command or from a release tar file in a working directory: - git clone https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git + git clone https://github.com/HDFGroup/hdf5.git [-b branch] [source directory] If no branch is specified, then the 'develop' version will be checked out. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1c5d96d..690635a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -34,8 +34,7 @@ CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.10.3 -- Bug Fixes since HDF5-1.10.2 +- Bug Fixes since HDF5-1.12.0 - Supported Platforms - Tested Configuration Features Summary - More Tested Platforms @@ -48,127 +47,236 @@ New Features Configuration: ------------- + - Fixed POSIX problems when building w/ gcc on Solaris + + When building on Solaris using gcc, the POSIX symbols were not + being set correctly, which could lead to issues like clock_gettime() + not being found. + + The standard is now set to gnu99 when building with gcc on Solaris, + which allows POSIX things to be #defined and linked correctly. This + differs slightly from the gcc norm, where we set the standard to c99 + and manually set POSIX #define symbols. + + (DER - 2020/11/25, HDFFV-11191) + + - Added a configure-time option to consider certain compiler warnings + as errors + + A new configure-time option was added that converts some compiler warnings + to errors. This is mainly intended for library developers and currently + only works for gcc and clang. The warnings that are considered errors + will appear in the generated libhdf5.settings file. These warnings apply + to C and C++ code and will appear in "H5 C Flags" and H5 C++ Flags", + respectively. They will NOT be exported to h5cc, etc. + + The default is OFF. Building with this option may fail when compiling + on operating systems and with compiler versions not commonly used by + the library developers. Compilation may also fail when headers not + under the control of the library developers (e.g., mpi.h, hdfs.h) raise + warnings. + + Autotools: --enable-warnings-as-errors + + CMake: HDF5_ENABLE_WARNINGS_AS_ERRORS + + (DER - 2020/11/23, HDFFV-11189) + + - Autotools and CMake target added to produce doxygen generated documentation + + The default is OFF or disabled. + Autoconf option is '--enable-doxygen' + autotools make target is 'doxygen' and will build all doxygen targets + CMake configure option is 'HDF5_BUILD_DOC'. + CMake target is 'doxygen' for all available doxygen targets + CMake target is 'hdf5lib_doc' for the src subdirectory + + (ADB - 2020/11/03) + + - CMake option to use MSVC naming conventions with MinGW + + HDF5_MSVC_NAMING_CONVENTION option enable to use MSVC naming conventions + when using a MinGW toolchain + + (xan - 2020/10/30) + + - CMake option to statically link gcc libs with MinGW + + HDF5_MINGW_STATIC_GCC_LIBS allows to statically link libg/libstdc++ + with the MinGW toolchain + + (xan - 2020/10/30) + - CMake option to build the HDF filter plugins project as an external project - The HDF filter plugins project is a collection of registered compression - filters that can be dynamically loaded when needed to access data stored - in a hdf5 file. This CMake-only option allows the plugins to be built and - distributed with the hdf5 library and tools. Like the options for szip and - zlib, either a tgz file or a git repository can be specified for the source. + The HDF filter plugins project is a collection of registered compression + filters that can be dynamically loaded when needed to access data stored + in a hdf5 file. This CMake-only option allows the plugins to be built and + distributed with the hdf5 library and tools. Like the options for szip and + zlib, either a tgz file or a git repository can be specified for the source. - The necessary options are (see the INSTALL_CMake.txt file): + The necessary options are (see the INSTALL_CMake.txt file): HDF5_ENABLE_PLUGIN_SUPPORT PLUGIN_TGZ_NAME or PLUGIN_GIT_URL - There are more options necessary for various filters and the plugin project - documents should be referenced. + There are more options necessary for various filters and the plugin project + documents should be referenced. - (ADB - 2020/09/27, OESS-98) + (ADB - 2020/09/27, OESS-98) - Added CMake option to format source files - HDF5_ENABLE_FORMATTERS option will enable creation of targets using the - pattern - HDF5_*_SRC_FORMAT - where * corresponds to the source folder - or tool folder. All sources can be formatted by executing the format target; - make format + HDF5_ENABLE_FORMATTERS option will enable creation of targets using the + pattern - HDF5_*_SRC_FORMAT - where * corresponds to the source folder + or tool folder. All sources can be formatted by executing the format target; + make format + + (ADB - 2020/08/24) + + - Add file locking configure and CMake options + + HDF5 1.10.0 introduced a file locking scheme, primarily to help + enforce SWMR setup. Formerly, the only user-level control of the scheme + was via the HDF5_USE_FILE_LOCKING environment variable. + + This change introduces configure-time options that control whether + or not file locking will be used and whether or not the library + ignores errors when locking has been disabled on the file system + (useful on some HPC Lustre installations). + + In both the Autotools and CMake, the settings have the effect of changing + the default property list settings (see the H5Pset/get_file_locking() + entry, below). - (ADB - 2020/08/24) + The yes/no/best-effort file locking configure setting has also been + added to the libhdf5.settings file. + + Autotools: + + An --enable-file-locking=(yes|no|best-effort) option has been added. + + yes: Use file locking. + no: Do not use file locking. + best-effort: Use file locking and ignore "disabled" errors. + + CMake: + + Two self-explanatory options have been added: + + HDF5_USE_FILE_LOCKING + HDF5_IGNORE_DISABLED_FILE_LOCKS + + Setting both of these to ON is the equivalent to the Autotools' + best-effort setting. + + NOTE: + The precedence order of the various file locking control mechanisms is: + + 1) HDF5_USE_FILE_LOCKING environment variable (highest) + + 2) H5Pset_file_locking() + + 3) configure/CMake options (which set the property list defaults) + + 4) library defaults (currently best-effort) + + (DER - 2020/07/30, HDFFV-11092) - CMake option to link the generated Fortran MOD files into the include directory. - The Fortran generation of MOD files by a Fortran compile can produce - different binary files between SHARED and STATIC compiles with different - compilers and/or different platforms. Note that it has been found that - different versions of Fortran compilers will produce incompatible MOD - files. Currently, CMake will locate these MOD files in subfolders of - the include directory and add that path to the Fortran library target - in the CMake config file, which can be used by the CMake find library - process. For other build systems using the binary from a CMake install, - a new CMake configuration can be used to copy the pre-chosen version - of the Fortran MOD files into the install include directory. - - The default will depend on the configuration of - BUILD_STATIC_LIBS and BUILD_SHARED_LIBS: + The Fortran generation of MOD files by a Fortran compile can produce + different binary files between SHARED and STATIC compiles with different + compilers and/or different platforms. Note that it has been found that + different versions of Fortran compilers will produce incompatible MOD + files. Currently, CMake will locate these MOD files in subfolders of + the include directory and add that path to the Fortran library target + in the CMake config file, which can be used by the CMake find library + process. For other build systems using the binary from a CMake install, + a new CMake configuration can be used to copy the pre-chosen version + of the Fortran MOD files into the install include directory. + + The default will depend on the configuration of + BUILD_STATIC_LIBS and BUILD_SHARED_LIBS: YES YES Default to SHARED 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 - HDF5_INSTALL_MOD_FORTRAN to one of NO, SHARED, or STATIC + The defaults can be overriden by setting the config option + HDF5_INSTALL_MOD_FORTRAN to one of NO, SHARED, or STATIC - (ADB - 2020/07/9, HDFFV-11116) + (ADB - 2020/07/09, HDFFV-11116) - CMake option to use AEC (open source SZip) library instead of SZip - The open source AEC library is a replacement library for SZip. In - order to use it for hdf5 the libaec CMake source was changed to add - "-fPIC" and exclude test files. Autotools does not build the - compression libraries within hdf5 builds. New option USE_LIBAEC is - required to compensate for the different files produced by AEC build. + The open source AEC library is a replacement library for SZip. In + order to use it for hdf5 the libaec CMake source was changed to add + "-fPIC" and exclude test files. Autotools does not build the + compression libraries within hdf5 builds. New option USE_LIBAEC is + required to compensate for the different files produced by AEC build. - (ADB - 2020/04/22, OESS-65) + (ADB - 2020/04/22, OESS-65) - CMake ConfigureChecks.cmake file now uses CHECK_STRUCT_HAS_MEMBER - Some handcrafted tests in HDFTests.c has been removed and the CMake - CHECK_STRUCT_HAS_MEMBER module has been used. + Some handcrafted tests in HDFTests.c has been removed and the CMake + CHECK_STRUCT_HAS_MEMBER module has been used. - (ADB - 2020/03/24, TRILAB-24) + (ADB - 2020/03/24, TRILAB-24) - Both build systems use same set of warnings flags - GNU C, C++ and gfortran warnings flags were moved to files in a config - sub-folder named gnu-warnings. Flags that only are available for a specific - version of the compiler are in files named with that version. - Clang C warnings flags were moved to files in a config sub-folder - named clang-warnings. - Intel C, Fortran warnings flags were moved to files in a config sub-folder - named intel-warnings. + GNU C, C++ and gfortran warnings flags were moved to files in a config + sub-folder named gnu-warnings. Flags that only are available for a specific + version of the compiler are in files named with that version. + Clang C warnings flags were moved to files in a config sub-folder + named clang-warnings. + Intel C, Fortran warnings flags were moved to files in a config sub-folder + named intel-warnings. - There are flags in named "error-xxx" files with warnings that may - be promoted to errors. Some source files may still need fixes. + There are flags in named "error-xxx" files with warnings that may + be promoted to errors. Some source files may still need fixes. - There are also pairs of files named "developer-xxx" and "no-developer-xxx" - that are chosen by the CMake option:HDF5_ENABLE_DEV_WARNINGS or the - configure option:--enable-developer-warnings. + There are also pairs of files named "developer-xxx" and "no-developer-xxx" + that are chosen by the CMake option:HDF5_ENABLE_DEV_WARNINGS or the + configure option:--enable-developer-warnings. - In addition, CMake no longer applies these warnings for examples. + In addition, CMake no longer applies these warnings for examples. - (ADB - 2020/03/24, TRILAB-192) + (ADB - 2020/03/24, TRILAB-192) - Added test script for file size compare - if CMake minimum version is at least 3.14, the fileCompareTest.cmake - script will compare file sizes. + If CMake minimum version is at least 3.14, the fileCompareTest.cmake + script will compare file sizes. - (ADB - 2020/02/24, HDFFV-11036) + (ADB - 2020/02/24, HDFFV-11036) - Update CMake minimum version to 3.12 - Updated CMake minimum version to 3.12 and added version checks - for Windows features. + Updated CMake minimum version to 3.12 and added version checks + for Windows features. - (ADB - 2020/02/05, TRILABS-142) + (ADB - 2020/02/05, TRILABS-142) - Fixed CMake include properties for Fortran libraries - Corrected the library properties for Fortran to use the - correct path for the Fortran module files. + Corrected the library properties for Fortran to use the + correct path for the Fortran module files. - (ADB - 2020/02/04, HDFFV-11012) + (ADB - 2020/02/04, HDFFV-11012) - Added common warnings files for gnu and intel - Added warnings files to use one common set of flags - during configure for both autotools and CMake build - systems. The initial implementation only affects a - general set of flags for gnu and intel compilers. + Added warnings files to use one common set of flags + during configure for both autotools and CMake build + systems. The initial implementation only affects a + general set of flags for gnu and intel compilers. - (ADB - 2020/01/17) + (ADB - 2020/01/17) - Added new options to CMake for control of testing - Added CMake options (default ON); + Added CMake options (default ON); HDF5_TEST_SERIAL AND/OR HDF5_TEST_PARALLEL combined with: HDF5_TEST_TOOLS @@ -178,13 +286,13 @@ New Features HDF5_TEST_CPP HDF5_TEST_JAVA - (ADB - 2020/01/15, HDFFV-11001) + (ADB - 2020/01/15, HDFFV-11001) - Added Clang sanitizers to CMake for analyzer support if compiler is clang. - Added CMake code and files to execute the Clang sanitizers if - HDF5_ENABLE_SANITIZERS is enabled and the USE_SANITIZER option - is set to one of the following: + Added CMake code and files to execute the Clang sanitizers if + HDF5_ENABLE_SANITIZERS is enabled and the USE_SANITIZER option + is set to one of the following: Address Memory MemoryWithOrigins @@ -193,631 +301,267 @@ New Features Leak 'Address;Undefined' - (ADB - 2019/12/12, TRILAB-135) + (ADB - 2019/12/12, TRILAB-135) - Update CMake for VS2019 support - CMake added support for VS2019 in version 3.15. Changes to the CMake - generator setting required changes to scripts. Also updated version - references in CMake files as necessary. + CMake added support for VS2019 in version 3.15. Changes to the CMake + generator setting required changes to scripts. Also updated version + references in CMake files as necessary. - (ADB - 2019/11/18, HDFFV-10962) + (ADB - 2019/11/18, HDFFV-10962) - Update CMake options to match new autotools options - Add configure options (autotools - CMake): + Add configure options (autotools - CMake): enable-asserts HDF5_ENABLE_ASSERTS enable-symbols HDF5_ENABLE_SYMBOLS enable-profiling HDF5_ENABLE_PROFILING enable-optimization HDF5_ENABLE_OPTIMIZATION - In addition NDEBUG is no longer forced defined and relies on the CMake - process. - - (ADB - 2019/10/07, HDFFV-100901, HDFFV-10637, TRILAB-97) - - - Update CMake tests to use FIXTURES - - CMake test fixtures allow setup/cleanup tests and other dependency - requirements as properties for tests. This is more flexible for - modern CMake code. - - (ADB - 2019/07/23, HDFFV-10529) - - - Windows PDB files are always installed - - There are build configuration or flag settings for Windows that may not - generate PDB files. If those files are not generated then the install - utility will fail because those PDB files are not found. An optional - variable, DISABLE_PDB_FILES, was added to not install PDB files. - - (ADB - 2019/07/17, HDFFV-10424) - - - Add mingw CMake support with a toolchain file - - There has been a number of mingw issues that has been linked under - HDFFV-10845. It has been decided to implement the CMake cross-compiling - technique of toolchain files. We will use a linux platform with the mingw - compiler stack for testing. Only the C language is fully supported, and - the error tests are skipped. The C++ language works for static but shared - builds has a shared library issue with the mingw Standard Exception Handling - library, which is not available on Windows. Fortran has a common cross-compile - problem with the fortran configure tests. - - (ADB - 2019/07/12, HDFFV-10845, HDFFV-10595) - - - Windows PDB files are installed incorrectly - - For static builds, the PDB files for windows should be installed next - to the static libraries in the lib folder. Also the debug versions of - libraries and PDB files are now correctly built using the default - CMAKE_DEBUG_POSTFIX setting. - - (ADB - 2019/07/09, HDFFV-10581) - - - Add option to build only shared libs - - A request was made to prevent building static libraries and only build - shared. A new option was added to CMake, ONLY_SHARED_LIBS, which will - skip building static libraries. Certain utility functions will build with - static libs but are not published. Tests are adjusted to use the correct - libraries depending on SHARED/STATIC settings. - - (ADB - 2019/06/12, HDFFV-10805) - - - Add options to enable or disable building tools and tests - - Configure options --enable-tests and --enable-tools were added for - autotools configure. These options are enabled by default, and can be - disabled with either --disable-tests (or tools) or --enable-tests=no - (or --enable-tools=no). Build time is reduced ~20% when tools are - disabled, 35% when tests are disabled, 45% when both are disabled. - Reenabling them after the initial build requires running configure - again with the option(s) enabled. - - (LRK - 2019/06/12, HDFFV-9976) - - - Change tools test that test the error stack - - There are some use cases which can cause the error stack of tools to be - different then the expected output. These tests now use grepTest.cmake, - this was changed to allow the error file to be searched for an expected string. - - (ADB - 2019/04/15, HDFFV-10741) - - - Keep stderr and stdout separate in tests - - Changed test handling of output capture. Tests now keep the stderr - output separate from the stdout output. It is up to the test to decide - which output to check against a reference. Also added the option - to grep for a string in either output. - - (ADB - 2018/12/12, HDFFV-10632) - - - Add toolchain and cross-compile support - - Added info on using a toolchain file to INSTALL_CMAKE.txt. A - toolchain file is also used in cross-compiling, which requires - CMAKE_CROSSCOMPILING_EMULATOR to be set. To help with cross-compiling - the fortran configure process, the HDF5UseFortran.cmake file macros - were improved. Fixed a Fortran configure file issue that incorrectly - used #cmakedefine instead of #define. - - (ADB - 2018/10/04, HDFFV-10594) - - - Add warning flags for Intel compilers - - Identified Intel compiler specific warnings flags that should be used - instead of GNU flags. - - (ADB - 2018/10/04, TRILABS-21) - - - Add default rpath to targets - - Default rpaths should be set in shared executables and - libraries to allow the use of loading dependent libraries - without requiring LD_LIBRARY_PATH to be set. The default - path should be relative using @rpath on osx and $ORIGIN - on linux. Windows is not affected. - - (ADB - 2018/09/26, HDFFV-10594) - - - Add missing USE_110_API_DEFAULT option. - - Option USE_110_API_DEFAULT sets the default version of - versioned APIs. The bin/makevers perl script did not set - the maxidx variable correctly when the 1.10 branch was - created. This caused the versioning process to always use - the latest version of any API. - - (ADB - 2018/08/17, HDFFV-10552) - - - Added configuration checks for the following MPI functions: - - MPI_Mprobe - Used for the Parallel Compression feature - MPI_Imrecv - Used for the Parallel Compression feature - - MPI_Get_elements_x - Used for the "big Parallel I/O" feature - MPI_Type_size_x - Used for the "big Parallel I/O" feature - - (JTH - 2018/08/02, HDFFV-10512) - - - Added section to the libhdf5.settings file to indicate - the status of the Parallel Compression and "big Parallel I/O" - features. - - (JTH - 2018/08/02, HDFFV-10512) - - - Add option to execute swmr shell scripts from CMake. - - Option TEST_SHELL_SCRIPTS redirects processing into a - separate ShellTests.cmake file for UNIX types. The tests - execute the shell scripts if a SH program is found. - - (ADB - 2018/07/16) - - - Add file locking configure and CMake options - - HDF5 1.10.0 introduced a file locking scheme, primarily to help - enforce SWMR setup. Formerly, the only user-level control of the scheme - was via the HDF5_USE_FILE_LOCKING environment variable. - - This change introduces configure-time options that control whether - or not file locking will be used and whether or not the library - ignores errors when locking has been disabled on the file system - (useful on some HPC Lustre installations). - - In both the Autotools and CMake, the settings have the effect of changing - the default property list settings (see the H5Pset/get_file_locking() - entry, below). - - The yes/no/best-effort file locking configure setting has also been - added to the libhdf5.settings file. - - Autotools: - - An --enable-file-locking=(yes|no|best-effort) option has been added. - - yes: Use file locking. - no: Do not use file locking. - best-effort: Use file locking and ignore "disabled" errors. - - CMake: - - Two self-explanatory options have been added: - - HDF5_USE_FILE_LOCKING - HDF5_IGNORE_DISABLED_FILE_LOCKS - - Setting both of these to ON is the equivalent to the Autotools' - best-effort setting. + In addition NDEBUG is no longer forced defined and relies on the CMake + process. - NOTE: - The precedence order of the various file locking control mechanisms is: - - 1) HDF5_USE_FILE_LOCKING environment variable (highest) - - 2) H5Pset_file_locking() - - 3) configure/CMake options (which set the property list defaults) - - 4) library defaults (currently best-effort) - - (DER - 2020/07/30, HDFFV-11092) + (ADB - 2019/10/07, HDFFV-100901, HDFFV-10637, TRILAB-97) Library: -------- - Add 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. - This can be useful when needing to iterate over a selection - multiple times without having to repeatedly create/destroy - a selection iterator for that dataspace selection. + This function resets a dataspace selection iterator back to an + initial state so that it may be used for iteration once more. + This can be useful when needing to iterate over a selection + multiple times without having to repeatedly create/destroy + a selection iterator for that dataspace selection. - (JTH - 2020/09/18) + (JTH - 2020/09/18) - Remove HDFS VFD stubs - The original implementation of the HDFS VFD included non-functional - versions of the following public API calls when the HDFS VFD is - not built as a part of the HDF5 library: + The original implementation of the HDFS VFD included non-functional + versions of the following public API calls when the HDFS VFD is + not built as a part of the HDF5 library: - * H5FD_hdfs_init() - * H5Pget_fapl_hdfs() - * H5Pset_fapl_hdfs() + * H5FD_hdfs_init() + * H5Pget_fapl_hdfs() + * H5Pset_fapl_hdfs() - They will remain present in HDF5 1.10 and HDF5 1.12 releases - for binary compatibility purposes but have been removed as of 1.14.0. + They will remain present in HDF5 1.10 and HDF5 1.12 releases + for binary compatibility purposes but have been removed as of 1.14.0. - Note that this has nothing to do with the real HDFS VFD API calls - that are fully functional when the HDFS VFD is configured and built. + Note that this has nothing to do with the real HDFS VFD API calls + that are fully functional when the HDFS VFD is configured and built. - We simply changed: + We simply changed: - #ifdef LIBHDFS - <real API call> - #else - <useless stub> - #endif + #ifdef LIBHDFS + <real API call> + #else + <useless stub> + #endif - to: + to: - #ifdef LIBHDFS - <real API call> - #endif + #ifdef LIBHDFS + <real API call> + #endif - Which is how the other optional VFDs are handled. + Which is how the other optional VFDs are handled. - (DER - 2020/08/27) + (DER - 2020/08/27) - Add Mirror VFD - Use TCP/IP sockets to perform write-only (W/O) file I/O on a remote - machine. Must be used in conjunction with the Splitter VFD. + Use TCP/IP sockets to perform write-only (W/O) file I/O on a remote + machine. Must be used in conjunction with the Splitter VFD. - (JOS - 2020/03/13, TBD) + (JOS - 2020/03/13, TBD) - Add Splitter VFD - Maintain separate R/W and W/O channels for "concurrent" file writes - to two files using a single HDF5 file handle. + Maintain separate R/W and W/O channels for "concurrent" file writes + to two files using a single HDF5 file handle. - (JOS - 2020/03/13, TBD) + (JOS - 2020/03/13, TBD) - Refactored public exposure of haddr_t type in favor of "object tokens" - To better accommodate HDF5 VOL connectors where "object addresses in a file" - may not make much sense, the following changes were made to the library: - - * Introduced new H5O_token_t "object token" type, which represents a - unique and permanent identifier for referencing an HDF5 object within - a container; these "object tokens" are meant to replace object addresses. - Along with the new type, a new H5Oopen_by_token API call was introduced - to open an object by a token, similar to how object addresses were - previously used with H5Oopen_by_addr. - - * Introduced new H5Lget_info2, H5Lget_info_by_idx2, H5Literate2, H5Literate_by_name2, - H5Lvisit2 and H5Lvisit_by_name2 API calls, along with their associated H5L_info2_t - struct and H5L_iterate2_t callback function, which work with the newly-introduced - object tokens, instead of object addresses. The original functions have been - renamed to version 1 functions and are deprecated in favor of the new version 2 - functions. The H5L_info_t and H5L_iterate_t types have been renamed to version 1 - types and are now deprecated in favor of their version 2 counterparts. For each of - the functions and types, compatibility macros take place of the original symbols. - - * Introduced new H5Oget_info3, H5Oget_info_by_name3, H5Oget_info_by_idx3, - H5Ovisit3 and H5Ovisit_by_name3 API calls, along with their associated H5O_info2_t - struct and H5O_iterate2_t callback function, which work with the newly-introduced - object tokens, instead of object addresses. The version 2 functions are now - deprecated in favor of the version 3 functions. The H5O_info_t and H5O_iterate_t - types have been renamed to version 1 types and are now deprecated in favor of their - version 2 counterparts. For each, compatibility macros take place of the original - symbols. - - * Introduced new H5Oget_native_info, H5Oget_native_info_by_name and - H5Oget_native_info_by_idx API calls, along with their associated H5O_native_info_t - struct, which are used to retrieve the native HDF5 file format-specific information - about an object. This information (such as object header info and B-tree/heap info) - has been removed from the new H5O_info2_t struct so that the more generic - H5Oget_info(_by_name/_by_idx)3 routines will not try to retrieve it for non-native - VOL connectors. - - * Added new H5Otoken_cmp, H5Otoken_to_str and H5Otoken_from_str routines to compare - two object tokens, convert an object token into a nicely-readable string format and - to convert an object token string back into a real object token, respectively. - - (DER, QAK, JTH - 2020/01/16) + To better accommodate HDF5 VOL connectors where "object addresses in a file" + may not make much sense, the following changes were made to the library: + + * Introduced new H5O_token_t "object token" type, which represents a + unique and permanent identifier for referencing an HDF5 object within + a container; these "object tokens" are meant to replace object addresses. + Along with the new type, a new H5Oopen_by_token API call was introduced + to open an object by a token, similar to how object addresses were + previously used with H5Oopen_by_addr. + + * Introduced new H5Lget_info2, H5Lget_info_by_idx2, H5Literate2, H5Literate_by_name2, + H5Lvisit2 and H5Lvisit_by_name2 API calls, along with their associated H5L_info2_t + struct and H5L_iterate2_t callback function, which work with the newly-introduced + object tokens, instead of object addresses. The original functions have been + renamed to version 1 functions and are deprecated in favor of the new version 2 + functions. The H5L_info_t and H5L_iterate_t types have been renamed to version 1 + types and are now deprecated in favor of their version 2 counterparts. For each of + the functions and types, compatibility macros take place of the original symbols. + + * Introduced new H5Oget_info3, H5Oget_info_by_name3, H5Oget_info_by_idx3, + H5Ovisit3 and H5Ovisit_by_name3 API calls, along with their associated H5O_info2_t + struct and H5O_iterate2_t callback function, which work with the newly-introduced + object tokens, instead of object addresses. The version 2 functions are now + deprecated in favor of the version 3 functions. The H5O_info_t and H5O_iterate_t + types have been renamed to version 1 types and are now deprecated in favor of their + version 2 counterparts. For each, compatibility macros take place of the original + symbols. + + * Introduced new H5Oget_native_info, H5Oget_native_info_by_name and + H5Oget_native_info_by_idx API calls, along with their associated H5O_native_info_t + struct, which are used to retrieve the native HDF5 file format-specific information + about an object. This information (such as object header info and B-tree/heap info) + has been removed from the new H5O_info2_t struct so that the more generic + H5Oget_info(_by_name/_by_idx)3 routines will not try to retrieve it for non-native + VOL connectors. + + * Added new H5Otoken_cmp, H5Otoken_to_str and H5Otoken_from_str routines to compare + two object tokens, convert an object token into a nicely-readable string format and + to convert an object token string back into a real object token, respectively. + + (DER, QAK, JTH - 2020/01/16) - Add new public function H5Sselect_adjust. - This function shifts a dataspace selection by a specified logical offset - within the dataspace extent. This can be useful for VOL developers to - implement chunked datasets. + This function shifts a dataspace selection by a specified logical offset + within the dataspace extent. This can be useful for VOL developers to + implement chunked datasets. - (NAF - 2019/11/18) + (NAF - 2019/11/18) - Add new public function H5Sselect_project_intersection. - This function computes the intersection between two dataspace selections - and projects that intersection into a third selection. This can be useful - for VOL developers to implement chunked or virtual datasets. + This function computes the intersection between two dataspace selections + and projects that intersection into a third selection. This can be useful + for VOL developers to implement chunked or virtual datasets. - (NAF - 2019/11/13, ID-148) + (NAF - 2019/11/13, ID-148) - Add new public function H5VLget_file_type. - 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. - - (NAF - 2019/11/08, ID-127) - - - Add S3 and HDFS VFDs to HDF5 maintenance - - Fix windows requirements and java tests. Windows requires CMake 3.13. - Install openssl library (with dev files); - from "Shining Light Productions". msi package preferred. - - PATH should have been updated with the installation dir. - set ENV variable OPENSSL_ROOT_DIR to the installation dir. - set ENV variable OPENSSL_CONF to the cfg file, likely %OPENSSL_ROOT_DIR%\bin\openssl.cfg - Install libcurl library (with dev files); - download the latest released version using git: https://github.com/curl/curl.git - - Open a Visual Studio Command prompt - change to the libcurl root folder - run the "buildconf.bat" batch file - change to the winbuild directory - nmake /f Makefile.vc mode=dll MACHINE=x64 - copy libcurl-vc-x64-release-dll-ipv6-sspi-winssl dir to C:\curl (installation dir) - set ENV variable CURL_ROOT to C:\curl (installation dir) - update PATH ENV variable to %CURL_ROOT%\bin (installation bin dir). - the aws credentials file should be in %USERPROFILE%\.aws folder - set the ENV variable "HDF5_ROS3_TEST_BUCKET_URL=https://s3.us-east-2.amazonaws.com/hdf5ros3" - - (ADB - 2019/09/12, HDFFV-10854) - - - Added new chunk query functions - - The following public functions were added to discover information about - the chunks in an HDF5 file. - herr_t H5Dget_num_chunks(dset_id, fspace_id, *nchunks) - herr_t H5Dget_chunk_info_by_coord(dset_id, *coord, *filter_mask, *addr, *size) - herr_t H5Dget_chunk_info(dset_id, fspace_id, index, *coord, *filter_mask, *addr, *size) - - (BMR - 2019/06/11, HDFFV-10677) - - - Improved the performance of virtual dataset I/O - - Refactored the internal dataspace routines used by the virtual dataset - code to improve performance, especially when one of the selections - involved is very long and non-contiguous. - - (NAF - 2019/05/31, HDFFV-10693) - - - Added the ability to open files with UTF-8 file names on Windows. - - The POSIX open(2) API call on Windows is limited to ASCII - file names. The library has been updated to convert incoming file - names to UTF-16 (via MultiByteToWideChar(CP_UTF8, ...) and use - _wopen() instead. - - (DER - 2019/03/15, HDFFV-2714, HDFFV-3914, HDFFV-3895, HDFFV-8237, HDFFV-10413, HDFFV-10691) - - - Add new API H5M for map objects. Currently not supported by native - library, can be supported by VOL connectors. - - (NAF - 2019/03/01) - - - Add new H5R_ref_t type for object, dataset region and _attribute_ - references. This new type will deprecate the current hobj_ref_t - and hdset_reg_ref_t types for references. Added H5T_REF datatype - to read and write new reference types. As opposed to previous - reference types, reference creation no longer modifies existing - files. New reference types also now support references to external - files. - - (JS - 2019/10/08) - - - Remove H5I_REFERENCE from the library + 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 ID class was never used by the library and has been removed. + (NAF - 2019/11/08, ID-127) - (DER - 2018/12/08, HDFFV-10252) - - - Allow pre-generated H5Tinit.c and H5make_libsettings.c to be used. - - Rather than always running H5detect and generating H5Tinit.c and - H5make_libsettings.c, supply a location for those files. - - (ADB - 2018/09/18, HDFFV-10332) - - - Fix shutdown failure when using H5VLregister_connector_by_name/value - - When using H5VLregister_connector_by_name/value to dynamically load a - VOL connector plugin, the library can experience segmentation faults - when the library is closed. This is due to the library unloading - the plugin interface before the virtual object layer. Then, when the - VOL shutdown occurs, it will attempt to close the VOL connector, - however this will fail since the plugin will already have been unloaded. - - (DER - 2020/03/18, HDFFV-11057) - - - Add BEST_EFFORT value to HDF5_USE_FILE_LOCKING environment variable - - This change adds a BEST_EFFORT to the TRUE/FALSE, 1/0 settings that - were previously accepted. This option turns on file locking but - ignores locking errors when the library detects that file locking - has been disabled on a file system (useful on some HPC Lustre - installations). - - The capitalization of BEST_EFFORT is mandatory. - - See the configure option discussion for HDFFV-11092 (above) for more - information on the file locking feature and how it's controlled. - - (DER - 2020/07/30, HDFFV-11092) - - - - Add H5Pset/get_file_locking() API calls - - This change adds new API calls which can be used to set or get the - file locking parameters. The single API call sets both the "use file - locking" flag and the "ignore disabled file locking" flag. - - See the configure option discussion for HDFFV-11092 (above) for more - information on the file locking feature and how it's controlled. - - (DER - 2020/07/30, HDFFV-11092) Parallel Library: ----------------- - - Changed the default behavior in parallel when reading the same dataset in its entirely - (i.e. H5S_ALL dataset selection) which is being read by all the processes collectively. - The dataset mush be contiguous, less than 2GB, and of an atomic datatype. - The new behavior is the HDF5 library will use an MPI_Bcast to pass the data read from - the disk by the root process to the remain processes in the MPI communicator associated - with the HDF5 file. + - - (MSB - 2019/01/02, HDFFV-10652) Fortran Library: ---------------- - - Added new Fortran derived type, c_h5o_info_t, which is interoperable with - C's h5o_info_t. This is needed for callback functions which - pass C's h5o_info_t data type definition. - - (MSB, 2019/01/08, HDFFV-10443) - - - Added new Fortran API, H5gmtime, which converts (C) 'time_t' structure - to Fortran DATE AND TIME storage format. - - (MSB, 2019/01/08, HDFFV-10443) - - - Added new Fortran 'fields' optional parameter to: h5ovisit_f, h5oget_info_by_name_f, - h5oget_info, h5oget_info_by_idx and h5ovisit_by_name_f. - - (MSB, 2019/01/08, HDFFV-10443) - - Add wrappers for H5Pset/get_file_locking() API calls - h5pget_file_locking_f() - h5pset_file_locking_f() + h5pget_file_locking_f() + h5pset_file_locking_f() - See the configure option discussion for HDFFV-11092 (above) for more - information on the file locking feature and how it's controlled. + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. - (DER - 2020/07/30, HDFFV-11092) + (DER - 2020/07/30, HDFFV-11092) C++ Library: ------------ - - Added new wrappers for H5Pset/get_create_intermediate_group() - LinkCreatPropList::getCreateIntermediateGroup() - LinkCreatPropList::setCreateIntermediateGroup() - - (BMR - 2019/04/22, HDFFV-10622) - - - Added new wrapper for H5Ovisit2() - H5Object::visit() - - (BMR - 2019/02/14, HDFFV-10532) - - Add wrappers for H5Pset/get_file_locking() API calls - FileAccPropList::setFileLocking() - FileAccPropList::getFileLocking() + FileAccPropList::setFileLocking() + FileAccPropList::getFileLocking() - See the configure option discussion for HDFFV-11092 (above) for more - information on the file locking feature and how it's controlled. + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. - (DER - 2020/07/30, HDFFV-11092) + (DER - 2020/07/30, HDFFV-11092) Java Library: ---------------- - - Added ability to test java library with VOLs. - - Created new CMake script that combines the java and vol test scripts. - - (ADB - 2020/02/03, HDFFV-10996) + - Added new H5S functions. - - Tests fail for non-English locale. - - 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 - error. Changed the regex for the Time substitution. - - (ADB - 2020/01/09, HDFFV-10995) + H5Sselect_copy, H5Sselect_shape_same, H5Sselect_adjust, + H5Sselect_intersect_block, H5Sselect_project_intersection, + H5Scombine_hyperslab, H5Smodify_select, H5Scombine_select + wrapper functions added. - - Fix a failure in JUnit-TestH5P on 32-bit architectures + (ADB - 2020/10/27, HDFFV-10868) - (JTH - 2019/04/30) - - - Duplicate the data read/write functions of Datasets for Attributes. + - Add wrappers for H5Pset/get_file_locking() API calls - Region references could not be displayed for attributes as they could - for datasets. Datasets had overloaded read and write functions for different - datatypes that were not available for attributes. After adding similar - functions, attribute region references work normally. + H5Pset_file_locking() + H5Pget_use_file_locking() + H5Pget_ignore_disabled_file_locking() - (ADB - 2018/12/12, HDFVIEW-4) + Unlike the C++ and Fortran wrappers, there are separate getters for the + two file locking settings, each of which returns a boolean value. - - Removed H5I_REFERENCE from the Java wrappers + See the configure option discussion for HDFFV-11092 (above) for more + information on the file locking feature and how it's controlled. - This ID class was never used by the library and has been removed - from the Java wrappers. + (DER - 2020/07/30, HDFFV-11092) - (DER - 2018/12/08, HDFFV-10252) + - Added ability to test java library with VOLs. - - Add wrappers for H5Pset/get_file_locking() API calls + Created new CMake script that combines the java and vol test scripts. - H5Pset_file_locking() - H5Pget_use_file_locking() - H5Pget_ignore_disabled_file_locking() + (ADB - 2020/02/03, HDFFV-10996) - Unlike the C++ and Fortran wrappers, there are separate getters for the - two file locking settings, each of which returns a boolean value. + - Tests fail for non-English locale. - See the configure option discussion for HDFFV-11092 (above) for more - information on the file locking feature and how it's controlled. + 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 + error. Changed the regex for the Time substitution. - (DER - 2020/07/30, HDFFV-11092) + (ADB - 2020/01/09, HDFFV-10995) Tools: ------ - h5repack added options to control how external links are handled. - Currently h5repack preserves external links and cannot copy and merge - data from the external files. Two options, merge and prune, were added to - control how to merge data from an external link into the resulting file. - --merge Follow external soft link recursively and merge data. - --prune Do not follow external soft links and remove link. - --merge --prune Follow external link, merge data and remove dangling link. + Currently h5repack preserves external links and cannot copy and merge + data from the external files. Two options, merge and prune, were added to + control how to merge data from an external link into the resulting file. + --merge Follow external soft link recursively and merge data. + --prune Do not follow external soft links and remove link. + --merge --prune Follow external link, merge data and remove dangling link. - (ADB - 2020/08/05, HDFFV-9984) + (ADB - 2020/08/05, HDFFV-9984) - h5repack was fixed to repack the reference attributes properly. - The code line that checks if the update of reference inside a compound - datatype is misplaced outside the code block loop that carries out the - check. In consequence, the next attribute that is not the reference - type was repacked again as the reference type and caused the failure of - repacking. The fix is to move the corresponding code line to the correct - code block. + The code line that checks if the update of reference inside a compound + datatype is misplaced outside the code block loop that carries out the + check. In consequence, the next attribute that is not the reference + type was repacked again as the reference type and caused the failure of + repacking. The fix is to move the corresponding code line to the correct + code block. - (KY -2020/02/07, HDFFV-11014) + (KY -2020/02/07, HDFFV-11014) - h5diff was updated to use the new reference APIs. - h5diff uses the new reference APIs to compare references. - Attribute references can also be compared. + h5diff uses the new reference APIs to compare references. + Attribute references can also be compared. - (ADB - 2019/12/19, HDFFV-10980) + (ADB - 2019/12/19, HDFFV-10980) - h5dump and h5ls were updated to use the new reference APIs. - The tools library now use the new reference APIs to inspect a - file. Also the DDL spec was updated to reflect the format - changes produced with the new APIs. The export API and support - functions in the JNI were updated to match. - - (ADB - 2019/12/06, HDFFV-10876 and HDFFV-10877) - - - h5repack was fixed to repack datasets with external storage - to other types of storage. - - New test added to repack files and verify the correct data using h5diff. - - (JS - 2019/09/25, HDFFV-10408) - (ADB - 2019/10/02, HDFFV-10918) + The tools library now use the new reference APIs to inspect a + file. Also the DDL spec was updated to reflect the format + changes produced with the new APIs. The export API and support + functions in the JNI were updated to match. - - h5dump was fixed for 128-bit floats, but was missing a test. - - New test greps for the first 15 numbers of the 128-bit value. - - (ADB - 2019/06/23, HDFFV-9407) + (ADB - 2019/12/06, HDFFV-10876 and HDFFV-10877) High-Level APIs: @@ -840,431 +584,130 @@ Support for new platforms, languages and compilers. ======================================= - -Bug Fixes since HDF5-1.10.3 release +Bug Fixes since HDF5-1.12.0 release ================================== Library ------- - Creation of dataset with optional filter - When the combination of type, space, etc doesn't work for filter - and the filter is optional, it was supposed to be skipped but it was - not skipped and the creation failed. + When the combination of type, space, etc doesn't work for filter + 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 situation. - (BMR - 2020/8/13, HDFFV-10933) + (BMR - 2020/08/13, HDFFV-10933) - Explicitly declared dlopen to use RTLD_LOCAL - dlopen documentation states that if neither RTLD_GLOBAL nor - RTLD_LOCAL are specified, then the default behavior is unspecified. - The default on linux is usually RTLD_LOCAL while macos will default - to RTLD_GLOBAL. - - (ADB - 2020/08/12, HDFFV-11127) - - - Fixed issues CVE-2018-13870 and CVE-2018-13869 - - When a buffer overflow occurred because a name length was corrupted - and became very large, h5dump crashed on memory access violation. - - A check for reading pass the end of the buffer was added to multiple - locations to prevent the crashes and h5dump now simply fails with an - error message when this error condition occurs. - - (BMR - 2020/07/22, HDFFV-11120 and HDFFV-11121) - - - Fixed the segmentation fault when reading attributes with multiple threads - - It was reported that the reading of attributes with variable length string - datatype will crash with segmentation fault particularly when the number of - threads is high (>16 threads). The problem was due to the file pointer that - was set in the variable length string datatype for the attribute. That file - pointer was already closed when the attribute was accessed. - - The problem was fixed by setting the file pointer to the current opened file pointer - when the attribute was accessed. Similar patch up was done before when reading - dataset with variable length string datatype. - - (VC - 2020/07/13, HDFFV-11080) - - - Fixed CVE-2020-10810 - - The tool h5clear produced a segfault during an error recovery in - the superblock decoding. An internal pointer was reset to prevent - further accessing when it is not assigned with a value. - - (BMR - 2020/6/29, HDFFV-11053) - - - Fixed CVE-2018-17435 - - The tool h52gif produced a segfault when the size of an attribute - message was corrupted and caused a buffer overflow. - - The problem was fixed by verifying the attribute message's size - against the buffer size before accessing the buffer. h52gif was - also fixed to display the failure instead of silently exiting - after the segfault was eliminated. - - (BMR - 2020/6/19, HDFFV-10591) - - - Improved peformance when creating a large number of small datasets by - retrieving default property values from the API context instead of doing - skip list searches. - - (CJH - 2019/12/10, HDFFV-10658) - - - Fixed user-created data access properties not existing in the property list - returned by H5Dget_access_plist. Thanks to Steven Varga for submitting a - reproducer and a patch. - - (CJH - 2019/12/9, HDFFV-10934) - - - Fixed an assertion failure in the parallel library when collectively - filling chunks. As it is required that chunks be written in - monotonically non-decreasing order of offset in the file, this assertion - was being triggered when the list of chunk file space allocations being - passed to the collective chunk filling routine was not sorted according - to this particular requirement. - - The addition of a sort of the out of order chunks trades a bit of - performance for the elimination of this assertion and of any complaints - from MPI implementations about the file offsets used being out of order. - - (JTH - 2019/10/07, HDFFV-10792) - - - Fixed the iteration error in test_versionbounds() in test/dtypes.c + dlopen documentation states that if neither RTLD_GLOBAL nor + RTLD_LOCAL are specified, then the default behavior is unspecified. + The default on linux is usually RTLD_LOCAL while macos will default + to RTLD_GLOBAL. - The test was supposed to loop through all valid combinations of - low and high bounds in the array versions[], but they were set to - H5F_LIBVER_EARLIEST always without changing. + (ADB - 2020/08/12, HDFFV-11127) - The problem was fixed by indexing low and high into the array versions[]. - - (VC - 2019/09/30) - - - Fixed the slowness of regular hyperslab selection in a chunked dataset - - It was reported that the selection of every 10th element from a 20G - chunked dataset was extremely slow and sometimes could hang the system. - The problem was due to the iteration and the building of the span tree - for all the selected elements in file space. - - As the selected elements are going to a 1-d contiguous single block - memory space, the problem was fixed by building regular hyperslab selections - in memory space for the selected elements in file space. - - (VC - 2019/09/26, HDFFV-10585) - - - Fixed a bug caused by bad tag value when condensing object header - messages - - There was an assertion failure when moving meessages from running a - user test program with library release hdf5.1.10.4. It was because - the tag value (object header's address) was not set up when entering - the library routine H5O__chunk_update_idx(), which will eventually - verifies the metadata tag value when protecting the object header. - - The problem was fixed by replacing FUNC_ENTER_PACKAGE in H5O__chunk_update_idx() - with FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) to set up the metadata tag. - - (VC - 2019/08/23, HDFFV-10873) - - - Fixed the test failure from test_metadata_read_retry_info() in - test/swmr.c - - The test failure is due to the incorrect number of bins returned for - retry info (info.nbins). The # of bins expected for 101 read attempts - is 3 instead of 2. The routine H5F_set_retries() in src/H5Fint.c - calculates the # of bins by first obtaining the log10 value for - (read attempts - 1). For PGI/19, the log10 value for 100 read attempts - is 1.9999999999999998 instead of 2.00000. When casting the log10 value - to unsigned later on, the decimal part is chopped off causing the test - failure. - - This was fixed by obtaining the rounded integer value (HDceil) for the - log10 value of read attempts first before casting the result to unsigned. - - (VC - 2019/8/14, HDFFV-10813) - - - Fixed an issue where creating a file with non-default file space info - together with library high bound setting to H5F_LIBVER_V18. - - When setting non-default file space info in fcpl via - H5Pset_file_space_strategy() and then creating a file with - both high and low library bounds set to - H5F_LIBVER_V18 in fapl, the library succeeds in creating the file. - File creation should fail because the feature of setting non-default - file space info does not exist in library release 1.8 or earlier. - - This was fixed by setting and checking the proper version in the - file space info message based on the library low and high bounds - when creating and opening the HDF5 file. - - (VC - 2019/6/25, HDFFV-10808) - - - When iterating over an old-style group (i.e., when not using the latest - file format) of size 0, a NULL pointer representing the empty links - table would be sent to qsort(3) for sorting, which is undefined behavior. - - Iterating over an empty group is explicitly tested in the links test. - This has not caused any failures to date and was flagged by gcc's - -fsanitize=undefined. - - The library no longer attempts to sort an empty array. - - (DER - 2019/06/18, HDFFV-10829) - - - Fixed an issue where copying a version 1.8 dataset between files using - H5Ocopy fails due to an incompatible fill version - - When using the HDF5 1.10.x H5Ocopy() API call to copy a version 1.8 - dataset to a file created with both high and low library bounds set to - H5F_LIBVER_V18, the H5Ocopy() call will fail with the error stack indicating - that the fill value version is out of bounds. - - This was fixed by changing the fill value message version to H5O_FILL_VERSION_3 - (from H5O_FILL_VERSION_2) for H5F_LIBVER_V18. - - (VC - 2019/6/14, HDFFV-10800) - - - Some oversights in the index iterating area of the library caused - a callback function to continue iterating even though it's supposed - to stop. - - Added the returned value check to the for loop's conditions in - H5EA_iterate(), H5FA_iterate(), and H5D__none_idx_iterate(). The - iteration now stops when it should. - - (BMR - 2019/06/11, HDFFV-10661) - - - Fixed a bug that would cause an error or cause fill values to be - incorrectly read from a chunked dataset using the "single chunk" index if - the data was held in cache and there was no data on disk. - - (NAF - 2019/03/06) - - - Fixed a bug that could cause an error or cause fill values to be - incorrectly read from a dataset that was written to using H5Dwrite_chunk - if the dataset was not closed after writing. - - (NAF - 2019/03/06, HDFFV-10716) - - - Fixed memory leak in scale offset filter - - In a special case where the MinBits is the same as the number of bits in - the datatype's precision, the filter's data buffer was not freed, causing - the memory usage to grow. In general the buffer was freed correctly. The - Minbits are the minimal number of bits to store the data values. Please - see the reference manual for H5Pset_scaleoffset for the detail. - - (RL - 2019/3/4, HDFFV-10705) - - - Fix hangs with collective metadata reads during chunked dataset I/O - - In the parallel library, it was discovered that when a particular - sequence of operations following a pattern of: - - "write to chunked dataset" -> "flush file" -> "read from dataset" - - occurred with collective metadata reads enabled, hangs could be - observed due to certain MPI ranks not participating in the collective - metadata reads. - - To fix the issue, collective metadata reads are now disabled during - chunked dataset raw data I/O. - - (JTH - 2019/02/11, HDFFV-10563, HDFFV-10688) - - - Performance issue when closing an object - - The slow down is due to the search of the "tag_list" to find - out the "corked" status of an object and "uncork" it if so. - - Improve porformance by skipping the search of the "tag_list" - if there are no "corked" objects when closing an object. - - (VC - 2019/2/6) - - - Fixed a potential invalid memory access and failure that could occur when - decoding an unknown object header message (from a future version of the - library). - - (NAF - 2019/01/07) - - - Deleting attributes in dense storage - - The library aborts with "infinite loop closing library" after - attributes in dense storage are created and then deleted. - - When deleting the attribute nodes from the name index v2 B-tree, - if an attribute is found in the intermediate B-tree nodes, - which may be merged/redistributed in the process, we need to - free the dynamically allocated spaces for the intermediate - decoded attribute. - - (VC - 2018/12/26, HDFFV-10659) - - - Allow H5detect and H5make_libsettings to take a file as an argument. - - Rather than only writing to stdout, add a command argument to name - the file that H5detect and H5make_libsettings will use for output. - Without an argument, stdout is still used, so backwards compatibility - is maintained. + - H5Sset_extent_none() sets the dataspace class to H5S_NO_CLASS which + causes asserts/errors when passed to other dataspace API calls. - (ADB - 2018/09/05, HDFFV-9059) + H5S_NO_CLASS is an internal class value that should not have been + exposed via a public API call. - - A bug was discovered in the parallel library where an application - would hang if a collective read/write of a chunked dataset occurred - when collective metadata reads were enabled and some of the ranks - had no selection in the dataset's dataspace. The ranks which had no - selection in the dataset's dataspace called H5D__chunk_addrmap() to - retrieve the lowest chunk address in the dataset. This is because we - require reads/writes to be performed in strictly non-decreasing order - of chunk address in the file. + In debug builds of the library, this can cause asserts to trip. In + non-debug builds, it will produce normal library errors. - When the chunk index used was a version 1 or 2 B-tree, these - non-participating ranks would issue a collective MPI_Bcast() call - that the participating ranks would not issue, causing the hang. Since - the non-participating ranks are not actually reading/writing anything, - the H5D__chunk_addrmap() call can be safely removed and the address used - for the read/write can be set to an arbitrary number (0 was chosen). + The new library behavior is for H5Sset_extent_none() to convert + the dataspace into one of type H5S_NULL, which is better handled + by the library and easier for developers to reason about. - (JTH - 2018/08/25, HDFFV-10501) + (DER - 2020/07/27, HDFFV-11027) - - fcntl(2)-based file locking incorrectly passed the lock argument struct - instead of a pointer to the struct, causing errors on systems where - flock(2) is not available. + - Fixed issues CVE-2018-13870 and CVE-2018-13869 - File locking is used when files are opened to enforce SWMR semantics. A - lock operation takes place on all file opens unless the - HDF5_USE_FILE_LOCKING environment variable is set to the string "FALSE". - flock(2) is preferentially used, with fcntl(2) locks as a backup if - flock(2) is unavailable on a system (if neither is available, the lock - operation fails). On these systems, the file lock will often fail, which - causes HDF5 to not open the file and report an error. + When a buffer overflow occurred because a name length was corrupted + and became very large, h5dump crashed on memory access violation. - This bug only affects POSIX systems. Win32 builds on Windows use a no-op - locking call which always succeeds. Systems which exhibit this bug will - have H5_HAVE_FCNTL defined but not H5_HAVE_FLOCK in the configure output. + A check for reading pass the end of the buffer was added to multiple + locations to prevent the crashes and h5dump now simply fails with an + error message when this error condition occurs. - This bug affects HDF5 1.10.0 through 1.10.5. + (BMR - 2020/07/22, HDFFV-11120 and HDFFV-11121) - fcntl(2)-based file locking now correctly passes the struct pointer. + - Fixed the segmentation fault when reading attributes with multiple threads - (DER - 2019/08/27, HDFFV-10892) + It was reported that the reading of attributes with variable length string + datatype will crash with segmentation fault particularly when the number of + threads is high (>16 threads). The problem was due to the file pointer that + was set in the variable length string datatype for the attribute. That file + pointer was already closed when the attribute was accessed. - - Torn pread/pwrite I/O would result in read and write corruption. + The problem was fixed by setting the file pointer to the current opened file pointer + when the attribute was accessed. Similar patch up was done before when reading + dataset with variable length string datatype. - In the sec2, log, and core (with backing store) virtual file drivers - (VFDs), the read and write calls incorrectly reset the offset parameter - on torn pread and pwrite operations (i.e., I/O operations which fail to - be written atomically by the OS). For this bug to occur, pread/pwrite - have to be configured (this is the default if they are present on the - system) and the pread/pwrite operation has to fail to transfer all - the bytes, resulting in a multiple pread/pwrite calls. + (VC - 2020/07/13, HDFFV-11080) - This feature was initially enabled in HDF5 1.10.5 so the bug is - limited to that version. + - Fixed CVE-2020-10810 - (DER - 2019/12/09, HDFFV-10945) + The tool h5clear produced a segfault during an error recovery in + the superblock decoding. An internal pointer was reset to prevent + further accessing when it is not assigned with a value. - - H5Sset_extent_none() sets the dataspace class to H5S_NO_CLASS which - causes asserts/errors when passed to other dataspace API calls. + (BMR - 2020/06/29, HDFFV-11053) - H5S_NO_CLASS is an internal class value that should not have been - exposed via a public API call. + - Fixed CVE-2018-17435 - In debug builds of the library, this can cause asserts to trip. In - non-debug builds, it will produce normal library errors. + The tool h52gif produced a segfault when the size of an attribute + message was corrupted and caused a buffer overflow. - The new library behavior is for H5Sset_extent_none() to convert - the dataspace into one of type H5S_NULL, which is better handled - by the library and easier for developers to reason about. + The problem was fixed by verifying the attribute message's size + against the buffer size before accessing the buffer. h52gif was + also fixed to display the failure instead of silently exiting + after the segfault was eliminated. - (DER - 2020/07/27, HDFFV-11027) + (BMR - 2020/06/19, HDFFV-10591) Java Library: ---------------- - - JNI native library dependencies - - The build for the hdf5_java native library used the wrong - hdf5 target library for CMake builds. Correcting the hdf5_java - library to build with the shared hdf5 library required testing - paths to change also. - - (ADB - 2018/08/31, HDFFV-10568) - - Java iterator callbacks - - Change global callback object to a small stack structure in order - to fix a runtime crash. This crash was discovered when iterating - through a file with nested group members. The global variable - visit_callback is overwritten when recursion starts. When recursion - completes, visit_callback will be pointing to the wrong callback method. - - (ADB - 2018/08/15, HDFFV-10536) + - Added ability to test java library with VOLs. - - Java HDFLibraryException class + Created new CMake script that combines the java and vol test scripts. - Change parent class from Exception to RuntimeException. + (ADB - 2020/02/03, HDFFV-10996) - (ADB - 2018/07/30, HDFFV-10534) + - Tests fail for non-English locale. - - JNI Read and Write + 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 + error. Changed the regex for the Time substitution. - Refactored variable-length functions, H5DreadVL and H5AreadVL, - to correct dataset and attribute reads. New write functions, - H5DwriteVL and H5AwriteVL, are under construction. + (ADB - 2020/01/09, HDFFV-10995) - (ADB - 2018/06/02, HDFFV-10519) Configuration ------------- - - Correct option for default API version - - CMake options for default API version are not mutually exclusive. - Change the multiple BOOL options to a single STRING option with the - strings; v16, v18, v110, v112. + - - (ADB - 2019/08/12, HDFFV-10879) Performance ------------- - + Fortran -------- - - Added symbolic links libhdf5_hl_fortran.so to libhdf5hl_fortran.so and - libhdf5_hl_fortran.a to libhdf5hl_fortran.a in hdf5/lib directory for - autotools installs. These were added to match the name of the files - installed by cmake and the general pattern of hl lib files. We will - change the names of the installed lib files to the matching name in - the next major release. - - (LRK - 2019/01/04, HDFFV-10596) - - - Made Fortran specific subroutines PRIVATE in generic procedures. - - Effected generic procedures were functions in H5A, H5D, H5P, H5R and H5T. - - (MSB, 2018/12/04, HDFFV-10511) - - - Fixed issue with Fortran not returning h5o_info_t field values - meta_size%attr%index_size and meta_size%attr%heap_size. - - (MSB, 2018/1/8, HDFFV-10443) - - Corrected INTERFACE INTENT(IN) to INTENT(OUT) for buf_size in h5fget_file_image_f. - (MSB - 2020/2/18, HDFFV-11029) + (MSB - 2020/02/18, HDFFV-11029) + Tools ----- - The tools library was updated by standardizing the error stack process. - General sequence is: + General sequence is: h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); h5tools_init(); @@ -1273,292 +716,66 @@ Bug Fixes since HDF5-1.10.3 release ... (do work) ... h5diff_exit(ret); - (ADB - 2020/07/20, HDFFV-11066) + (ADB - 2020/07/20, HDFFV-11066) - h5diff fixed a command line parsing error. - h5diff would ignore the argument to -d (delta) if it is smaller than DBL_EPSILON. - The macro H5_DBL_ABS_EQUAL was removed and a direct value comparision was used. + h5diff would ignore the argument to -d (delta) if it is smaller than DBL_EPSILON. + The macro H5_DBL_ABS_EQUAL was removed and a direct value comparision was used. - (ADB - 2020/07/20, HDFFV-10897) + (ADB - 2020/07/20, HDFFV-10897) - 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. + 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. - (ADB - 2020/07/20, HDFFV-5935) + (ADB - 2020/07/20, HDFFV-5935) - h5diff added another level to the verbose argument to print filenames. - Added verbose level 3 that is level 2 plus the filenames. The levels are: + Added verbose level 3 that is level 2 plus the filenames. The levels are: 0 : Identical to '-v' or '--verbose' 1 : All level 0 information plus one-line attribute status summary 2 : All level 1 information plus extended attribute status report 3 : All level 2 information plus file names - (ADB - 2020/07/20, HDFFV-10005) - - High-Level APIs: - ------ - - The H5DSis_scale function was updated to return "not a dimension scale" (0) - instead of failing (-1), when CLASS or DIMENSION_SCALE attributes are - not written according to Dimension Scales Specification. - - (EIP - 2020/08/12, HDFFV-10436) - - Fortran High-Level APIs: - ------ - - - - Documentation - ------------- - - - - F90 APIs - -------- - - - - C++ APIs - -------- - - - - Testing - ------- - - Stopped java/test/junit.sh.in installing libs for testing under ${prefix} - - Lib files needed are now copied to a subdirectory in the java/test - directory, and on Macs the loader path for libhdf5.xxxs.so is changed - in the temporary copy of libhdf5_java.dylib. - - (LRK, 2020/7/2, HDFFV-11063) - - - Fixed a test failure in testpar/t_dset.c caused by - the test trying to use the parallel filters feature - on MPI-2 implementations. - - (JTH, 2019/2/7) - -Bug Fixes since HDF5-1.10.2 release -================================== - - Library - ------- - - Java HDF5LibraryException class - - The error minor and major values would be lost after the - constructor executed. - - Created two local class variables to hold the values obtained during - execution of the constructor. Refactored the class functions to retrieve - the class values rather then calling the native functions. - The native functions were renamed and called only during execution - of the constructor. - Added error checking to calling class constructors in JNI classes. - - (ADB - 2018/08/06, HDFFV-10544) - - - Added checks of the defined MPI_VERSION to guard against usage of - MPI-3 functions in the Parallel Compression and "big Parallel I/O" - features when HDF5 is built with MPI-2. Previously, the configure - step would pass but the build itself would fail when it could not - locate the MPI-3 functions used. - - As a result of these new checks, HDF5 can again be built with MPI-2, - but the Parallel Compression feature will be disabled as it relies - on the MPI-3 functions used. - - (JTH - 2018/08/02, HDFFV-10512) - - - User's patches: CVEs - - The following patches have been applied: - - CVE-2018-11202 - NULL pointer dereference was discovered in - H5S_hyper_make_spans in H5Shyper.c (HDFFV-10476) - https://security-tracker.debian.org/tracker/CVE-2018-11202 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11202 - - CVE-2018-11203 - A division by zero was discovered in - H5D__btree_decode_key in H5Dbtree.c (HDFFV-10477) - https://security-tracker.debian.org/tracker/CVE-2018-11203 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11203 - - CVE-2018-11204 - A NULL pointer dereference was discovered in - H5O__chunk_deserialize in H5Ocache.c (HDFFV-10478) - https://security-tracker.debian.org/tracker/CVE-2018-11204 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11204 - - CVE-2018-11206 - An out of bound read was discovered in - H5O_fill_new_decode and H5O_fill_old_decode in H5Ofill.c - (HDFFV-10480) - https://security-tracker.debian.org/tracker/CVE-2018-11206 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11206 - - CVE-2018-11207 - A division by zero was discovered in - H5D__chunk_init in H5Dchunk.c (HDFFV-10481) - https://security-tracker.debian.org/tracker/CVE-2018-11207 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=3DCVE-2018-11207 - - (BMR - 2018/7/22, PR#s: 1134 and 1139, - HDFFV-10476, HDFFV-10477, HDFFV-10478, HDFFV-10480, HDFFV-10481) - - - H5Adelete - - H5Adelete failed when deleting the last "large" attribute that - is stored densely via fractal heap/v2 b-tree. - - After removing the attribute, update the ainfo message. If the - number of attributes goes to zero, remove the message. - - (VC - 2018/07/20, HDFFV-9277) - - - A bug was discovered in the parallel library which caused partial - parallel reads of filtered datasets to return incorrect data. The - library used the incorrect dataspace for each chunk read, causing - the selection used in each chunk to be wrong. - - The bug was not caught during testing because all of the current - tests which do parallel reads of filtered data read all of the data - using an H5S_ALL selection. Several tests were added which exercise - partial parallel reads. - - (JTH - 2018/07/16, HDFFV-10467) - - - A bug was discovered in the parallel library which caused parallel - writes of filtered datasets to trigger an assertion failure in the - file free space manager. - - This occurred when the filter used caused chunks to repeatedly shrink - and grow over the course of several dataset writes. The previous chunk - information, such as the size of the chunk and the offset in the file, - was being cached and not updated after each write, causing the next write - to the chunk to retrieve the incorrect cached information and run into - issues when reallocating space in the file for the chunk. - - (JTH - 2018/07/16, HDFFV-10509) - - - A bug was discovered in the parallel library which caused the - H5D__mpio_array_gatherv() function to allocate too much memory. - - When the function is called with the 'allgather' parameter set - to a non-true value, the function will receive data from all MPI - ranks and gather it to the single rank specied by the 'root' - parameter. However, the bug in the function caused memory for - the received data to be allocated on all MPI ranks, not just the - singular rank specified as the receiver. In some circumstances, - this would cause an application to fail due to the large amounts - of memory being allocated. - - (JTH - 2018/07/16, HDFFV-10467) - - - Error checks in h5stat and when decoding messages - - h5stat exited with seg fault/core dumped when - errors are encountered in the internal library. - - Add error checks and --enable-error-stack option to h5stat. - Add range checks when decoding messages: old fill value, old - layout and refcount. - - (VC - 2018/07/11, HDFFV-10333) - - - If an HDF5 file contains a malformed compound datatype with a - suitably large offset, the type conversion code can run off - the end of the type conversion buffer, causing a segmentation - fault. + (ADB - 2020/07/20, HDFFV-10005) - This issue was reported to The HDF Group as issue #CVE-2017-17507. - - NOTE: The HDF5 C library cannot produce such a file. This condition - should only occur in a corrupt (or deliberately altered) file - or a file created by third-party software. - - THE HDF GROUP WILL NOT FIX THIS BUG AT THIS TIME - - Fixing this problem would involve updating the publicly visible - H5T_conv_t function pointer typedef and versioning the API calls - which use it. We normally only modify the public API during - major releases, so this bug will not be fixed at this time. - - (DER - 2018/02/26, HDFFV-10356) - - - Inappropriate linking with deprecated MPI C++ libraries - - HDF5 does not define *_SKIP_MPICXX in the public headers, so applications - can inadvertently wind up linking to the deprecated MPI C++ wrappers. - - MPICH_SKIP_MPICXX and OMPI_SKIP_MPICXX have both been defined in H5public.h - so this should no longer be an issue. HDF5 makes no use of the deprecated - MPI C++ wrappers. - - (DER - 2019/09/17, HDFFV-10893) - - - - Configuration - ------------- - - Applied patches to address Cywin build issues - - There were three issues for Cygwin builds: - - Shared libs were not built. - - The -std=c99 flag caused a SIG_SETMASK undeclared error. - - Undefined errors when buildbing test shared libraries. - - Patches to address these issues were received and incorporated in this version. - - (LRK - 2018/07/18, HDFFV-10475) - - - Moved the location of gcc attribute. - - The gcc attribute(no_sanitize), named as the macro HDF_NO_UBSAN, - was located after the function name. Builds with GCC 7 did not - indicate any problem, but GCC 8 issued errors. Moved the - attribute before the function name, as required. - - (ADB - 2018/05/22, HDFFV-10473) - - - Reworked java test suite into individual JUnit tests. + - h5repack was fixed to repack the reference attributes properly. - Testing the whole suite of java unit tests in a single JUnit run - made it difficult to determine actual failures when tests would fail. - Running each file set of tests individually, allows individual failures - to be diagnosed easier. A side benefit is that tests for optional components - of the library can be disabled if not configured. + The code line that checks if the update of reference inside a compound + datatype is misplaced outside the code block loop that carries out the + check. In consequence, the next attribute that is not the reference + type was repacked again as the reference type and caused the failure of + repacking. The fix is to move the corresponding code line to the correct + code block. - (ADB - 2018/05/16, HDFFV-9739) + (KY -2020/02/10, HDFFV-11014) - - Converted CMake global commands ADD_DEFINITIONS and INCLUDE_DIRECTORIES - to use target_* type commands. This change modernizes the CMake usage - in the HDF5 library. + - h5diff was updated to use the new reference APIs. - In addition, there is the intention to convert to generator expressions, - where possible. The exception is Fortran FLAGS on Windows Visual Studio. - The HDF macros TARGET_C_PROPERTIES and TARGET_FORTRAN_PROPERTIES have - been removed with this change in usage. + h5diff uses the new reference APIs to compare references. + Attribute references can also be compared. - The additional language (C++ and Fortran) checks have also been localized - to only be checked when that language is enabled. + (ADB - 2019/12/19, HDFFV-10980) - (ADB - 2018/05/08) + - h5dump and h5ls were updated to use the new reference APIs. - Performance - ------------- - - + The tools library now use the new reference APIs to inspect a + file. Also the DDL spec was updated to reflect the format + changes produced with the new APIs. The export API and support + functions in the JNI were updated to match. - Fortran - -------- - - + (ADB - 2019/12/06, HDFFV-10876 and HDFFV-10877) - Tools - ----- - - High-Level APIs: ------ - + Fortran High-Level APIs: ------ - @@ -1573,36 +790,18 @@ Bug Fixes since HDF5-1.10.2 release C++ APIs -------- - - Adding default arguments to existing functions - - Added the following items: - + Two more property list arguments are added to H5Location::createDataSet: - const DSetAccPropList& dapl = DSetAccPropList::DEFAULT - const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT - - + One more property list argument is added to H5Location::openDataSet: - const DSetAccPropList& dapl = DSetAccPropList::DEFAULT - - (BMR - 2018/07/21, PR# 1146) - - - Improvement C++ documentation - - Replaced the table in main page of the C++ documentation from mht to htm format - for portability. - - (BMR - 2018/07/17, PR# 1141) + - Testing ------- - - The dt_arith test failed on IBM Power8 and Power9 machines when testing - conversions from or to long double types, especially when special values - such as infinity or NAN were involved. In some cases the results differed - by extremely small amounts from those on other machines, while some other - tests resulted in segmentation faults. These conversion tests with long - double types have been disabled for ppc64 machines until the problems are - better understood and can be properly addressed. + - Stopped java/test/junit.sh.in installing libs for testing under ${prefix} + + Lib files needed are now copied to a subdirectory in the java/test + directory, and on Macs the loader path for libhdf5.xxxs.so is changed + in the temporary copy of libhdf5_java.dylib. + + (LRK, 2020/07/02, HDFFV-11063) - (SRL - 2019/01/07, TRILAB-98) Supported Platforms =================== @@ -1739,9 +938,15 @@ 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 - Fedora30 5.3.11-200.fc30.x86_64 - #1 SMP x86_64 GNU/Linux GNU gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1 20190827) - GNU Fortran (GCC) 9.2.1 20190827 (Red Hat 9.2.1 20190827) + Fedora32 5.8.18-200.fc32.x86_64 + #1 SMP x86_64 GNU/Linux GNU gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6) + GNU Fortran (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6) + clang version 10.0.1 (Fedora 10.0.1-3.fc32) + (cmake and autotools) + + Ubuntu20.10 -5.8.0-29-generic-x86_64 + #31-Ubuntu SMP x86_64 GNU/Linux GNU gcc (GCC) 10.2.0-13ubuntu1 + GNU Fortran (GCC) 10.2.0-13ubuntu1 (cmake and autotools) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 597f620..a7e3f57 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -380,6 +380,8 @@ IDE_GENERATED_PROPERTIES ("H5HP" "${H5HP_HDRS}" "${H5HP_SOURCES}" ) set (H5I_SOURCES ${HDF5_SRC_DIR}/H5I.c + ${HDF5_SRC_DIR}/H5Idbg.c + ${HDF5_SRC_DIR}/H5Iint.c ${HDF5_SRC_DIR}/H5Itest.c ) set (H5I_HDRS @@ -714,6 +716,7 @@ set (H5Z_HDRS IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SOURCES}" ) set (H5_MODULE_HEADERS + ${HDF5_SRC_DIR}/H5module.h ${HDF5_SRC_DIR}/H5Amodule.h ${HDF5_SRC_DIR}/H5ACmodule.h ${HDF5_SRC_DIR}/H5Bmodule.h @@ -743,6 +746,7 @@ set (H5_MODULE_HEADERS ${HDF5_SRC_DIR}/H5PBmodule.h ${HDF5_SRC_DIR}/H5PLmodule.h ${HDF5_SRC_DIR}/H5Rmodule.h + ${HDF5_SRC_DIR}/H5RSmodule.h ${HDF5_SRC_DIR}/H5Smodule.h ${HDF5_SRC_DIR}/H5SLmodule.h ${HDF5_SRC_DIR}/H5SMmodule.h @@ -1356,3 +1360,41 @@ if (NOT WIN32) COMPONENT libraries ) 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) + + # 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_dependencies(doxygen hdf5lib_doc) + +endif () @@ -14,6 +14,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -55,6 +56,9 @@ static int H5__mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *fla /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /*****************************/ /* Library Private Variables */ /*****************************/ @@ -85,6 +89,33 @@ H5_debug_t H5_debug_g; /* debugging info */ /*******************/ /*-------------------------------------------------------------------------- +NAME + H5__init_package -- Initialize interface-specific information +USAGE + herr_t H5__init_package() +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. +--------------------------------------------------------------------------*/ +herr_t +H5__init_package(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Run the library initialization routine, if it hasn't already ran */ + if (!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { + if (H5_init_library() < 0) + HGOTO_ERROR(H5E_LIB, H5E_CANTINIT, FAIL, "unable to initialize library") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5__init_package() */ + +/*-------------------------------------------------------------------------- * NAME * H5_init_library -- Initialize library-global information * USAGE @@ -103,6 +134,11 @@ H5_init_library(void) { herr_t ret_value = SUCCEED; + /* Set the 'library initialized' flag as early as possible, to avoid + * possible re-entrancy. + */ + H5_INIT_GLOBAL = TRUE; + FUNC_ENTER_NOAPI(FAIL) #ifdef H5_HAVE_PARALLEL @@ -336,6 +372,7 @@ H5_term_library(void) */ if (pending == 0) { pending += DOWN(AC); + /* Shut down the "pluggable" interfaces, before the plugin framework */ pending += DOWN(Z); pending += DOWN(FD); pending += DOWN(VL); @@ -367,7 +404,7 @@ H5_term_library(void) HDfprintf(stderr, " %s\n", loop); #ifndef NDEBUG HDabort(); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end if */ } /* end if */ @@ -560,12 +597,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, size_t *fac_size) +H5get_free_list_sizes(size_t *reg_size /*out*/, size_t *arr_size /*out*/, size_t *blk_size /*out*/, + size_t *fac_size /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "*z*z*z*z", reg_size, arr_size, blk_size, fac_size); + H5TRACE4("e", "xxxx", reg_size, arr_size, blk_size, fac_size); /* Call the free list function to actually get the sizes */ if (H5FL_get_free_list_sizes(reg_size, arr_size, blk_size, fac_size) < 0) @@ -600,12 +638,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5get_alloc_stats(H5_alloc_stats_t *stats) +H5get_alloc_stats(H5_alloc_stats_t *stats /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", stats); + H5TRACE1("e", "x", stats); /* Call the internal allocation stat routine to get the values */ if (H5MM_get_alloc_stats(stats) < 0) @@ -763,12 +801,12 @@ H5__mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void *------------------------------------------------------------------------- */ herr_t -H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum) +H5get_libversion(unsigned *majnum /*out*/, unsigned *minnum /*out*/, unsigned *relnum /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*Iu*Iu*Iu", majnum, minnum, relnum); + H5TRACE3("e", "xxx", majnum, minnum, relnum); /* Set the version information */ if (majnum) @@ -1079,7 +1117,7 @@ H5is_library_threadsafe(hbool_t *is_ts) /* At this time, it is impossible for this to fail. */ #ifdef H5_HAVE_THREADSAFE *is_ts = TRUE; -#else /* H5_HAVE_THREADSAFE */ +#else /* H5_HAVE_THREADSAFE */ *is_ts = FALSE; #endif /* H5_HAVE_THREADSAFE */ @@ -40,13 +40,6 @@ /* Local Typedefs */ /******************/ -/* Object header iterator callbacks */ -/* Data structure for callback for locating the index by name */ -typedef struct H5A_iter_cb1 { - const char *name; - int idx; -} H5A_iter_cb1; - /********************/ /* Package Typedefs */ /********************/ @@ -59,9 +52,6 @@ typedef struct H5A_iter_cb1 { /* Package Variables */ /*********************/ -/* Package initialization variable */ -hbool_t H5_PKG_INIT_VAR = FALSE; - /*****************************/ /* Library Private Variables */ /*****************************/ @@ -70,160 +60,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Local Variables */ /*******************/ -/* Declare the free lists of H5A_t */ -H5FL_DEFINE(H5A_t); - -/* Declare the free lists for H5A_shared_t's */ -H5FL_DEFINE(H5A_shared_t); - -/* Declare a free list to manage blocks of type conversion data */ -H5FL_BLK_DEFINE(attr_buf); - -/* Attribute ID class */ -static const H5I_class_t H5I_ATTR_CLS[1] = {{ - H5I_ATTR, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5A__close_cb /* Callback routine for closing objects of this class */ -}}; - -/* Flag indicating "top" of interface has been initialized */ -static hbool_t H5A_top_package_initialize_s = FALSE; - -/*------------------------------------------------------------------------- - * Function: H5A_init - * - * Purpose: Initialize the interface from some other layer. - * - * Return: Success: non-negative - * - * Failure: negative - *------------------------------------------------------------------------- - */ -herr_t -H5A_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 H5A_init() */ - -/*-------------------------------------------------------------------------- -NAME - H5A__init_package -- Initialize interface-specific information -USAGE - herr_t H5A__init_package() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. - ---------------------------------------------------------------------------*/ -herr_t -H5A__init_package(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* - * Create attribute ID type. - */ - if (H5I_register_type(H5I_ATTR_CLS) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to initialize interface") - - /* Mark "top" of interface as initialized, too */ - H5A_top_package_initialize_s = TRUE; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A__init_package() */ - -/*-------------------------------------------------------------------------- - NAME - H5A_top_term_package - PURPOSE - Terminate various H5A objects - USAGE - void H5A_top_term_package() - RETURNS - DESCRIPTION - Release IDs for the atom group, deferring full interface shutdown - until later (in H5A_term_package). - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Can't report errors... - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -int -H5A_top_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if (H5A_top_package_initialize_s) { - if (H5I_nmembers(H5I_ATTR) > 0) { - (void)H5I_clear_type(H5I_ATTR, FALSE, FALSE); - n++; /*H5I*/ - } /* end if */ - - /* Mark closed */ - if (0 == n) - H5A_top_package_initialize_s = FALSE; - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* H5A_top_term_package() */ - -/*-------------------------------------------------------------------------- - NAME - H5A_term_package - PURPOSE - Terminate various H5A objects - USAGE - void H5A_term_package() - RETURNS - DESCRIPTION - Release any other resources allocated. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Can't report errors... - - Finishes shutting down the interface, after H5A_top_term_package() - is called - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -int -H5A_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if (H5_PKG_INIT_VAR) { - /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_ATTR)); - HDassert(FALSE == H5A_top_package_initialize_s); - - /* Destroy the attribute object id group */ - n += (H5I_dec_type_ref(H5I_ATTR) > 0); - - /* Mark closed */ - if (0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* H5A_term_package() */ - /*-------------------------------------------------------------------------- * Function: H5Acreate2 * @@ -685,13 +521,13 @@ done: This function reads a complete attribute from disk. --------------------------------------------------------------------------*/ herr_t -H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) +H5Aread(hid_t attr_id, hid_t dtype_id, void *buf /*out*/) { H5VL_object_t *vol_obj; /* Attribute object for ID */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ii*x", attr_id, dtype_id, buf); + H5TRACE3("e", "iix", attr_id, dtype_id, buf); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -849,14 +685,14 @@ done: properly terminate the string. --------------------------------------------------------------------------*/ ssize_t -H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) +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; FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "iz*s", attr_id, buf_size, buf); + H5TRACE3("Zs", "izx", attr_id, buf_size, buf); /* check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -995,14 +831,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Aget_info(hid_t attr_id, H5A_info_t *ainfo) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", attr_id, ainfo); + H5TRACE2("e", "ix", attr_id, ainfo); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -1036,7 +872,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo, +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; @@ -1044,7 +880,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*s*xi", loc_id, obj_name, attr_name, ainfo, lapl_id); + H5TRACE5("e", "i*s*sxi", loc_id, obj_name, attr_name, ainfo, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1094,14 +930,14 @@ done: */ herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - H5A_info_t *ainfo, hid_t lapl_id) + 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 */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIoh*xi", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id); + H5TRACE7("e", "i*sIiIohxi", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1300,7 +1136,7 @@ done: attribute. --------------------------------------------------------------------------*/ herr_t -H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, +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 */ @@ -1308,7 +1144,7 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *i herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIo*hx*x", loc_id, idx_type, order, idx, op, op_data); + H5TRACE6("e", "iIiIo*hAO*x", loc_id, idx_type, order, idx, op, op_data); /* check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1379,14 +1215,14 @@ done: --------------------------------------------------------------------------*/ 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) + 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 */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, obj_name, idx_type, order, idx, op, op_data, lapl_id); + H5TRACE8("e", "i*sIiIo*hAO*xi", loc_id, obj_name, idx_type, order, idx, op, op_data, lapl_id); /* Check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -374,7 +374,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co 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); #ifdef H5_HAVE_PARALLEL - } /* end else */ + } /* end else */ #endif /* H5_HAVE_PARALLEL */ if (NULL == f->shared->cache) @@ -432,7 +432,7 @@ done: aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr); } /* end if */ } /* end if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_create() */ @@ -466,7 +466,7 @@ H5AC_dest(H5F_t *f) hbool_t curr_logging; /* TRUE if currently logging */ #ifdef H5_HAVE_PARALLEL H5AC_aux_t *aux_ptr = NULL; -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -585,7 +585,7 @@ H5AC_dest(H5F_t *f) aux_ptr->magic = 0; aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr); - } /* end if */ + } /* end if */ #endif /* H5_HAVE_PARALLEL */ done: @@ -1104,7 +1104,7 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne { #ifdef H5_HAVE_PARALLEL H5AC_aux_t *aux_ptr; -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1414,7 +1414,7 @@ H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata, unsi #ifdef H5_HAVE_PARALLEL HDassert(0 == (flags & (unsigned)(~(H5C__READ_ONLY_FLAG | H5C__FLUSH_LAST_FLAG | H5C__FLUSH_COLLECTIVELY_FLAG)))); -#else /* H5_HAVE_PARALLEL */ +#else /* H5_HAVE_PARALLEL */ HDassert(0 == (flags & (unsigned)(~(H5C__READ_ONLY_FLAG | H5C__FLUSH_LAST_FLAG)))); #endif /* H5_HAVE_PARALLEL */ @@ -1631,7 +1631,7 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, un hbool_t deleted; #ifdef H5_HAVE_PARALLEL H5AC_aux_t *aux_ptr = NULL; -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1674,7 +1674,7 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, un if (deleted && aux_ptr->mpi_rank == 0) if (H5AC__log_deleted_entry((H5AC_info_t *)thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed") - } /* end if */ + } /* end if */ #endif /* H5_HAVE_PARALLEL */ if (H5C_unprotect(f, addr, thing, flags) < 0) @@ -2163,7 +2163,7 @@ H5AC__check_if_write_permitted(const H5F_t write_permitted = aux_ptr->write_permitted; else write_permitted = FALSE; - } /* end if */ + } /* end if */ #endif /* H5_HAVE_PARALLEL */ *write_permitted_ptr = write_permitted; diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index a806b35..3826a9c 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -137,8 +137,7 @@ H5FL_DEFINE_STATIC(H5AC_slist_entry_t); *------------------------------------------------------------------------- */ herr_t -H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, - void (*sync_point_done)(unsigned num_writes, haddr_t *written_entries_tbl)) +H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, H5AC_sync_point_done_cb_t sync_point_done) { H5AC_aux_t *aux_ptr; @@ -170,7 +169,7 @@ H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, *------------------------------------------------------------------------- */ herr_t -H5AC__set_write_done_callback(H5C_t *cache_ptr, void (*write_done)(void)) +H5AC__set_write_done_callback(H5C_t *cache_ptr, H5AC_write_done_cb_t write_done) { H5AC_aux_t *aux_ptr; @@ -760,7 +759,7 @@ H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr) #if H5AC_DEBUG_DIRTY_BYTES_CREATION aux_ptr->unprotect_dirty_bytes += entry_ptr->size; aux_ptr->unprotect_dirty_bytes_updates += 1; -#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ +#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ } /* end if */ /* the entry is dirty. If it exists on the cleaned entries list, @@ -776,7 +775,7 @@ H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr) aux_ptr->unprotect_dirty_bytes += entry_ptr->size; aux_ptr->unprotect_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ - } /* end else */ + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1090,7 +1089,7 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) #if H5AC_DEBUG_DIRTY_BYTES_CREATION aux_ptr->move_dirty_bytes += entry_size; aux_ptr->move_dirty_bytes_updates += 1; -#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ +#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ } /* end else */ /* insert / reinsert the entry in the dirty slist */ @@ -1104,7 +1103,7 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) aux_ptr->move_dirty_bytes += entry_size; aux_ptr->move_dirty_bytes_updates += 1; #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ - } /* end else-if */ + } /* end else-if */ done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 5ec364a..0548193 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -401,7 +401,12 @@ typedef struct H5AC_aux_t { unsigned p0_image_len; } H5AC_aux_t; /* struct H5AC_aux_t */ -#endif /* H5_HAVE_PARALLEL */ + +/* Typedefs for debugging function pointers */ +typedef void (*H5AC_sync_point_done_cb_t)(unsigned num_writes, haddr_t *written_entries_tbl); +typedef void (*H5AC_write_done_cb_t)(void); + +#endif /* H5_HAVE_PARALLEL */ /******************************/ /* Package Private Prototypes */ @@ -417,10 +422,8 @@ H5_DLL herr_t H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr); H5_DLL herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5AC__flush_entries(H5F_t *f); H5_DLL herr_t H5AC__run_sync_point(H5F_t *f, int sync_point_op); -H5_DLL herr_t H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, - void (*sync_point_done)(unsigned num_writes, - haddr_t *written_entries_tbl)); -H5_DLL herr_t H5AC__set_write_done_callback(H5C_t *cache_ptr, void (*write_done)(void)); +H5_DLL herr_t H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, H5AC_sync_point_done_cb_t sync_point_done); +H5_DLL herr_t H5AC__set_write_done_callback(H5C_t *cache_ptr, H5AC_write_done_cb_t write_done); #endif /* H5_HAVE_PARALLEL */ #endif /* _H5ACpkg_H */ diff --git a/src/H5ACproxy_entry.c b/src/H5ACproxy_entry.c index 76e885f..4426189 100644 --- a/src/H5ACproxy_entry.c +++ b/src/H5ACproxy_entry.c @@ -521,7 +521,7 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_AFTER_LOAD: #ifdef NDEBUG HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "invalid notify action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Invalid action?!?"); #endif /* NDEBUG */ break; @@ -529,7 +529,7 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_AFTER_FLUSH: #ifdef NDEBUG HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "invalid notify action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Invalid action?!?"); #endif /* NDEBUG */ break; @@ -605,10 +605,10 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) default: #ifdef NDEBUG HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unknown notify action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); #endif /* NDEBUG */ - } /* end switch */ + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Adense.c b/src/H5Adense.c index 3d99202..1efe45d 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -1100,7 +1100,7 @@ H5A__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) HDassert("unknown attribute op type" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unsupported attribute op type") -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ /* Release the space allocated for the attribute */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 3589296..cd3dd25 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -373,13 +373,13 @@ done: Deprecated in favor of H5Aiterate2 --------------------------------------------------------------------------*/ herr_t -H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) +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 */ FUNC_ENTER_API(H5_ITER_ERROR) - H5TRACE4("e", "i*Iux*x", loc_id, attr_num, op, op_data); + H5TRACE4("e", "i*IuAo*x", loc_id, attr_num, op, op_data); /* check arguments */ if (H5I_ATTR == H5I_get_type(loc_id)) diff --git a/src/H5Aint.c b/src/H5Aint.c index b7e7be6..5a78a67 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -83,6 +83,7 @@ typedef struct { /* Local Prototypes */ /********************/ +static herr_t H5A__close_cb(H5VL_object_t *attr_vol_obj); static herr_t H5A__compact_build_table_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, unsigned *oh_flags_ptr, void *_udata /*in,out*/); static herr_t H5A__dense_build_table_cb(const H5A_t *attr, void *_udata); @@ -98,6 +99,9 @@ static herr_t H5A__iterate_common(hid_t loc_id, H5_index_t idx_type, H5_iter_ord /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Format version bounds for attribute */ const unsigned H5O_attr_ver_bounds[] = { H5O_ATTR_VERSION_1, /* H5F_LIBVER_EARLIEST */ @@ -115,8 +119,162 @@ const unsigned H5O_attr_ver_bounds[] = { /* Local Variables */ /*******************/ +/* Declare the free lists of H5A_t */ +H5FL_DEFINE(H5A_t); + +/* Declare the free lists for H5A_shared_t's */ +H5FL_DEFINE(H5A_shared_t); + +/* Declare a free list to manage blocks of type conversion data */ +H5FL_BLK_DEFINE(attr_buf); + typedef H5A_t *H5A_t_ptr; -H5FL_SEQ_DEFINE(H5A_t_ptr); +H5FL_SEQ_DEFINE_STATIC(H5A_t_ptr); + +/* Attribute ID class */ +static const H5I_class_t H5I_ATTR_CLS[1] = {{ + H5I_ATTR, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5A__close_cb /* Callback routine for closing objects of this class */ +}}; + +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5A_top_package_initialize_s = FALSE; + +/*------------------------------------------------------------------------- + * Function: H5A_init + * + * Purpose: Initialize the interface from some other layer. + * + * Return: Success: non-negative + * + * Failure: negative + *------------------------------------------------------------------------- + */ +herr_t +H5A_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 H5A_init() */ + +/*-------------------------------------------------------------------------- +NAME + H5A__init_package -- Initialize interface-specific information +USAGE + herr_t H5A__init_package() + +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. + +--------------------------------------------------------------------------*/ +herr_t +H5A__init_package(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* + * Create attribute ID type. + */ + if (H5I_register_type(H5I_ATTR_CLS) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to initialize interface") + + /* Mark "top" of interface as initialized, too */ + H5A_top_package_initialize_s = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5A__init_package() */ + +/*-------------------------------------------------------------------------- + NAME + H5A_top_term_package + PURPOSE + Terminate various H5A objects + USAGE + void H5A_top_term_package() + RETURNS + DESCRIPTION + Release IDs for the atom group, deferring full interface shutdown + until later (in H5A_term_package). + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int +H5A_top_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if (H5A_top_package_initialize_s) { + if (H5I_nmembers(H5I_ATTR) > 0) { + (void)H5I_clear_type(H5I_ATTR, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + + /* Mark closed */ + if (0 == n) + H5A_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* H5A_top_term_package() */ + +/*-------------------------------------------------------------------------- + NAME + H5A_term_package + PURPOSE + Terminate various H5A objects + USAGE + void H5A_term_package() + RETURNS + DESCRIPTION + Release any other resources allocated. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Can't report errors... + + Finishes shutting down the interface, after H5A_top_term_package() + is called + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +int +H5A_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if (H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_ATTR)); + HDassert(FALSE == H5A_top_package_initialize_s); + + /* Destroy the attribute object id group */ + n += (H5I_dec_type_ref(H5I_ATTR) > 0); + + /* Mark closed */ + if (0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* H5A_term_package() */ /*------------------------------------------------------------------------- * Function: H5A__create @@ -356,12 +514,12 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* check args */ HDassert(loc); @@ -1134,12 +1292,12 @@ H5A__shared_free(H5A_t *attr) * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5A__close_cb(H5VL_object_t *attr_vol_obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* Sanity check */ HDassert(attr_vol_obj); @@ -1813,7 +1971,7 @@ H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *l HDassert("unknown attribute op type" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unsupported attribute op type") -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ /* Increment the number of entries passed through */ diff --git a/src/H5Amodule.h b/src/H5Amodule.h index 707fc54..09e6c4a 100644 --- a/src/H5Amodule.h +++ b/src/H5Amodule.h @@ -29,4 +29,21 @@ #define H5_MY_PKG_ERR H5E_ATTR #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. + * + * 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. + * + * 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. + * + */ + #endif /* _H5Amodule_H */ diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 49d86b1..5a64a1b 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -185,14 +185,12 @@ H5_DLL H5A_t *H5A__open(const H5G_loc_t *loc, const char *attr_name); H5_DLL H5A_t *H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name); H5_DLL H5A_t *H5A__open_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__open_common(const H5G_loc_t *loc, H5A_t *attr); H5_DLL H5A_t *H5A__copy(H5A_t *new_attr, const H5A_t *old_attr); H5_DLL hid_t H5A__get_type(H5A_t *attr); H5_DLL herr_t H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo); H5_DLL hid_t H5A__get_create_plist(H5A_t *attr); H5_DLL herr_t H5A__shared_free(H5A_t *attr); H5_DLL herr_t H5A__close(H5A_t *attr); -H5_DLL herr_t H5A__close_cb(H5VL_object_t *attr_vol_obj); H5_DLL htri_t H5A__get_ainfo(H5F_t *f, H5O_t *oh, H5O_ainfo_t *ainfo); H5_DLL herr_t H5A__set_version(const H5F_t *f, H5A_t *attr); H5_DLL herr_t H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, diff --git a/src/H5Apublic.h b/src/H5Apublic.h index 89a3b04..c3442b8 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -45,18 +45,285 @@ typedef herr_t (*H5A_operator2_t)(hid_t location_id /*in*/, const char *attr_nam extern "C" { #endif +/* --------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Creates an attribute attached to a specified object + * + * \fgdt_loc_id + * \param[in] attr_name Name of attribute + * \param[in] type_id Attribute datatype identifier + * \space_id + * \acpl_id + * \aapl_id + * + * \return \hid_tv{attribute} + * + * \details H5Acreate2() creates an attribute, \p attr_name, which is attached + * to the object specified by the identifier \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. + * + * 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 access property list is currently unused, but will be used in + * the future. This property list should currently be #H5P_DEFAULT. + * + * 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. + * + * \since 1.8.0 + * + * \see H5Aclose() + * + */ 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 H5A + * + * \brief Creates an attribute attached to a specified object + * + * \fgdt_loc_id + * \param[in] obj_name Name, relative to \p loc_id, of object that + * attribute is to be attached to + * \param[in] attr_name Attribute name + * \param[in] type_id Attribute datatype identifier + * \space_id + * \acpl_id + * \aapl_id + * \lapl_id + * + * \return \hid_tv{attribute} + * + * \details H5Acreate_by_name() creates an attribute, \p attr_name, which is + * 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). + * + * 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. + * + * 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. + * + * 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 H5A + * + * \brief Opens an attribute for an object specified by object identifier and + * attribute name + * + * \fgdt_loc_id{obj_id} + * \param[in] attr_name Name of attribute to open + * \aapl_id + * + * \return \hid_tv{attribute} + * + * \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. + * + * This function, H5Aopen_by_idx() or H5Aopen_by_name() must be called + * before the attribute can be accessed for any further purpose, + * including reading, writing, or any modification. + * + * The attribute identifier returned by this function must be released + * with H5Aclose() or resource leaks will develop. + * + * \since 1.8.0 + * + * \see H5Aclose(), H5Acreate() + */ H5_DLL hid_t H5Aopen(hid_t obj_id, const char *attr_name, hid_t aapl_id); -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 H5A + * + * \brief Opens the nth attribute attached to an object + * + * \loc_id + * \param[in] obj_name Name of object to which attribute is attached, + * relative to location + * \param[in] idx_type Type of index + * \param[in] order Index traversal order + * \param[in] n Attribute’s position in index + * \aapl_id + * \lapl_id + * + * \return \hid_tv{attribute} + * + * \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). + * + * 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(). + * + * The attribute access property list, \p aapl_id, is currently + * unused and should currently be #H5P_DEFAULT. + * + * The link access property list, \p lapl_id, may provide + * information regarding the properties of links required to access + * the object, \p obj_name. + * + * This function, H5Aopen(), or H5Aopen_by_name() must be called + * before an attribute can be accessed for any further purpose, + * including reading, writing, or any modification. + * + * The attribute identifier returned by this function must be + * released with H5Aclose() or resource leaks will develop. + * + * \since 1.8.0 + * + */ 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); -H5_DLL herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf); +/*--------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Opens an attribute for an object by object name and attribute name + * + * \fgdt_loc_id + * \param[in] obj_name Name of object to which attribute is attached, + * relative to \p loc_id + * \param[in] attr_name Name of attribute to open + * \aapl_id + * \lapl_id + * + * \return \hid_tv{attribute} + * + * \details H5Aopen_by_name() opens an existing attribute, \p attr_name, + * that is attached to an object specified by location and name, + * \p loc_id and \p obj_name, respectively. + * + * \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). + * + * The attribute access property list, \p aapl_id, is currently + * unused and should currently be #H5P_DEFAULT. + * + * The link access property list, \p lapl_id, may provide + * information regarding the properties of links required to access + * the object, \p obj_name. + * + * This function, H5Aopen(), or H5Aopen_by_idx() must be called + * before an attribute can be accessed for any further purpose, + * including reading, writing, or any modification. + * + * The attribute identifier returned by this function must be + * released with H5Aclose() or resource leaks will develop. + * + * \since 1.8.0 + * + */ +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 H5A + * + * \brief Reads the value of an attribute + * + * \attr_id + * \mem_type_id{type_id} + * \param[out] buf Buffer for data to be read + * + * \return \herr_t + * + * \details H5Aread() reads an attribute, specified with \p attr_id. The + * attribute's in-memory datatype is specified with \p type_id. The + * entire attribute is read into \p buf from the file. + * + * Datatype conversion takes place at the time of a read or write and + * is automatic. + * + * \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. + * \since 1.0.0 + * + * \see H5Awrite() + * +*/ H5_DLL herr_t H5Aread(hid_t attr_id, hid_t type_id, void *buf); -H5_DLL herr_t H5Aclose(hid_t attr_id); +/*--------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Writes data to an attribute + * + * \attr_id + * \mem_type_id{type_id} + * \param[out] buf Data to be written + * + * \return \herr_t + * + * \details H5Awrite() writes an attribute, specified with \p attr_id. The + * 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. + * + * \version 1.8.8 Fortran updated to Fortran2003. + * \version 1.4.2 Fortran \p dims parameter added in this release + * \since 1.0.0 + * \see H5Aread() + * + */ +H5_DLL herr_t H5Awrite(hid_t attr_id, hid_t type_id, const void *buf); H5_DLL hid_t H5Aget_space(hid_t attr_id); H5_DLL hid_t H5Aget_type(hid_t attr_id); H5_DLL hid_t H5Aget_create_plist(hid_t attr_id); @@ -84,6 +351,27 @@ H5_DLL herr_t H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t id hsize_t n, hid_t lapl_id); 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 H5A + * + * \brief Closes the specified attribute + * + * \attr_id + * + * \return \herr_t + * + * \details H5Aclose() terminates access to the attribute specified by + * \p attr_id by releasing the identifier. + * + * \attention Further use of a released attribute identifier is illegal; a + * function using such an identifier will generate an error. + * + * \since 1.0.0 + * + * \see H5Acreate(), H5Aopen() + */ +H5_DLL herr_t H5Aclose(hid_t attr_id); /* Symbols defined for compatibility with previous versions of the HDF5 API. * @@ -100,6 +388,51 @@ typedef herr_t (*H5A_operator1_t)(hid_t location_id /*in*/, const char *attr_nam void *operator_data /*in,out*/); /* Function prototypes */ +/* --------------------------------------------------------------------------*/ +/** + * \ingroup H5A + * + * \brief Creates an attribute attached to a specified object + * + * \fgdt_loc_id + * \param[in] name Name of attribute to locate and open + * \param[in] type_id Identifier of attribute datatype + * \space_id + * \acpl_id + * + * \return \hid_tv{attribute} + * + * \note The \p acpl parameters is currently not used; specify #H5P_DEFAULT. + * + * \deprecated Deprecated in favor of H5Acreate2() + * + * \details H5Acreate1() creates an attribute, \p name, which is attached + * to the object specified by the identifier \p loc_id. + * + * 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. + * + * \since 1.8.0 + * + * \version 1.8.0 The function H5Acreate() was renamed to H5Acreate1() and + * deprecated in this release. + * + * \see H5Aclose() + * + */ H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t acpl_id); H5_DLL hid_t H5Aopen_name(hid_t loc_id, const char *name); H5_DLL hid_t H5Aopen_idx(hid_t loc_id, unsigned idx); @@ -1313,9 +1313,9 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) */ #ifdef OLD_WAY HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "key not found in leaf node") -#else /* OLD_WAY */ +#else /* OLD_WAY */ HGOTO_DONE(FAIL) -#endif /* OLD_WAY */ +#endif /* OLD_WAY */ } /* end if */ else { /* Make callback for current record */ diff --git a/src/H5B2cache.c b/src/H5B2cache.c index ce91085..106542e 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -486,9 +486,9 @@ H5B2__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) default: #ifdef NDEBUG HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ } /* end if */ else @@ -904,9 +904,9 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing) default: #ifdef NDEBUG HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ } /* end if */ else @@ -1283,9 +1283,9 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing) default: #ifdef NDEBUG HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ } /* end if */ else @@ -576,7 +576,7 @@ void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, #ifndef NDEBUG int32_t version, -#else /* NDEBUG */ +#else /* NDEBUG */ int32_t H5_ATTR_UNUSED version, #endif /* NDEBUG */ double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size, @@ -806,7 +806,7 @@ H5C_prep_for_file_close(H5F_t *f) */ if (H5C__serialize_cache(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "serialization of the cache failed") - } /* end if */ + } /* end if */ #endif /* H5_HAVE_PARALLEL */ done: @@ -1310,7 +1310,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u hbool_t flush_last; #ifdef H5_HAVE_PARALLEL hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ hbool_t set_flush_marker; hbool_t write_permitted = TRUE; size_t empty_space; @@ -2092,7 +2092,7 @@ H5C_resize_entry(void *thing, size_t new_size) H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->coll_list_len), (cache_ptr->coll_list_size), (entry_ptr->size), (new_size)) } /* end if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ /* update statistics just before changing the entry size */ H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size); @@ -2228,7 +2228,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign hbool_t flush_last; #ifdef H5_HAVE_PARALLEL hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ hbool_t write_permitted; hbool_t was_loaded = FALSE; /* Whether the entry was loaded as a result of the protect */ size_t empty_space; @@ -2348,7 +2348,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign H5C__MOVE_TO_TOP_IN_COLL_LIST(cache_ptr, entry_ptr, NULL) } /* end else-if */ } /* end if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ #if H5C_DO_TAGGING_SANITY_CHECKS { @@ -3359,7 +3359,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) if (!dirtied) clear_entry = TRUE; } /* end if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ if (!entry_ptr->is_protected) @@ -3538,7 +3538,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear entry") } /* end else if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ } H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) @@ -3899,7 +3899,7 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) for (u = 0; u < child_entry->flush_dep_nparents; u++) HDassert(child_entry->flush_dep_parent[u] != parent_entry); - } /* end block */ + } /* end block */ #endif /* NDEBUG */ /* More sanity checks */ @@ -4138,13 +4138,13 @@ done: * *------------------------------------------------------------------------- */ -#if H5C_COLLECT_CACHE_STATS -static herr_t -H5C__pin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) -#else static herr_t -H5C__pin_entry_from_client(H5C_t H5_ATTR_UNUSED *cache_ptr, H5C_cache_entry_t *entry_ptr) +H5C__pin_entry_from_client(H5C_t +#if !H5C_COLLECT_CACHE_STATS + H5_ATTR_UNUSED #endif + * cache_ptr, + H5C_cache_entry_t *entry_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -5823,7 +5823,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(cache_ptr->slist_size == (size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase)); } /* end if */ -#endif /* H5C_DO_SANITY_CHECKS */ +#endif /* H5C_DO_SANITY_CHECKS */ /* Since we are doing a destroy, we must make a pass through * the hash table and try to flush - destroy all entries that @@ -6321,7 +6321,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(cache_ptr->slist_ring_len[ring] == 0); HDassert(cache_ptr->slist_ring_size[ring] == 0); - } /* end if */ + } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ done: @@ -6763,7 +6763,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL) } /* end if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, FAIL) @@ -7130,7 +7130,7 @@ H5C__load_entry(H5F_t *f, int mpi_rank = 0; /* MPI process rank */ MPI_Comm comm = MPI_COMM_NULL; /* File MPI Communicator */ int mpi_code; /* MPI error code */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -7176,7 +7176,7 @@ H5C__load_entry(H5F_t *f, HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "Can't get MPI rank") if ((comm = H5F_mpi_get_comm(f)) == MPI_COMM_NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "get_comm request failed") - } /* end if */ + } /* end if */ #endif /* H5_HAVE_PARALLEL */ /* Get the on-disk entry image */ @@ -7206,7 +7206,7 @@ H5C__load_entry(H5F_t *f, image = (uint8_t *)new_image; #if H5C_DO_MEMORY_SANITY_CHECKS H5MM_memcpy(image + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); -#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ } /* end if */ #ifdef H5_HAVE_PARALLEL @@ -7227,7 +7227,7 @@ H5C__load_entry(H5F_t *f, if (MPI_SUCCESS != (mpi_code = MPI_Bcast(image, buf_size, MPI_BYTE, 0, comm))) HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mpi_code) } /* end if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ /* If the entry could be read speculatively and the length is still * changing, check for updating the actual size @@ -7275,9 +7275,9 @@ H5C__load_entry(H5F_t *f, (mpi_code = MPI_Bcast(image + len, buf_size, MPI_BYTE, 0, comm))) HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mpi_code) } /* end if */ -#endif /* H5_HAVE_PARALLEL */ - } /* end if */ - } /* end if (actual_len != len) */ +#endif /* H5_HAVE_PARALLEL */ + } /* end if */ + } /* end if (actual_len != len) */ else { /* The length has stabilized */ len_changed = FALSE; @@ -7306,8 +7306,7 @@ H5C__load_entry(H5F_t *f, /* Check for too many tries */ if (tries == 0) - HGOTO_ERROR(H5E_CACHE, H5E_READERROR, NULL, - "incorrect metadatda checksum after all read attempts") + HGOTO_ERROR(H5E_CACHE, H5E_READERROR, NULL, "incorrect metadata checksum after all read attempts") /* Calculate and track the # of retries */ retries = max_tries - tries; @@ -8534,7 +8533,7 @@ H5C__serialize_cache(H5F_t *f) scan_ptr = scan_ptr->il_next; } /* end while */ } /* end block */ -#endif /* NDEBUG */ +#endif /* NDEBUG */ /* set cache_ptr->serialization_in_progress to TRUE, and back * to FALSE at the end of the function. Must maintain this flag @@ -8600,7 +8599,7 @@ H5C__serialize_cache(H5F_t *f) scan_ptr = scan_ptr->il_next; } /* end while */ } /* end block */ -#endif /* NDEBUG */ +#endif /* NDEBUG */ done: cache_ptr->serialization_in_progress = FALSE; @@ -8777,7 +8776,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) #ifndef NDEBUG /* Increment serialization counter (to detect multiple serializations) */ entry_ptr->serialization_count++; -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end if */ } /* end if */ @@ -8846,7 +8845,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) #ifndef NDEBUG /* Increment serialization counter (to detect multiple serializations) */ entry_ptr->serialization_count++; -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end if */ } /* end if */ else { @@ -8911,7 +8910,7 @@ H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + image_size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ - } /* end if */ + } /* end if */ /* Generate image for entry */ if (H5C__generate_image(f, cache_ptr, entry_ptr) < 0) @@ -9218,7 +9217,7 @@ H5C_remove_entry(void *_entry) if (entry->coll_access) { entry->coll_access = FALSE; H5C__REMOVE_FROM_COLL_LIST(cache, entry, FAIL) - } /* end if */ + } /* end if */ #endif /* H5_HAVE_PARALLEL */ H5C__UPDATE_RP_FOR_EVICTION(cache, entry, FAIL) @@ -213,7 +213,7 @@ typedef struct H5CX_t { MPI_Datatype ftype; /* MPI datatype for file, when using collective I/O */ hbool_t mpi_file_flushing; /* Whether an MPI-opened file is being flushed */ hbool_t rank0_bcast; /* Whether a dataset meets read-with-rank0-and-bcast requirements */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ /* Cached DXPL properties */ size_t max_temp_buf; /* Maximum temporary buffer size */ @@ -241,8 +241,8 @@ typedef struct H5CX_t { hbool_t mpio_chunk_opt_num_valid; /* Whether collective chunk threshold is valid */ unsigned mpio_chunk_opt_ratio; /* Collective chunk ratio (H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME) */ hbool_t mpio_chunk_opt_ratio_valid; /* Whether collective chunk ratio is valid */ -#endif /* H5_HAVE_PARALLEL */ - H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ +#endif /* H5_HAVE_PARALLEL */ + H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ hbool_t err_detect_valid; /* Whether error detection info is valid */ H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ hbool_t filter_cb_valid; /* Whether filter callback function is valid */ @@ -298,8 +298,8 @@ typedef struct H5CX_t { (H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */ hbool_t mpio_coll_rank0_bcast_set; /* Whether instrumented "collective chunk multi ratio ind" value is set */ -#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ +#endif /* H5_HAVE_PARALLEL */ /* Cached LCPL properties */ H5T_cset_t encoding; /* Link name character encoding */ @@ -373,7 +373,7 @@ typedef struct H5CX_dxpl_cache_t { mpio_chunk_opt_mode; /* Collective chunk option (H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME) */ unsigned mpio_chunk_opt_num; /* Collective chunk thrreshold (H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME) */ unsigned mpio_chunk_opt_ratio; /* Collective chunk ratio (H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME) */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ H5Z_data_xform_t * data_transform; /* Data transform info (H5D_XFER_XFORM_NAME) */ @@ -437,7 +437,7 @@ hbool_t H5_PKG_INIT_VAR = FALSE; #ifndef H5_HAVE_THREADSAFE static H5CX_node_t *H5CX_head_g = NULL; /* Pointer to head of context stack */ -#endif /* H5_HAVE_THREADSAFE */ +#endif /* H5_HAVE_THREADSAFE */ /* Define a "default" dataset transfer property list cache structure to use for default DXPLs */ static H5CX_dxpl_cache_t H5CX_def_dxpl_cache; @@ -932,9 +932,11 @@ H5CX_retrieve_state(H5CX_state_t **api_state) /* Keep a reference to the current VOL wrapping context */ (*api_state)->vol_wrap_ctx = (*head)->ctx.vol_wrap_ctx; - if (NULL != (*api_state)->vol_wrap_ctx) + if (NULL != (*api_state)->vol_wrap_ctx) { + HDassert((*head)->ctx.vol_wrap_ctx_valid); if (H5VL_inc_vol_wrapper((*api_state)->vol_wrap_ctx) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTINC, FAIL, "can't increment refcount on VOL wrapping context") + } /* end if */ /* Keep a copy of the VOL connector property, if there is one */ if ((*head)->ctx.vol_connector_prop_valid && (*head)->ctx.vol_connector_prop.connector_id > 0) { @@ -1023,6 +1025,8 @@ H5CX_restore_state(const H5CX_state_t *api_state) /* Restore the VOL wrapper context */ (*head)->ctx.vol_wrap_ctx = api_state->vol_wrap_ctx; + if (NULL != (*head)->ctx.vol_wrap_ctx) + (*head)->ctx.vol_wrap_ctx_valid = TRUE; /* Restore the VOL connector info */ if (api_state->vol_connector_prop.connector_id) { @@ -1377,8 +1381,8 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, if (H5P_USER_TRUE == md_coll_read) is_collective = TRUE; } /* end if */ -#endif /* H5_HAVE_PARALLEL */ - } /* end else */ +#endif /* H5_HAVE_PARALLEL */ + } /* end else */ #ifdef H5_HAVE_PARALLEL /* Check for collective operation */ @@ -1404,7 +1408,7 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, MPI_Barrier(mpi_comm); } /* end if */ } /* end if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1465,7 +1469,7 @@ H5CX_set_loc(hid_t done: FUNC_LEAVE_NOAPI(ret_value) -#else /* H5_HAVE_PARALLEL */ +#else /* H5_HAVE_PARALLEL */ FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index a8917ea..3cd6e6c 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -434,7 +434,7 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, 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; -#endif /* H5C_COLLECT_CACHE_STATS */ +#endif /* H5C_COLLECT_CACHE_STATS */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -489,7 +489,7 @@ H5C_stats(H5C_t *cache_ptr, const char *cache_name, if (aggregate_max_pins < cache_ptr->max_pins[i]) aggregate_max_pins = cache_ptr->max_pins[i]; #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ - } /* end for */ + } /* end for */ if ((total_hits > 0) || (total_misses > 0)) hit_rate = (double)100.0f * ((double)(total_hits)) / ((double)(total_hits + total_misses)); @@ -738,7 +738,7 @@ H5C_stats__reset(H5C_t *cache_ptr) #else /* NDEBUG */ #if H5C_COLLECT_CACHE_STATS H5C_stats__reset(H5C_t *cache_ptr) -#else /* H5C_COLLECT_CACHE_STATS */ +#else /* H5C_COLLECT_CACHE_STATS */ H5C_stats__reset(H5C_t H5_ATTR_UNUSED *cache_ptr) #endif /* H5C_COLLECT_CACHE_STATS */ #endif /* NDEBUG */ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index b3f6c12..3135969 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -361,7 +361,7 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr) fake_cache_ptr->image_entries = (H5C_image_entry_t *)H5MM_xfree(fake_cache_ptr->image_entries); fake_cache_ptr = (H5C_t *)H5MM_xfree(fake_cache_ptr); - } /* end block */ + } /* end block */ #endif /* NDEBUG */ done: @@ -908,7 +908,7 @@ done: herr_t #if H5C_COLLECT_CACHE_STATS H5C_image_stats(H5C_t *cache_ptr, hbool_t print_header) -#else /* H5C_COLLECT_CACHE_STATS */ +#else /* H5C_COLLECT_CACHE_STATS */ H5C_image_stats(H5C_t *cache_ptr, hbool_t H5_ATTR_UNUSED print_header) #endif /* H5C_COLLECT_CACHE_STATS */ { @@ -918,7 +918,7 @@ H5C_image_stats(H5C_t *cache_ptr, hbool_t H5_ATTR_UNUSED print_header) int64_t total_misses = 0; double hit_rate; double prefetch_use_rate; -#endif /* H5C_COLLECT_CACHE_STATS */ +#endif /* H5C_COLLECT_CACHE_STATS */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1024,7 +1024,7 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) HMPI_GOTO_ERROR(FAIL, "can't receive cache image MPI_Bcast", mpi_result) } /* end else-if */ } /* end block */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1607,7 +1607,7 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_image_ctl HDassert(!(cache_ptr->image_ctl.generate_image)); } /* end else */ #ifdef H5_HAVE_PARALLEL - } /* end else */ + } /* end else */ #endif /* H5_HAVE_PARALLEL */ done: @@ -2088,7 +2088,7 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e u++; } /* end while */ HDassert(found); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end if */ } /* end if */ @@ -3172,7 +3172,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) * we add code to store and restore adaptive resize status. */ HDassert(lru_rank_holes <= H5C__MAX_EPOCH_MARKERS); - } /* end block */ + } /* end block */ #endif /* NDEBUG */ /* Check to see if the cache is oversize, and evict entries as @@ -3480,7 +3480,7 @@ H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr) #ifdef H5_HAVE_PARALLEL } /* end if */ } /* end block */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Clog.c b/src/H5Clog.c index d48b7b1..3e7d6da 100644 --- a/src/H5Clog.c +++ b/src/H5Clog.c @@ -269,8 +269,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_logging_status(const H5C_t *cache, /*OUT*/ hbool_t *is_enabled, - /*OUT*/ hbool_t *is_currently_logging) +H5C_get_logging_status(const H5C_t *cache, hbool_t *is_enabled, hbool_t *is_currently_logging) { FUNC_ENTER_NOAPI_NOERR diff --git a/src/H5Ctag.c b/src/H5Ctag.c index a3eb173..47df69f 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -883,7 +883,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_get_tag(const void *thing, haddr_t *tag /*OUT*/) +H5C_get_tag(const void *thing, haddr_t *tag) { const H5C_cache_entry_t *entry = (const H5C_cache_entry_t *)thing; /* Pointer to cache entry */ @@ -138,7 +138,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t /* Create the dataset */ if (NULL == (dset = H5VL_dataset_create(vol_obj, &loc_params, name, lcpl_id, type_id, space_id, dcpl_id, dapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset") + HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, H5I_INVALID_HID, "unable to create dataset") /* Get an ID for the dataset */ if ((ret_value = H5VL_register(H5I_DATASET, dset, vol_obj->connector, TRUE)) < 0) @@ -187,9 +187,9 @@ done: hid_t H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id) { - void * dset = NULL; /* dset object from VOL connector */ - H5VL_object_t * vol_obj = NULL; /* object of loc_id */ - H5VL_loc_params_t loc_params; + void * dset = NULL; /* dset object from VOL connector */ + H5VL_object_t * vol_obj = NULL; /* Object for loc_id */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -374,13 +374,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Ds", dset_id, allocation); + H5TRACE2("e", "ix", dset_id, allocation); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -661,7 +661,7 @@ H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *op herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "*xiix*x", buf, type_id, space_id, op, operator_data); + H5TRACE5("e", "*xiiDO*x", buf, type_id, space_id, op, operator_data); /* Check args */ if (NULL == op) @@ -704,14 +704,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size) +H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size /*out*/) { H5VL_object_t *vol_obj; /* Dataset for this operation */ hbool_t supported; /* Whether 'get vlen buf size' operation is supported by VOL connector */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iii*h", dataset_id, type_id, space_id, size); + H5TRACE4("e", "iiix", dataset_id, type_id, space_id, size); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(dataset_id))) @@ -911,13 +911,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dget_chunk_index_type(hid_t dset_id, H5D_chunk_index_t *idx_type) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Dk", dset_id, idx_type); + H5TRACE2("e", "ix", dset_id, idx_type); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -950,13 +950,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_nbytes) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*h*h", dset_id, offset, chunk_nbytes); + H5TRACE3("e", "i*hx", dset_id, offset, chunk_nbytes); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -997,13 +997,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks) +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; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ii*h", dset_id, fspace_id, nchunks); + H5TRACE3("e", "iix", dset_id, fspace_id, nchunks); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -1043,15 +1043,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *offset, unsigned *filter_mask, - haddr_t *addr, hsize_t *size) +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; FUNC_ENTER_API(FAIL) - H5TRACE7("e", "iih*h*Iu*a*h", dset_id, fspace_id, chk_index, offset, filter_mask, addr, size); + H5TRACE7("e", "iihxxxx", dset_id, fspace_id, chk_index, offset, filter_mask, addr, size); /* Check arguments */ if (NULL == offset && NULL == filter_mask && NULL == addr && NULL == size) @@ -1100,14 +1100,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filter_mask, haddr_t *addr, - hsize_t *size) +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; FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*h*Iu*a*h", dset_id, offset, filter_mask, addr, size); + H5TRACE5("e", "i*hxxx", dset_id, offset, filter_mask, addr, size); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 60bf57e..081206e 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2429,7 +2429,7 @@ H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_ #ifdef H5_HAVE_PARALLEL } /* end else */ #endif /* H5_HAVE_PARALLEL */ - } /* end else */ + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -4427,7 +4427,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ /* Check for the chunk expanding too much to encode in a 32-bit value */ if (orig_chunk_size > ((size_t)0xffffffff)) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") -#endif /* H5_SIZEOF_SIZE_T > 4 */ +#endif /* H5_SIZEOF_SIZE_T > 4 */ } /* end if */ } /* end if */ @@ -4629,7 +4629,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ #ifdef H5_HAVE_PARALLEL } /* end else */ #endif /* H5_HAVE_PARALLEL */ - } /* end if */ + } /* end if */ /* Insert the chunk record into the index */ if (need_insert && ops->insert) diff --git a/src/H5Defl.c b/src/H5Defl.c index 1ab677a..77ea056 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -272,8 +272,8 @@ H5D__efl_read(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t size tempto_read = MIN((size_t)(efl->slot[u].size - skip), (hsize_t)size); H5_CHECK_OVERFLOW(tempto_read, hsize_t, size_t); to_read = (size_t)tempto_read; -#else /* NDEBUG */ - to_read = MIN((size_t)(efl->slot[u].size - skip), (hsize_t)size); +#else /* NDEBUG */ + to_read = MIN((size_t)(efl->slot[u].size - skip), (hsize_t)size); #endif /* NDEBUG */ if ((n = HDread(fd, buf, to_read)) < 0) HGOTO_ERROR(H5E_EFL, H5E_READERROR, FAIL, "read error in external raw data file") @@ -364,7 +364,7 @@ H5D__efl_write(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t siz tempto_write = MIN(efl->slot[u].size - skip, (hsize_t)size); H5_CHECK_OVERFLOW(tempto_write, hsize_t, size_t); to_write = (size_t)tempto_write; -#else /* NDEBUG */ +#else /* NDEBUG */ to_write = MIN((size_t)(efl->slot[u].size - skip), size); #endif /* NDEBUG */ if ((size_t)HDwrite(fd, buf, to_write) != to_write) diff --git a/src/H5Dint.c b/src/H5Dint.c index 7a2b93b..813a7c7 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -344,11 +344,6 @@ H5D__close_cb(H5VL_object_t *dset_vol_obj) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to close dataset"); done: - /* XXX: (MSC) Weird thing for datasets and filters: - * Always decrement the ref count on the VOL for datasets, since - * the ID is removed even if the close fails. - */ - /* Free the VOL object */ if (H5VL_free_object(dset_vol_obj) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to free VOL object"); @@ -2006,7 +2001,7 @@ H5D_close(H5D_t *dataset) HDassert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Destroy any cached layout information for the dataset */ @@ -2170,7 +2165,7 @@ H5D_mult_refresh_close(hid_t dset_id) HDassert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Destroy any cached layout information for the dataset */ @@ -2380,7 +2375,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, hb HDassert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Check if we need to initialize the space */ @@ -2502,7 +2497,7 @@ H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t HDassert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ /*lint !e788 All appropriate cases are covered */ done: diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index df7c829..71e5f0a 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -207,6 +207,9 @@ typedef struct H5D_filtered_collective_io_info_t { } async_info; } H5D_filtered_collective_io_info_t; +/* Function pointer typedef for sort function */ +typedef int (*H5D_mpio_sort_func_cb_t)(const void *, const void *); + /********************/ /* Local Prototypes */ /********************/ @@ -424,7 +427,7 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, co #ifdef H5_HAVE_INSTRUMENTED_LIBRARY H5CX_test_set_mpio_coll_rank0_bcast(TRUE); #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ - } /* end if */ + } /* end if */ /* Set the return value, based on the global cause */ ret_value = global_cause[0] > 0 ? FALSE : TRUE; @@ -527,7 +530,7 @@ done: static herr_t H5D__mpio_array_gatherv(void *local_array, size_t local_array_num_entries, size_t array_entry_size, void **_gathered_array, size_t *_gathered_array_num_entries, hbool_t allgather, - int root, MPI_Comm comm, int (*sort_func)(const void *, const void *)) + int root, MPI_Comm comm, H5D_mpio_sort_func_cb_t sort_func) { size_t gathered_array_num_entries = 0; /* The size of the newly-constructed array */ void * gathered_array = NULL; /* The newly-constructed array returned to the caller */ @@ -843,7 +846,7 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf else temp_not_link_io = TRUE; #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ - } /* end else */ + } /* end else */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY { diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 6a85a95..4e40d27 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -131,7 +131,6 @@ H5_DLL hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t s hid_t dcpl_id, hid_t dapl_id); H5_DLL hid_t H5Dcreate_anon(hid_t file_id, hid_t type_id, hid_t space_id, hid_t plist_id, hid_t dapl_id); H5_DLL hid_t H5Dopen2(hid_t file_id, const char *name, hid_t dapl_id); -H5_DLL herr_t H5Dclose(hid_t dset_id); H5_DLL hid_t H5Dget_space(hid_t dset_id); H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation); H5_DLL hid_t H5Dget_type(hid_t dset_id); @@ -163,9 +162,10 @@ H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, h void *dst_buf); H5_DLL herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data); -H5_DLL herr_t H5Ddebug(hid_t dset_id); +H5_DLL herr_t H5Dclose(hid_t dset_id); /* 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); diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 1a272d8..ee3fce8 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -916,7 +916,7 @@ H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info) *------------------------------------------------------------------------- */ herr_t -H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf) +H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_id, void *dst_buf /*out*/) { H5T_t * type; /* Datatype */ H5S_t * dst_space; /* Dataspace */ @@ -930,7 +930,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "x*xii*x", op, op_data, type_id, dst_space_id, dst_buf); + H5TRACE5("e", "DS*xiix", op, op_data, type_id, dst_space_id, dst_buf); /* Check args */ if (op == NULL) @@ -1012,7 +1012,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf, +H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf_size, void *dst_buf /*out*/, H5D_gather_func_t op, void *op_data) { H5T_t * type; /* Datatype */ @@ -1026,7 +1026,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*xiz*xx*x", src_space_id, src_buf, type_id, dst_buf_size, dst_buf, op, op_data); + H5TRACE7("e", "i*xizxDg*x", src_space_id, src_buf, type_id, dst_buf_size, dst_buf, op, op_data); /* Check args */ if (NULL == (src_space = (H5S_t *)H5I_object_verify(src_space_id, H5I_DATASPACE))) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 2588d1c..f61522f 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2821,8 +2821,8 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsiz HDassert((tot_nelmts + (hsize_t)select_nelmts) >= nelmts); } /* end block */ #endif /* NDEBUG */ - } /* end if */ - } /* end if */ + } /* end if */ + } /* end if */ done: /* Cleanup I/O operation */ @@ -306,14 +306,14 @@ H5E__set_default_auto(H5E_t *stk) #ifndef H5_NO_DEPRECATED_SYMBOLS #ifdef H5_USE_16_API_DEFAULT stk->auto_op.vers = 1; -#else /* H5_USE_16_API */ +#else /* H5_USE_16_API */ stk->auto_op.vers = 2; #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.is_default = TRUE; -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ stk->auto_op.func2 = (H5E_auto2_t)H5Eprint2; #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -575,13 +575,13 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Eget_class_name(hid_t class_id, char *name, size_t size) +H5Eget_class_name(hid_t class_id, char *name /*out*/, size_t size) { H5E_cls_t *cls; /* Pointer to error class */ ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "i*sz", class_id, name, size); + H5TRACE3("Zs", "ixz", class_id, name, size); /* Get the error class */ if (NULL == (cls = (H5E_cls_t *)H5I_object_verify(class_id, H5I_ERROR_CLASS))) @@ -836,13 +836,13 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg_str, size_t size) +H5Eget_msg(hid_t msg_id, H5E_type_t *type /*out*/, char *msg_str /*out*/, size_t size) { H5E_msg_t *msg; /* Pointer to error message */ ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API_NOCLEAR((-1)) - H5TRACE4("Zs", "i*Et*sz", msg_id, type, msg_str, size); + H5TRACE4("Zs", "ixxz", msg_id, type, msg_str, size); /* Get the message object */ if (NULL == (msg = (H5E_msg_t *)H5I_object_verify(msg_id, H5I_ERROR_MSG))) @@ -1318,6 +1318,7 @@ done: * *------------------------------------------------------------------------- */ +H5_ATTR_FORMAT(printf, 8, 9) 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 *fmt, ...) @@ -1524,14 +1525,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data) +H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func /*out*/, void **client_data /*out*/) { H5E_t * estack; /* Error stack to operate on */ H5E_auto_op_t op; /* Error stack function */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", estack_id, func, client_data); + H5TRACE3("e", "ixx", estack_id, func, client_data); if (estack_id == H5E_DEFAULT) { if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in @@ -1589,7 +1590,7 @@ H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(FAIL) - H5TRACE3("e", "ix*x", estack_id, func, client_data); + H5TRACE3("e", "iEA*x", estack_id, func, client_data); if (estack_id == H5E_DEFAULT) { if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 6316ded..a41c25c 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -555,9 +555,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, default: #ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ } /* end if */ else @@ -939,10 +939,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, default: #ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); #endif /* NDEBUG */ - } /* end switch */ + } /* end switch */ CATCH @@ -1346,10 +1346,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, default: #ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); #endif /* NDEBUG */ - } /* end switch */ + } /* end switch */ CATCH @@ -1750,10 +1750,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, default: #ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); #endif /* NDEBUG */ - } /* end switch */ + } /* end switch */ CATCH @@ -2125,10 +2125,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, default: #ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); #endif /* NDEBUG */ - } /* end switch */ + } /* end switch */ CATCH diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 0a85729..bbd436e 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -262,7 +262,7 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, /* Local variables */ #ifndef NDEBUG H5EA__test_ctx_t *ctx = (H5EA__test_ctx_t *)_ctx; /* Callback context to destroy */ -#endif /* NDEBUG */ +#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 */ diff --git a/src/H5ESpublic.h b/src/H5ESpublic.h index 63f2379..dad929e 100644 --- a/src/H5ESpublic.h +++ b/src/H5ESpublic.h @@ -10,6 +10,10 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * This file contains public declarations for the H5ES (event set) module. + */ + #ifndef _H5ESpublic_H #define _H5ESpublic_H diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index d3eef5d..0f887ec 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -334,14 +334,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Eget_auto1(H5E_auto1_t *func, void **client_data) +H5Eget_auto1(H5E_auto1_t *func /*out*/, void **client_data /*out*/) { H5E_t * estack; /* Error stack to operate on */ H5E_auto_op_t auto_op; /* Error stack operator */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "*x**x", func, client_data); + H5TRACE2("e", "xx", func, client_data); /* Retrieve default error stack */ if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in @@ -395,7 +395,7 @@ H5Eset_auto1(H5E_auto1_t func, void *client_data) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(FAIL) - H5TRACE2("e", "x*x", func, client_data); + H5TRACE2("e", "Ea*x", func, client_data); if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ diff --git a/src/H5Eint.c b/src/H5Eint.c index c743ddb..2580fa4 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -440,10 +440,10 @@ H5E__print(const H5E_t *estack, FILE *stream, hbool_t bk_compatible) walk_op.u.func1 = H5E__walk1_cb; if (H5E__walk(estack, H5E_WALK_DOWNWARD, &walk_op, (void *)&eprint) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ HDassert(0 && "version 1 error stack print without deprecated symbols!"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - } /* end if */ + } /* end if */ else { walk_op.vers = 2; walk_op.u.func2 = H5E__walk2_cb; @@ -539,10 +539,10 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o if (ret_value < 0) HERROR(H5E_ERROR, H5E_CANTLIST, "can't walk error stack"); } /* end if */ -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ HDassert(0 && "version 1 error stack walk without deprecated symbols!"); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - } /* end if */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + } /* end if */ else { HDassert(op->vers == 2); if (op->u.func2) { @@ -939,7 +939,7 @@ H5E_dump_api_stack(hbool_t is_api) #ifdef H5_NO_DEPRECATED_SYMBOLS if (estack->auto_op.func2) (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ if (estack->auto_op.vers == 1) { if (estack->auto_op.func1) (void)((estack->auto_op.func1)(estack->auto_data)); @@ -949,7 +949,7 @@ H5E_dump_api_stack(hbool_t is_api) (void)((estack->auto_op.func2)(H5E_DEFAULT, estack->auto_data)); } /* end else */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - } /* end if */ + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Epkg.h b/src/H5Epkg.h index a1db885..fe5e127 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -73,7 +73,7 @@ typedef struct { H5E_auto1_t func1_default; /* The saved library's default function - old style. */ H5E_auto2_t func2_default; /* The saved library's default function - new style. */ } H5E_auto_op_t; -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ typedef struct { H5E_auto2_t func2; /* Only the new style callback function is available. */ } H5E_auto_op_t; @@ -85,7 +85,7 @@ typedef struct { union { #ifndef H5_NO_DEPRECATED_SYMBOLS H5E_walk1_t func1; /* Old-style callback, NO error stack param. */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ H5E_walk2_t func2; /* New-style callback, with error stack param. */ } u; } H5E_walk_op_t; diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 8f89201..f3d3b6f 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -114,12 +114,18 @@ typedef struct H5E_t H5E_t; #define HSYS_DONE_ERROR(majorcode, minorcode, retcode, str) \ { \ int myerrno = errno; \ + /* 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'", str, myerrno, \ HDstrerror(myerrno)); \ } #define HSYS_GOTO_ERROR(majorcode, minorcode, retcode, str) \ { \ int myerrno = errno; \ + /* 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'", str, myerrno, \ HDstrerror(myerrno)); \ } @@ -21,20 +21,13 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Aprivate.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ #include "H5FLprivate.h" /* Free lists */ -#include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -#include "H5Tprivate.h" /* Datatypes */ #include "H5VLprivate.h" /* Virtual Object Layer */ #include "H5VLnative_private.h" /* Native VOL connector */ @@ -312,12 +305,12 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list) +H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list /*out*/) { ssize_t ret_value = 0; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE4("Zs", "iIuz*i", file_id, types, max_objs, oid_list); + H5TRACE4("Zs", "iIuzx", file_id, types, max_objs, oid_list); /* Check arguments */ if (0 == (types & H5F_OBJ_ALL)) @@ -391,13 +384,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ii**x", file_id, fapl_id, file_handle); + H5TRACE3("e", "iix", file_id, fapl_id, file_handle); /* Check args */ if (!file_handle) @@ -479,7 +472,7 @@ done: hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { - H5F_t * new_file = NULL; /* File struct for new file */ + void * new_file = NULL; /* File struct for new file */ H5P_genplist_t * plist; /* Property list pointer */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ H5VL_object_t * vol_obj = NULL; /* VOL object for file */ @@ -534,8 +527,8 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; /* Create a new file or truncate an existing file through the VOL */ - if (NULL == (new_file = (H5F_t *)H5VL_file_create(&connector_prop, filename, flags, fcpl_id, fapl_id, - H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) + if (NULL == (new_file = H5VL_file_create(&connector_prop, filename, flags, fcpl_id, fapl_id, + H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to create file") /* Get an atom for the file */ @@ -579,7 +572,7 @@ done: hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { - H5F_t * new_file = NULL; /* File struct for new file */ + void * new_file = NULL; /* File struct for new file */ H5P_genplist_t * plist; /* Property list pointer */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ H5VL_object_t * vol_obj = NULL; /* VOL object for file */ @@ -622,8 +615,8 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL connector info in API context") /* Open the file through the VOL layer */ - if (NULL == (new_file = (H5F_t *)H5VL_file_open(&connector_prop, filename, flags, fapl_id, - H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) + if (NULL == (new_file = H5VL_file_open(&connector_prop, filename, flags, fapl_id, + H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file") /* Get an ID for the file */ @@ -674,7 +667,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) H5I_DATASET != obj_type && H5I_ATTR != obj_type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - /* get the file object */ + /* Get the file object */ if (NULL == (vol_obj = H5VL_vol_object(object_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") @@ -704,7 +697,7 @@ done: herr_t H5Fclose(hid_t file_id) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -715,7 +708,7 @@ H5Fclose(hid_t file_id) /* Close the file */ if (H5I_dec_app_ref(file_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed") + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") done: FUNC_LEAVE_API(ret_value) @@ -833,7 +826,6 @@ H5Freopen(hid_t file_id) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to make file 'post open' callback") done: - /* XXX (VOL MERGE): If registration fails, file will not be closed */ FUNC_LEAVE_API(ret_value) } /* end H5Freopen() */ @@ -848,12 +840,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_intent(hid_t file_id, unsigned *intent_flags) +H5Fget_intent(hid_t file_id, unsigned *intent_flags /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", file_id, intent_flags); + H5TRACE2("e", "ix", file_id, intent_flags); /* If no intent flags were passed in, exit quietly */ if (intent_flags) { @@ -884,12 +876,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_fileno(hid_t file_id, unsigned long *fnumber) +H5Fget_fileno(hid_t file_id, unsigned long *fnumber /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Ul", file_id, fnumber); + H5TRACE2("e", "ix", file_id, fnumber); /* If no fnumber pointer was passed in, exit quietly */ if (fnumber) { @@ -952,13 +944,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_filesize(hid_t file_id, hsize_t *size) +H5Fget_filesize(hid_t file_id, hsize_t *size /*out*/) { H5VL_object_t *vol_obj; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*h", file_id, size); + H5TRACE2("e", "ix", file_id, size); /* Check args */ if (!size) @@ -1013,13 +1005,13 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) +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 */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "i*xz", file_id, buf_ptr, buf_len); + H5TRACE3("Zs", "ixz", file_id, buf, buf_len); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1027,7 +1019,7 @@ H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) /* Get the file image */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_FILE_IMAGE, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, buf_ptr, &ret_value, buf_len) < 0) + H5_REQUEST_NULL, buf, &ret_value, buf_len) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file image") done: @@ -1049,17 +1041,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", file_id, config_ptr); + H5TRACE2("e", "ix", file_id, config); /* Check args */ - if ((NULL == config_ptr) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") + if ((NULL == config) || (config->version != H5AC__CURR_CACHE_CONFIG_VERSION)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config ptr") /* Get the file object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) @@ -1067,7 +1059,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) /* 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_ptr) < 0) + config) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache configuration") done: @@ -1092,7 +1084,7 @@ H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", file_id, config_ptr); + H5TRACE2("e", "i*Cc", file_id, config_ptr); /* Get the file object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) @@ -1120,23 +1112,23 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr) +H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate /*out*/) { H5VL_object_t *vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*d", file_id, hit_rate_ptr); + H5TRACE2("e", "ix", file_id, hit_rate); /* Check args */ - if (NULL == hit_rate_ptr) + if (NULL == hit_rate) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL hit rate pointer") 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") /* 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_ptr) < 0) + hit_rate) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC hit rate") done: @@ -1157,14 +1149,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, - int *cur_num_entries_ptr) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*z*z*z*Is", file_id, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr); + H5TRACE5("e", "ixxxx", file_id, max_size, min_clean_size, cur_size, cur_num_entries); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1172,7 +1164,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, /* 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_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr) < 0) + max_size, min_clean_size, cur_size, cur_num_entries) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC size") done: @@ -1279,14 +1271,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", obj_id, finfo); + H5TRACE2("e", "ix", obj_id, finfo); /* Check args */ if (!finfo) @@ -1322,13 +1314,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", file_id, info); + H5TRACE2("e", "ix", file_id, info); /* Check args */ if (!info) @@ -1553,13 +1545,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, hbool_t *is_currently_logging) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*b*b", file_id, is_enabled, is_currently_logging); + H5TRACE3("e", "ixx", file_id, is_enabled, is_currently_logging); /* Sanity check */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1690,14 +1682,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2], unsigned misses[2], - unsigned evictions[2], unsigned bypasses[2]) +H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2] /*out*/, unsigned hits[2] /*out*/, + 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 */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*Iu*Iu*Iu*Iu*Iu", file_id, accesses, hits, misses, evictions, bypasses); + H5TRACE6("e", "ixxxxx", file_id, accesses, hits, misses, evictions, bypasses); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1728,13 +1721,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_len) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*a*h", file_id, image_addr, image_len); + H5TRACE3("e", "ixx", file_id, image_addr, image_len); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1761,13 +1754,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_eoa(hid_t file_id, haddr_t *eoa) +H5Fget_eoa(hid_t file_id, haddr_t *eoa /*out*/) { H5VL_object_t *vol_obj; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*a", file_id, eoa); + H5TRACE2("e", "ix", file_id, eoa); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1827,13 +1820,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize) +H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize /*out*/) { H5VL_object_t *vol_obj = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", file_id, minimize); + H5TRACE2("e", "ix", file_id, minimize); if (NULL == minimize) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "out pointer 'minimize' cannot be NULL") diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 3772399..b9c2f93 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -478,9 +478,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, default: #ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ } /* end if */ else @@ -862,9 +862,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, default: #ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ } /* end if */ @@ -1205,10 +1205,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, default: #ifdef NDEBUG H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); #endif /* NDEBUG */ - } /* end switch */ + } /* end switch */ CATCH diff --git a/src/H5FAtest.c b/src/H5FAtest.c index 4da7d6f..350530a 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -241,7 +241,7 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, /* Local variables */ #ifndef NDEBUG H5FA__test_ctx_t *ctx = (H5FA__test_ctx_t *)_ctx; /* Callback context to destroy */ -#endif /* NDEBUG */ +#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 */ @@ -218,7 +218,7 @@ H5FDregister(const H5FD_class_t *cls) hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE1("i", "*x", cls); + H5TRACE1("i", "*FC", cls); /* Check arguments */ if (!cls) @@ -644,7 +644,7 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5FD_t *ret_value = NULL; FUNC_ENTER_API(NULL) - H5TRACE4("*x", "*sIuia", name, flags, fapl_id, maxaddr); + H5TRACE4("*#", "*sIuia", name, flags, fapl_id, maxaddr); /* Check arguments */ if (H5P_DEFAULT == fapl_id) @@ -780,7 +780,7 @@ H5FDclose(H5FD_t *file) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", file); + H5TRACE1("e", "*#", file); /* Check arguments */ if (!file) @@ -858,7 +858,7 @@ H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) int ret_value = -1; FUNC_ENTER_API(-1) /* return value is arbitrary */ - H5TRACE2("Is", "*x*x", f1, f2); + H5TRACE2("Is", "*#*#", f1, f2); /* Call private function */ ret_value = H5FD_cmp(f1, f2); @@ -928,7 +928,7 @@ H5FDquery(const H5FD_t *file, unsigned long *flags /*out*/) int ret_value = 0; FUNC_ENTER_API((-1)) - H5TRACE2("Is", "*xx", file, flags); + H5TRACE2("Is", "*#x", file, flags); /* Check arguments */ if (!file) @@ -1021,7 +1021,7 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_API(HADDR_UNDEF) - H5TRACE4("a", "*xMtih", file, type, dxpl_id, size); + H5TRACE4("a", "*#Mtih", file, type, dxpl_id, size); /* Check arguments */ if (!file) @@ -1071,7 +1071,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "*xMtiah", file, type, dxpl_id, addr, size); + H5TRACE5("e", "*#Mtiah", file, type, dxpl_id, addr, size); /* Check arguments */ if (!file) @@ -1114,7 +1114,7 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type) haddr_t ret_value; FUNC_ENTER_API(HADDR_UNDEF) - H5TRACE2("a", "*xMt", file, type); + H5TRACE2("a", "*#Mt", file, type); /* Check arguments */ if (!file) @@ -1162,7 +1162,7 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xMta", file, type, addr); + H5TRACE3("e", "*#Mta", file, type, addr); /* Check arguments */ if (!file) @@ -1210,7 +1210,7 @@ H5FDget_eof(H5FD_t *file, H5FD_mem_t type) haddr_t ret_value; FUNC_ENTER_API(HADDR_UNDEF) - H5TRACE2("a", "*xMt", file, type); + H5TRACE2("a", "*#Mt", file, type); /* Check arguments */ if (!file) @@ -1361,7 +1361,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "*xMtiazx", file, type, dxpl_id, addr, size, buf); + H5TRACE6("e", "*#Mtiazx", file, type, dxpl_id, addr, size, buf); /* Check arguments */ if (!file) @@ -1407,7 +1407,7 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "*xMtiaz*x", file, type, dxpl_id, addr, size, buf); + H5TRACE6("e", "*#Mtiaz*x", file, type, dxpl_id, addr, size, buf); /* Check arguments */ if (!file) @@ -1451,7 +1451,7 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xib", file, dxpl_id, closing); + H5TRACE3("e", "*#ib", file, dxpl_id, closing); /* Check arguments */ if (!file) @@ -1518,7 +1518,7 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xib", file, dxpl_id, closing); + H5TRACE3("e", "*#ib", file, dxpl_id, closing); /* Check arguments */ if (!file) @@ -1584,7 +1584,7 @@ H5FDlock(H5FD_t *file, hbool_t rw) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "*xb", file, rw); + H5TRACE2("e", "*#b", file, rw); /* Check arguments */ if (!file) @@ -1643,7 +1643,7 @@ H5FDunlock(H5FD_t *file) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", file); + H5TRACE1("e", "*#", file); /* Check arguments */ if (!file) @@ -1724,12 +1724,12 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) *-------------------------------------------------------------------------- */ herr_t -H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle) +H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*xi**x", file, fapl_id, file_handle); + H5TRACE3("e", "*#ix", file, fapl_id, file_handle); /* Check arguments */ if (!file) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 419a0d9..a9e49d3 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -88,7 +88,7 @@ typedef struct H5FD_core_t { DWORD dwVolumeSerialNumber; HANDLE hFile; /* Native windows file handle */ -#endif /* H5_HAVE_WIN32_API */ +#endif /* H5_HAVE_WIN32_API */ hbool_t dirty; /* changes not saved? */ H5FD_file_image_callbacks_t fi_callbacks; /* file image callbacks */ H5SL_t * dirty_list; /* dirty parts of the file */ @@ -281,13 +281,13 @@ H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) else { /* Store the new item endpoint if it's bigger */ item->end = (item->end < end) ? end : item->end; - } /* end else */ - } /* end if */ + } + } else { /* Update the size of the before region */ if (b_item->end < end) b_item->end = end; - } /* end else */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -557,14 +557,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_core_write_tracking(hid_t plist_id, hbool_t *is_enabled, size_t *page_size) +H5Pget_core_write_tracking(hid_t plist_id, hbool_t *is_enabled /*out*/, size_t *page_size /*out*/) { H5P_genplist_t * plist; /* Property list pointer */ const H5FD_core_fapl_t *fa; /* Core VFD info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*b*z", plist_id, is_enabled, page_size); + H5TRACE3("e", "ixx", plist_id, is_enabled, page_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -831,11 +831,11 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr file->nFileIndexHigh = fileinfo.nFileIndexHigh; file->nFileIndexLow = fileinfo.nFileIndexLow; file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; file->inode = sb.st_ino; #endif /* H5_HAVE_WIN32_API */ - } /* end if */ + } /* end if */ /* If an existing file is opened, load the whole file into memory. */ if (!(H5F_ACC_CREAT & flags)) { @@ -1071,7 +1071,7 @@ H5FD__core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HGOTO_DONE(-1) if (f1->device > f2->device) HGOTO_DONE(1) -#else /* H5_DEV_T_IS_SCALAR */ +#else /* H5_DEV_T_IS_SCALAR */ /* If dev_t isn't a scalar value on this system, just use memcmp to * determine if the values are the same or not. The actual return value * shouldn't really matter... @@ -1088,7 +1088,7 @@ H5FD__core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HGOTO_DONE(1) #endif /*H5_HAVE_WIN32_API*/ - } /* end if */ + } /* end if */ else { if (NULL == f1->name && NULL == f2->name) { if (f1 < f2) @@ -1335,7 +1335,7 @@ H5FD__core_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU temp_nbytes = file->eof - addr; H5_CHECK_OVERFLOW(temp_nbytes, hsize_t, size_t); nbytes = MIN(size, (size_t)temp_nbytes); -#else /* NDEBUG */ +#else /* NDEBUG */ nbytes = MIN(size, (size_t)(file->eof - addr)); #endif /* NDEBUG */ @@ -1607,7 +1607,7 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing bError = SetEndOfFile(file->hFile); if (0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ if (-1 == HDftruncate(file->fd, (HDoff_t)new_eof)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index ac7720f..eb2590f 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -383,15 +383,14 @@ done: static void * H5FD__direct_fapl_get(H5FD_t *_file) { - H5FD_direct_t *file = (H5FD_direct_t *)_file; - void * ret_value; /* Return value */ + H5FD_direct_t *file = (H5FD_direct_t *)_file; + void * ret_value = NULL; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR /* Set return value */ ret_value = H5FD__direct_fapl_copy(&(file->fa)); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__direct_fapl_get() */ @@ -444,10 +443,10 @@ H5FD__direct_fapl_copy(const void *_old_fa) static H5FD_t * H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - int o_flags; - int fd = (-1); - H5FD_direct_t * file = NULL; - H5FD_direct_fapl_t *fa; + int o_flags; + int fd = (-1); + H5FD_direct_t * file = NULL; + const H5FD_direct_fapl_t *fa; #ifdef H5_HAVE_WIN32_API HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; @@ -496,7 +495,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad /* Get the driver specific information */ if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - if (NULL == (fa = (H5FD_direct_fapl_t *)H5P_peek_driver_info(plist))) + if (NULL == (fa = (const H5FD_direct_fapl_t *)H5P_peek_driver_info(plist))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info") file->fd = fd; @@ -546,7 +545,8 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad } else { file->fa.must_align = FALSE; - HDftruncate(file->fd, (HDoff_t)0); + if (-1 == HDftruncate(file->fd, (HDoff_t)0)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file") } } else { @@ -660,7 +660,7 @@ H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HGOTO_DONE(-1) if (f1->device > f2->device) HGOTO_DONE(1) -#else /* H5_DEV_T_IS_SCALAR */ +#else /* H5_DEV_T_IS_SCALAR */ /* If dev_t isn't a scalar value on this system, just use memcmp to * determine if the values are the same or not. The actual return value * shouldn't really matter... @@ -793,7 +793,7 @@ H5FD__direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t *)_file; - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eof) } @@ -1276,7 +1276,7 @@ H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_AT (void)SetFilePointer((HANDLE)filehandle, li.LowPart, &li.HighPart, FILE_BEGIN); if (SetEndOfFile((HANDLE)filehandle) == 0) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h index 2d88a69..ea2b3f2 100644 --- a/src/H5FDdirect.h +++ b/src/H5FDdirect.h @@ -23,7 +23,7 @@ #ifdef H5_HAVE_DIRECT #define H5FD_DIRECT (H5FD_direct_init()) #else -#define H5FD_DIRECT (-1) +#define H5FD_DIRECT (H5I_INVALID_HID) #endif /* H5_HAVE_DIRECT */ #ifdef H5_HAVE_DIRECT diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 569b889..43ad9a1 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -20,6 +20,9 @@ * File System (HDFS). */ +/* This source code file is part of the H5FD driver module */ +#include "H5FDdrvr_module.h" + #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FDprivate.h" /* File drivers */ @@ -30,9 +33,6 @@ #ifdef H5_HAVE_LIBHDFS -/* This source code file is part of the H5FD driver module */ -#include "H5FDdrvr_module.h" - /* HDFS routines */ #include "hdfs.h" @@ -231,8 +231,7 @@ typedef struct { * * Programmer: Jacob Smith * - *************************************************************************** - */ + ***************************************************************************/ typedef struct H5FD_hdfs_t { H5FD_t pub; H5FD_hdfs_fapl_t fa; @@ -357,12 +356,12 @@ done: hid_t H5FD_hdfs_init(void) { - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; #if HDFS_STATS unsigned int bin_i; #endif - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) #if HDFS_DEBUG HDfprintf(stdout, "called %s.\n", FUNC); @@ -379,7 +378,7 @@ H5FD_hdfs_init(void) HDFS_STATS_POW(bin_i, &value) hdfs_stats_boundaries[bin_i] = value; - } /* end for */ + } #endif ret_value = H5FD_HDFS_g; @@ -593,7 +592,7 @@ done: * Function: H5Pset_fapl_hdfs * * Purpose: Modify the file access property list to use the H5FD_HDFS - * driver defined in this source file. All driver specfic + * driver defined in this source file. All driver specific * properties are passed in as a pointer to a suitably * initialized instance of H5FD_hdfs_fapl_t * @@ -611,7 +610,7 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa) herr_t ret_value = FAIL; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa); + H5TRACE2("e", "i*#", fapl_id, fa); HDassert(fa != NULL); @@ -647,33 +646,34 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out) +H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_dst /*out*/) { - const H5FD_hdfs_fapl_t *fa = NULL; + const H5FD_hdfs_fapl_t *fa_src = NULL; H5P_genplist_t * plist = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa_out); + H5TRACE2("e", "ix", fapl_id, fa_dst); #if HDFS_DEBUG HDfprintf(stdout, "called %s.\n", FUNC); #endif - if (fa_out == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL") + if (fa_dst == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst ptr is NULL") plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); if (plist == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") + if (H5FD_HDFS != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") - fa = (const H5FD_hdfs_fapl_t *)H5P_peek_driver_info(plist); - if (fa == NULL) + fa_src = (const H5FD_hdfs_fapl_t *)H5P_peek_driver_info(plist); + if (fa_src == NULL) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") /* Copy the hdfs fapl data out */ - HDmemcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t)); + H5MM_memcpy(fs_dst, fa_src, sizeof(H5FD_hdfs_fapl_t)); done: FUNC_LEAVE_API(ret_value) @@ -708,7 +708,7 @@ H5FD__hdfs_fapl_get(H5FD_t *_file) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed") /* Copy the fields of the structure */ - HDmemcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t)); + H5MM_memcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t)); ret_value = fa; @@ -746,7 +746,7 @@ H5FD__hdfs_fapl_copy(const void *_old_fa) if (new_fa == NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed") - HDmemcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t)); + H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t)); ret_value = new_fa; done: @@ -813,7 +813,7 @@ hdfs__reset_stats(H5FD_hdfs_t *file) FUNC_ENTER_STATIC #if HDFS_DEBUG - HDprintf("hdfs__reset_stats() called\n"); + HDfprintf(stdout, "called %s.\n", FUNC); #endif if (file == NULL) @@ -903,7 +903,7 @@ H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr if (file == NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct") file->hdfs_handle = handle; - HDmemcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t)); + H5MM_memcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t)); #if HDFS_STATS if (FAIL == hdfs__reset_stats(file)) @@ -1203,8 +1203,8 @@ done: static herr_t H5FD__hdfs_close(H5FD_t *_file) { - herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1245,8 +1245,8 @@ done: * field-by-field. * * Return: - * + Equivalent: 0 - * + Not Equivalent: -1 + * Equivalent: 0 + * Not Equivalent: -1 * * Programmer: Gerd Herber * May 2018 @@ -1470,8 +1470,8 @@ H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) static herr_t H5FD__hdfs_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle) { - herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1514,9 +1514,9 @@ static herr_t H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf) { - herr_t ret_value = SUCCEED; H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file; size_t filesize = 0; + herr_t ret_value = SUCCEED; #if HDFS_STATS /* working variables for storing stats */ hdfs_statsbin *bin = NULL; @@ -1655,7 +1655,7 @@ done: * No effect on Read-Only S3 file. * * Suggestion: remove lock/unlock from class - * > would result in error at H5FD_[un]lock() (H5FD.c) + * would result in error at H5FD_[un]lock() (H5FD.c) * * Return: * diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index 05506d4..abe7682 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -16,7 +16,7 @@ * Programmer: Jacob Smith * 2018-04-23 * - * Purpose: The public header file for the hdfs driver. + * Purpose: The public header file for the hdfs driver. */ #ifndef H5FDhdfs_H @@ -25,7 +25,7 @@ #ifdef H5_HAVE_LIBHDFS #define H5FD_HDFS (H5FD_hdfs_init()) #else /* H5_HAVE_LIBHDFS */ -#define H5FD_HDFS (-1) +#define H5FD_HDFS (H5I_INVALID_HID) #endif /* H5_HAVE_LIBHDFS */ #ifdef H5_HAVE_LIBHDFS diff --git a/src/H5FDlog.c b/src/H5FDlog.c index fc2cb12..99b0b8d 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -570,7 +570,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->nFileIndexHigh = fileinfo.nFileIndexHigh; file->nFileIndexLow = fileinfo.nFileIndexLow; file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; file->inode = sb.st_ino; #endif /* H5_HAVE_WIN32_API */ @@ -861,7 +861,7 @@ H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HGOTO_DONE(-1) if (f1->device > f2->device) HGOTO_DONE(1) -#else /* H5_DEV_T_IS_SCALAR */ +#else /* H5_DEV_T_IS_SCALAR */ /* If dev_t isn't a scalar value on this system, just use memcmp to * determine if the values are the same or not. The actual return value * shouldn't really matter... @@ -1182,7 +1182,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had #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 */ +#endif /* H5_HAVE_PREADWRITE */ HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ @@ -1250,7 +1250,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had 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) { @@ -1280,7 +1280,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had if (bytes_read > 0) offset += bytes_read; #else - bytes_read = HDread(file->fd, buf, bytes_in); + bytes_read = HDread(file->fd, buf, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while (-1 == bytes_read && EINTR == errno); @@ -1396,7 +1396,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha #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 */ +#endif /* H5_HAVE_PREADWRITE */ HDoff_t offset = (HDoff_t)addr; herr_t ret_value = SUCCEED; /* Return value */ @@ -1472,7 +1472,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha 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) { @@ -1648,7 +1648,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ if (0 == SetEndOfFile(file->hFile)) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") } -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ /* Truncate/extend the file */ if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index 3895b42..9448adb 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -126,7 +126,7 @@ typedef struct H5FD_mirror_t { } while (0) #else #define LOG_XMIT_BYTES(label, buf, len) /* no-op */ -#endif /* MIRROR_DEBUG_XMIT_BYTE */ +#endif /* MIRROR_DEBUG_XMIT_BYTE */ #if MIRROR_DEBUG_OP_CALLS #define LOG_OP_CALL(name) \ @@ -136,7 +136,7 @@ typedef struct H5FD_mirror_t { } while (0) #else #define LOG_OP_CALL(name) /* no-op */ -#endif /* MIRROR_DEBUG_OP_CALLS */ +#endif /* MIRROR_DEBUG_OP_CALLS */ /* Prototypes */ static herr_t H5FD__mirror_term(void); @@ -242,7 +242,7 @@ H5FD_mirror_init(void) { hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) LOG_OP_CALL(FUNC); @@ -298,7 +298,7 @@ H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *_buf) HDassert(_buf && out); - HDmemcpy(&n, _buf, sizeof(n)); + H5MM_memcpy(&n, _buf, sizeof(n)); *out = (uint16_t)HDntohs(n); return 2; /* number of bytes eaten */ @@ -326,7 +326,7 @@ H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf) HDassert(_buf && out); - HDmemcpy(&n, _buf, sizeof(n)); + H5MM_memcpy(&n, _buf, sizeof(n)); *out = (uint32_t)HDntohl(n); return 4; /* number of bytes eaten */ @@ -385,7 +385,7 @@ H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf) HDassert(_buf && out); - HDmemcpy(&n, _buf, sizeof(n)); + H5MM_memcpy(&n, _buf, sizeof(n)); if (TRUE == is_host_little_endian()) *out = BSWAP_64(n); else @@ -412,7 +412,7 @@ H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *_buf) HDassert(_buf && out); - HDmemcpy(out, _buf, sizeof(uint8_t)); + H5MM_memcpy(out, _buf, sizeof(uint8_t)); return 1; /* number of bytes eaten */ } /* end H5FD__mirror_xmit_decode_uint8() */ @@ -439,7 +439,7 @@ H5FD__mirror_xmit_encode_uint16(unsigned char *_dest, uint16_t v) HDassert(_dest); n = (uint16_t)HDhtons(v); - HDmemcpy(_dest, &n, sizeof(n)); + H5MM_memcpy(_dest, &n, sizeof(n)); return 2; } /* end H5FD__mirror_xmit_encode_uint16() */ @@ -466,7 +466,7 @@ H5FD__mirror_xmit_encode_uint32(unsigned char *_dest, uint32_t v) HDassert(_dest); n = (uint32_t)HDhtonl(v); - HDmemcpy(_dest, &n, sizeof(n)); + H5MM_memcpy(_dest, &n, sizeof(n)); return 4; } /* end H5FD__mirror_xmit_encode_uint32() */ @@ -494,7 +494,7 @@ H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v) if (TRUE == is_host_little_endian()) n = BSWAP_64(v); - HDmemcpy(_dest, &n, sizeof(n)); + H5MM_memcpy(_dest, &n, sizeof(n)); return 8; } /* H5FD__mirror_xmit_encode_uint64() */ @@ -519,7 +519,7 @@ H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v) HDassert(dest); - HDmemcpy(dest, &v, sizeof(v)); + H5MM_memcpy(dest, &v, sizeof(v)); return 1; } /* end H5FD__mirror_xmit_encode_uint8() */ @@ -1188,7 +1188,7 @@ H5FD__mirror_fapl_get(H5FD_t *_file) if (NULL == fa) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "calloc failed"); - HDmemcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t)); + H5MM_memcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t)); ret_value = fa; @@ -1224,7 +1224,7 @@ H5FD__mirror_fapl_copy(const void *_old_fa) if (new_fa == NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed"); - HDmemcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t)); + H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t)); ret_value = new_fa; done: @@ -1266,25 +1266,25 @@ H5FD__mirror_fapl_free(void *_fa) * Function: H5Pget_fapl_mirror * * Purpose: Get the configuration information for this fapl. - * Data is memcopied into the fa_out pointer. + * Data is memcopied into the fa_dst pointer. * * Return: SUCCEED/FAIL * ------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out) +H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_dst /*out*/) { - const H5FD_mirror_fapl_t *fa = NULL; + const H5FD_mirror_fapl_t *fa_src = NULL; H5P_genplist_t * plist = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa_out); + H5TRACE2("e", "ix", fapl_id, fa_dst); LOG_OP_CALL(FUNC); - if (NULL == fa_out) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL"); + if (NULL == fa_dst) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL"); plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); if (NULL == plist) @@ -1292,13 +1292,13 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out) if (H5P_peek_driver(plist) != H5FD_MIRROR) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver"); - fa = (const H5FD_mirror_fapl_t *)H5P_peek_driver_info(plist); - if (NULL == fa) + fa_src = (const H5FD_mirror_fapl_t *)H5P_peek_driver_info(plist); + if (NULL == fa_src) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info"); - HDassert(fa->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */ + HDassert(fa_src->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */ - HDmemcpy(fa_out, fa, sizeof(H5FD_mirror_fapl_t)); + H5MM_memcpy(fa_dst, fa_src, sizeof(H5FD_mirror_fapl_t)); done: FUNC_LEAVE_API(ret_value); @@ -1320,7 +1320,7 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa) herr_t ret_value = FAIL; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa); + H5TRACE2("e", "i*#", fapl_id, fa); LOG_OP_CALL(FUNC); diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 6042776..a4e0baf 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -200,7 +200,7 @@ H5FD_mpio_init(void) { #ifdef H5FDmpio_DEBUG static int H5FD_mpio_Debug_inited = 0; -#endif /* H5FDmpio_DEBUG */ +#endif /* H5FDmpio_DEBUG */ const char *s; /* String for environment variables */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -229,7 +229,7 @@ H5FD_mpio_init(void) } /* end while */ } /* end if */ H5FD_mpio_Debug_inited++; - } /* end if */ + } /* end if */ #endif /* H5FDmpio_DEBUG */ /* Set return value */ @@ -1746,33 +1746,4 @@ H5FD__mpio_communicator(const H5FD_t *_file) FUNC_LEAVE_NOAPI(file->comm) } /* end H5FD__mpio_communicator() */ -/*------------------------------------------------------------------------- - * Function: H5FD__mpio_get_info - * - * Purpose: Returns the file info of MPIO file driver. - * - * Returns: Non-negative if succeed or negative if fails. - * - * Programmer: John Mainzer - * April 4, 2017 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FD__mpio_get_info(H5FD_t *_file, void **mpi_info) -{ - H5FD_mpio_t *file = (H5FD_mpio_t *)_file; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_STATIC - - if (!mpi_info) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mpi info not valid") - - *mpi_info = &(file->info); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FD__mpio_get_info() */ - #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index c9280c7..0773d9e 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -25,7 +25,7 @@ #ifdef H5_HAVE_PARALLEL #define H5FD_MPIO (H5FD_mpio_init()) #else -#define H5FD_MPIO (-1) +#define H5FD_MPIO (H5I_INVALID_HID) #endif /* H5_HAVE_PARALLEL */ #ifdef H5_HAVE_PARALLEL diff --git a/src/H5FDros3.c b/src/H5FDros3.c index fa41b6f..83e4315 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -320,7 +320,7 @@ H5FD_ros3_init(void) unsigned int bin_i; #endif - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) #if ROS3_DEBUG HDfprintf(stdout, "H5FD_ros3_init() called.\n"); @@ -340,7 +340,6 @@ H5FD_ros3_init(void) } #endif - /* Set return value */ ret_value = H5FD_ROS3_g; done: @@ -395,7 +394,7 @@ H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa) herr_t ret_value = FAIL; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa); + H5TRACE2("e", "i*#", fapl_id, fa); HDassert(fa != NULL); @@ -473,21 +472,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out) +H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_dst /*out*/) { - const H5FD_ros3_fapl_t *fa = NULL; + const H5FD_ros3_fapl_t *fa_src = NULL; H5P_genplist_t * plist = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, fa_out); + H5TRACE2("e", "ix", fapl_id, fa_dst); #if ROS3_DEBUG HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n"); #endif - if (fa_out == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL") + if (fa_dst == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL") plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS); if (plist == NULL) @@ -496,12 +495,12 @@ H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out) if (H5FD_ROS3 != H5P_peek_driver(plist)) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") - fa = (const H5FD_ros3_fapl_t *)H5P_peek_driver_info(plist); - if (fa == NULL) + fa_src = (const H5FD_ros3_fapl_t *)H5P_peek_driver_info(plist); + if (fa_src == NULL) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") /* Copy the ros3 fapl data out */ - HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t)); + H5MM_memcpy(fa_dst, fa_src, sizeof(H5FD_ros3_fapl_t)); done: FUNC_LEAVE_API(ret_value) @@ -536,7 +535,7 @@ H5FD__ros3_fapl_get(H5FD_t *_file) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy the fields of the structure */ - HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t)); + H5MM_memcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t)); /* Set return value */ ret_value = fa; @@ -576,7 +575,7 @@ H5FD__ros3_fapl_copy(const void *_old_fa) if (new_fa == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t)); + H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t)); ret_value = new_fa; done: @@ -769,7 +768,7 @@ H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") file->s3r_handle = handle; - HDmemcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t)); + H5MM_memcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t)); #if ROS3_STATS if (FAIL == ros3_reset_stats(file)) diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index 2ac27d0..ac58f67 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -144,7 +144,7 @@ curlwritecallback(char *ptr, size_t size, size_t nmemb, void *userdata) return written; if (size > 0) { - HDmemcpy(&(sds->data[sds->size]), ptr, product); + H5MM_memcpy(&(sds->data[sds->size]), ptr, product); sds->size += product; written = product; } @@ -263,12 +263,12 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) namecpy = (char *)H5MM_malloc(sizeof(char) * (namelen + 1)); if (namecpy == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy."); - HDmemcpy(namecpy, name, (namelen + 1)); + H5MM_memcpy(namecpy, name, (namelen + 1)); valuecpy = (char *)H5MM_malloc(sizeof(char) * (valuelen + 1)); if (valuecpy == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy."); - HDmemcpy(valuecpy, value, (valuelen + 1)); + H5MM_memcpy(valuecpy, value, (valuelen + 1)); nvcat = (char *)H5MM_malloc(sizeof(char) * catwrite); if (nvcat == NULL) @@ -701,14 +701,14 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch res = (char *)H5MM_malloc(sizeof(char) * (reslen + 1)); if (res == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string"); - HDmemcpy(res, _resource, (reslen + 1)); + H5MM_memcpy(res, _resource, (reslen + 1)); } else { res = (char *)H5MM_malloc(sizeof(char) * (reslen + 2)); if (res == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string"); *res = '/'; - HDmemcpy((&res[1]), _resource, (reslen + 1)); + H5MM_memcpy((&res[1]), _resource, (reslen + 1)); HDassert((reslen + 1) == HDstrlen(res)); } /* end if (else resource string not starting with '/') */ @@ -910,7 +910,7 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16); if (handle->httpverb == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for S3 request HTTP verb"); - HDmemcpy(handle->httpverb, "HEAD", 5); + H5MM_memcpy(handle->httpverb, "HEAD", 5); headerresponse = (char *)H5MM_malloc(sizeof(char) * CURL_MAX_HTTP_HEADER); if (headerresponse == NULL) @@ -1078,19 +1078,19 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const handle->region = (char *)H5MM_malloc(sizeof(char) * tmplen); if (handle->region == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy."); - HDmemcpy(handle->region, region, tmplen); + H5MM_memcpy(handle->region, region, tmplen); tmplen = HDstrlen(id) + 1; handle->secret_id = (char *)H5MM_malloc(sizeof(char) * tmplen); if (handle->secret_id == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy."); - HDmemcpy(handle->secret_id, id, tmplen); + H5MM_memcpy(handle->secret_id, id, tmplen); tmplen = SHA256_DIGEST_LENGTH; handle->signing_key = (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen); if (handle->signing_key == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy."); - HDmemcpy(handle->signing_key, signing_key, tmplen); + H5MM_memcpy(handle->signing_key, signing_key, tmplen); } /* if authentication information provided */ /************************ @@ -1138,7 +1138,7 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const *********************/ HDassert(handle->httpverb != NULL); - HDmemcpy(handle->httpverb, "GET", 4); + H5MM_memcpy(handle->httpverb, "GET", 4); ret_value = handle; @@ -1951,7 +1951,7 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha for (buffer_i = 0; buffer_i < 128; buffer_i++) buffer[buffer_i] = 0; - line_buffer = fgets(line_buffer, 128, file); + line_buffer = HDfgets(line_buffer, 128, file); if (line_buffer == NULL) /* reached end of file */ goto done; } while (HDstrncmp(line_buffer, profile_line, HDstrlen(profile_line))); @@ -1963,7 +1963,7 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha buffer[buffer_i] = 0; /* collect a line from file */ - line_buffer = fgets(line_buffer, 128, file); + line_buffer = HDfgets(line_buffer, 128, file); if (line_buffer == NULL) goto done; /* end of file */ @@ -2062,9 +2062,9 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char * #endif #ifdef H5_HAVE_WIN32_API - ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("USERPROFILE")); + ret = HDsnprintf(awspath, 117, "%s/.aws/", HDgetenv("USERPROFILE")); #else - ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("HOME")); + ret = HDsnprintf(awspath, 117, "%s/.aws/", HDgetenv("HOME")); #endif if (ret < 0 || (size_t)ret >= 117) HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format home-aws path") @@ -2150,7 +2150,7 @@ H5FD_s3comms_nlowercase(char *dest, const char *s, size_t len) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null."); if (len > 0) { - HDmemcpy(dest, s, len); + H5MM_memcpy(dest, s, len); do { len--; dest[len] = (char)HDtolower((int)dest[len]); @@ -2686,14 +2686,14 @@ H5FD_s3comms_tostringtosign(char *dest, const char *req, const char *now, const if (ret <= 0 || ret >= 127) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem adding day and region to string") - HDmemcpy((dest + d), "AWS4-HMAC-SHA256\n", 17); + H5MM_memcpy((dest + d), "AWS4-HMAC-SHA256\n", 17); d = 17; - HDmemcpy((dest + d), now, HDstrlen(now)); + H5MM_memcpy((dest + d), now, HDstrlen(now)); d += HDstrlen(now); dest[d++] = '\n'; - HDmemcpy((dest + d), tmp, HDstrlen(tmp)); + H5MM_memcpy((dest + d), tmp, HDstrlen(tmp)); d += HDstrlen(tmp); dest[d++] = '\n'; @@ -2777,7 +2777,7 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written) s_len++; /* write output into dest */ - HDmemcpy(dest, s, s_len); + H5MM_memcpy(dest, s, s_len); } } diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 7789d39..02323c6 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -377,7 +377,7 @@ H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr file->nFileIndexHigh = fileinfo.nFileIndexHigh; file->nFileIndexLow = fileinfo.nFileIndexLow; file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; file->inode = sb.st_ino; #endif /* H5_HAVE_WIN32_API */ @@ -507,7 +507,7 @@ H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HGOTO_DONE(-1) if (f1->device > f2->device) HGOTO_DONE(1) -#else /* H5_DEV_T_IS_SCALAR */ +#else /* H5_DEV_T_IS_SCALAR */ /* If dev_t isn't a scalar value on this system, just use memcmp to * determine if the values are the same or not. The actual return value * shouldn't really matter... @@ -742,7 +742,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if (bytes_read > 0) offset += bytes_read; #else - bytes_read = HDread(file->fd, buf, bytes_in); + bytes_read = HDread(file->fd, buf, bytes_in); #endif /* H5_HAVE_PREADWRITE */ } while (-1 == bytes_read && EINTR == errno); @@ -945,7 +945,7 @@ H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR bError = SetEndOfFile(file->hFile); if (0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ diff --git a/src/H5FDspace.c b/src/H5FDspace.c index 38a96fb..98210a4 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -333,7 +333,7 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) HDfprintf(stderr, "%s: LEAKED MEMORY!!! type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)type, addr, size); #endif /* H5FD_ALLOC_DEBUG */ - } /* end else */ + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 5ba1a27..09bb4f3 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -94,7 +94,7 @@ typedef struct H5FD_splitter_t { } while (0) #else #define H5FD_SPLITTER_LOG_CALL(name) /* no-op */ -#endif /* H5FD_SPLITTER_DEBUG_OP_CALLS */ +#endif /* H5FD_SPLITTER_DEBUG_OP_CALLS */ /* Private functions */ @@ -210,7 +210,7 @@ H5FD_splitter_init(void) { hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) H5FD_SPLITTER_LOG_CALL(FUNC); @@ -297,7 +297,7 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Dr", fapl_id, vfd_config); + H5TRACE2("e", "i*#", fapl_id, vfd_config); H5FD_SPLITTER_LOG_CALL(FUNC); @@ -369,39 +369,39 @@ done: * Function: H5Pget_fapl_splitter * * Purpose: Returns information about the splitter file access property - * list through the structure config_out. + * list through the structure config. * - * Will fail if config_out is received without pre-set valid + * Will fail if config is received without pre-set valid * magic and version information. * * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out) +H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/) { const H5FD_splitter_fapl_t *fapl_ptr = NULL; H5P_genplist_t * plist_ptr = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Dr", fapl_id, config_out); + H5TRACE2("e", "ix", fapl_id, config); H5FD_SPLITTER_LOG_CALL(FUNC); /* Check arguments */ if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - if (config_out == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null") - if (H5FD_SPLITTER_MAGIC != config_out->magic) + if (config == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config pointer is null") + if (H5FD_SPLITTER_MAGIC != config->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)") - if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) + if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config->version) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)") /* Pre-set out FAPL IDs with intent to replace these values */ - config_out->rw_fapl_id = H5I_INVALID_HID; - config_out->wo_fapl_id = H5I_INVALID_HID; + config->rw_fapl_id = H5I_INVALID_HID; + config->wo_fapl_id = H5I_INVALID_HID; /* Check and get the splitter fapl */ if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -411,14 +411,14 @@ 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_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX); - HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX); - config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs; + 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); + config->ignore_wo_errs = fapl_ptr->ignore_wo_errs; /* Copy R/W and W/O FAPLs */ - if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) + if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config->rw_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL"); - if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) + if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config->wo_fapl_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL"); done: @@ -585,7 +585,7 @@ H5FD__splitter_fapl_copy(const void *_old_fa) if (NULL == new_fa_ptr) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL") - HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t)); + 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); @@ -1300,14 +1300,14 @@ H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char * s; size = HDstrlen(atfunc) + HDstrlen(msg) + 3; /* ':', ' ', '\n' */ - s = (char *)HDmalloc(sizeof(char) * (size + 1)); + s = (char *)H5MM_malloc(sizeof(char) * (size + 1)); if (NULL == s) ret_value = FAIL; else if (size < (size_t)HDsnprintf(s, size + 1, "%s: %s\n", atfunc, msg)) ret_value = FAIL; else if (size != HDfwrite(s, 1, size, file->logfp)) ret_value = FAIL; - HDfree(s); + H5MM_free(s); } FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 4650c39..c66765a 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -115,7 +115,7 @@ typedef struct H5FD_stdio_t { DWORD nFileIndexHigh; DWORD dwVolumeSerialNumber; - HANDLE hFile; /* Native windows file handle */ + HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ } H5FD_stdio_t; @@ -338,7 +338,7 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr static const char *func = "H5FD_stdio_open"; /* Function Name for error reporting */ #ifdef H5_HAVE_WIN32_API struct _BY_HANDLE_FILE_INFORMATION fileinfo; -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ struct stat sb; #endif /* H5_HAVE_WIN32_API */ @@ -431,7 +431,7 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr /* Get the file descriptor (needed for truncate and some Windows information) */ #ifdef H5_HAVE_WIN32_API file->fd = _fileno(file->fp); -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ file->fd = fileno(file->fp); #endif /* H5_HAVE_WIN32_API */ if (file->fd < 0) { @@ -458,7 +458,7 @@ H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr file->nFileIndexHigh = fileinfo.nFileIndexHigh; file->nFileIndexLow = fileinfo.nFileIndexLow; file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ if (fstat(file->fd, &sb) < 0) { free(file); fclose(f); @@ -549,7 +549,7 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) return -1; if (f1->device > f2->device) return 1; -#else /* H5_DEV_T_IS_SCALAR */ +#else /* H5_DEV_T_IS_SCALAR */ /* If dev_t isn't a scalar value on this system, just use memcmp to * determine if the values are the same or not. The actual return value * shouldn't really matter... @@ -1075,7 +1075,7 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t /*UNUSED*/ dxpl_id, hbool_t /*UNUSED*/ if (0 == bError) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "unable to truncate/extend file properly", -1) -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ /* Reset seek offset to beginning of file, so that file isn't re-extended later */ rewind(file->fp); @@ -362,7 +362,7 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr) #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Done expunging free space section info from cache\n", FUNC); -#endif /* H5FS_DEBUG */ +#endif /* H5FS_DEBUG */ } /* end if */ else { #ifdef H5FS_DEBUG @@ -513,7 +513,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace) */ #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Section info can't 'go away', header will own it\n", FUNC); -#endif /* H5FS_DEBUG */ +#endif /* H5FS_DEBUG */ } /* end if */ else { #ifdef H5FS_DEBUG diff --git a/src/H5FScache.c b/src/H5FScache.c index bf91e22..fc61edd 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -820,10 +820,10 @@ H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) default: #ifdef NDEBUG HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); #endif /* NDEBUG */ - } /* end switch */ + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1004,8 +1004,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l /* Check for any serialized sections */ if (fspace->serial_sect_count > 0) { hsize_t old_tot_sect_count; /* Total section count from header */ - hsize_t H5_ATTR_NDEBUG_UNUSED - old_serial_sect_count; /* Total serializable section count from header */ + hsize_t H5_ATTR_NDEBUG_UNUSED old_serial_sect_count; /* Total serializable section count from header */ hsize_t H5_ATTR_NDEBUG_UNUSED old_ghost_sect_count; /* Total ghost section count from header */ hsize_t H5_ATTR_NDEBUG_UNUSED old_tot_space; /* Total space managed from header */ unsigned sect_cnt_size; /* The size of the section size counts */ @@ -1358,9 +1357,9 @@ H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *_thing) default: #ifdef NDEBUG HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end switch */ } /* end if */ diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index bc0e6c5..f3cdb1f 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -87,7 +87,7 @@ *------------------------------------------------------------------------- */ herr_t -H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) +H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo /*out*/) { H5VL_object_t *vol_obj = NULL; H5I_type_t type; @@ -95,7 +95,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", obj_id, finfo); + H5TRACE2("e", "ix", obj_id, finfo); /* Check args */ if (!finfo) diff --git a/src/H5Fint.c b/src/H5Fint.c index b3d1be5..7b89b85 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -2624,7 +2624,7 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n #ifdef H5_HAVE_SYMLINK /* This has to be declared here to avoid unfreed resources on errors */ char *realname = NULL; /* Fully resolved path name of file */ -#endif /* H5_HAVE_SYMLINK */ +#endif /* H5_HAVE_SYMLINK */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index 953b4da..d57926f 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -29,4 +29,17 @@ #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 MDC Metadata Cache + * \ingroup H5F + * \defgroup PH5F Parallel + * \ingroup H5F + * \defgroup SWMR Single Writer Multiple Readers + * \ingroup H5F + */ + #endif /* _H5Fmodule_H */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index d930c1f..4c4d649 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -336,13 +336,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag) +H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag /*out*/) { H5VL_object_t *vol_obj = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL); - H5TRACE2("e", "i*b", file_id, flag); + H5TRACE2("e", "ix", file_id, flag); /* Get the file object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index ba6d67f..f4268e5 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -31,7 +31,7 @@ typedef struct H5F_t H5F_t; #include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_PARALLEL #include "H5Pprivate.h" /* Property lists */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ #include "H5VMprivate.h" /* Vectors and arrays */ #include "H5VLprivate.h" /* Virtual Object Layer */ @@ -618,7 +618,7 @@ typedef struct H5F_t H5F_t; #ifdef H5_HAVE_PARALLEL #define H5F_ACS_MPI_PARAMS_COMM_NAME "mpi_params_comm" /* the MPI communicator */ #define H5F_ACS_MPI_PARAMS_INFO_NAME "mpi_params_info" /* the MPI info struct */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ /* ======================== File Mount properties ====================*/ #define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ @@ -648,8 +648,7 @@ typedef struct H5F_t H5F_t; /* B-tree internal 'K' values */ #define HDF5_BTREE_SNODE_IK_DEF 16 -#define HDF5_BTREE_CHUNK_IK_DEF \ - 32 /* Note! this value is assumed \ +#define HDF5_BTREE_CHUNK_IK_DEF 32 /* Note! this value is assumed \ to be 32 for version 0 \ of the superblock and \ if it is changed, the code \ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index b84cff6..7981372 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -47,24 +47,20 @@ * 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 => 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*/ /* 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 RDONLY access, and use the special "SWMR_READ" \ + access flag. */ #define H5F_ACC_SWMR_READ \ - (H5CHECK 0x0040u) /*indicate that this file is \ + (H5CHECK 0x0040u) /**< indicate that this file is \ * open for reading in a \ * single-writer/multi-reader (SWMR) \ * scenario. Note that the \ @@ -73,19 +69,23 @@ * open the file with the RDONLY \ * flag. */ -/* Value passed to H5Pset_elink_acc_flags to cause flags to be taken from the - * parent file. */ -#define H5F_ACC_DEFAULT (H5CHECK H5OPEN 0xffffu) /*ignore setting on lapl */ +/** + * Default property list identifier + * + * \internal Value passed to H5Pset_elink_acc_flags to cause flags to be taken from the parent file. + * \internal ignore setting on lapl + */ +#define H5F_ACC_DEFAULT (H5CHECK H5OPEN 0xffffu) /* Flags for H5Fget_obj_count() & H5Fget_obj_ids() calls */ -#define H5F_OBJ_FILE (0x0001u) /* File objects */ -#define H5F_OBJ_DATASET (0x0002u) /* Dataset objects */ -#define H5F_OBJ_GROUP (0x0004u) /* Group objects */ -#define H5F_OBJ_DATATYPE (0x0008u) /* Named datatype objects */ -#define H5F_OBJ_ATTR (0x0010u) /* Attribute objects */ +#define H5F_OBJ_FILE (0x0001u) /**< File objects */ +#define H5F_OBJ_DATASET (0x0002u) /**< Dataset objects */ +#define H5F_OBJ_GROUP (0x0004u) /**< Group objects */ +#define H5F_OBJ_DATATYPE (0x0008u) /**< Named datatype objects */ +#define H5F_OBJ_ATTR (0x0010u) /**< Attribute objects */ #define H5F_OBJ_ALL (H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR) -#define H5F_OBJ_LOCAL (0x0020u) /* Restrict search to objects opened through current file ID */ -/* (as opposed to objects opened through any file ID accessing this file) */ +#define H5F_OBJ_LOCAL (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 @@ -99,128 +99,148 @@ #define H5F_MPIO_DEBUG_KEY "H5F_mpio_debug_key" #endif /* H5_HAVE_PARALLEL */ -/* The difference between a single file and a set of mounted files */ +/** + * The difference between a single file and 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, /**< specified file handle only */ + H5F_SCOPE_GLOBAL = 1 /**< entire virtual file */ } H5F_scope_t; -/* Unlimited file size for H5Pset_external() */ +/** + * Unlimited file size for H5Pset_external() + */ #define H5F_UNLIMITED ((hsize_t)(-1L)) -/* How does file close behave? - * H5F_CLOSE_DEFAULT - Use the degree pre-defined by underlining VFL - * H5F_CLOSE_WEAK - file closes only after all opened objects are closed - * H5F_CLOSE_SEMI - if no opened objects, file is close; otherwise, file - close fails - * H5F_CLOSE_STRONG - if there are opened objects, close them first, then - close file +/** + * How does file close behave? */ typedef enum H5F_close_degree_t { - H5F_CLOSE_DEFAULT = 0, - H5F_CLOSE_WEAK = 1, - H5F_CLOSE_SEMI = 2, - H5F_CLOSE_STRONG = 3 + H5F_CLOSE_DEFAULT = 0, /**< Use the degree pre-defined by underlining VFL */ + 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_STRONG = 3 /**< If there are opened objects, close them first, then close file */ } H5F_close_degree_t; -/* Current "global" information about file */ +/** + * Current "global" information about file + */ +//! [H5F_info2_t_snip] typedef struct H5F_info2_t { struct { - unsigned version; /* Superblock version # */ - hsize_t super_size; /* Superblock size */ - hsize_t super_ext_size; /* Superblock extension size */ + unsigned version; /**< Superblock version # */ + hsize_t super_size; /**< Superblock size */ + hsize_t super_ext_size; /**< Superblock extension size */ } super; struct { - unsigned version; /* Version # of file free space management */ - hsize_t meta_size; /* Free space manager metadata size */ - hsize_t tot_space; /* Amount of free space in the file */ + unsigned version; /**< Version # of file free space management */ + hsize_t meta_size; /**< Free space manager metadata size */ + hsize_t tot_space; /**< Amount of free space in the file */ } free; struct { - unsigned version; /* Version # of shared object header info */ - hsize_t hdr_size; /* Shared object header message header size */ - H5_ih_info_t msgs_info; /* Shared object header message index & heap size */ + unsigned version; /**< Version # of shared object header info */ + hsize_t hdr_size; /**< Shared object header message header size */ + H5_ih_info_t msgs_info; /**< Shared object header message index & heap size */ } sohm; } H5F_info2_t; +//! [H5F_info2_t_snip] -/* - * Types of allocation requests. The values larger than H5FD_MEM_DEFAULT +/** + * Types of allocation requests. The values larger than #H5FD_MEM_DEFAULT * should not change other than adding new types to the end. These numbers * might appear in files. * - * Note: please change the log VFD flavors array if you change this - * enumeration. + * \internal Please change the log VFD flavors array if you change this + * enumeration. */ typedef enum H5F_mem_t { - H5FD_MEM_NOLIST = -1, /* Data should not appear in the free list. + H5FD_MEM_NOLIST = -1, /**< Data should not appear in the free list. * Must be negative. */ - H5FD_MEM_DEFAULT = 0, /* Value not yet set. Can also be the + H5FD_MEM_DEFAULT = 0, /**< Value not yet set. Can also be the * datatype set in a larger allocation * that will be suballocated by the library. * Must be zero. */ - H5FD_MEM_SUPER = 1, /* Superblock data */ - H5FD_MEM_BTREE = 2, /* B-tree data */ - H5FD_MEM_DRAW = 3, /* Raw data (content of datasets, etc.) */ - H5FD_MEM_GHEAP = 4, /* Global heap data */ - H5FD_MEM_LHEAP = 5, /* Local heap data */ - H5FD_MEM_OHDR = 6, /* Object header data */ - - H5FD_MEM_NTYPES /* Sentinel value - must be last */ + H5FD_MEM_SUPER = 1, /**< Superblock data */ + H5FD_MEM_BTREE = 2, /**< B-tree data */ + H5FD_MEM_DRAW = 3, /**< Raw data (content of datasets, etc.) */ + H5FD_MEM_GHEAP = 4, /**< Global heap data */ + H5FD_MEM_LHEAP = 5, /**< Local heap data */ + H5FD_MEM_OHDR = 6, /**< Object header data */ + + H5FD_MEM_NTYPES /**< Sentinel value - must be last */ } H5F_mem_t; -/* Free space section information */ +/** + * Free space section information + */ +//! [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 */ + 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] -/* Library's format versions */ +/** + * Library's format versions + */ typedef enum H5F_libver_t { H5F_LIBVER_ERROR = -1, - H5F_LIBVER_EARLIEST = 0, /* Use the earliest possible format for storing objects */ - H5F_LIBVER_V18 = 1, /* Use the latest v18 format for storing objects */ - 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_EARLIEST = 0, /**< Use the earliest possible format for storing objects */ + H5F_LIBVER_V18 = 1, /**< Use the latest v18 format for storing objects */ + 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_t; #define H5F_LIBVER_LATEST H5F_LIBVER_V114 -/* File space handling strategy */ +/** + * File space handling strategy + */ 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 */ + H5F_FSPACE_STRATEGY_FSM_AGGR = 0, /**< Mechanisms: free-space managers, aggregators, and virtual file + drivers This is the library default when not set */ H5F_FSPACE_STRATEGY_PAGE = - 1, /* Mechanisms: free-space managers with embedded paged aggregation and virtual file drivers */ - H5F_FSPACE_STRATEGY_AGGR = 2, /* Mechanisms: aggregators and virtual file drivers */ - H5F_FSPACE_STRATEGY_NONE = 3, /* Mechanisms: virtual file drivers */ - H5F_FSPACE_STRATEGY_NTYPES /* must be last */ + 1, /**< Mechanisms: free-space managers with embedded paged aggregation and virtual file drivers */ + H5F_FSPACE_STRATEGY_AGGR = 2, /**< Mechanisms: aggregators and virtual file drivers */ + H5F_FSPACE_STRATEGY_NONE = 3, /**< Mechanisms: virtual file drivers */ + H5F_FSPACE_STRATEGY_NTYPES /**< Sentinel */ } H5F_fspace_strategy_t; -/* Deprecated: File space handling strategy for release 1.10.0 */ -/* They are mapped to H5F_fspace_strategy_t as defined above from release 1.10.1 onwards */ +/** + * File space handling strategy for release 1.10.0 + * + * \deprecated 1.10.1 + */ typedef enum H5F_file_space_type_t { - H5F_FILE_SPACE_DEFAULT = 0, /* Default (or current) free space strategy setting */ - H5F_FILE_SPACE_ALL_PERSIST = 1, /* Persistent free space managers, aggregators, virtual file driver */ - H5F_FILE_SPACE_ALL = 2, /* Non-persistent free space managers, aggregators, virtual file driver */ - /* This is the library default */ - H5F_FILE_SPACE_AGGR_VFD = 3, /* Aggregators, Virtual file driver */ - H5F_FILE_SPACE_VFD = 4, /* Virtual file driver */ - H5F_FILE_SPACE_NTYPES /* must be last */ + H5F_FILE_SPACE_DEFAULT = 0, /**< Default (or current) free space strategy setting */ + H5F_FILE_SPACE_ALL_PERSIST = 1, /**< Persistent free space managers, aggregators, virtual file driver */ + H5F_FILE_SPACE_ALL = 2, /**< Non-persistent free space managers, aggregators, virtual file driver + This is the library default */ + H5F_FILE_SPACE_AGGR_VFD = 3, /**< Aggregators, Virtual file driver */ + H5F_FILE_SPACE_VFD = 4, /**< Virtual file driver */ + H5F_FILE_SPACE_NTYPES /**< Sentinel */ } H5F_file_space_type_t; -/* Data structure to report the collection of read retries for metadata items with checksum */ -/* Used by public routine H5Fget_metadata_read_retry_info() */ +//! [H5F_retry_info_t_snip] #define H5F_NUM_METADATA_READ_RETRY_TYPES 21 + +/** + * Data structure to report the collection of read retries for metadata items with checksum as + * used by H5Fget_metadata_read_retry_info() + */ 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] -/* Callback for H5Pset_object_flush_cb() in a file access property list */ +/** + * Callback for H5Pset_object_flush_cb() in a file access property list + */ typedef herr_t (*H5F_flush_cb_t)(hid_t object_id, void *udata); /*********************/ @@ -230,56 +250,1912 @@ typedef herr_t (*H5F_flush_cb_t)(hid_t object_id, void *udata); extern "C" { #endif -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 create_plist, hid_t access_plist); -H5_DLL hid_t H5Fopen(const char *filename, unsigned flags, hid_t access_plist); -H5_DLL hid_t H5Freopen(hid_t file_id); -H5_DLL herr_t H5Fflush(hid_t object_id, H5F_scope_t scope); -H5_DLL herr_t H5Fclose(hid_t file_id); -H5_DLL herr_t H5Fdelete(const char *filename, hid_t fapl_id); -H5_DLL hid_t H5Fget_create_plist(hid_t file_id); -H5_DLL hid_t H5Fget_access_plist(hid_t file_id); -H5_DLL herr_t H5Fget_intent(hid_t file_id, unsigned *intent); -H5_DLL herr_t H5Fget_fileno(hid_t file_id, unsigned long *fileno); -H5_DLL ssize_t H5Fget_obj_count(hid_t file_id, unsigned types); -H5_DLL ssize_t H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *obj_id_list); -H5_DLL herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle); -H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); -H5_DLL herr_t H5Funmount(hid_t loc, const char *name); +/** + * \ingroup H5F + * + * \brief Checks if a file can be opened with a given file access property + * list + * + * \param[in] container_name Name of a file + * \fapl_id + * + * \return \htri_t + * + * \details H5Fis_accessible() checks if the file specified by \p + * container_name can be opened with the file access property list + * \p fapl_id. + * + * \note The H5Fis_accessible() function enables files to be checked with a + * given file access property list, unlike H5Fis_hdf5(), which only uses + * the default file driver when opening a file. + * + * \since 1.12.0 + * + */ +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 + * + * \param[in] filename Name of the file to create + * \param[in] flags File access flags. Allowable values are: + * - #H5F_ACC_TRUNC: Truncate file, if it already exists, + * erasing all data previously stored in the file + * - #H5F_ACC_EXCL: Fail if file already exists + * \fcpl_id + * \fapl_id + * \return \hid_t{file} + * + * \details H5Fcreate() is the primary function for creating HDF5 files; it + * creates a new HDF5 file with the specified name and property lists. + * + * The \p filename parameter specifies the name of the new file. + * + * The \p flags parameter specifies whether an existing file is to be + * overwritten. It should be set to either #H5F_ACC_TRUNC to overwrite + * an existing file or #H5F_ACC_EXCL, instructing the function to fail + * if the file already exists. + * + * New files are always created in read-write mode, so the read-write + * and read-only flags, #H5F_ACC_RDWR and #H5F_ACC_RDONLY, + * respectively, are not relevant in this function. Further note that + * a specification of #H5F_ACC_RDONLY will be ignored; the file will + * be created in read-write mode, regardless. + * + * More complex behaviors of file creation and access are controlled + * through the file creation and file access property lists, + * \p fcpl_id and \p fapl_id, respectively. The value of #H5P_DEFAULT + * for any property list value indicates that the library should use + * the default values for that appropriate property list. + * + * The return value is a file identifier for the newly-created file; + * this file identifier should be closed by calling H5Fclose() when + * it is no longer needed. + * + * \include H5Fcreate.c + * + * \note #H5F_ACC_TRUNC and #H5F_ACC_EXCL are mutually exclusive; use + * exactly one. + * + * \note An additional flag, #H5F_ACC_DEBUG, prints debug information. This + * flag can be combined with one of the above values using the bit-wise + * OR operator (\c |), but it is used only by HDF5 library developers; + * \Emph{it is neither tested nor supported for use in applications}. + * + * \attention \Bold{Special case — File creation in the case of an already-open file:} + * If a file being created is already opened, by either a previous + * H5Fopen() or H5Fcreate() call, the HDF5 library may or may not + * detect that the open file and the new file are the same physical + * file. (See H5Fopen() regarding the limitations in detecting the + * re-opening of an already-open file.)\n + * If the library detects that the file is already opened, + * H5Fcreate() will return a failure, regardless of the use of + * #H5F_ACC_TRUNC.\n + * If the library does not detect that the file is already opened + * and #H5F_ACC_TRUNC is not used, H5Fcreate() will return a failure + * because the file already exists. Note that this is correct + * behavior.\n + * But if the library does not detect that the file is already + * opened and #H5F_ACC_TRUNC is used, H5Fcreate() will truncate the + * existing file and return a valid file identifier. Such a + * truncation of a currently-opened file will almost certainly + * result in errors. While unlikely, the HDF5 library may not be + * able to detect, and thus report, such errors.\n + * Applications should avoid calling H5Fcreate() with an already + * opened file. + * + * \since 1.0.0 + * + * \see H5Fopen(), H5Fclose() + * + */ +H5_DLL hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id); +/** + * \ingroup H5F + * + * \brief Opens an existing HDF5 file + * + * \param[in] filename Name of the file to be opened + * \param[in] flags File access flags. Allowable values are: + * - #H5F_ACC_RDWR: Allows read and write access to file + * - #H5F_ACC_RDONLY: Allows read-only access to file + * - #H5F_ACC_RDWR \c | #H5F_ACC_SWMR_WRITE: Indicates that + * the file is open for writing in a + * single-writer/multi-writer (SWMR) scenario. + * - #H5F_ACC_RDONLY \c | #H5F_ACC_SWMR_READ: Indicates + * that the file is open for reading in a + * single-writer/multi-reader (SWMR) scenario. + * - An additional flag, #H5F_ACC_DEBUG, prints debug + * information. This flag can be combined with one of the + * above values using the bit-wise OR operator (\c |), but + * it is used only by HDF5 library developers; + * \Emph{it is neither tested nor supported} for use in + * applications. + * \fapl_id + * \return \hid_t{file} + * + * \details H5Fopen() is the primary function for accessing existing HDF5 files. + * This function opens the named file in the specified access mode and + * with the specified access property list. + * + * Note that H5Fopen() does not create a file if it does not already + * exist; see H5Fcreate(). + * + * The \p filename parameter specifies the name of the file to be + * opened. + * + * The \p fapl_id parameter specifies the file access property list. + * Use of #H5P_DEFAULT specifies that default I/O access properties + * are to be used. + * + * The \p flags parameter specifies whether the file will be opened in + * read-write or read-only mode, #H5F_ACC_RDWR or #H5F_ACC_RDONLY, + * respectively. More complex behaviors of file access are controlled + * through the file-access property list. + * + * The return value is a file identifier for the open file; this file + * identifier should be closed by calling H5Fclose() when it is no + * longer needed. + * + * \note #H5F_ACC_RDWR and #H5F_ACC_RDONLY are mutually exclusive; use + * exactly one. + * + * \attention \Bold{Special cases — Multiple opens:} A file can often be opened + * with a new H5Fopen() call without closing an already-open + * identifier established in a previous H5Fopen() or H5Fcreate() + * call. Each such H5Fopen() call will return a unique identifier + * and the file can be accessed through any of these identifiers as + * long as the identifier remains valid. In such multiply-opened + * cases, the open calls must use the same flags argument and the + * file access property lists must use the same file close degree + * property setting (see the external link discussion below and + * H5Pset_fclose_degree()).\n + * In some cases, such as files on a local Unix file system, the + * HDF5 library can detect that a file is multiply opened and will + * maintain coherent access among the file identifiers.\n + * But in many other cases, such as parallel file systems or + * networked file systems, it is not always possible to detect + * multiple opens of the same physical file. In such cases, HDF5 + * will treat the file identifiers as though they are accessing + * different files and will be unable to maintain coherent access. + * Errors are likely to result in these cases. While unlikely, the + * HDF5 library may not be able to detect, and thus report, + * such errors.\n + * It is generally recommended that applications avoid multiple + * opens of the same file. + * + * \attention \Bold{Special restriction on multiple opens of a file first + * opened by means of an external link:} When an external link is + * followed, the external file is always opened with the weak file + * close degree property setting, #H5F_CLOSE_WEAK (see + * H5Lcreate_external() and H5Pset_fclose_degree()). If the file is + * reopened with H5Fopen while it remains held open from such an + * external link call, the file access property list used in the + * open call must include the file close degree setting + * #H5F_CLOSE_WEAK or the open will fail. + * + * \version 1.10.0 The #H5F_ACC_SWMR_WRITE and #H5F_ACC_SWMR_READ flags were added. + * + * \see H5Fclose() + * + */ +H5_DLL hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id); +/** + * \ingroup H5F + * + * \brief Returns a new identifier for a previously-opened HDF5 file + * + * \param[in] file_id Identifier of a file for which an additional identifier + * is required + * + * \return \hid_t{file} + * + * \details H5Freopen() returns a new file identifier for an already-open HDF5 + * file, as specified by \p file_id. Both identifiers share caches and + * other information. The only difference between the identifiers is + * that the new identifier is not mounted anywhere and no files are + * mounted on it. + * + * The new file identifier should be closed by calling H5Fclose() when + * it is no longer needed. + * + * \note Note that there is no circumstance under which H5Freopen() can + * actually open a closed file; the file must already be open and have an + * active \p file_id. E.g., one cannot close a file with H5Fclose() on + * \p file_id then use H5Freopen() on \p file_id to reopen it. + * + */ +H5_DLL hid_t H5Freopen(hid_t file_id); +/** + * \ingroup H5F + * + * \brief Flushes all buffers associated with a file to storage + * + * \loc_id{object_id} + * \param[in] scope The scope of the flush action + * + * \return \herr_t + * + * \details H5Fflush() causes all buffers associated with a file to be + * immediately flushed to storage without removing the data from the + * cache. + * + * \p object_id can be any object associated with the file, including + * the file itself, a dataset, a group, an attribute, or a named + * datatype. + * + * \p scope specifies whether the scope of the flush action is + * global or local. Valid values are as follows: + * \scopes + * + * \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 + * that, the OS is responsible for ensuring that the data is + * actually flushed to disk. + * + */ +H5_DLL herr_t H5Fflush(hid_t object_id, H5F_scope_t scope); +/** + * \example H5Fclose.c + * After creating an HDF5 file with H5Fcreate(), we close it with + * H5Fclose(). + */ +/** + * \ingroup H5F + * + * \brief Terminates access to an HDF5 file + * + * \file_id + * \return \herr_t + * + * \details H5Fclose() terminates access to an HDF5 file (specified by + * \p file_id) by flushing all data to storage. + * + * If this is the last file identifier open for the file and no other + * access identifier is open (e.g., a dataset identifier, group + * 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 + * + * \note \Bold{Delayed close:} Note the following deviation from the + * above-described behavior. If H5Fclose() is called for a file but one + * or more objects within the file remain open, those objects will remain + * accessible until they are individually closed. Thus, if the dataset + * \c data_sample is open when H5Fclose() is called for the file + * containing it, \c data_sample will remain open and accessible + * (including writable) until it is explicitly closed. The file will be + * automatically closed once all objects in the file have been closed.\n + * Be warned, however, that there are circumstances where it is not + * possible to delay closing a file. For example, an MPI-IO file close is + * a collective call; all of the processes that opened the file must + * close it collectively. The file cannot be closed at some time in the + * future by each process in an independent fashion. Another example is + * that an application using an AFS token-based file access privilege may + * destroy its AFS token after H5Fclose() has returned successfully. This + * would make any future access to the file, or any object within it, + * illegal.\n + * In such situations, applications must close all open objects in a file + * before calling H5Fclose. It is generally recommended to do so in all + * cases. + * + * \see H5Fopen() + * + */ +H5_DLL herr_t H5Fclose(hid_t file_id); +/** + * \ingroup H5F + * + * \brief Deletes an HDF5 file + * + * \param[in] filename Name of the file to delete + * \fapl_id + * + * \return \herr_t + * + * \details H5Fdelete() deletes an HDF5 file \p filename with a file access + * property list \p fapl_id. The \p fapl_id should be configured with + * the same VOL connector or VFD that was used to open the file. + * + * This API was introduced for use with the Virtual Object Layer + * (VOL). With the VOL, HDF5 "files" can map to arbitrary storage + * schemes such as object stores and relational database tables. The + * data created by these implementations may be inconvenient for a + * user to remove without a detailed knowledge of the storage scheme. + * H5Fdelete() gives VOL connector authors the ability to add + * connector-specific delete code to their connectors so that users + * can remove these "files" without detailed knowledge of the storage + * scheme. + * + * For a VOL connector, H5Fdelete() deletes the file in a way that + * makes sense for the specified VOL connector. + * + * For the native HDF5 connector, HDF5 files will be deleted via the + * VFDs, each of which will have to be modified to delete the files it + * creates. + * + * For all implementations, H5Fdelete() will first check if the file + * is an HDF5 file via H5Fis_accessible(). This is done to ensure that + * H5Fdelete() cannot be used as an arbitrary file deletion call. + * + * \since 1.12.0 + * + */ +H5_DLL herr_t H5Fdelete(const char *filename, hid_t fapl_id); +/** + * \ingroup H5F + * + * \brief Returns a file creation property list identifier + * + * \file_id + * \return \hid_t{file creation property list} + * + * \details H5Fget_create_plist() returns the file creation property list + * identifier identifying the creation properties used to create this + * file. This function is useful for duplicating properties when + * creating another file. + * + * The creation property list identifier should be released with + * H5Pclose(). + * + */ +H5_DLL hid_t H5Fget_create_plist(hid_t file_id); +/** + * \ingroup H5F + * + * \brief Returns a file access property list identifier + * + * \file_id + * \return \hid_t{file access property list} + * + * \details H5Fget_access_plist() returns the file access property list + * identifier of the specified file. + * + */ +H5_DLL hid_t H5Fget_access_plist(hid_t file_id); +/** + * \ingroup H5F + * + * \brief Determines the read/write or read-only status of a file + * + * \file_id + * \param[out] intent Access mode flag as originally passed with H5Fopen() + * + * \return \herr_t + * + * \details Given the identifier of an open file, \p file_id, H5Fget_intent() + * retrieves the intended access mode" flag passed with H5Fopen() when + * the file was opened. + * + * The value of the flag is returned in \p intent. Valid values are as + * follows: + * \file_access + * + * \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. + * + * \since 1.8.0 + * + */ +H5_DLL herr_t H5Fget_intent(hid_t file_id, unsigned *intent); +/** + * \ingroup H5F + * + * \brief Retrieves a file's file number that uniquely identifies an open file + * + * \file_id + * \param[out] fileno A buffer to hold the file number + * + * \return \herr_t + * + * \details H5Fget_fileno() retrieves a file number for a file specified by the + * file identifier \p file_id and the pointer \p fnumber to the file + * number. + * + * \since 1.12.0 + * + */ +H5_DLL herr_t H5Fget_fileno(hid_t file_id, unsigned long *fileno); +/** + * \ingroup H5F + * + * \brief Returns the number of open object identifiers for an open file + * + * \file_id or #H5F_OBJ_ALL for all currently-open HDF5 files + * \param[in] types Type of object for which identifiers are to be returned + * + * \return Returns the number of open objects if successful; otherwise returns + * a negative value. + * + * \details Given the identifier of an open file, file_id, and the desired + * object types, types, H5Fget_obj_count() returns the number of open + * object identifiers for the file. + * + * To retrieve a count of open identifiers for open objects in all + * HDF5 application files that are currently open, pass the value + * #H5F_OBJ_ALL in \p file_id. + * + * The types of objects to be counted are specified in types as + * follows: + * \obj_types + * + * Multiple object types can be combined with the + * logical \c OR operator (|). For example, the expression + * \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.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. + * + */ +H5_DLL ssize_t H5Fget_obj_count(hid_t file_id, unsigned types); +/** + *------------------------------------------------------------------------- + * \ingroup H5F + * + * \brief Returns a list of open object identifiers + * + * \file_id or #H5F_OBJ_ALL for all currently-open HDF5 files + * \param[in] types Type of object for which identifiers are to be returned + * \param[in] max_objs Maximum number of object identifiers to place into + * \p obj_id_list + * \param[out] obj_id_list Pointer to the returned buffer of open object + * identifiers + * + * \return Returns number of objects placed into \p obj_id_list if successful; + * otherwise returns a negative value. + * + * \details Given the file identifier \p file_id and the type of objects to be + * identified, types, H5Fget_obj_ids() returns the list of identifiers + * for all open HDF5 objects fitting the specified criteria. + * + * To retrieve identifiers for open objects in all HDF5 application + * files that are currently open, pass the value #H5F_OBJ_ALL in + * \p file_id. + * + * The types of object identifiers to be retrieved are specified in + * types using the codes listed for the same parameter in + * H5Fget_obj_count(). + * + * 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 + * max_objs parameter datatype changed to \c size_t. + * \version 1.6.8 C function return type changed to \c ssize_t and \p + * max_objs parameter datatype changed to \c size_t. + * \since 1.6.0 + * + */ +H5_DLL ssize_t H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *obj_id_list); +/** + * \ingroup H5F + * + * \brief Returns pointer to the file handle from the virtual file driver + * + * \file_id + * \fapl_id{fapl} + * \param[out] file_handle Pointer to the file handle being used by the + * low-level virtual file driver + * + * \return \herr_t + * + * \details Given the file identifier \p file_id and the file access property + * list \p fapl_id, H5Fget_vfd_handle() returns a pointer to the file + * handle from the low-level file driver currently being used by the + * HDF5 library for file I/O. + * + * \note For most drivers, the value of \p fapl_id will be #H5P_DEFAULT. For + * the \c FAMILY or \c MULTI drivers, this value should be defined + * through the property list functions: H5Pset_family_offset() for the + * \c FAMILY driver and H5Pset_multi_type() for the \c MULTI driver + * + * \since 1.6.0 + * + */ +H5_DLL herr_t H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle); +/** + * \ingroup H5F + * + * \brief Mounts an HDF5 file + * + * \loc_id{loc} + * \param[in] name Name of the group onto which the file specified by \p child + * is to be mounted + * \file_id{child} + * \param[in] plist File mount property list identifier. Pass #H5P_DEFAULT! + * + * \return \herr_t + * + * \details H5Fmount() mounts the file specified by \p child onto the object + * specified by \p loc and \p name using the mount properties \p plist + * If the object specified by \p loc is a dataset, named datatype or + * attribute, then the file will be mounted at the location where the + * attribute, dataset, or named datatype is attached. + * + * \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. + * + */ +H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); +/** + * \ingroup H5F + * + * \brief Unounts an HDF5 file + * + * \loc_id{loc} + * \param[in] name Name of the mount point + * + * \return \herr_t + * + * \details Given a mount point, H5Funmount() dissociates the mount point's + * file from the file mounted there. This function does not close + * either file. + * + * The mount point can be either the group in the parent or the root + * group of the mounted file (both groups have the same name). If the + * mount point was opened before the mount then it is the group in the + * parent; if it was opened after the mount then it is the root group + * of the child. + * + */ +H5_DLL herr_t H5Funmount(hid_t loc, const char *name); +/** + * \ingroup H5F + * + * \brief Returns the amount of free space in a file (in bytes) + * + * \file_id + * + * \return Returns the amount of free space in the file if successful; + * otherwise returns a negative value. + * + * \details Given the identifier of an open file, \p file_id, + * H5Fget_freespace() returns the amount of space that is unused by + * any objects in the file. + * + * The interpretation of this number depends on the configured free space + * management strategy. For example, if the HDF5 library only tracks free + * space in a file from a file open or create until that file is closed, + * then this routine will report the free space that has been created + * during that interval. + * + * \since 1.6.1 + * + */ H5_DLL hssize_t H5Fget_freespace(hid_t file_id); -H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); -H5_DLL herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa); -H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment); -H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len); -H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr); -H5_DLL herr_t H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, - size_t *cur_size_ptr, int *cur_num_entries_ptr); -H5_DLL herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id); -H5_DLL ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size); -H5_DLL herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo); -H5_DLL herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info); -H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id); -H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, - H5F_sect_info_t *sect_info /*out*/); -H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id); -H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high); -H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id); -H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id); -H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id, - /*OUT*/ hbool_t *is_enabled, - /*OUT*/ hbool_t *is_currently_logging); -H5_DLL herr_t H5Fformat_convert(hid_t fid); -H5_DLL herr_t H5Freset_page_buffering_stats(hid_t file_id); -H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2], - unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]); -H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); -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); +/** + * \ingroup H5F + * + * \brief Returns the size of an HDF5 file (in bytes) + * + * \file_id + * \param[out] size Size of the file, in bytes + * + * \return \herr_t + * + * \details H5Fget_filesize() returns the size of the HDF5 file specified by + * \p file_id. + * + * The returned size is that of the entire file, as opposed to only + * the HDF5 portion of the file. I.e., size includes the user block, + * 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 + * + */ +H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); +/** + * \ingroup H5F + * + * \brief Retrieves the file's end-of-allocation (EOA) + * + * \file_id + * \param[out] eoa The file's EOA + * + * \return \herr_t + * + * \details H5Fget_eoa() retrieves the file's EOA and returns it in the + * parameter eoa. + * + * \since 1.10.2 + * + */ +H5_DLL herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa); +/** + * \ingroup H5F + * + * \brief Sets the file' EOA to the maximum of (EOA, EOF) + increment + * + * \file_id + * \param[in] increment The number of bytes to be added to the maximum of + * (EOA, EOF) + * + * \return \herr_t + * + * \details H5Fincrement_filesize() sets the file's EOA to the maximum of (EOA, + * EOF) + \p increment. The EOA is the end-of-file address stored in + * the file's superblock while EOF is the file's actual end-of-file. + * + * \since 1.10.2 + * + */ +H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment); +/** + * \ingroup H5F + * + * \brief Retrieves a copy of the image of an existing, open file + * + * \file_id + * \param[out] buf_ptr Pointer to the buffer into which the image of the + * HDF5 file is to be copied. If \p buf_ptr is NULL, + * no data will be copied but the function’s return value + * will still indicate the buffer size required (or a + * negative value on error). + * \param[out] buf_len Size of the supplied buffer + * + * \return ssize_t + * + * \details H5Fget_file_image() retrieves a copy of the image of an existing, + * open file. This routine can be used with files opened using the + * SEC2 (or POSIX), STDIO, and Core (or Memory) virtual file drivers + * (VFDs). + * + * If the return value of H5Fget_file_image() is a positive value, it + * will be the length in bytes of the buffer required to store the + * file image. So if the file size is unknown, it can be safely + * determined with an initial H5Fget_file_image() call with buf_ptr + * set to NULL. The file image can then be retrieved with a second + * H5Fget_file_image() call with \p buf_len set to the initial call’s + * return value. + * + * While the current file size can also be retrieved with + * H5Fget_filesize(), that call may produce a larger value than is + * needed. The value returned by H5Fget_filesize() includes the user + * block, if it exists, and any unallocated space at the end of the + * file. It is safe in all situations to get the file size with + * H5Fget_file_image() and it often produces a value that is more + * appropriate for the size of a file image buffer. + * + * \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. + * + * \attention H5Pget_file_image() will fail, returning a negative value, if the + * file is too large for the supplied buffer. + * + * \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 + * + */ +H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len); +/** + * \ingroup MDC + * + * \brief Obtains current metadata cache configuration for target file + * + * \file_id + * \param[in,out] config_ptr Pointer to the H5AC_cache_config_t instance in which + * the current metadata cache configuration is to be + * reported. The fields of this structure are discussed + * \ref H5AC-cache-config-t "here". + * \return \herr_t + * + * \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> + * + * \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); +/** + * \ingroup MDC + * + * \brief Attempts to configure metadata cache of target file + * + * \file_id + * \param[in,out] config_ptr Pointer to the H5AC_cache_config_t instance + * containing the desired configuration. + * The fields of this structure are discussed + * \ref H5AC-cache-config-t "here". + * \return \herr_t + * + * \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 normally be set + * to <code>0</code>, as trace file collection imposes considerable overhead.</p><p>This field should only 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> + * + * \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); +/** + * \ingroup MDC + * + * \brief Obtains target file's metadata cache hit rate + * + * \file_id + * \param[out] hit_rate_ptr Pointer to the double in which the hit rate is returned. Note that + * \p hit_rate_ptr is undefined if the API call fails + * \return \herr_t + * + * \details H5Fget_mdc_hit_rate() queries the metadata cache of the target file to obtain its hit rate + * \Code{(cache hits / (cache hits + cache misses))} since the last time hit rate statistics + * were reset. If the cache has not been accessed since the last time the hit rate stats were + * reset, the hit rate is defined to be 0.0. + * + * The hit rate stats can be reset either manually (via H5Freset_mdc_hit_rate_stats()), or + * automatically. If the cache's adaptive resize code is enabled, the hit rate stats will be + * reset once per epoch. If they are reset manually as well, the cache may behave oddly. + * + * See the overview of the metadata cache in the special topics section of the user manual for + * details on the metadata cache and its adaptive resize algorithms. + * + */ +H5_DLL herr_t H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr); +/** + * \ingroup MDC + * + * \brief Obtains current metadata cache size data for specified file + * + * \file_id + * \param[out] max_size_ptr Pointer to the location in which the current cache maximum size is to be + * returned, or NULL if this datum is not desired + * \param[out] min_clean_size_ptr Pointer to the location in which the current cache minimum clean + * size is to be returned, or NULL if that datum is not desired + * \param[out] cur_size_ptr Pointer to the location in which the current cache size is to be returned, + * or NULL if that datum is not desired + * \param[out] cur_num_entries_ptr Pointer to the location in which the current number of entries in + * the cache is to be returned, or NULL if that datum is not desired + * \returns \herr_t + * + * \details H5Fget_mdc_size() queries the metadata cache of the target file for the desired size + * information, and returns this information in the locations indicated by the pointer + * parameters. If any pointer parameter is NULL, the associated data is not returned. + * + * If the API call fails, the values returned via the pointer parameters are undefined. + * + * If adaptive cache resizing is enabled, the cache maximum size and minimum clean size + * may change at the end of each epoch. Current size and current number of entries can + * change on each cache access. + * + * Current size can exceed maximum size under certain conditions. See the overview of the + * metadata cache in the special topics section of the user manual for a discussion of this. + * + */ +H5_DLL herr_t H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, + size_t *cur_size_ptr, int *cur_num_entries_ptr); +/** + * \ingroup MDC + * + * \brief Resets hit rate statistics counters for the target file + * + * \file_id + * \returns \herr_t + * + * \details + * \parblock + * H5Freset_mdc_hit_rate_stats() resets the hit rate statistics counters in the metadata cache + * associated with the specified file. + * + * If the adaptive cache resizing code is enabled, the hit rate statistics are reset at the beginning + * of each epoch. This API call allows you to do the same thing from your program. + * + * The adaptive cache resizing code may behave oddly if you use this call when adaptive cache resizing + * 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 + * 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); +/** + * \ingroup H5F + * + * \brief Retrieves name of file to which object belongs + * + * \obj_id + * \param[out] name Buffer for the file name + * \param[in] size Size, in bytes, of the \p name buffer + * + * \return Returns the length of the file name if successful; otherwise returns + * a negative value. + * + * \details H5Fget_name() retrieves the name of the file to which the object \p + * obj_id belongs. The object can be a file, group, dataset, + * attribute, or named datatype. + * + * Up to \p size characters of the file 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 + * size, is unknown, a preliminary H5Fget_name() call can be made by + * setting \p name to NULL. The return value of this call will be the + * size of the file name; that value plus one (1) can then be assigned + * to size for a second H5Fget_name() call, which will retrieve the + * actual name. (The value passed in with the parameter \p size must + * be one greater than size in bytes of the actual name in order to + * accommodate the null terminator; if \p size is set to the exact + * size of the name, the last byte passed back will contain the null + * terminator and the last character will be missing from the name + * passed back to the calling application.) + * + * If an error occurs, the buffer pointed to by \p name is unchanged + * and the function returns a negative value. + * + * \since 1.6.3 + * + */ +H5_DLL ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size); +/** + * \ingroup H5F + * + * \brief Retrieves name of file to which object belongs + * + * \fgdta_obj_id + * \param[out] file_info Buffer for global file information + * + * \return \herr_t + * + * \details H5Fget_info2() returns global information for the file associated + * with the object identifier \p obj_id in the H5F_info2_t \c struct + * named \p file_info. + * + * \p obj_id is an identifier for any object in the file of interest. + * + * H5F_info2_t struct is defined in H5Fpublic.h as follows: + * \snippet this H5F_info2_t_snip + * + * The \c super sub-struct contains the following information: + * \li \c vers is the version number of the superblock. + * \li \c super_size is the size of the superblock. + * \li \c super_ext_size is the size of the superblock extension. + * + * The \c free sub-struct contains the following information: + * \li vers is the version number of the free-space manager. + * \li \c hdr_size is the size of the free-space manager header. + * \li \c tot_space is the total amount of free space in the file. + * + * The \c sohm sub-struct contains shared object header message + * information as follows: + * \li \c vers is the version number of the shared object header information. + * \li \c hdr_size is the size of the shared object header message. + * \li \c msgs_info is an H5_ih_info_t struct defined in H5public.h as + * follows: \snippet H5public.h H5_ih_info_t_snip + * \li \p index_size is the summed size of all the shared object + * header indexes. Each index might be either a B-tree or + * a list. + * \li \p heap_size is the size of the heap. + * + * + * \since 1.10.0 + * + */ +H5_DLL herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *file_info); +/** + * \ingroup SWMR + * + * \brief Retrieves the collection of read retries for metadata entries with checksum + * + * \file_id + * \param[out] info Struct containing the collection of read retries for metadata + * entries with checksum + * \return \herr_t\n + * + * \details \Bold{Failure Modes:} + * \li When the input identifier is not a file identifier. + * \li When the pointer to the output structure is NULL. + * \li When the memory allocation for \p retries failed. + * + * \details H5Fget_metadata_read_retry_info() retrieves information regarding the number + * of read retries for metadata entries with checksum for the file \p file_id. + * This information is reported in the H5F_retry_info_t struct defined in + * H5Fpublic.h as follows: + * \snippet this H5F_retry_info_t_snip + * \c nbins is the number of bins for each \c retries[i] of metadata entry \c i. + * It is calculated based on the current number of read attempts used in the + * library and logarithmic base 10. + * + * If read retries are incurred for a metadata entry \c i, the library will + * allocate memory for \Code{retries[i] (nbins * sizeof(uint32_t)} and store + * the collection of retries there. If there are no retries for a metadata entry + * \c i, \Code{retries[i]} will be NULL. After a call to this routine, users should + * free each \Code{retries[i]} that is non-NULL, otherwise resource leak will occur. + * + * For the library default read attempts of 100 for SWMR access, nbins will be 2 + * as depicted below: + * \li \Code{retries[i][0]} is the number of 1 to 9 read retries. + * \li \Code{retries[i][1]} is the number of 10 to 99 read retries. + * For the library default read attempts of 1 for non-SWMR access, \c nbins will + * be 0 and each \Code{retries[i]} will be NULL. + * + * The following table lists the 21 metadata entries of \Code{retries[]}: + * <table> + * <tr> + * <th>Index for \Code{retries[]}</th> + * <th>Metadata entries<sup>*</sup></th> + * </tr> + * <tr><td>0</td><td>Object header (version 2)</td></tr> + * <tr><td>1</td><td>Object header chunk (version 2)</td></tr> + * <tr><td>2</td><td>B-tree header (version 2)</td></tr> + * <tr><td>3</td><td>B-tree internal node (version 2)</td></tr> + * <tr><td>4</td><td>B-tree leaf node (version 2)</td></tr> + * <tr><td>5</td><td>Fractal heap header</td></tr> + * <tr><td>6</td><td>Fractal heap direct block (optional checksum)</td></tr> + * <tr><td>7</td><td>Fractal heap indirect block</td></tr> + * <tr><td>8</td><td>Free-space header</td></tr> + * <tr><td>9</td><td>Free-space sections</td></tr> + * <tr><td>10</td><td>Shared object header message table</td></tr> + * <tr><td>11</td><td>Shared message record list</td></tr> + * <tr><td>12</td><td>Extensive array header</td></tr> + * <tr><td>13</td><td>Extensive array index block</td></tr> + * <tr><td>14</td><td>Extensive array super block</td></tr> + * <tr><td>15</td><td>Extensive array data block</td></tr> + * <tr><td>16</td><td>Extensive array data block page</td></tr> + * <tr><td>17</td><td>Fixed array super block</td></tr> + * <tr><td>18</td><td>Fixed array data block</td></tr> + * <tr><td>19</td><td>Fixed array data block page</td></tr> + * <tr><td>20</td><td>File's superblock (version 2)</td></tr> + * <tr><td colspan=2><sup>*</sup> All entries are of version 0 (zero) unless indicated otherwise.</td></tr> + * </table> + * + * \note 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 for a set number of times to attempt to + * obtain consistent data. The maximum number of read attempts used by the library + * will be either the value set via H5Pset_metadata_read_attempts() or the library + * default value when a value is not set.\n + * When the current number of metadata read attempts used in the library is unable + * to remedy the reading of inconsistent metadata on a system, the user can assess + * the information obtained via this routine to derive a different maximum value. + * The information can also be helpful for debugging purposes to identify potential + * issues with metadata flush dependencies and SWMR implementation in general. + * + * \since 1.10.0 + * + */ +H5_DLL herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info); +/** + * \ingroup SWMR + * + * \brief Retrieves free-space section information for a file + * + * \file_id + * + * \return \herr_t + * + * \details H5Fstart_swmr_write() will activate SWMR writing mode for a file + * associated with \p file_id. This routine will prepare and ensure + * the file is safe for SWMR writing as follows: + * \li Check that the file is opened with write access (#H5F_ACC_RDWR). + * \li Check that the file is opened with the latest library format to + * ensure data structures with check-summed metadata are used. + * \li Check that the file is not already marked in SWMR writing mode. + * \li Enable reading retries for check-summed metadata to remedy + * possible checksum failures from reading inconsistent metadata + * on a system that is not atomic. + * \li Turn off usage of the library's accumulator to avoid possible + * ordering problem on a system that is not atomic. + * \li Perform a flush of the file’s data buffers and metadata to set + * a consistent state for starting SWMR write operations. + * + * Library objects are groups, datasets, and committed datatypes. For + * the current implementation, groups and datasets can remain open when + * activating SWMR writing mode, but not committed datatypes. Attributes + * attached to objects cannot remain open either. + * + * \since 1.10.0 + * + */ +H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id); +/** + * \ingroup H5F + * + * \brief Retrieves free-space section information for a file + * + * \file_id + * \param[in] type The file memory allocation type + * \param[in] nsects The number of free-space sections + * \param[out] sect_info Array of instances of H5F_sect_info_t in which + * the free-space section information is to be returned + * + * \return Returns the number of free-space sections for the specified + * free-space manager in the file; otherwise returns a negative value. + * + * \details H5Fget_free_sections() retrieves free-space section information for + * the free-space manager with type that is associated with file + * \p file_id. If type is #H5FD_MEM_DEFAULT, this routine retrieves + * free-space section information for all the free-space managers in + * the file. + * + * Valid values for \p type are the following: + * \mem_types + * + * H5F_sect_info_t is defined as follows (in H5Fpublic.h): + * \snippet this H5F_sect_info_t_snip + * + * This routine retrieves free-space section information for \p nsects + * sections or at most the maximum number of sections in the specified + * free-space manager. If the number of sections is not known, a + * preliminary H5Fget_free_sections() call can be made by setting \p + * sect_info to NULL and the total number of free-space sections for + * the specified free-space manager will be returned. Users can then + * allocate space for entries in \p sect_info, each of which is + * defined as an H5F_sect_info_t \c struct. + * + * \attention \Bold{Failure Modes:} This routine will fail when the following + * is true: + * \li The library fails to retrieve the file creation property list + * associated with \p file_id. + * \li If the parameter \p sect_info is non-null, but the parameter + * \p nsects is equal to 0. + * \li The library fails to retrieve free-space section information + * for the file. + * + * \since 1.10.0 + * + */ +H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, + H5F_sect_info_t *sect_info /*out*/); +/** + * \ingroup H5F + * + * \brief Clears the external link open file cache + * + * \file_id + * \return \herr_t + * + * \details H5Fclear_elink_file_cache() evicts all the cached child files in + * the specified file’s external file cache, causing them to be closed + * if there is nothing else holding them open. + * + * H5Fclear_elink_file_cache() does not close the cache itself; + * subsequent external link traversals from the parent file will again + * cache the target file. See H5Pset_elink_file_cache_size() for + * information on closing the file cache. + * + * \see H5Pset_elink_file_cache_size(), H5Pget_elink_file_cache_size() + * + * \since 1.8.7 + * + */ +H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id); +/** + * \ingroup H5F + * + * \brief Enables the switch of version bounds setting for a file + * + * \file_id + * \param[in] low The earliest version of the library that will be used for + * writing objects + * \param[in] high The latest version of the library that will be used for + * writing objects + * + * \return \herr_t + * + * \details H5Fset_libver_bounds() enables the switch of version bounds setting + * for an open file associated with \p file_id. + * + * For the parameters \p low and \p high, see the description for + * H5Pset_libver_bounds(). + * + * \since 1.10.2 + * + */ +H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high); +/** + * \ingroup MDC + * + * \brief Starts logging metadata cache events if logging was previously enabled + * + * \file_id + * + * \return \herr_t + * + * \details The metadata cache is a central part of the HDF5 library through + * which all \Emph{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() 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 \Emph{Metadata Cache Logging} document. + * + * \note Logging can only be started or stopped if metadata cache logging was enabled + * via H5Pset_mdc_log_options().\n + * When enabled and currently logging, the overhead of the logging feature will + * almost certainly be significant.\n + * The log file is opened when the HDF5 file is opened or created and not when + * this function is called for the first time.\n + * This function opens the log file and starts logging metadata cache operations + * for a particular file. Calling this function when logging has already been + * enabled will be considered an error. + * + * \since 1.10.0 + * + * \todo Fix the document reference! + * + */ +H5_DLL herr_t H5Fstart_mdc_logging(hid_t file_id); +/** + * \ingroup MDC + * + * \brief Stops logging metadata cache events if logging was previously enabled and is currently ongoing + * + * \file_id + * + * \return \herr_t + * + * \details The metadata cache is a central part of the HDF5 library through + * which all \Emph{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() 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 \Emph{Metadata Cache Logging} document. + * + * \note Logging can only be started or stopped if metadata cache logging was enabled + * via H5Pset_mdc_log_options().\n + * This function only suspends the logging operations. The log file will remain + * open and will not be closed until the HDF5 file is closed. + * + * \since 1.10.0 + * + */ +H5_DLL herr_t H5Fstop_mdc_logging(hid_t file_id); +/** + * \ingroup MDC + * + * \brief Gets the current metadata cache logging status + * + * \file_id + * \param[out] is_enabled Whether logging is enabled + * \param[out] is_currently_logging Whether events are currently being logged + * \return \herr_t + * + * \details The metadata cache is a central part of the HDF5 library through + * which all \Emph{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() 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 \Emph{Metadata Cache Logging} document. + * + * \note Unlike H5Fstart_mdc_logging() and H5Fstop_mdc_logging(), this function can + * be called on any open file identifier. + * + * \since 1.10.0 + */ +H5_DLL herr_t H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled, + hbool_t *is_currently_logging); +/** + * \ingroup SWMR + * + * \todo Finish this! + */ +H5_DLL herr_t H5Fformat_convert(hid_t fid); +/** + * \ingroup H5F + * + * \brief Resets the page buffer statistics + * + * \file_id + * + * \return \herr_t + * + * \details H5Freset_page_buffering_stats() resets the page buffer statistics + * for a specified file identifier \p file_id. + * + * \since 1.10.1 + * + */ +H5_DLL herr_t H5Freset_page_buffering_stats(hid_t file_id); +/** + * \ingroup H5F + * + * \brief Retrieves statistics about page access when it is enabled + * + * \file_id + * \param[out] accesses Two integer array for the number of metadata and raw + * data accesses to the page buffer + * \param[out] hits Two integer array for the number of metadata and raw data + * hits in the page buffer + * \param[out] misses Two integer array for the number of metadata and raw data + * misses in the page buffer + * \param[out] evictions Two integer array for the number of metadata and raw + * data evictions from the page buffer + * \param[out] bypasses Two integer array for the number of metadata and raw + * data accesses that bypass the page buffer + * + * \return \herr_t + * + * \details H5Fget_page_buffering_stats() retrieves page buffering statistics + * such as the number of metadata and raw data accesses (\p accesses), + * hits (\p hits), misses (\p misses), evictions (\p evictions), and + * accesses that bypass the page buffer (\p bypasses). + * + * \since 1.10.1 + * + */ +H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2], + unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]); +/** + * \ingroup MDC + * + * \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_size Length of the cache image if it exists, or 0 if it does not + * \returns \herr_t + * + * \details + * \parblock + * H5Fget_mdc_image_info() returns information about a cache image if it exists. + * + * When an HDF5 file is opened in Read/Write mode, any metadata cache image will + * be read and deleted from the file on the first metadata cache access (or, if + * persistent free space managers are enabled, on the first file space + * allocation / deallocation, or read of free space manager status, whichever + * comes first). + * + * Thus, if the file is opened Read/Write, H5Fget_mdc_image_info() should be called + * immediately after file open and before any other operation. If H5Fget_mdc_image_info() + * is called after the cache image is loaded, it will correctly report that no cache image + * exists, as the image will have already been read and deleted from the file. In the Read Only + * case, the function may be called at any time, as any cache image will not be deleted + * from the file. + * \endparblock + * + * \since 1.10.1 + */ +H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); +/** + * \ingroup H5F + * + * \brief Retrieves the setting for whether or not a file will create minimized + * dataset object headers + * + * \file_id + * \param[out] minimize Flag indicating whether the library will or will not + * create minimized dataset object headers + * + * \return \herr_t + * + * \details H5Fget_dset_no_attrs_hint() retrieves the no dataset attributes + * hint setting for the file specified by the file identifier \p + * file_id. This setting is used to inform the library to create + * minimized dataset object headers when \c TRUE. + * + * The setting's value is returned in the boolean pointer minimize. + * + * \since 1.10.5 + * + */ +H5_DLL herr_t H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize); +/** + * \ingroup H5F + * + * \brief Sets the flag to create minimized dataset object headers + * + * \file_id + * \param[in] minimize Flag indicating whether the library will or will not + * create minimized dataset object headers + * + * \return \herr_t + * + * \details H5Fset_dset_no_attrs_hint() sets the no dataset attributes hint + * setting for the file specified by the file identifier \p file_id. + * If the boolean flag \p minimize is set to \c TRUE, then the library + * will create minimized dataset object headers in the file. + * \Bold{All} files that refer to the same file-on-disk will be + * affected by the most recent setting, regardless of the file + * identifier/handle (e.g., as returned by H5Fopen()). By setting the + * \p minimize flag to \c TRUE, the library expects that no attributes + * will be added to the dataset - attributes can be added, but they + * are appended with a continuation message, which can reduce + * performance. + * + * \attention This setting interacts with H5Pset_dset_no_attrs_hint(): if + * either is set to \c TRUE, then the created dataset's object header + * will be minimized. + * + * \since 1.10.5 + * + */ +H5_DLL herr_t H5Fset_dset_no_attrs_hint(hid_t file_id, hbool_t minimize); #ifdef H5_HAVE_PARALLEL +/** + * \ingroup PH5F + * + * \brief Sets the MPI atomicity mode + * + * \file_id + * \param[in] flag Logical flag for atomicity setting. Valid values are: + * \li \c 1 -- Sets MPI file access to atomic mode. + * \li \c 0 -- Sets MPI file access to nonatomic mode. + * \returns \herr_t + * + * \par Motivation + * H5Fset_mpi_atomicity() is applicable only in parallel environments using MPI I/O. + * The function is one of the tools used to ensure sequential consistency. This means + * that a set of operations will behave as though they were performed in a serial + * order consistent with the program order. + * + * \details + * \parblock + * H5Fset_mpi_atomicity() sets MPI consistency semantics for data access to the file, + * \p file_id. + * + * If \p flag is set to \c 1, all file access operations will appear atomic, guaranteeing + * sequential consistency. If \p flag is set to \c 0, enforcement of atomic file access + * will be turned off. + * + * H5Fset_mpi_atomicity() is a collective function and all participating processes must + * pass the same values for \p file_id and \p flag. + * + * This function is available only when the HDF5 library is configured with parallel support + * (\Code{--enable-parallel}). It is useful only when used with the #H5FD_MPIO driver + * (see H5Pset_fapl_mpio()). + * \endparblock + * + * \attention + * \parblock + * H5Fset_mpi_atomicity() calls \Code{MPI_File_set_atomicity} underneath and is not supported + * if the execution platform does not support \Code{MPI_File_set_atomicity}. When it is + * supported and used, the performance of data access operations may drop significantly. + * + * In certain scenarios, even when \Code{MPI_File_set_atomicity} is supported, setting + * atomicity with H5Fset_mpi_atomicity() and \p flag set to 1 does not always yield + * strictly atomic updates. For example, some H5Dwrite() calls translate to multiple + * \Code{MPI_File_write_at} calls. This happens in all cases where the high-level file + * access routine translates to multiple lower level file access routines. + * The following scenarios will raise this issue: + * \li Non-contiguous file access using independent I/O + * \li Partial collective I/O using chunked access + * \li Collective I/O using filters or when data conversion is required + * + * This issue arises because MPI atomicity is a matter of MPI file access operations rather + * than HDF5 access operations. But the user is normally seeking atomicity at the HDF5 level. + * To accomplish this, the application must set a barrier after a write, H5Dwrite(), but before + * the next read, H5Dread(), in addition to calling H5Fset_mpi_atomicity().The barrier will + * guarantee that all underlying write operations execute atomically before the read + * operations starts. This ensures additional ordering semantics and will normally produce + * the desired behavior. + * \endparblock + * + * \see Enabling a Strict Consistency Semantics Model in Parallel HDF5 + * + * \since 1.8.9 + * + * \todo Fix the reference! + */ H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); +/** + * \ingroup PH5F + * + * \brief Retrieves the atomicity mode in use + * + * \file_id + * \param[out] flag Logical flag for atomicity setting. Valid values are: + * \li 1 -- MPI file access is set to atomic mode. + * \li 0 -- MPI file access is set to nonatomic mode. + * \returns \herr_t + * + * \details H5Fget_mpi_atomicity() retrieves the current consistency semantics mode for + * data access for the file \p file_id. + * + * 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 + * + * \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 */ @@ -294,19 +2170,95 @@ H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); /* Typedefs */ -/* Current "global" information about file */ +/** + * Current "global" information about file + */ +//! [H5F_info1_t_snip] typedef struct H5F_info1_t { - hsize_t super_ext_size; /* Superblock extension size */ + hsize_t super_ext_size; /**< Superblock extension size */ struct { - hsize_t hdr_size; /* Shared object header message header size */ - H5_ih_info_t msgs_info; /* Shared object header message index & heap size */ + hsize_t hdr_size; /**< Shared object header message header size */ + H5_ih_info_t msgs_info; /**< Shared object header message index & heap size */ } sohm; } H5F_info1_t; +//! [H5F_info1_t_snip] /* Function prototypes */ -H5_DLL herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo); +/** + * \ingroup H5F + * + * \brief Retrieves name of file to which object belongs + * + * \fgdta_obj_id + * \param[out] file_info Buffer for global file information + * + * \return \herr_t + * + * \deprecated This function has been renamed from H5Fget_info() and is + * deprecated in favor of the macro #H5Fget_info or the function + * H5Fget_info2(). + * + * \details H5Fget_info1() returns global information for the file associated + * with the object identifier \p obj_id in the H5F_info1_t \c struct + * named \p file_info. + * + * \p obj_id is an identifier for any object in the file of interest. + * + * H5F_info1_t struct is defined in H5Fpublic.h as follows: + * \snippet this H5F_info1_t_snip + * + * \c super_ext_size is the size of the superblock extension. + * + * The \c sohm sub-struct contains shared object header message + * information as follows: + * \li \c hdr_size is the size of the shared object header message. + * \li \c msgs_info is an H5_ih_info_t struct defined in H5public.h as + * follows: \snippet H5public.h H5_ih_info_t_snip + * + * \li \p index_size is the summed size of all the shared object + * 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 + * deprecated in this release. + * + * \since 1.8.0 + * + */ +H5_DLL herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *file_info); +/** + * \ingroup H5F + * + * \brief Sets thelatest version of the library to be used for writing objects + * + * \file_id + * \param[in] latest_format Latest format flag + * + * \return \herr_t + * + * \deprecated When? + * + * \todo In which version was this function deprecated? + * + */ H5_DLL herr_t H5Fset_latest_format(hid_t file_id, hbool_t latest_format); -H5_DLL htri_t H5Fis_hdf5(const char *filename); +/** + * \ingroup H5F + * + * \brief Determines whether a file is in the HDF5 format + * + * \param[in] file_name File name + * + * \return \htri_t + * + * \deprecated When? + * + * \details H5Fis_hdf5() determines whether a file is in the HDF5 format. + * + * \todo In which version was this function deprecated? + * + */ +H5_DLL htri_t H5Fis_hdf5(const char *file_name); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 9eee975..2cd6ddf 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -329,7 +329,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) hbool_t skip_eof_check = FALSE; /* Whether to skip checking the EOF value */ #ifdef H5_HAVE_PARALLEL int mpi_size = 1; -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE_TAG(H5AC__SUPERBLOCK_TAG) @@ -879,12 +879,12 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) /* Do the same kluge until we know for sure. VC */ #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ - /* KLUGE ALERT!! - * - * H5F__super_ext_write_msg() expects f->shared->sblock to - * be set -- verify that it is NULL, and then set it. - * Set it back to NULL when we are done. - */ + /* KLUGE ALERT!! + * + * H5F__super_ext_write_msg() expects f->shared->sblock to + * be set -- verify that it is NULL, and then set it. + * Set it back to NULL when we are done. + */ HDassert(f->shared->sblock == NULL); f->shared->sblock = sblock; #endif /* JRM */ @@ -104,16 +104,10 @@ /* Local Prototypes */ /********************/ -/* Group close callback */ -static herr_t H5G__close_cb(H5VL_object_t *grp_vol_obj); - /*********************/ /* Package Variables */ /*********************/ -/* Package initialization variable */ -hbool_t H5_PKG_INIT_VAR = FALSE; - /*****************************/ /* Library Private Variables */ /*****************************/ @@ -122,182 +116,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Local Variables */ /*******************/ -/* Group ID class */ -static const H5I_class_t H5I_GROUP_CLS[1] = {{ - H5I_GROUP, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5G__close_cb /* Callback routine for closing objects of this class */ -}}; - -/* Flag indicating "top" of interface has been initialized */ -static hbool_t H5G_top_package_initialize_s = FALSE; - -/*------------------------------------------------------------------------- - * Function: H5G_init - * - * Purpose: Initialize the interface from some other layer. - * - * Return: Success: non-negative - * - * Failure: negative - *------------------------------------------------------------------------- - */ -herr_t -H5G_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 H5G_init() */ - -/*------------------------------------------------------------------------- - * Function: H5G__init_package - * - * Purpose: Initializes the H5G interface. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, January 5, 1998 - * - * Notes: The group creation properties are registered in the property - * list interface initialization routine (H5P_init_package) - * so that the file creation property class can inherit from it - * correctly. (Which allows the file creation property list to - * control the group creation properties of the root group of - * a file) QAK - 24/10/2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G__init_package(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* Initialize the atom group for the group IDs */ - if (H5I_register_type(H5I_GROUP_CLS) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to initialize interface") - - /* Mark "top" of interface as initialized, too */ - H5G_top_package_initialize_s = TRUE; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G__init_package() */ - -/*------------------------------------------------------------------------- - * Function: H5G_top_term_package - * - * Purpose: Close the "top" of the interface, releasing IDs, etc. - * - * Return: Success: Positive if anything is done that might - * affect other interfaces; zero otherwise. - * Failure: Negative. - * - * Programmer: Quincey Koziol - * Sunday, September 13, 2015 - * - *------------------------------------------------------------------------- - */ -int -H5G_top_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if (H5G_top_package_initialize_s) { - if (H5I_nmembers(H5I_GROUP) > 0) { - (void)H5I_clear_type(H5I_GROUP, FALSE, FALSE); - n++; /*H5I*/ - } /* end if */ - - /* Mark closed */ - if (0 == n) - H5G_top_package_initialize_s = FALSE; - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5G_top_term_package() */ - -/*------------------------------------------------------------------------- - * Function: H5G_term_package - * - * Purpose: Terminates the H5G interface - * - * Note: Finishes shutting down the interface, after - * H5G_top_term_package() is called - * - * Return: Success: Positive if anything is done that might - * affect other interfaces; zero otherwise. - * Failure: Negative. - * - * Programmer: Robb Matzke - * Monday, January 5, 1998 - * - *------------------------------------------------------------------------- - */ -int -H5G_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if (H5_PKG_INIT_VAR) { - /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_GROUP)); - HDassert(FALSE == H5G_top_package_initialize_s); - - /* Destroy the group object id group */ - n += (H5I_dec_type_ref(H5I_GROUP) > 0); - - /* Mark closed */ - if (0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5G_term_package() */ - -/*------------------------------------------------------------------------- - * Function: H5G__close_cb - * - * Purpose: Called when the ref count reaches zero on the group's ID - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G__close_cb(H5VL_object_t *grp_vol_obj) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity check */ - HDassert(grp_vol_obj); - - /* Close the group */ - if (H5VL_group_close(grp_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to close group") - - /* Free the VOL object */ - if (H5VL_free_object(grp_vol_obj) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to free VOL object") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G__close_cb() */ - /*------------------------------------------------------------------------- * Function: H5Gcreate2 * @@ -370,9 +188,9 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t g H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group") - /* Get an atom for the group */ + /* Get an ID for the group */ if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize group handle") + HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get ID for group handle") done: if (H5I_INVALID_HID == ret_value) @@ -417,9 +235,9 @@ done: hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) { - void * grp = NULL; /* Structure for new group */ - H5VL_object_t * vol_obj = NULL; /* Object for loc_id */ - H5VL_loc_params_t loc_params; + void * grp = NULL; /* Structure for new group */ + H5VL_object_t * vol_obj = NULL; /* Object for loc_id */ + H5VL_loc_params_t loc_params; /* Location parameters for object access */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -448,9 +266,9 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) gapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group") - /* Get an atom for the group */ + /* Get an ID for the group */ if ((ret_value = H5VL_register(H5I_GROUP, grp, vol_obj->connector, TRUE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize group handle") + HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get ID for group handle") done: /* Cleanup on failure */ @@ -566,7 +384,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Gget_info(hid_t loc_id, H5G_info_t *group_info) +H5Gget_info(hid_t loc_id, H5G_info_t *group_info /*out*/) { H5VL_object_t * vol_obj; H5I_type_t id_type; /* Type of ID */ @@ -574,7 +392,7 @@ H5Gget_info(hid_t loc_id, H5G_info_t *group_info) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", loc_id, group_info); + H5TRACE2("e", "ix", loc_id, group_info); /* Check args */ id_type = H5I_get_type(loc_id); @@ -609,14 +427,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *group_info, hid_t lapl_id) +H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *group_info /*out*/, hid_t lapl_id) { H5VL_object_t * vol_obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*s*xi", loc_id, name, group_info, lapl_id); + H5TRACE4("e", "i*sxi", loc_id, name, group_info, lapl_id); /* Check args */ if (!name) @@ -661,14 +479,14 @@ done: */ herr_t H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n, H5G_info_t *group_info, hid_t lapl_id) + hsize_t n, H5G_info_t *group_info /*out*/, hid_t lapl_id) { H5VL_object_t * vol_obj; H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, group_info, lapl_id); + H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, group_info, lapl_id); /* Check args */ if (!group_name) @@ -726,15 +544,15 @@ H5Gclose(hid_t group_id) FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); - /* Check args */ - if (NULL == H5I_object_verify(group_id, H5I_GROUP)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + /* Check arguments */ + if (H5I_GROUP != H5I_get_type(group_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group ID") - /* Decrement the counter on the group atom. It will be freed if the count + /* Decrement the counter on the group ID. It will be freed if the count * reaches zero. */ if (H5I_dec_app_ref(group_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "decrementing group ID failed") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index a731bcf..e72d225 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -724,7 +724,7 @@ done: *------------------------------------------------------------------------- */ int -H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) +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; @@ -732,7 +732,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) int ret_value; /* Return value */ FUNC_ENTER_API(-1) - H5TRACE4("Is", "i*sz*s", loc_id, name, bufsize, buf); + H5TRACE4("Is", "i*szx", loc_id, name, bufsize, buf); if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, -1, "no name specified") @@ -800,7 +800,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, void *o herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*Isx*x", loc_id, name, idx_p, op, op_data); + H5TRACE5("e", "i*s*IsGi*x", loc_id, name, idx_p, op, op_data); /* Check args */ if (!name || !*name) @@ -858,7 +858,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) +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 */ @@ -867,7 +867,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*h", loc_id, num_objs); + H5TRACE2("e", "ix", loc_id, num_objs); /* Check args */ id_type = H5I_get_type(loc_id); @@ -1131,14 +1131,14 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE4("Zs", "ih*sz", loc_id, idx, name, size); + H5TRACE4("Zs", "ihxz", loc_id, idx, name, size); /* Set up collective metadata if appropriate */ if (H5CX_set_loc(loc_id) < 0) diff --git a/src/H5Gent.c b/src/H5Gent.c index 12a2caf..fb59d97 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -53,9 +53,6 @@ /* Package Variables */ /*********************/ -/* Declare extern the PQ free list for the wrapped strings */ -H5FL_BLK_EXTERN(str_buf); - /*****************************/ /* Library Private Variables */ /*****************************/ @@ -424,7 +421,7 @@ H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk HDassert(!stab_exists); } /* end else */ #endif /* NDEBUG */ - } /* end if */ + } /* end if */ else if (obj_type == H5O_TYPE_UNKNOWN) { /* Try to retrieve symbol table information for caching */ H5O_loc_t targ_oloc; /* Location of link target */ diff --git a/src/H5Gint.c b/src/H5Gint.c index 483e6b2..c4d6e64 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -84,11 +84,15 @@ typedef struct { static herr_t H5G__open_oid(H5G_t *grp); static herr_t H5G__visit_cb(const H5O_link_t *lnk, void *_udata); +static herr_t H5G__close_cb(H5VL_object_t *grp_vol_obj); /*********************/ /* Package Variables */ /*********************/ +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + /* Declare a free list to manage the H5G_t struct */ H5FL_DEFINE(H5G_t); H5FL_DEFINE(H5G_shared_t); @@ -104,6 +108,182 @@ H5FL_DEFINE(H5_obj_t); /* Local Variables */ /*******************/ +/* Group ID class */ +static const H5I_class_t H5I_GROUP_CLS[1] = {{ + H5I_GROUP, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5G__close_cb /* Callback routine for closing objects of this class */ +}}; + +/* Flag indicating "top" of interface has been initialized */ +static hbool_t H5G_top_package_initialize_s = FALSE; + +/*------------------------------------------------------------------------- + * Function: H5G_init + * + * Purpose: Initialize the interface from some other layer. + * + * Return: Success: non-negative + * + * Failure: negative + *------------------------------------------------------------------------- + */ +herr_t +H5G_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 H5G_init() */ + +/*------------------------------------------------------------------------- + * Function: H5G__init_package + * + * Purpose: Initializes the H5G interface. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + * Notes: The group creation properties are registered in the property + * list interface initialization routine (H5P_init_package) + * so that the file creation property class can inherit from it + * correctly. (Which allows the file creation property list to + * control the group creation properties of the root group of + * a file) QAK - 24/10/2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__init_package(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Initialize the ID group for the group IDs */ + if (H5I_register_type(H5I_GROUP_CLS) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to initialize interface") + + /* Mark "top" of interface as initialized, too */ + H5G_top_package_initialize_s = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G__init_package() */ + +/*------------------------------------------------------------------------- + * Function: H5G_top_term_package + * + * Purpose: Close the "top" of the interface, releasing IDs, etc. + * + * Return: Success: Positive if anything is done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. + * + * Programmer: Quincey Koziol + * Sunday, September 13, 2015 + * + *------------------------------------------------------------------------- + */ +int +H5G_top_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if (H5G_top_package_initialize_s) { + if (H5I_nmembers(H5I_GROUP) > 0) { + (void)H5I_clear_type(H5I_GROUP, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + + /* Mark closed */ + if (0 == n) + H5G_top_package_initialize_s = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5G_top_term_package() */ + +/*------------------------------------------------------------------------- + * Function: H5G_term_package + * + * Purpose: Terminates the H5G interface + * + * Note: Finishes shutting down the interface, after + * H5G_top_term_package() is called + * + * Return: Success: Positive if anything is done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + *------------------------------------------------------------------------- + */ +int +H5G_term_package(void) +{ + int n = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if (H5_PKG_INIT_VAR) { + /* Sanity checks */ + HDassert(0 == H5I_nmembers(H5I_GROUP)); + HDassert(FALSE == H5G_top_package_initialize_s); + + /* Destroy the group object id group */ + n += (H5I_dec_type_ref(H5I_GROUP) > 0); + + /* Mark closed */ + if (0 == n) + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(n) +} /* end H5G_term_package() */ + +/*------------------------------------------------------------------------- + * Function: H5G__close_cb + * + * Purpose: Called when the ref count reaches zero on the group's ID + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__close_cb(H5VL_object_t *grp_vol_obj) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(grp_vol_obj); + + /* Close the group */ + if (H5VL_group_close(grp_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to close group") + + /* Free the VOL object */ + if (H5VL_free_object(grp_vol_obj) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to free VOL object") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G__close_cb() */ + /*------------------------------------------------------------------------- * Function: H5G__create_named * diff --git a/src/H5Gname.c b/src/H5Gname.c index d27428d..218b8d4 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -79,20 +79,14 @@ typedef struct H5G_gnba_iter_t { static htri_t H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r); static H5RS_str_t *H5G__build_fullpath(const char *prefix, const char *name); -#ifdef NOT_YET -static H5RS_str_t *H5G__build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r); -#endif /* NOT_YET */ -static herr_t H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, - const char *dst_path); -static int H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); +static herr_t H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, + const char *dst_path); +static int H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); /*********************/ /* Package Variables */ /*********************/ -/* Declare extern the PQ free list for the wrapped strings */ -H5FL_BLK_EXTERN(str_buf); - /*****************************/ /* Library Private Variables */ /*****************************/ @@ -277,11 +271,6 @@ done: static H5RS_str_t * H5G__build_fullpath(const char *prefix, const char *name) { - char * full_path; /* Full user path built */ - size_t orig_path_len; /* Original length of the path */ - size_t path_len; /* Length of the path */ - size_t name_len; /* Length of the name */ - unsigned need_sep; /* Flag to indicate if separator is needed */ H5RS_str_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -290,32 +279,12 @@ H5G__build_fullpath(const char *prefix, const char *name) HDassert(prefix); HDassert(name); - /* Get the length of the prefix */ - orig_path_len = path_len = HDstrlen(prefix); - - /* Determine if there is a trailing separator in the name */ - if (prefix[path_len - 1] == '/') - need_sep = 0; - else - need_sep = 1; - - /* Add in the length needed for the '/' separator and the relative path */ - name_len = HDstrlen(name); - path_len += name_len + need_sep; - - /* Allocate space for the path */ - if (NULL == (full_path = (char *)H5FL_BLK_MALLOC(str_buf, path_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Build full path */ - HDstrncpy(full_path, prefix, orig_path_len + 1); - if (need_sep) - HDstrncat(full_path, "/", (size_t)1); - HDstrncat(full_path, name, name_len); - - /* Create reference counted string for path */ - if (NULL == (ret_value = H5RS_own(full_path))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* Create full path */ + if (NULL == (ret_value = H5RS_create(prefix))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, NULL, "can't create ref-counted string") + if (prefix[HDstrlen(prefix) - 1] != '/') + H5RS_aputc(ret_value, '/'); /* Add separator, if the prefix doesn't end in one */ + H5RS_acat(ret_value, name); done: FUNC_LEAVE_NOAPI(ret_value) @@ -355,44 +324,6 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_build_fullpath_refstr_str() */ -#ifdef NOT_YET - -/*------------------------------------------------------------------------- - * Function: H5G_name_build_refstr_refstr - * - * Purpose: Build a full path from a prefix & base pair of reference counted - * strings - * - * Return: Pointer to reference counted string on success, NULL on error - * - * Programmer: Quincey Koziol - * - * Date: August 19, 2005 - * - *------------------------------------------------------------------------- - */ -static H5RS_str_t * -H5G__build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *name_r) -{ - const char *prefix; /* Pointer to raw string of prefix */ - const char *name; /* Pointer to raw string of name */ - H5RS_str_t *ret_value; /* Return value */ - - FUNC_ENTER_STATIC_NOERR - - /* Get the pointer to the prefix */ - prefix = H5RS_get_str(prefix_r); - - /* Get the pointer to the raw src user path */ - name = H5RS_get_str(name_r); - - /* Create reference counted string for path */ - ret_value = H5G__build_fullpath(prefix, name); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G__build_fullpath_refstr_refstr() */ -#endif /* NOT_YET */ - /*------------------------------------------------------------------------- * Function: H5G__name_init * @@ -681,27 +612,23 @@ H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char path_len = HDstrlen(path); if (full_suffix_len < path_len) { const char *dst_suffix; /* Destination suffix that changes */ - size_t dst_suffix_len; /* Length of destination suffix */ const char *src_suffix; /* Source suffix that changes */ size_t path_prefix_len; /* Length of path prefix */ const char *path_prefix2; /* 2nd prefix for path */ size_t path_prefix2_len; /* Length of 2nd path prefix */ - const char *common_prefix; /* Common prefix for src & dst paths */ size_t common_prefix_len; /* Length of common prefix */ - char * new_path; /* Pointer to new path */ - size_t new_path_len; /* Length of new path */ + H5RS_str_t *rs; /* Ref-counted string for new path */ - /* Compute path prefix before full suffix*/ + /* Compute path prefix before full suffix */ path_prefix_len = path_len - full_suffix_len; /* Determine the common prefix for src & dst paths */ - common_prefix = src_path; common_prefix_len = 0; /* Find first character that is different */ while (*(src_path + common_prefix_len) == *(dst_path + common_prefix_len)) common_prefix_len++; /* Back up to previous '/' */ - while (*(common_prefix + common_prefix_len) != '/') + while (*(src_path + common_prefix_len) != '/') common_prefix_len--; /* Include '/' */ common_prefix_len++; @@ -710,33 +637,28 @@ H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char src_suffix = src_path + (common_prefix_len - 1); /* Determine destination suffix */ - dst_suffix = dst_path + (common_prefix_len - 1); - dst_suffix_len = HDstrlen(dst_suffix); + dst_suffix = dst_path + (common_prefix_len - 1); - /* Compute path prefix before src suffix*/ + /* Compute path prefix before src suffix */ path_prefix2 = path; path_prefix2_len = path_prefix_len - HDstrlen(src_suffix); - /* Allocate space for the new path */ - new_path_len = path_prefix2_len + dst_suffix_len + full_suffix_len; - if (NULL == (new_path = (char *)H5FL_BLK_MALLOC(str_buf, new_path_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + /* Allocate new ref-counted string */ + if (NULL == (rs = H5RS_create(NULL))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create ref-counted string") /* Create the new path */ - if (path_prefix2_len > 0) { - HDstrncpy(new_path, path_prefix2, path_prefix2_len + 1); - HDstrncpy(new_path + path_prefix2_len, dst_suffix, dst_suffix_len + 1); - } /* end if */ - else - HDstrncpy(new_path, dst_suffix, dst_suffix_len + 1); + if (path_prefix2_len > 0) + H5RS_ancat(rs, path_prefix2, path_prefix2_len); + H5RS_acat(rs, dst_suffix); if (full_suffix_len > 0) - HDstrncat(new_path, full_suffix, full_suffix_len); + H5RS_acat(rs, full_suffix); /* Release previous path */ H5RS_decr(*path_r_ptr); /* Take ownership of the new full path */ - *path_r_ptr = H5RS_own(new_path); + *path_r_ptr = rs; } /* end if */ done: @@ -853,33 +775,24 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5G_NAME_MOUNT: /* Check if object is in child mount hier. */ if (obj_in_child) { - const char *full_path; /* Full path of current object */ - const char *src_path; /* Full path of source object */ - size_t src_path_len; /* Length of source full path */ - char * new_full_path; /* New full path of object */ - size_t new_full_len; /* Length of new full path */ + const char *full_path; /* Full path of current object */ + const char *src_path; /* Full path of source object */ + H5RS_str_t *rs; /* Ref-counted string for new path */ /* Get pointers to paths of interest */ - full_path = H5RS_get_str(obj_path->full_path_r); - src_path = H5RS_get_str(names->src_full_path_r); - src_path_len = HDstrlen(src_path); - - /* Build new full path */ - - /* Allocate space for the new full path */ - new_full_len = src_path_len + HDstrlen(full_path); - if (NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, new_full_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + full_path = H5RS_get_str(obj_path->full_path_r); + src_path = H5RS_get_str(names->src_full_path_r); - /* Create the new full path */ - HDstrncpy(new_full_path, src_path, src_path_len + 1); - HDstrncat(new_full_path, full_path, new_full_len); + /* Create new full path */ + if (NULL == (rs = H5RS_create(src_path))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create ref-counted string") + H5RS_acat(rs, full_path); /* Release previous full path */ H5RS_decr(obj_path->full_path_r); /* Take ownership of the new full path */ - obj_path->full_path_r = H5RS_own(new_full_path); + obj_path->full_path_r = rs; } /* end if */ /* Object must be in parent mount file hier. */ else { @@ -899,36 +812,30 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) */ case H5G_NAME_UNMOUNT: if (obj_in_child) { - const char *full_path; /* Full path of current object */ - const char *full_suffix; /* Full path after source path */ - size_t full_suffix_len; /* Length of full path after source path */ - const char *src_path; /* Full path of source object */ - char * new_full_path; /* New full path of object */ + const char *full_path; /* Full path of current object */ + const char *full_suffix; /* Full path after source path */ + const char *src_path; /* Full path of source object */ + H5RS_str_t *rs; /* Ref-counted string for new path */ /* Get pointers to paths of interest */ full_path = H5RS_get_str(obj_path->full_path_r); src_path = H5RS_get_str(names->src_full_path_r); /* Construct full path suffix */ - full_suffix = full_path + HDstrlen(src_path); - full_suffix_len = HDstrlen(full_suffix); + full_suffix = full_path + HDstrlen(src_path); - /* Build new full path */ - - /* Create the new full path */ - if (NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, full_suffix_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - HDstrncpy(new_full_path, full_suffix, full_suffix_len + 1); + /* Create new full path suffix */ + if (NULL == (rs = H5RS_create(full_suffix))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create ref-counted string") /* Release previous full path */ H5RS_decr(obj_path->full_path_r); /* Take ownership of the new full path */ - obj_path->full_path_r = H5RS_own(new_full_path); + obj_path->full_path_r = rs; /* Check if the object's user path should be invalidated */ - if (obj_path->user_path_r && - HDstrlen(new_full_path) < (size_t)H5RS_len(obj_path->user_path_r)) { + if (obj_path->user_path_r && H5RS_len(rs) < H5RS_len(obj_path->user_path_r)) { /* Free user path */ H5RS_decr(obj_path->user_path_r); obj_path->user_path_r = NULL; @@ -963,53 +870,42 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) case H5G_NAME_MOVE: /* Link move case, check for relative names case */ /* Check if the src object moved is in the current object's path */ if (H5G__common_path(obj_path->full_path_r, names->src_full_path_r)) { - const char *full_path; /* Full path of current object */ - const char *full_suffix; /* Suffix of full path, after src_path */ - size_t full_suffix_len; /* Length of suffix of full path after src_path*/ - char * new_full_path; /* New full path of object */ - size_t new_full_len; /* Length of new full path */ - const char *src_path; /* Full path of source object */ - const char *dst_path; /* Full path of destination object */ - size_t dst_path_len; /* Length of destination's full path */ + const char *full_path; /* Full path of current object */ + const char *full_suffix; /* Suffix of full path, after src_path */ + const char *src_path; /* Full path of source object */ + const char *dst_path; /* Full path of destination object */ + H5RS_str_t *rs; /* Ref-counted string for new path */ /* Sanity check */ HDassert(names->dst_full_path_r); /* Get pointers to paths of interest */ - full_path = H5RS_get_str(obj_path->full_path_r); - src_path = H5RS_get_str(names->src_full_path_r); - dst_path = H5RS_get_str(names->dst_full_path_r); - dst_path_len = HDstrlen(dst_path); + full_path = H5RS_get_str(obj_path->full_path_r); + src_path = H5RS_get_str(names->src_full_path_r); + dst_path = H5RS_get_str(names->dst_full_path_r); /* Make certain that the source and destination names are full (not relative) paths */ HDassert(*src_path == '/'); HDassert(*dst_path == '/'); /* Get pointer to "full suffix" */ - full_suffix = full_path + HDstrlen(src_path); - full_suffix_len = HDstrlen(full_suffix); + full_suffix = full_path + HDstrlen(src_path); /* Update the user path, if one exists */ if (obj_path->user_path_r) if (H5G__name_move_path(&(obj_path->user_path_r), full_suffix, src_path, dst_path) < 0) HGOTO_ERROR(H5E_SYM, H5E_PATH, FAIL, "can't build user path name") - /* Build new full path */ - - /* Allocate space for the new full path */ - new_full_len = dst_path_len + full_suffix_len; - if (NULL == (new_full_path = (char *)H5FL_BLK_MALLOC(str_buf, new_full_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Create the new full path */ - HDstrncpy(new_full_path, dst_path, dst_path_len + 1); - HDstrncat(new_full_path, full_suffix, full_suffix_len); + /* Create new full path */ + if (NULL == (rs = H5RS_create(dst_path))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create ref-counted string") + H5RS_acat(rs, full_suffix); /* Release previous full path */ H5RS_decr(obj_path->full_path_r); /* Take ownership of the new full path */ - obj_path->full_path_r = H5RS_own(new_full_path); + obj_path->full_path_r = rs; } /* end if */ break; diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 14b7ae7..a9a2903 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -167,7 +167,7 @@ typedef herr_t (*H5G_traverse_t)(H5G_loc_t *grp_loc /*in*/, const char *name, typedef enum H5G_link_iterate_op_type_t { #ifndef H5_NO_DEPRECATED_SYMBOLS H5G_LINK_OP_OLD, /* "Old" application callback */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ H5G_LINK_OP_NEW /* "New" application callback */ } H5G_link_iterate_op_type_t; @@ -176,7 +176,7 @@ typedef struct { union { #ifndef H5_NO_DEPRECATED_SYMBOLS H5G_iterate_t op_old; /* "Old" application callback for each link */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ H5L_iterate2_t op_new; /* "New" application callback for each link */ } op_func; } H5G_link_iterate_t; diff --git a/src/H5Groot.c b/src/H5Groot.c index d7fbb49..29cb46e 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -246,8 +246,8 @@ H5G_mkroot(H5F_t *f, hbool_t create_root) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to verify symbol table") } /* end if */ #endif /* H5_STRICT_FORMAT_CHECKS */ - } /* end if */ - } /* end else */ + } /* end if */ + } /* end else */ /* Cache the root group's symbol table information in the root group symbol * table entry. It will have been allocated by now if it needs to be diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 505718a..13be47a 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -198,7 +198,7 @@ H5G__traverse_ud(const H5G_loc_t *grp_loc /*in,out*/, const H5O_link_t *lnk, H5G else cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, H5CX_get_lapl(), H5CX_get_dxpl()); -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, H5CX_get_lapl(), H5CX_get_dxpl()); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 0e1304f..a9f89e0 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -1304,7 +1304,7 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG #ifndef NDEBUG unsigned nchildren = 0; /* Track # of children */ size_t max_child = 0; /* Track max. child entry used */ -#endif /* NDEBUG */ +#endif /* NDEBUG */ uint32_t metadata_chksum; /* Computed metadata checksum value */ size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1378,7 +1378,7 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG max_child = u; } /* end if */ #endif /* NDEBUG */ - } /* end for */ + } /* end for */ /* Compute checksum */ metadata_chksum = H5_checksum_metadata((uint8_t *)_image, (size_t)(image - (uint8_t *)_image), 0); @@ -548,7 +548,7 @@ H5HG_insert(H5F_t *f, size_t size, const void *obj, H5HG_t *hobj /*out*/) HDmemset(heap->obj[idx].begin + H5HG_SIZEOF_OBJHDR(f) + size, 0, need - (H5HG_SIZEOF_OBJHDR(f) + size)); #endif /* OLD_WAY */ - } /* end if */ + } /* end if */ heap_flags |= H5AC__DIRTIED_FLAG; /* Return value */ @@ -12,61 +12,32 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * FILE: H5I.c - Internal storage routines for handling "IDs" - * - * REMARKS: IDs which allow objects (void * currently) to be bundled - * into "types" for more general storage. - * - * DESIGN: The types are stored in an array of pointers to store each - * type in an element. Each "type" node contains a link to a - * hash table to manage the IDs in each type. Allowed types are - * values within the range 1 to H5I_MAX_NUM_TYPES and are given out - * at run-time. Types used by the library are stored in global - * variables defined in H5Ipublic.h. + * H5I.c - Public routines for handling IDs */ +/****************/ +/* Module Setup */ +/****************/ + #include "H5Imodule.h" /* This source code file is part of the H5I module */ -#define H5T_FRIEND /* Suppress error about including H5Tpkg */ +/***********/ +/* 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 "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Gprivate.h" /* Groups */ +#include "H5Fprivate.h" /* Files */ #include "H5Ipkg.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5SLprivate.h" /* Skip Lists */ -#include "H5Tpkg.h" /* Datatypes */ -#include "H5VLprivate.h" /* Virtual Object Layer */ +#include "H5Pprivate.h" /* Property lists */ +/****************/ /* Local Macros */ +/****************/ -/* Combine a Type number and an atom index into an atom */ -#define H5I_MAKE(g, i) ((((hid_t)(g)&TYPE_MASK) << ID_BITS) | ((hid_t)(i)&ID_MASK)) - -/* Local typedefs */ - -/* Atom information structure used */ -typedef struct H5I_id_info_t { - hid_t id; /* ID for this info */ - unsigned count; /* ref. count for this atom */ - unsigned app_count; /* ref. count of application visible atoms */ - const void *obj_ptr; /* pointer associated with the atom */ -} H5I_id_info_t; - -/* ID type structure used */ -typedef struct { - const H5I_class_t *cls; /* Pointer to ID class */ - unsigned init_count; /* # of times this type has been initialized*/ - uint64_t id_count; /* Current number of IDs held */ - uint64_t nextid; /* ID to use for the next atom */ - H5I_id_info_t * last_info; /* Info for most recent ID looked up */ - H5SL_t * ids; /* Pointer to skip list that stores IDs */ -} H5I_id_type_t; +/******************/ +/* Local Typedefs */ +/******************/ typedef struct { H5I_search_func_t app_cb; /* Application's callback routine */ @@ -79,119 +50,28 @@ typedef struct { void * op_data; /* Application's user data */ } H5I_iterate_pub_ud_t; -/* User data for iterator callback for retrieving an ID corresponding to an object pointer */ -typedef struct { - const void *object; /* object pointer to search for */ - H5I_type_t obj_type; /* type of object we are searching for */ - hid_t ret_id; /* ID returned */ -} H5I_get_id_ud_t; +/********************/ +/* Package Typedefs */ +/********************/ -/* User data for iterator callback for ID iteration */ -typedef struct { - H5I_search_func_t user_func; /* 'User' function to invoke */ - void * user_udata; /* User data to pass to 'user' function */ - hbool_t app_ref; /* Whether this is an appl. ref. call */ - H5I_type_t obj_type; /* Type of object we are iterating over */ -} H5I_iterate_ud_t; +/********************/ +/* Local Prototypes */ +/********************/ -/* User data for H5I__clear_type_cb */ -typedef struct { - H5I_id_type_t *type_ptr; /* Pointer to the type being cleard */ - hbool_t force; /* Whether to always remove the id */ - hbool_t app_ref; /* Whether this is an appl. ref. call */ -} H5I_clear_type_ud_t; - -/* Package initialization variable */ -hbool_t H5_PKG_INIT_VAR = FALSE; - -/*-------------------- Locally scoped variables -----------------------------*/ - -/* Array of pointers to atomic types */ -static H5I_id_type_t *H5I_id_type_list_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 */ -static int H5I_next_type = (int)H5I_NTYPES; - -/* Declare a free list to manage the H5I_id_info_t struct */ -H5FL_DEFINE_STATIC(H5I_id_info_t); - -/* Declare a free list to manage the H5I_id_type_t struct */ -H5FL_DEFINE_STATIC(H5I_id_type_t); - -/* Declare a free list to manage the H5I_class_t struct */ -H5FL_DEFINE_STATIC(H5I_class_t); - -H5FL_EXTERN(H5VL_object_t); - -/*--------------------- Local function prototypes ---------------------------*/ -static void * H5I__unwrap(void *obj_ptr, H5I_type_t type); -static htri_t H5I__clear_type_cb(void *_id, void *key, void *udata); -static int H5I__destroy_type(H5I_type_t type); -static void * H5I__remove_verify(hid_t id, H5I_type_t id_type); -static void * H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id); -static int H5I__inc_type_ref(H5I_type_t type); -static int H5I__get_type_ref(H5I_type_t type); -static int H5I__search_cb(void *obj, hid_t id, void *_udata); -static H5I_id_info_t *H5I__find_id(hid_t id); -static int H5I__iterate_pub_cb(void *obj, hid_t id, void *udata); -static int H5I__find_id_cb(void *_item, void *_key, void *_udata); -static int H5I__id_dump_cb(void *_item, void *_key, void *_udata); +static int H5I__search_cb(void *obj, hid_t id, void *_udata); +static int H5I__iterate_pub_cb(void *obj, hid_t id, void *udata); -/*------------------------------------------------------------------------- - * Function: H5I_term_package - * - * Purpose: Terminate the H5I interface: release all memory, reset all - * global variables to initial values. This only happens if all - * types have been destroyed from other interfaces. - * - * Return: Success: Positive if any action was taken that might - * affect some other interface; zero otherwise. - * - * Failure: Negative - * - *------------------------------------------------------------------------- - */ -int -H5I_term_package(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - if (H5_PKG_INIT_VAR) { - H5I_id_type_t *type_ptr; /* Pointer to ID type */ - int type; /* Type of ID */ - - /* How many types are still being used? */ - for (type = 0; type < H5I_next_type; type++) - if ((type_ptr = H5I_id_type_list_g[type]) && type_ptr->ids) - n++; - - /* If no types are used then clean up */ - if (0 == n) { - for (type = 0; type < H5I_next_type; type++) { - type_ptr = H5I_id_type_list_g[type]; - if (type_ptr) { - HDassert(NULL == type_ptr->ids); - type_ptr = H5FL_FREE(H5I_id_type_t, type_ptr); - H5I_id_type_list_g[type] = NULL; - n++; - } /* end if */ - } /* end for */ - - /* Mark interface closed */ - if (0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end if */ - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5I_term_package() */ +/*********************/ +/* Package Variables */ +/*********************/ + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + +/*******************/ +/* Local Variables */ +/*******************/ /*------------------------------------------------------------------------- * Function: H5Iregister_type @@ -213,45 +93,45 @@ H5I_term_package(void) H5I_type_t H5Iregister_type(size_t H5_ATTR_DEBUG_API_USED hash_size, unsigned reserved, H5I_free_t free_func) { - H5I_class_t *cls = NULL; /* New ID class */ - H5I_type_t new_type; /* New ID type value */ + H5I_class_t *cls = NULL; /* New ID class */ + H5I_type_t new_type = H5I_BADID; /* New ID type value */ H5I_type_t ret_value = H5I_BADID; /* Return value */ FUNC_ENTER_API(H5I_BADID) - H5TRACE3("It", "zIux", hash_size, reserved, free_func); + H5TRACE3("It", "zIuIf", hash_size, reserved, free_func); /* Generate a new H5I_type_t value */ /* Increment the number of types */ - if (H5I_next_type < H5I_MAX_NUM_TYPES) { - new_type = (H5I_type_t)H5I_next_type; - H5I_next_type++; - } /* end if */ + if (H5I_next_type_g < H5I_MAX_NUM_TYPES) { + new_type = (H5I_type_t)H5I_next_type_g; + H5I_next_type_g++; + } else { hbool_t done; /* Indicate that search was successful */ - int i; /* Local index variable */ + int i; /* Look for a free type to give out */ done = FALSE; for (i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES && done == FALSE; i++) { - if (NULL == H5I_id_type_list_g[i]) { + if (NULL == H5I_type_info_array_g[i]) { /* Found a free type ID */ new_type = (H5I_type_t)i; done = TRUE; - } /* end if */ - } /* end for */ + } + } /* Verify that we found a type to give out */ if (done == FALSE) HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, H5I_BADID, "Maximum number of ID types exceeded") - } /* end else */ + } /* Allocate new ID class */ - if (NULL == (cls = H5FL_CALLOC(H5I_class_t))) + if (NULL == (cls = H5MM_calloc(sizeof(H5I_class_t)))) HGOTO_ERROR(H5E_ATOM, H5E_CANTALLOC, H5I_BADID, "ID class allocation failed") /* Initialize class fields */ - cls->type_id = new_type; + cls->type = new_type; cls->flags = H5I_CLASS_IS_APPLICATION; cls->reserved = reserved; cls->free_func = free_func; @@ -267,72 +147,12 @@ done: /* Clean up on error */ if (ret_value < 0) if (cls) - cls = H5FL_FREE(H5I_class_t, cls); + cls = H5MM_xfree(cls); FUNC_LEAVE_API(ret_value) } /* end H5Iregister_type() */ /*------------------------------------------------------------------------- - * Function: H5I_register_type - * - * Purpose: Creates a new type of ID's to give out. - * The class is initialized or its reference count is incremented - * (if it is already initialized). - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5I_register_type(const H5I_class_t *cls) -{ - H5I_id_type_t *type_ptr = NULL; /* Ptr to the atomic type*/ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Sanity check */ - HDassert(cls); - HDassert(cls->type_id > 0 && (int)cls->type_id < H5I_MAX_NUM_TYPES); - - /* Initialize the type */ - if (NULL == H5I_id_type_list_g[cls->type_id]) { - /* Allocate the type information for new type */ - if (NULL == (type_ptr = (H5I_id_type_t *)H5FL_CALLOC(H5I_id_type_t))) - HGOTO_ERROR(H5E_ATOM, H5E_CANTALLOC, FAIL, "ID type allocation failed") - H5I_id_type_list_g[cls->type_id] = type_ptr; - } /* end if */ - else { - /* Get the pointer to the existing type */ - type_ptr = H5I_id_type_list_g[cls->type_id]; - } /* end else */ - - /* Initialize the ID type structure for new types */ - if (type_ptr->init_count == 0) { - type_ptr->cls = cls; - type_ptr->id_count = 0; - type_ptr->nextid = cls->reserved; - type_ptr->last_info = NULL; - if (NULL == (type_ptr->ids = H5SL_create(H5SL_TYPE_HID, NULL))) - HGOTO_ERROR(H5E_ATOM, H5E_CANTCREATE, FAIL, "skip list creation failed") - } /* end if */ - - /* Increment the count of the times this type has been initialized */ - type_ptr->init_count++; - -done: - if (ret_value < 0) { /* Clean up on error */ - if (type_ptr) { - if (type_ptr->ids) - H5SL_close(type_ptr->ids); - (void)H5FL_FREE(H5I_id_type_t, type_ptr); - } /* end if */ - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_register_type() */ - -/*------------------------------------------------------------------------- * Function: H5Itype_exists * * Purpose: Query function to inform the user if a given type is @@ -353,10 +173,10 @@ H5Itype_exists(H5I_type_t type) /* Validate parameter */ if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") - if (type <= H5I_BADID || (int)type >= H5I_next_type) + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - if (NULL == H5I_id_type_list_g[type]) + if (NULL == H5I_type_info_array_g[type]) ret_value = FALSE; done: @@ -373,8 +193,8 @@ done: * * Return: SUCCEED/FAIL * - * Programmer: James Laird - * Nathaniel Furrer + * Programmer: James Laird + * Nathaniel Furrer * Friday, April 23, 2004 * *------------------------------------------------------------------------- @@ -382,7 +202,7 @@ done: herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members) { - int ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "It*h", type, num_members); @@ -394,9 +214,9 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) * the private interface handle it, because the public interface throws * an error when the supplied type does not exist. */ - if (type <= H5I_BADID || (int)type >= H5I_next_type) + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - if (NULL == H5I_id_type_list_g[type]) + if (NULL == H5I_type_info_array_g[type]) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "supplied type does not exist") if (num_members) { @@ -406,92 +226,13 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) HGOTO_ERROR(H5E_ATOM, H5E_CANTCOUNT, FAIL, "can't compute number of members") H5_CHECKED_ASSIGN(*num_members, hsize_t, members, int64_t); - } /* end if */ + } done: FUNC_LEAVE_API(ret_value) } /* end H5Inmembers() */ /*------------------------------------------------------------------------- - * Function: H5I_nmembers - * - * Purpose: Returns the number of members in a type. - * - * Return: Success: Number of members; zero if the type is empty - * or has been deleted. - * - * Failure: Negative - * - * Programmer: Robb Matzke - * Wednesday, March 24, 1999 - * - *------------------------------------------------------------------------- - */ -int64_t -H5I_nmembers(H5I_type_t type) -{ - H5I_id_type_t *type_ptr; /* Pointer to the ID type */ - int64_t ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Validate parameter */ - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - if (NULL == (type_ptr = H5I_id_type_list_g[type]) || type_ptr->init_count <= 0) - HGOTO_DONE(0); - - /* Set return value */ - H5_CHECKED_ASSIGN(ret_value, int64_t, type_ptr->id_count, uint64_t); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_nmembers() */ - -/*------------------------------------------------------------------------- - * Function: H5I__unwrap - * - * Purpose: Unwraps the object pointer for the 'item' that corresponds - * to an ID. - * - * Return: Pointer to the unwrapped pointer (can't fail) - * - * Programmer: Quincey Koziol - * Friday, October 19, 2018 - * - *------------------------------------------------------------------------- - */ -static void * -H5I__unwrap(void *obj_ptr, H5I_type_t type) -{ - void *ret_value = NULL; /* Return value */ - - FUNC_ENTER_STATIC_NOERR - - /* Sanity checks */ - HDassert(obj_ptr); - - /* 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.). - */ - if (H5I_FILE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) { - const H5VL_object_t *vol_obj; - - vol_obj = (const H5VL_object_t *)obj_ptr; - ret_value = H5VL_object_data(vol_obj); - } /* end if */ - else if (H5I_DATATYPE == type) { - H5T_t *dt = (H5T_t *)obj_ptr; - - ret_value = (void *)H5T_get_actual_type(dt); - } /* end if */ - else - ret_value = obj_ptr; - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__unwrap() */ - -/*------------------------------------------------------------------------- * Function: H5Iclear_type * * Purpose: Removes all objects from the type, calling the free @@ -500,8 +241,8 @@ H5I__unwrap(void *obj_ptr, H5I_type_t type) * * Return: SUCCEED/FAIL * - * Programmer: James Laird - * Nathaniel Furrer + * Programmer: James Laird + * Nathaniel Furrer * Friday, April 23, 2004 * *------------------------------------------------------------------------- @@ -524,116 +265,9 @@ done: } /* end H5Iclear_type() */ /*------------------------------------------------------------------------- - * Function: H5I_clear_type - * - * Purpose: Removes all objects from the type, calling the free - * function for each object regardless of the reference count. - * - * Return: SUCCEED/FAIL - * - * Programmer: Robb Matzke - * Wednesday, March 24, 1999 - * - *------------------------------------------------------------------------- - */ -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 */ - int ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Validate parameters */ - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - - udata.type_ptr = H5I_id_type_list_g[type]; - if (udata.type_ptr == NULL || udata.type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - - /* Finish constructing udata */ - udata.force = force; - udata.app_ref = app_ref; - - /* Attempt to free all ids in the type */ - if (H5SL_try_free_safe(udata.type_ptr->ids, H5I__clear_type_cb, &udata) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, FAIL, "can't free ids in type") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_clear_type() */ - -/*------------------------------------------------------------------------- - * Function: H5I__clear_type_cb - * - * Purpose: Attempts to free the specified ID, calling the free - * function for the object. - * - * Return: TRUE/FALSE/FAIL - * - * Programmer: Neil Fortner - * Friday, July 10, 2015 - * - *------------------------------------------------------------------------- - */ -static htri_t -H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata) -{ - H5I_id_info_t * id = (H5I_id_info_t *)_id; /* Current ID being worked with */ - H5I_clear_type_ud_t *udata = (H5I_clear_type_ud_t *)_udata; /* udata struct */ - htri_t ret_value = FALSE; /* Return value */ - - FUNC_ENTER_STATIC_NOERR - - /* Sanity checks */ - HDassert(id); - HDassert(udata); - HDassert(udata->type_ptr); - - /* Do nothing to the object if the reference count is larger than - * one and forcing is off. - */ - if (udata->force || (id->count - (!udata->app_ref * id->app_count)) <= 1) { - /* Check for a 'free' function and call it, if it exists */ - if (udata->type_ptr->cls->free_func && - (udata->type_ptr->cls->free_func)((void *)id->obj_ptr) < 0) { /* (Casting away const OK -QAK) */ - if (udata->force) { -#ifdef H5I_DEBUG - if (H5DEBUG(I)) { - HDfprintf(H5DEBUG(I), - "H5I: free type=%d obj=0x%08lx " - "failure ignored\n", - (int)udata->type_ptr->cls->type_id, (unsigned long)(id->obj_ptr)); - } /* end if */ -#endif /*H5I_DEBUG*/ - - /* Indicate node should be removed from list */ - ret_value = TRUE; - } /* end if */ - } /* end if */ - else { - /* Indicate node should be removed from list */ - ret_value = TRUE; - } /* end else */ - - /* Remove ID if requested */ - if (ret_value) { - /* Free ID info */ - id = H5FL_FREE(H5I_id_info_t, id); - - /* Decrement the number of IDs in the type */ - udata->type_ptr->id_count--; - } /* end if */ - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__clear_type_cb() */ - -/*------------------------------------------------------------------------- * Function: H5Idestroy_type * - * Purpose: Destroys a type along with all atoms in that type + * Purpose: Destroys a type along with all IDs in that type * regardless of their reference counts. Destroying IDs * involves calling the free-func for each ID's object and * then adding the ID struct to the ID free list. Public @@ -641,8 +275,8 @@ H5I__clear_type_cb(void *_id, void H5_ATTR_UNUSED *key, void *_udata) * * Return: SUCCEED/FAIL * - * Programmer: Nathaniel Furrer - * James Laird + * Programmer: Nathaniel Furrer + * James Laird * *------------------------------------------------------------------------- */ @@ -664,56 +298,6 @@ done: } /* end H5Idestroy_type() */ /*------------------------------------------------------------------------- - * Function: H5I__destroy_type - * - * Purpose: Destroys a type along with all atoms in that type - * regardless of their reference counts. Destroying IDs - * involves calling the free-func for each ID's object and - * then adding the ID struct to the ID free list. - * - * Return: SUCCEED/FAIL - * - * Programmer: Nathaniel Furrer - * James Laird - * - *------------------------------------------------------------------------- - */ -static herr_t -H5I__destroy_type(H5I_type_t type) -{ - H5I_id_type_t *type_ptr; /* ptr to the atomic type */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Validate parameter */ - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - - type_ptr = H5I_id_type_list_g[type]; - if (type_ptr == NULL || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - - /* Close/clear/destroy all IDs for this type */ - 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_ptr->cls->flags & H5I_CLASS_IS_APPLICATION) - type_ptr->cls = H5FL_FREE(H5I_class_t, (void *)type_ptr->cls); - - if (H5SL_close(type_ptr->ids) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list") - type_ptr->ids = NULL; - - type_ptr = H5FL_FREE(H5I_id_type_t, type_ptr); - H5I_id_type_list_g[type] = NULL; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__destroy_type() */ - -/*------------------------------------------------------------------------- * Function: H5Iregister * * Purpose: Public interface to H5I_register. @@ -732,7 +316,7 @@ H5Iregister(H5I_type_t type, const void *object) H5TRACE2("i", "It*x", type, object); if (H5I_IS_LIB_TYPE(type)) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, H5I_INVALID_HID, "cannot call public function on library type") ret_value = H5I_register(type, object, TRUE); @@ -741,202 +325,6 @@ done: } /* end H5Iregister() */ /*------------------------------------------------------------------------- - * Function: H5I_register - * - * Purpose: Registers an OBJECT in a TYPE and returns an ID for it. - * This routine does _not_ check for unique-ness of the objects, - * if you register an object twice, you will get two different - * IDs for it. This routine does make certain that each ID in a - * type is unique. IDs are created by getting a unique number - * for the type the ID is in and incorporating the type into - * the ID which is returned to the user. - * - * Return: Success: New object ID - * Failure: H5I_INVALID_HID - * - *------------------------------------------------------------------------- - */ -hid_t -H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) -{ - H5I_id_type_t *type_ptr = NULL; /* ptr to the type */ - H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID information */ - hid_t new_id = -1; /* new ID */ - hid_t ret_value = H5I_INVALID_HID; /* return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check arguments */ - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid type number") - type_ptr = H5I_id_type_list_g[type]; - if ((NULL == type_ptr) || (type_ptr->init_count <= 0)) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, H5I_INVALID_HID, "invalid type") - if (NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) - HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed") - - /* Create the struct & its ID */ - new_id = H5I_MAKE(type, type_ptr->nextid); - id_ptr->id = new_id; - id_ptr->count = 1; /* initial reference count */ - id_ptr->app_count = !!app_ref; - id_ptr->obj_ptr = object; - - /* Insert into the type */ - if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert ID node into skip list") - type_ptr->id_count++; - type_ptr->nextid++; - - /* Sanity check for the 'nextid' getting too large and wrapping around */ - HDassert(type_ptr->nextid <= ID_MASK); - - /* Set the most recent ID to this object */ - type_ptr->last_info = id_ptr; - - /* Set return value */ - ret_value = new_id; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_register() */ - -/*------------------------------------------------------------------------- - * Function: H5I_register_using_existing_id - * - * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it. - * This routine will check to ensure the supplied ID is not already - * in use, and ensure that it is a valid ID for the given type, - * but will NOT check to ensure the OBJECT is not already - * registered (thus, it is possible to register one object under - * multiple IDs). - * - * NOTE: Intended for use in refresh calls, where we have to close - * and re-open the underlying data, then hook the object back - * up to the original ID. - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, hid_t existing_id) -{ - H5I_id_type_t *type_ptr; /* ptr to the type */ - H5I_id_info_t *id_ptr; /* ptr to the new ID information */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check arguments */ - HDassert(object); - - /* Make sure ID is not already in use */ - if (NULL != (id_ptr = H5I__find_id(existing_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADRANGE, FAIL, "ID already in use") - - /* Make sure type number is valid */ - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - - /* Get type pointer from list of types */ - type_ptr = H5I_id_type_list_g[type]; - - if (NULL == type_ptr || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - - /* Make sure requested ID belongs to object's type */ - if (H5I_TYPE(existing_id) != type) - HGOTO_ERROR(H5E_ATOM, H5E_BADRANGE, FAIL, "invalid type for provided ID") - - /* Allocate new structure to house this ID */ - if (NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) - HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Create the struct & insert requested ID */ - id_ptr->id = existing_id; - id_ptr->count = 1; /* initial reference count*/ - id_ptr->app_count = !!app_ref; - id_ptr->obj_ptr = object; - - /* Insert into the type */ - if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") - type_ptr->id_count++; - - /* Set the most recent ID to this object */ - type_ptr->last_info = id_ptr; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_register_using_existing_id() */ - -/*------------------------------------------------------------------------- - * Function: H5I_subst - * - * Purpose: Substitute a new object pointer for the specified ID. - * - * Return: Success: Non-NULL previous object pointer associated - * with the specified ID. - * Failure: NULL - * - * Programmer: Quincey Koziol - * Saturday, February 27, 2010 - * - *------------------------------------------------------------------------- - */ -void * -H5I_subst(hid_t id, const void *new_object) -{ - H5I_id_info_t *id_ptr; /* Pointer to the atom */ - void * ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI(NULL) - - /* General lookup of the ID */ - if (NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_NOTFOUND, NULL, "can't get ID ref count") - - /* Get the old object pointer to return */ - ret_value = (void *)id_ptr->obj_ptr; /* (Casting away const OK -QAK) */ - - /* Set the new object pointer for the ID */ - id_ptr->obj_ptr = new_object; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_subst() */ - -/*------------------------------------------------------------------------- - * Function: H5I_object - * - * Purpose: Find an object pointer for the specified ID. - * - * Return: Success: Non-NULL object pointer associated with the - * specified ID - * - * Failure: NULL - * - *------------------------------------------------------------------------- - */ -void * -H5I_object(hid_t id) -{ - H5I_id_info_t *id_ptr; /* Pointer to the new atom */ - void * ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI_NOERR - - /* General lookup of the ID */ - if (NULL != (id_ptr = H5I__find_id(id))) { - /* Get the object pointer to return */ - ret_value = (void *)id_ptr->obj_ptr; /* (Casting away const OK -QAK) */ - } - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_object() */ - -/*------------------------------------------------------------------------- * Function: H5Iobject_verify * * Purpose: Find an object pointer for the specified ID, verifying that @@ -950,93 +338,26 @@ H5I_object(hid_t id) *------------------------------------------------------------------------- */ void * -H5Iobject_verify(hid_t id, H5I_type_t id_type) +H5Iobject_verify(hid_t id, H5I_type_t type) { void *ret_value = NULL; /* Return value */ FUNC_ENTER_API(NULL) - H5TRACE2("*x", "iIt", id, id_type); + H5TRACE2("*x", "iIt", id, type); /* Validate parameters */ - if (H5I_IS_LIB_TYPE(id_type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") - if (id_type < 1 || (int)id_type >= H5I_next_type) + if (type < 1 || (int)type >= H5I_next_type_g) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "identifier has invalid type") - ret_value = H5I_object_verify(id, id_type); + ret_value = H5I_object_verify(id, type); done: FUNC_LEAVE_API(ret_value) } /* end H5Iobject_verify() */ /*------------------------------------------------------------------------- - * Function: H5I_object_verify - * - * Purpose: Find an object pointer for the specified ID, verifying that - * its in a particular type. - * - * Return: Success: Non-NULL object pointer associated with the - * specified ID. - * Failure: NULL - * - * Programmer: Quincey Koziol - * Wednesday, July 31, 2002 - * - *------------------------------------------------------------------------- - */ -void * -H5I_object_verify(hid_t id, H5I_type_t id_type) -{ - H5I_id_info_t *id_ptr = NULL; /* Pointer to the new atom */ - void * ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI_NOERR - - HDassert(id_type >= 1 && (int)id_type < H5I_next_type); - - /* Verify that the type of the ID is correct & lookup the ID */ - if (id_type == H5I_TYPE(id) && NULL != (id_ptr = H5I__find_id(id))) { - /* Get the object pointer to return */ - ret_value = (void *)id_ptr->obj_ptr; /* (Casting away const OK -QAK) */ - } - - FUNC_LEAVE_NOAPI(ret_value) -} /* H5I_object_verify() */ - -/*------------------------------------------------------------------------- - * Function: H5I_get_type - * - * Purpose: Given an object ID return the type to which it - * belongs. The ID need not be the ID of an object which - * currently exists because the type number is encoded - * in the object ID. - * - * Return: Success: A positive integer (corresponding to an H5I_type_t - * enum value for library ID types, but not for user - * ID types). - * Failure: H5I_BADID - * - * Programmer: Robb Matzke - * Friday, February 19, 1999 - * - *------------------------------------------------------------------------- - */ -H5I_type_t -H5I_get_type(hid_t id) -{ - H5I_type_t ret_value = H5I_BADID; /* Return value */ - - FUNC_ENTER_NOAPI_NOERR - - if (id > 0) - ret_value = H5I_TYPE(id); - - HDassert(ret_value >= H5I_BADID && (int)ret_value < H5I_next_type); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_get_type() */ - -/*------------------------------------------------------------------------- * Function: H5Iget_type * * Purpose: The public version of H5I_get_type(), obtains a type number @@ -1061,7 +382,7 @@ H5Iget_type(hid_t id) ret_value = H5I_get_type(id); - if (ret_value <= H5I_BADID || (int)ret_value >= H5I_next_type || NULL == H5I_object(id)) + if (ret_value <= H5I_BADID || (int)ret_value >= H5I_next_type_g || NULL == H5I_object(id)) HGOTO_DONE(H5I_BADID); done: @@ -1069,54 +390,6 @@ done: } /* end H5Iget_type() */ /*------------------------------------------------------------------------- - * Function: H5I_is_file_object - * - * Purpose: Convenience function to determine if an ID represents - * a file object. - * - * In H5O calls, you can't use object_verify to ensure - * the ID was of the correct class since there's no - * H5I_OBJECT ID class. - * - * Return: Success: TRUE/FALSE - * Failure: FAIL - * - *------------------------------------------------------------------------- - */ -htri_t -H5I_is_file_object(hid_t id) -{ - H5I_type_t id_type = H5I_get_type(id); - htri_t ret_value = FAIL; - - FUNC_ENTER_NOAPI(FAIL); - - /* Fail if the ID type is out of range */ - if (id_type < 1 || id_type >= H5I_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID type out of range"); - - /* Return TRUE if the ID is a file object (dataset, group, map, or committed - * datatype), FALSE otherwise. - */ - if (H5I_DATASET == id_type || H5I_GROUP == id_type || H5I_MAP == id_type) - ret_value = TRUE; - else if (H5I_DATATYPE == id_type) { - - H5T_t *dt = NULL; - - if (NULL == (dt = (H5T_t *)H5I_object(id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to get underlying datatype struct"); - - ret_value = H5T_is_named(dt); - } - else - ret_value = FALSE; - -done: - FUNC_LEAVE_NOAPI(ret_value); -} /* H5I_is_file_object() */ - -/*------------------------------------------------------------------------- * Function: H5Iremove_verify * * Purpose: Removes the specified ID from its type, first checking that the @@ -1128,145 +401,30 @@ done: * calling H5I_object(). * Failure: NULL * - * Programmer: James Laird - * Nathaniel Furrer + * Programmer: James Laird + * Nathaniel Furrer * *------------------------------------------------------------------------- */ void * -H5Iremove_verify(hid_t id, H5I_type_t id_type) +H5Iremove_verify(hid_t id, H5I_type_t type) { void *ret_value = NULL; /* Return value */ FUNC_ENTER_API(NULL) - H5TRACE2("*x", "iIt", id, id_type); + H5TRACE2("*x", "iIt", id, type); - if (H5I_IS_LIB_TYPE(id_type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") /* Remove the id */ - ret_value = H5I__remove_verify(id, id_type); + ret_value = H5I__remove_verify(id, type); done: FUNC_LEAVE_API(ret_value) } /* end H5Iremove_verify() */ /*------------------------------------------------------------------------- - * Function: H5I__remove_verify - * - * Purpose: Removes the specified ID from its type, first checking that - * the ID's type is the same as the ID type supplied as an argument - * - * Return: Success: A pointer to the object that was removed, the - * same pointer which would have been found by - * calling H5I_object(). - * Failure: NULL - * - * Programmer: James Laird - * Nat Furrer - * - *------------------------------------------------------------------------- - */ -static void * -H5I__remove_verify(hid_t id, H5I_type_t id_type) -{ - void *ret_value = NULL; /*return value */ - - FUNC_ENTER_STATIC_NOERR - - /* Argument checking will be performed by H5I_remove() */ - - /* Verify that the type of the ID is correct */ - if (id_type == H5I_TYPE(id)) - ret_value = H5I_remove(id); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__remove_verify() */ - -/*------------------------------------------------------------------------- - * Function: H5I__remove_common - * - * Purpose: Common code to remove a specified ID from its type. - * - * Return: Success: A pointer to the object that was removed, the - * same pointer which would have been found by - * calling H5I_object(). - * Failure: NULL - * - * Programmer: Quincey Koziol - * October 3, 2013 - * - *------------------------------------------------------------------------- - */ -static void * -H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id) -{ - H5I_id_info_t *curr_id; /* Pointer to the current atom */ - void * ret_value = NULL; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity check */ - HDassert(type_ptr); - - /* Get the ID node for the ID */ - if (NULL == (curr_id = (H5I_id_info_t *)H5SL_remove(type_ptr->ids, &id))) - HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node from skip list") - - /* Check if this ID was the last one accessed */ - if (type_ptr->last_info == curr_id) - type_ptr->last_info = NULL; - - ret_value = (void *)curr_id->obj_ptr; /* (Casting away const OK -QAK) */ - curr_id = H5FL_FREE(H5I_id_info_t, curr_id); - - /* Decrement the number of IDs in the type */ - (type_ptr->id_count)--; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__remove_common() */ - -/*------------------------------------------------------------------------- - * Function: H5I_remove - * - * Purpose: Removes the specified ID from its type. - * - * Return: Success: A pointer to the object that was removed, the - * same pointer which would have been found by - * calling H5I_object(). - * Failure: NULL - * - * Programmer: Unknown - * - *------------------------------------------------------------------------- - */ -void * -H5I_remove(hid_t id) -{ - H5I_id_type_t *type_ptr; /* Pointer to the atomic type */ - H5I_type_t type; /* Atom's atomic type */ - void * ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI(NULL) - - /* Check arguments */ - type = H5I_TYPE(id); - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") - type_ptr = H5I_id_type_list_g[type]; - if (type_ptr == NULL || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid type") - - /* Remove the node from the type */ - if (NULL == (ret_value = H5I__remove_common(type_ptr, id))) - HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_remove() */ - -/*------------------------------------------------------------------------- * Function: H5Idec_ref * * Purpose: Decrements the number of references outstanding for an ID. @@ -1302,163 +460,6 @@ done: } /* end H5Idec_ref() */ /*------------------------------------------------------------------------- - * Function: H5I_dec_ref - * - * Purpose: Decrements the number of references outstanding for an ID. - * This will fail if the type is not a reference counted type. - * The ID type's 'free' function will be called for the ID - * if the reference count for the ID reaches 0 and a free - * function has been defined at type creation time. - * - * Return: Success: New reference count - * - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -int -H5I_dec_ref(hid_t id) -{ - H5I_id_info_t *id_ptr; /* Pointer to the new ID */ - int ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI((-1)) - - /* Sanity check */ - HDassert(id >= 0); - - /* General lookup of the ID */ - if (NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID") - - /* If this is the last reference to the object then invoke the type's - * free method on the object. If the free method is undefined or - * successful then remove the object from the type; otherwise leave - * the object in the type without decrementing the reference - * count. If the reference count is more than one then decrement the - * reference count without calling the free method. - * - * Beware: the free method may call other H5I functions. - * - * If an object is closing, we can remove the ID even though the free - * method might fail. This can happen when a mandatory filter fails to - * write when a dataset is closed and the chunk cache is flushed to the - * file. We have to close the dataset anyway. (SLU - 2010/9/7) - */ - if (1 == id_ptr->count) { - H5I_id_type_t *type_ptr; /*ptr to the type */ - - /* Get the ID's type */ - type_ptr = H5I_id_type_list_g[H5I_TYPE(id)]; - - /* (Casting away const OK -QAK) */ - if (!type_ptr->cls->free_func || (type_ptr->cls->free_func)((void *)id_ptr->obj_ptr) >= 0) { - /* Remove the node from the type */ - if (NULL == H5I__remove_common(type_ptr, id)) - HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, (-1), "can't remove ID node") - ret_value = 0; - } /* end if */ - else - ret_value = -1; - } /* end if */ - else { - --(id_ptr->count); - ret_value = (int)id_ptr->count; - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_dec_ref() */ - -/*------------------------------------------------------------------------- - * Function: H5I_dec_app_ref - * - * Purpose: H5I_dec_ref wrapper for case of modifying the application ref. - * count for an ID as well as normal reference count. - * - * Return: Success: New app. reference count - * Failure: -1 - * - * Programmer: Quincey Koziol - * Sept 16, 2010 - * - *------------------------------------------------------------------------- - */ -int -H5I_dec_app_ref(hid_t id) -{ - H5I_id_info_t *id_ptr; /* Pointer to the new ID */ - int ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI((-1)) - - /* Sanity check */ - HDassert(id >= 0); - - /* Call regular decrement reference count routine */ - if ((ret_value = H5I_dec_ref(id)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count") - - /* Check if the ID still exists */ - if (ret_value > 0) { - /* General lookup of the ID */ - if (NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID") - - /* Adjust app_ref */ - --(id_ptr->app_count); - HDassert(id_ptr->count >= id_ptr->app_count); - - /* Set return value */ - ret_value = (int)id_ptr->app_count; - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_dec_app_ref() */ - -/*------------------------------------------------------------------------- - * Function: H5I_dec_app_ref_always_close - * - * Purpose: H5I_dec_app_ref wrapper for case of always closing the ID, - * even when the free routine fails - * - * Return: Success: New app. reference count - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -int -H5I_dec_app_ref_always_close(hid_t id) -{ - int ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI((-1)) - - /* Sanity check */ - HDassert(id >= 0); - - /* Call application decrement reference count routine */ - ret_value = H5I_dec_app_ref(id); - - /* Check for failure */ - if (ret_value < 0) { - /* - * If an object is closing, we can remove the ID even though the free - * method might fail. This can happen when a mandatory filter fails to - * write when a dataset is closed and the chunk cache is flushed to the - * file. We have to close the dataset anyway. (SLU - 2010/9/7) - */ - H5I_remove(id); - - HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count") - } - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_dec_app_ref_always_close() */ - -/*------------------------------------------------------------------------- * Function: H5Iinc_ref * * Purpose: Increments the number of references outstanding for an ID. @@ -1471,7 +472,7 @@ done: int H5Iinc_ref(hid_t id) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) H5TRACE1("Is", "i", id); @@ -1489,43 +490,6 @@ done: } /* end H5Iinc_ref() */ /*------------------------------------------------------------------------- - * Function: H5I_inc_ref - * - * Purpose: Increment the reference count for an object. - * - * Return: Success: The new reference count - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -int -H5I_inc_ref(hid_t id, hbool_t app_ref) -{ - H5I_id_info_t *id_ptr; /* Pointer to the ID */ - int ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI((-1)) - - /* Sanity check */ - HDassert(id >= 0); - - /* General lookup of the ID */ - if (NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID") - - /* Adjust reference counts */ - ++(id_ptr->count); - if (app_ref) - ++(id_ptr->app_count); - - /* Set return value */ - ret_value = (int)(app_ref ? id_ptr->app_count : id_ptr->count); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_inc_ref() */ - -/*------------------------------------------------------------------------- * Function: H5Iget_ref * * Purpose: Retrieves the number of references outstanding for an ID. @@ -1538,7 +502,7 @@ done: int H5Iget_ref(hid_t id) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) H5TRACE1("Is", "i", id); @@ -1556,38 +520,6 @@ done: } /* end H5Iget_ref() */ /*------------------------------------------------------------------------- - * Function: H5I_get_ref - * - * Purpose: Retrieve the reference count for an object. - * - * Return: Success: The reference count - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -int -H5I_get_ref(hid_t id, hbool_t app_ref) -{ - H5I_id_info_t *id_ptr; /* Pointer to the ID */ - int ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI((-1)) - - /* Sanity check */ - HDassert(id >= 0); - - /* General lookup of the ID */ - if (NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID") - - /* Set return value */ - ret_value = (int)(app_ref ? id_ptr->app_count : id_ptr->count); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_get_ref() */ - -/*------------------------------------------------------------------------- * Function: H5Iinc_type_ref * * Purpose: Increments the number of references outstanding for an ID type. @@ -1600,13 +532,13 @@ done: int H5Iinc_type_ref(H5I_type_t type) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) H5TRACE1("Is", "It", type); /* Check arguments */ - if (type <= 0 || (int)type >= H5I_next_type) + if (type <= 0 || (int)type >= H5I_next_type_g) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID type") if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type") @@ -1620,44 +552,11 @@ done: } /* end H5Iinc_ref() */ /*------------------------------------------------------------------------- - * Function: H5I__inc_type_ref - * - * Purpose: Increment the reference count for an ID type. - * - * Return: Success: The new reference count - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -static int -H5I__inc_type_ref(H5I_type_t type) -{ - H5I_id_type_t *type_ptr; /* Pointer to the type */ - int ret_value = -1; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity check */ - HDassert(type > 0 && (int)type < H5I_next_type); - - /* Check arguments */ - type_ptr = H5I_id_type_list_g[type]; - if (NULL == type_ptr) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type") - - /* Set return value */ - ret_value = (int)(++(type_ptr->init_count)); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__inc_type_ref() */ - -/*------------------------------------------------------------------------- * Function: H5Idec_type_ref * * Purpose: Decrements the reference count on an entire type of IDs. * If the type reference count becomes zero then the type is - * destroyed along with all atoms in that type regardless of + * destroyed along with all IDs in that type regardless of * their reference counts. Destroying IDs involves calling * the free-func for each ID's object and then adding the ID * struct to the ID free list. Public interface to @@ -1694,58 +593,6 @@ done: } /* end H5Idec_type_ref() */ /*------------------------------------------------------------------------- - * Function: H5I_dec_type_ref - * - * Purpose: Decrements the reference count on an entire type of IDs. - * If the type reference count becomes zero then the type is - * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling - * the free-func for each ID's object and then adding the ID - * struct to the ID free list. - * Returns the number of references to the type on success; a - * return value of 0 means that the type will have to be - * re-initialized before it can be used again (and should probably - * be set to H5I_UNINIT). - * - * Return: Success: Number of references to type - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -int -H5I_dec_type_ref(H5I_type_t type) -{ - H5I_id_type_t *type_ptr; /* Pointer to the ID type */ - herr_t ret_value = 0; /* Return value */ - - FUNC_ENTER_NOAPI((-1)) - - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, (-1), "invalid type number") - - type_ptr = H5I_id_type_list_g[type]; - if (type_ptr == NULL || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type") - - /* Decrement the number of users of the atomic type. If this is the - * last user of the type then release all atoms from the type and - * free all memory it used. The free function is invoked for each atom - * being freed. - */ - if (1 == type_ptr->init_count) { - H5I__destroy_type(type); - ret_value = 0; - } /* end if */ - else { - --(type_ptr->init_count); - ret_value = (herr_t)type_ptr->init_count; - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_dec_type_ref() */ - -/*------------------------------------------------------------------------- * Function: H5Iget_type_ref * * Purpose: Retrieves the number of references outstanding for a type. @@ -1758,13 +605,13 @@ done: int H5Iget_type_ref(H5I_type_t type) { - int ret_value; /* Return value */ + int ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) H5TRACE1("Is", "It", type); /* Check arguments */ - if (type <= 0 || (int)type >= H5I_next_type) + if (type <= 0 || (int)type >= H5I_next_type_g) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID type") if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type") @@ -1778,40 +625,6 @@ done: } /* end H5Iget_ref() */ /*------------------------------------------------------------------------- - * Function: H5I__get_type_ref - * - * Purpose: Retrieve the reference count for an ID type. - * - * Return: Success: The reference count - * - * Failure: -1 - * - *------------------------------------------------------------------------- - */ -static int -H5I__get_type_ref(H5I_type_t type) -{ - H5I_id_type_t *type_ptr; /* Pointer to the type */ - int ret_value = -1; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity check */ - HDassert(type >= 0); - - /* Check arguments */ - type_ptr = H5I_id_type_list_g[type]; - if (!type_ptr) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - - /* Set return value */ - ret_value = (int)type_ptr->init_count; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__get_type_ref() */ - -/*------------------------------------------------------------------------- * Function: H5Iis_valid * * Purpose: Check if the given id is valid. An id is valid if it is in @@ -1824,16 +637,16 @@ done: htri_t H5Iis_valid(hid_t id) { - H5I_id_info_t *id_ptr; /* ptr to the ID */ + H5I_id_info_t *info = NULL; /* Pointer to the ID info */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", id); /* Find the ID */ - if (NULL == (id_ptr = H5I__find_id(id))) + if (NULL == (info = H5I__find_id(id))) ret_value = FALSE; - else if (!id_ptr->app_count) /* Check if the found id is an internal id */ + else if (!info->app_count) /* Check if the found id is an internal id */ ret_value = FALSE; done: @@ -1897,11 +710,11 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) void * H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) { - H5I_search_ud_t udata; /* Context for iteration */ - void * ret_value; /* Return value */ + H5I_search_ud_t udata; /* Context for iteration */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_API(NULL) - H5TRACE3("*x", "Itx*x", type, func, key); + H5TRACE3("*x", "ItIS*x", type, func, key); /* Check arguments */ if (H5I_IS_LIB_TYPE(type)) @@ -1943,9 +756,9 @@ done: static int H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata) { - H5I_iterate_pub_ud_t *udata = (H5I_iterate_pub_ud_t *)_udata; /* User data for callback */ - herr_t cb_ret_val; /* User callback return value */ - int ret_value = H5_ITER_ERROR; /* Callback return value */ + H5I_iterate_pub_ud_t *udata = (H5I_iterate_pub_ud_t *)_udata; /* User data for callback */ + herr_t cb_ret_val = FAIL; /* User callback return value */ + int ret_value = H5_ITER_ERROR; /* Callback return value */ FUNC_ENTER_STATIC_NOERR @@ -1989,11 +802,11 @@ H5I__iterate_pub_cb(void H5_ATTR_UNUSED *obj, hid_t id, void *_udata) herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data) { - H5I_iterate_pub_ud_t int_udata; /* Internal user data */ - herr_t ret_value; /* Return value */ + H5I_iterate_pub_ud_t int_udata; /* Internal user data */ + herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "Itx*x", type, op, op_data); + H5TRACE3("e", "ItII*x", type, op, op_data); /* Set up udata struct */ int_udata.op = op; @@ -2010,154 +823,48 @@ done: } /* end H5Iiterate() */ /*------------------------------------------------------------------------- - * Function: H5I__iterate_cb - * - * Purpose: Callback routine for H5I_iterate, invokes "user" callback - * function, and then sets return value, based on the result of - * that callback. - * - * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1) - * Failure: H5_ITER_ERROR (-1) - * - *------------------------------------------------------------------------- - */ -static int -H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) -{ - H5I_id_info_t * item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ - H5I_iterate_ud_t *udata = (H5I_iterate_ud_t *)_udata; /* User data for callback */ - int ret_value = H5_ITER_CONT; /* Callback return value */ - - FUNC_ENTER_STATIC_NOERR - - /* Only invoke the callback function if this ID is visible externally and - * its reference count is positive. - */ - if ((!udata->app_ref) || (item->app_count > 0)) { - H5I_type_t type = udata->obj_type; - void * obj_ptr; - herr_t cb_ret_val; - - /* 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.). - */ - obj_ptr = H5I__unwrap((void *)item->obj_ptr, type); - - /* Invoke callback function */ - cb_ret_val = - (*udata->user_func)((void *)obj_ptr, item->id, udata->user_udata); /* (Casting away const OK) */ - - /* Set the return value based on the callback's return value */ - if (cb_ret_val > 0) - ret_value = H5_ITER_STOP; /* terminate iteration early */ - else if (cb_ret_val < 0) - ret_value = H5_ITER_ERROR; /* indicate failure (which terminates iteration) */ - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__iterate_cb() */ - -/*------------------------------------------------------------------------- - * Function: H5I_iterate - * - * Purpose: Apply function FUNC to each member of type TYPE (with - * non-zero application reference count if app_ref is TRUE). - * Stop if FUNC returns a non zero value (i.e. anything - * other than H5_ITER_CONT). - * - * If FUNC returns a positive value (i.e. H5_ITER_STOP), - * return SUCCEED. - * - * If FUNC returns a negative value (i.e. H5_ITER_ERROR), - * return FAIL. + * Function: H5Iget_file_id * - * The FUNC should take a pointer to the object and the - * udata as arguments and return non-zero to terminate - * siteration, and zero to continue. + * Purpose: Obtains the file ID given an object ID. The user has to + * close this ID. * - * Limitation: Currently there is no way to start the iteration from - * where a previous iteration left off. + * Return: Success: The file ID associated with the object * - * Return: SUCCEED/FAIL + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ -herr_t -H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref) +hid_t +H5Iget_file_id(hid_t obj_id) { - H5I_id_type_t *type_ptr; /* Pointer to the type */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check arguments */ - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - type_ptr = H5I_id_type_list_g[type]; - - /* Only iterate through ID list if it is initialized and there are IDs in type */ - if (type_ptr && type_ptr->init_count > 0 && type_ptr->id_count > 0) { - H5I_iterate_ud_t iter_udata; /* User data for iteration callback */ - herr_t iter_status; /* Iteration status */ - - /* Set up iterator user data */ - iter_udata.user_func = func; - iter_udata.user_udata = udata; - iter_udata.app_ref = app_ref; - iter_udata.obj_type = type; - - /* Iterate over IDs */ - if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "iteration failed") - } /* end if */ + H5I_type_t type; /* ID type */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_iterate() */ + FUNC_ENTER_API(H5I_INVALID_HID) + H5TRACE1("i", "i", obj_id); -/*------------------------------------------------------------------------- - * Function: H5I__find_id - * - * Purpose: Given an object ID find the info struct that describes the - * object. - * - * Return: Success: A pointer to the object's info struct. - * - * Failure: NULL - * - *------------------------------------------------------------------------- - */ -static H5I_id_info_t * -H5I__find_id(hid_t id) -{ - H5I_type_t type; /*ID's type */ - H5I_id_type_t *type_ptr; /*ptr to the type */ - H5I_id_info_t *ret_value = NULL; /* Return value */ + /* Get object type */ + type = H5I_TYPE(obj_id); - FUNC_ENTER_STATIC_NOERR + /* Call internal function */ + if (H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type || + H5I_ATTR == type) { + H5VL_object_t *vol_obj; /* Object of obj_id */ - /* Check arguments */ - type = H5I_TYPE(id); - if (type <= H5I_BADID || (int)type >= H5I_next_type) - HGOTO_DONE(NULL) - type_ptr = H5I_id_type_list_g[type]; - if (!type_ptr || type_ptr->init_count <= 0) - HGOTO_DONE(NULL) - - /* Check for same ID as we have looked up last time */ - if (type_ptr->last_info && type_ptr->last_info->id == id) - ret_value = type_ptr->last_info; - else { - /* Locate the ID node for the ID */ - ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id); + /* Get the VOL object */ + if (NULL == (vol_obj = H5VL_vol_object(obj_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier") - /* Remember this ID */ - type_ptr->last_info = ret_value; - } /* end else */ + /* Get the file ID */ + if ((ret_value = H5F_get_file_id(vol_obj, type, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID") + } + else + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "not an ID of a file object") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__find_id() */ + FUNC_LEAVE_API(ret_value) +} /* end H5Iget_file_id() */ /*------------------------------------------------------------------------- * Function: H5Iget_name @@ -2168,10 +875,7 @@ done: * * Failure: -1 * - * NOTE: Not safe for arbitrary VOL connectors as it relies on - * private H5G calls. - * - * Comments: Public function + * Notes: * If 'name' is non-NULL then write up to 'size' bytes into that * buffer and always return the length of the entry name. * Otherwise 'size' is ignored and the function does not store the name, @@ -2186,9 +890,9 @@ done: ssize_t H5Iget_name(hid_t id, char *name /*out*/, size_t size) { - H5VL_object_t * vol_obj; /* Object of loc_id */ + H5VL_object_t * vol_obj = NULL; /* Object stored in ID */ H5VL_loc_params_t loc_params; - ssize_t ret_value; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) H5TRACE3("Zs", "ixz", id, name, size); @@ -2209,255 +913,3 @@ H5Iget_name(hid_t id, char *name /*out*/, size_t size) done: FUNC_LEAVE_API(ret_value) } /* end H5Iget_name() */ - -/*------------------------------------------------------------------------- - * Function: H5Iget_file_id - * - * Purpose: Obtains the file ID given an object ID. The user has to - * close this ID. - * - * Return: Success: The file ID associated with the object - * - * Failure: H5I_INVALID_HID - * - *------------------------------------------------------------------------- - */ -hid_t -H5Iget_file_id(hid_t obj_id) -{ - H5I_type_t type; /* ID type */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE1("i", "i", obj_id); - - /* Get object type */ - type = H5I_TYPE(obj_id); - - /* Call internal function */ - if (H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type || - H5I_ATTR == type) { - H5VL_object_t *vol_obj; /* Object of obj_id */ - - /* Get the VOL object */ - if (NULL == (vol_obj = H5VL_vol_object(obj_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier") - - /* Get the file ID */ - if ((ret_value = H5F_get_file_id(vol_obj, type, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID") - } /* end if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "not an ID of a file object") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Iget_file_id() */ - -/*------------------------------------------------------------------------- - * Function: H5I__find_id_cb - * - * Purpose: Callback for searching for an ID with a specific pointer - * - * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1) - * Failure: H5_ITER_ERROR (-1) - * - *------------------------------------------------------------------------- - */ -static int -H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) -{ - H5I_id_info_t * item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ - H5I_get_id_ud_t *udata = (H5I_get_id_ud_t *)_udata; /* Pointer to user data */ - H5I_type_t type = udata->obj_type; - const void * obj_ptr = NULL; - int ret_value = H5_ITER_CONT; /* Return value */ - - FUNC_ENTER_STATIC_NOERR - - /* Sanity check */ - HDassert(item); - HDassert(udata); - - /* Get a pointer to the VOL connector's data */ - obj_ptr = H5I__unwrap(item->obj_ptr, type); - - /* Check for a match */ - if (obj_ptr == udata->object) { - udata->ret_id = item->id; - ret_value = H5_ITER_STOP; - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__find_id_cb() */ - -/*------------------------------------------------------------------------- - * Function: H5I_find_id - * - * Purpose: Return the ID of an object by searching through the ID list - * for the type. - * - * Return: SUCCEED/FAIL - * (id will be set to H5I_INVALID_HID on errors or not found) - * - *------------------------------------------------------------------------- - */ -herr_t -H5I_find_id(const void *object, H5I_type_t type, hid_t *id) -{ - H5I_id_type_t *type_ptr; /* Pointer to the type */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - HDassert(id); - - *id = H5I_INVALID_HID; - - type_ptr = H5I_id_type_list_g[type]; - if (!type_ptr || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - - /* Only iterate through ID list if it is initialized and there are IDs in type */ - if (type_ptr->init_count > 0 && type_ptr->id_count > 0) { - H5I_get_id_ud_t udata; /* User data */ - herr_t iter_status; /* Iteration status */ - - /* Set up iterator user data */ - udata.object = object; - udata.obj_type = type; - udata.ret_id = H5I_INVALID_HID; - - /* Iterate over IDs for the ID type */ - if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__find_id_cb, &udata)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "iteration failed") - - *id = udata.ret_id; - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_find_id() */ - -/*------------------------------------------------------------------------- - * Function: H5I__id_dump_cb - * - * Purpose: Dump the contents of an ID to stderr for debugging. - * - * Return: H5_ITER_CONT (always) - * - *------------------------------------------------------------------------- - */ -static int -H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) -{ - H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ - H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ - H5G_name_t * path = NULL; /* Path to file object */ - const void * obj_ptr = NULL; /* Pointer to VOL connector object */ - - FUNC_ENTER_STATIC_NOERR - - HDfprintf(stderr, " id = %" PRIdHID "\n", item->id); - HDfprintf(stderr, " count = %u\n", item->count); - HDfprintf(stderr, " obj = 0x%8p\n", item->obj_ptr); - - /* Get the group location, so we get get the name */ - switch (type) { - case H5I_GROUP: { - const H5VL_object_t *vol_obj = (const H5VL_object_t *)item->obj_ptr; - - obj_ptr = H5VL_object_data(vol_obj); - if (H5_VOL_NATIVE == vol_obj->connector->cls->value) - path = H5G_nameof((const H5G_t *)obj_ptr); - break; - } - - case H5I_DATASET: { - const H5VL_object_t *vol_obj = (const H5VL_object_t *)item->obj_ptr; - - obj_ptr = H5VL_object_data(vol_obj); - if (H5_VOL_NATIVE == vol_obj->connector->cls->value) - path = H5D_nameof((const H5D_t *)obj_ptr); - break; - } - - case H5I_DATATYPE: { - const H5T_t *dt = (const H5T_t *)item->obj_ptr; - - obj_ptr = (void *)H5T_get_actual_type((H5T_t *)dt); /* Casting away const OK - QAK */ - path = H5T_nameof((const H5T_t *)obj_ptr); - break; - } - - /* TODO: Maps will have to be added when they are supported in the - * native VOL connector. - */ - case H5I_MAP: - - case H5I_UNINIT: - case H5I_BADID: - case H5I_FILE: - case H5I_DATASPACE: - case H5I_ATTR: - case H5I_VFL: - case H5I_VOL: - case H5I_GENPROP_CLS: - case H5I_GENPROP_LST: - case H5I_ERROR_CLASS: - case H5I_ERROR_MSG: - case H5I_ERROR_STACK: - case H5I_SPACE_SEL_ITER: - case H5I_NTYPES: - default: - break; /* Other types of IDs are not stored in files */ - } - - if (path) { - if (path->user_path_r) - HDfprintf(stderr, " user_path = %s\n", H5RS_get_str(path->user_path_r)); - if (path->full_path_r) - HDfprintf(stderr, " full_path = %s\n", H5RS_get_str(path->full_path_r)); - } - - FUNC_LEAVE_NOAPI(H5_ITER_CONT) -} /* end H5I__id_dump_cb() */ - -/*------------------------------------------------------------------------- - * Function: H5I_dump_ids_for_type - * - * Purpose: Dump the contents of a type to stderr for debugging. - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -herr_t -H5I_dump_ids_for_type(H5I_type_t type) -{ - H5I_id_type_t *type_ptr = NULL; - - FUNC_ENTER_NOAPI_NOERR - - HDfprintf(stderr, "Dumping ID type %d\n", (int)type); - type_ptr = H5I_id_type_list_g[type]; - - if (type_ptr) { - - /* Header */ - HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count); - HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); - HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); - HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); - - /* List */ - if (type_ptr->id_count > 0) { - HDfprintf(stderr, " List:\n"); - H5SL_iterate(type_ptr->ids, H5I__id_dump_cb, &type); - } - } - else - HDfprintf(stderr, "Global type info/tracking pointer for that type is NULL\n"); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5I_dump_ids_for_type() */ diff --git a/src/H5Idbg.c b/src/H5Idbg.c new file mode 100644 index 0000000..80be9d0 --- /dev/null +++ b/src/H5Idbg.c @@ -0,0 +1,191 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * H5Idbg.c - Debugging routines for handling IDs + */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5Imodule.h" /* This source code file is part of the H5I module */ + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#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 */ + +/****************/ +/* Local Macros */ +/****************/ + +/******************/ +/* Local Typedefs */ +/******************/ + +/********************/ +/* Package Typedefs */ +/********************/ + +/********************/ +/* Local Prototypes */ +/********************/ + +static int H5I__id_dump_cb(void *_item, void *_key, void *_udata); + +/*********************/ +/* Package Variables */ +/*********************/ + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + +/*******************/ +/* Local Variables */ +/*******************/ + +/*------------------------------------------------------------------------- + * Function: H5I__id_dump_cb + * + * Purpose: Dump the contents of an ID to stderr for debugging. + * + * Return: H5_ITER_CONT (always) + * + *------------------------------------------------------------------------- + */ +static int +H5I__id_dump_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) +{ + H5I_id_info_t *info = (H5I_id_info_t *)_item; /* Pointer to the ID node */ + H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ + H5G_name_t * path = NULL; /* Path to file object */ + const void * object = NULL; /* Pointer to VOL connector object */ + + FUNC_ENTER_STATIC_NOERR + + HDfprintf(stderr, " id = %" PRIdHID "\n", info->id); + HDfprintf(stderr, " count = %u\n", info->count); + HDfprintf(stderr, " obj = 0x%8p\n", info->object); + + /* Get the group location, so we get get the name */ + switch (type) { + case H5I_GROUP: { + const H5VL_object_t *vol_obj = (const H5VL_object_t *)info->object; + + object = H5VL_object_data(vol_obj); + if (H5_VOL_NATIVE == vol_obj->connector->cls->value) + path = H5G_nameof((const H5G_t *)object); + break; + } + + case H5I_DATASET: { + const H5VL_object_t *vol_obj = (const H5VL_object_t *)info->object; + + object = H5VL_object_data(vol_obj); + if (H5_VOL_NATIVE == vol_obj->connector->cls->value) + path = H5D_nameof((const H5D_t *)object); + break; + } + + case H5I_DATATYPE: { + const H5T_t *dt = (const H5T_t *)info->object; + + H5_GCC_DIAG_OFF("cast-qual") + object = (void *)H5T_get_actual_type((H5T_t *)dt); /* Casting away const OK - QAK */ + H5_GCC_DIAG_ON("cast-qual") + + path = H5T_nameof((const H5T_t *)object); + break; + } + + /* TODO: Maps will have to be added when they are supported in the + * native VOL connector. + */ + case H5I_MAP: + + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_DATASPACE: + case H5I_ATTR: + case H5I_VFL: + case H5I_VOL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_SPACE_SEL_ITER: + case H5I_NTYPES: + default: + break; /* Other types of IDs are not stored in files */ + } + + if (path) { + if (path->user_path_r) + HDfprintf(stderr, " user_path = %s\n", H5RS_get_str(path->user_path_r)); + if (path->full_path_r) + HDfprintf(stderr, " full_path = %s\n", H5RS_get_str(path->full_path_r)); + } + + FUNC_LEAVE_NOAPI(H5_ITER_CONT) +} /* end H5I__id_dump_cb() */ + +/*------------------------------------------------------------------------- + * Function: H5I_dump_ids_for_type + * + * Purpose: Dump the contents of a type to stderr for debugging. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5I_dump_ids_for_type(H5I_type_t type) +{ + H5I_type_info_t *type_info = NULL; + + FUNC_ENTER_NOAPI_NOERR + + HDfprintf(stderr, "Dumping ID type %d\n", (int)type); + type_info = H5I_type_info_array_g[type]; + + if (type_info) { + + /* Header */ + HDfprintf(stderr, " init_count = %u\n", type_info->init_count); + HDfprintf(stderr, " reserved = %u\n", type_info->cls->reserved); + HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_info->id_count); + HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_info->nextid); + + /* List */ + if (type_info->id_count > 0) { + HDfprintf(stderr, " List:\n"); + H5SL_iterate(type_info->ids, H5I__id_dump_cb, &type); + } + } + else + HDfprintf(stderr, "Global type info/tracking pointer for that type is NULL\n"); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5I_dump_ids_for_type() */ diff --git a/src/H5Iint.c b/src/H5Iint.c new file mode 100644 index 0000000..2e1145d --- /dev/null +++ b/src/H5Iint.c @@ -0,0 +1,1472 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * H5Iint.c - Private routines for handling IDs + */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5Imodule.h" /* This source code file is part of the H5I module */ + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#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 */ + +/****************/ +/* Local Macros */ +/****************/ + +/* Combine a Type number and an ID index into an ID */ +#define H5I_MAKE(g, i) ((((hid_t)(g)&TYPE_MASK) << ID_BITS) | ((hid_t)(i)&ID_MASK)) + +/******************/ +/* Local Typedefs */ +/******************/ + +/* User data for iterator callback for retrieving an ID corresponding to an object pointer */ +typedef struct { + const void *object; /* object pointer to search for */ + H5I_type_t obj_type; /* type of object we are searching for */ + hid_t ret_id; /* ID returned */ +} H5I_get_id_ud_t; + +/* User data for iterator callback for ID iteration */ +typedef struct { + H5I_search_func_t user_func; /* 'User' function to invoke */ + void * user_udata; /* User data to pass to 'user' function */ + hbool_t app_ref; /* Whether this is an appl. ref. call */ + H5I_type_t obj_type; /* Type of object we are iterating over */ +} H5I_iterate_ud_t; + +/* User data for H5I__clear_type_cb */ +typedef struct { + H5I_type_info_t *type_info; /* Pointer to the type's info to be cleared */ + hbool_t force; /* Whether to always remove the ID */ + hbool_t app_ref; /* Whether this is an appl. ref. call */ +} H5I_clear_type_ud_t; + +/********************/ +/* Package Typedefs */ +/********************/ + +/********************/ +/* Local Prototypes */ +/********************/ + +static void * H5I__unwrap(void *object, H5I_type_t type); +static htri_t H5I__clear_type_cb(void *_id, void *key, void *udata); +static void * H5I__remove_common(H5I_type_info_t *type_info, hid_t id); +static int H5I__find_id_cb(void *_item, void *_key, void *_udata); + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + +/* Declared extern in H5Ipkg.h and documented there */ +H5I_type_info_t *H5I_type_info_array_g[H5I_MAX_NUM_TYPES]; +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); + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + +/*******************/ +/* Local Variables */ +/*******************/ + +/*------------------------------------------------------------------------- + * Function: H5I_term_package + * + * Purpose: Terminate the H5I interface: release all memory, reset all + * global variables to initial values. This only happens if all + * types have been destroyed from other interfaces. + * + * Return: Success: Positive if any action was taken that might + * affect some other interface; zero otherwise. + * + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +int +H5I_term_package(void) +{ + int in_use = 0; /* Number of ID types still in use */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if (H5_PKG_INIT_VAR) { + H5I_type_info_t *type_info = NULL; /* Pointer to ID type */ + int i; + + /* 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) + in_use++; + + /* If no types are still being used then clean up */ + if (0 == in_use) { + 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); + type_info = H5MM_xfree(type_info); + H5I_type_info_array_g[i] = NULL; + in_use++; + } + } + + /* Mark interface closed */ + if (0 == in_use) + H5_PKG_INIT_VAR = FALSE; + } + } + + FUNC_LEAVE_NOAPI(in_use) +} /* end H5I_term_package() */ + +/*------------------------------------------------------------------------- + * Function: H5I_register_type + * + * Purpose: Creates a new type of ID's to give out. + * The class is initialized or its reference count is incremented + * (if it is already initialized). + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5I_register_type(const H5I_class_t *cls) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the ID type*/ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(cls); + HDassert(cls->type > 0 && (int)cls->type < H5I_MAX_NUM_TYPES); + + /* Initialize the type */ + if (NULL == H5I_type_info_array_g[cls->type]) { + /* Allocate the type information for new type */ + if (NULL == (type_info = (H5I_type_info_t *)H5MM_calloc(sizeof(H5I_type_info_t)))) + HGOTO_ERROR(H5E_ATOM, H5E_CANTALLOC, FAIL, "ID type allocation failed") + H5I_type_info_array_g[cls->type] = type_info; + } + else { + /* Get the pointer to the existing type */ + type_info = H5I_type_info_array_g[cls->type]; + } + + /* Initialize the ID type structure for new types */ + if (type_info->init_count == 0) { + type_info->cls = 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_ATOM, H5E_CANTCREATE, FAIL, "skip list creation failed") + } + + /* Increment the count of the times this type has been initialized */ + type_info->init_count++; + +done: + /* Clean up on error */ + if (ret_value < 0) { + if (type_info) { + if (type_info->ids) + H5SL_close(type_info->ids); + H5MM_free(type_info); + } + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_register_type() */ + +/*------------------------------------------------------------------------- + * Function: H5I_nmembers + * + * Purpose: Returns the number of members in a type. + * + * Return: Success: Number of members; zero if the type is empty + * or has been deleted. + * + * Failure: Negative + * + * Programmer: Robb Matzke + * Wednesday, March 24, 1999 + * + *------------------------------------------------------------------------- + */ +int64_t +H5I_nmembers(H5I_type_t type) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the ID type */ + int64_t ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI((-1)) + + /* Validate parameter */ + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + if (NULL == (type_info = H5I_type_info_array_g[type]) || type_info->init_count <= 0) + HGOTO_DONE(0); + + /* Set return value */ + H5_CHECKED_ASSIGN(ret_value, int64_t, type_info->id_count, uint64_t); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_nmembers() */ + +/*------------------------------------------------------------------------- + * Function: H5I__unwrap + * + * Purpose: Unwraps the object pointer for the 'item' that corresponds + * to an ID. + * + * Return: Pointer to the unwrapped pointer (can't fail) + * + * Programmer: Quincey Koziol + * Friday, October 19, 2018 + * + *------------------------------------------------------------------------- + */ +static void * +H5I__unwrap(void *object, H5I_type_t type) +{ + void *ret_value = NULL; /* Return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(object); + + /* 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.). + */ + if (H5I_FILE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) { + const H5VL_object_t *vol_obj; + + vol_obj = (const H5VL_object_t *)object; + ret_value = H5VL_object_data(vol_obj); + } + else if (H5I_DATATYPE == type) { + H5T_t *dt = (H5T_t *)object; + + ret_value = (void *)H5T_get_actual_type(dt); + } + else + ret_value = object; + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__unwrap() */ + +/*------------------------------------------------------------------------- + * Function: H5I_clear_type + * + * Purpose: Removes all objects from the type, calling the free + * function for each object regardless of the reference count. + * + * Return: SUCCEED/FAIL + * + * Programmer: Robb Matzke + * Wednesday, March 24, 1999 + * + *------------------------------------------------------------------------- + */ +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 */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Validate parameters */ + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + + udata.type_info = H5I_type_info_array_g[type]; + if (udata.type_info == NULL || udata.type_info->init_count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + + /* Finish constructing udata */ + 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_ATOM, H5E_CANTDELETE, FAIL, "can't free ids in type") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_clear_type() */ + +/*------------------------------------------------------------------------- + * Function: H5I__clear_type_cb + * + * Purpose: Attempts to free the specified ID, calling the free + * function for the object. + * + * Return: TRUE/FALSE/FAIL + * + * Programmer: Neil Fortner + * Friday, July 10, 2015 + * + *------------------------------------------------------------------------- + */ +static htri_t +H5I__clear_type_cb(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 */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(info); + HDassert(udata); + HDassert(udata->type_info); + + /* Do nothing to the object if the reference count is larger than + * one and forcing is off. + */ + if (udata->force || (info->count - (!udata->app_ref * info->app_count)) <= 1) { + /* Check for a 'free' function and call it, if it exists */ + H5_GCC_DIAG_OFF("cast-qual") + if (udata->type_info->cls->free_func && + (udata->type_info->cls->free_func)((void *)info->object) < 0) { /* (Casting away const OK -QAK) */ + if (udata->force) { +#ifdef H5I_DEBUG + if (H5DEBUG(I)) { + HDfprintf(H5DEBUG(I), + "H5I: free type=%d obj=0x%08lx " + "failure ignored\n", + (int)udata->type_info->cls->type, (unsigned long)(info->object)); + } +#endif /* H5I_DEBUG */ + + /* Indicate node should be removed from list */ + ret_value = TRUE; + } + } + else { + /* Indicate node should be removed from list */ + ret_value = TRUE; + } + H5_GCC_DIAG_ON("cast-qual") + + /* Remove ID if requested */ + if (ret_value) { + /* Free ID info */ + info = H5FL_FREE(H5I_id_info_t, info); + + /* Decrement the number of IDs in the type */ + udata->type_info->id_count--; + } + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__clear_type_cb() */ + +/*------------------------------------------------------------------------- + * Function: H5I__destroy_type + * + * Purpose: Destroys a type along with all IDs in that type + * regardless of their reference counts. Destroying IDs + * involves calling the free-func for each ID's object and + * then adding the ID struct to the ID free list. + * + * Return: SUCCEED/FAIL + * + * Programmer: Nathaniel Furrer + * James Laird + * + *------------------------------------------------------------------------- + */ +herr_t +H5I__destroy_type(H5I_type_t type) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the ID type */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Validate parameter */ + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + + type_info = H5I_type_info_array_g[type]; + if (type_info == NULL || type_info->init_count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + + /* Close/clear/destroy all IDs for this type */ + 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_ATOM, H5E_CANTCLOSEOBJ, FAIL, "can't close skip list") + type_info->ids = NULL; + + type_info = H5MM_xfree(type_info); + + H5I_type_info_array_g[type] = NULL; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__destroy_type() */ + +/*------------------------------------------------------------------------- + * Function: H5I_register + * + * Purpose: Registers an OBJECT in a TYPE and returns an ID for it. + * This routine does _not_ check for unique-ness of the objects, + * if you register an object twice, you will get two different + * IDs for it. This routine does make certain that each ID in a + * type is unique. IDs are created by getting a unique number + * for the type the ID is in and incorporating the type into + * the ID which is returned to the user. + * + * Return: Success: New object ID + * Failure: H5I_INVALID_HID + * + *------------------------------------------------------------------------- + */ +hid_t +H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the type */ + H5I_id_info_t * info = NULL; /* Pointer to the new ID information */ + hid_t new_id = H5I_INVALID_HID; /* New ID */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_NOAPI(H5I_INVALID_HID) + + /* Check arguments */ + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid type number") + type_info = H5I_type_info_array_g[type]; + if ((NULL == type_info) || (type_info->init_count <= 0)) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, H5I_INVALID_HID, "invalid type") + if (NULL == (info = H5FL_MALLOC(H5I_id_info_t))) + HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed") + + /* Create the struct & its ID */ + new_id = H5I_MAKE(type, type_info->nextid); + info->id = new_id; + info->count = 1; /* initial reference count */ + info->app_count = !!app_ref; + info->object = object; + + /* Insert into the type */ + if (H5SL_insert(type_info->ids, info, &info->id) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert ID node into skip list") + type_info->id_count++; + type_info->nextid++; + + /* Sanity check for the 'nextid' getting too large and wrapping around */ + HDassert(type_info->nextid <= ID_MASK); + + /* Set the most recent ID to this object */ + type_info->last_id_info = info; + + /* Set return value */ + ret_value = new_id; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_register() */ + +/*------------------------------------------------------------------------- + * Function: H5I_register_using_existing_id + * + * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it. + * This routine will check to ensure the supplied ID is not already + * in use, and ensure that it is a valid ID for the given type, + * but will NOT check to ensure the OBJECT is not already + * registered (thus, it is possible to register one object under + * multiple IDs). + * + * NOTE: Intended for use in refresh calls, where we have to close + * and re-open the underlying data, then hook the object back + * up to the original ID. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, hid_t existing_id) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the type */ + H5I_id_info_t * info = NULL; /* Pointer to the new ID information */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check arguments */ + HDassert(object); + + /* Make sure ID is not already in use */ + if (NULL != (info = H5I__find_id(existing_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADRANGE, FAIL, "ID already in use") + + /* Make sure type number is valid */ + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + + /* Get type pointer from list of types */ + type_info = H5I_type_info_array_g[type]; + + if (NULL == type_info || type_info->init_count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + + /* Make sure requested ID belongs to object's type */ + if (H5I_TYPE(existing_id) != type) + HGOTO_ERROR(H5E_ATOM, H5E_BADRANGE, FAIL, "invalid type for provided ID") + + /* Allocate new structure to house this ID */ + if (NULL == (info = H5FL_MALLOC(H5I_id_info_t))) + HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Create the struct & insert requested ID */ + info->id = existing_id; + info->count = 1; /* initial reference count*/ + info->app_count = !!app_ref; + info->object = object; + + /* Insert into the type */ + if (H5SL_insert(type_info->ids, info, &info->id) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") + type_info->id_count++; + + /* Set the most recent ID to this object */ + type_info->last_id_info = info; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_register_using_existing_id() */ + +/*------------------------------------------------------------------------- + * Function: H5I_subst + * + * Purpose: Substitute a new object pointer for the specified ID. + * + * Return: Success: Non-NULL previous object pointer associated + * with the specified ID. + * Failure: NULL + * + * Programmer: Quincey Koziol + * Saturday, February 27, 2010 + * + *------------------------------------------------------------------------- + */ +void * +H5I_subst(hid_t id, const void *new_object) +{ + H5I_id_info_t *info = NULL; /* Pointer to the ID's info */ + void * ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* General lookup of the ID */ + if (NULL == (info = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_NOTFOUND, NULL, "can't get ID ref count") + + /* Get the old object pointer to return */ + H5_GCC_DIAG_OFF("cast-qual") + ret_value = (void *)info->object; /* (Casting away const OK -QAK) */ + H5_GCC_DIAG_ON("cast-qual") + + /* Set the new object pointer for the ID */ + info->object = new_object; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_subst() */ + +/*------------------------------------------------------------------------- + * Function: H5I_object + * + * Purpose: Find an object pointer for the specified ID. + * + * Return: Success: Non-NULL object pointer associated with the + * specified ID + * + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +void * +H5I_object(hid_t id) +{ + H5I_id_info_t *info = NULL; /* Pointer to the ID info */ + void * ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI_NOERR + + /* General lookup of the ID */ + if (NULL != (info = H5I__find_id(id))) { + /* Get the object pointer to return */ + H5_GCC_DIAG_OFF("cast-qual") + ret_value = (void *)info->object; /* (Casting away const OK -QAK) */ + H5_GCC_DIAG_ON("cast-qual") + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_object() */ + +/*------------------------------------------------------------------------- + * Function: H5I_object_verify + * + * Purpose: Find an object pointer for the specified ID, verifying that + * its in a particular type. + * + * Return: Success: Non-NULL object pointer associated with the + * specified ID. + * Failure: NULL + * + * Programmer: Quincey Koziol + * Wednesday, July 31, 2002 + * + *------------------------------------------------------------------------- + */ +void * +H5I_object_verify(hid_t id, H5I_type_t type) +{ + H5I_id_info_t *info = NULL; /* Pointer to the ID info */ + void * ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI_NOERR + + HDassert(type >= 1 && (int)type < H5I_next_type_g); + + /* 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") + ret_value = (void *)info->object; /* (Casting away const OK -QAK) */ + H5_GCC_DIAG_ON("cast-qual") + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5I_object_verify() */ + +/*------------------------------------------------------------------------- + * Function: H5I_get_type + * + * Purpose: Given an object ID return the type to which it + * belongs. The ID need not be the ID of an object which + * currently exists because the type number is encoded + * in the object ID. + * + * Return: Success: A positive integer (corresponding to an H5I_type_t + * enum value for library ID types, but not for user + * ID types). + * Failure: H5I_BADID + * + * Programmer: Robb Matzke + * Friday, February 19, 1999 + * + *------------------------------------------------------------------------- + */ +H5I_type_t +H5I_get_type(hid_t id) +{ + H5I_type_t ret_value = H5I_BADID; /* Return value */ + + FUNC_ENTER_NOAPI_NOERR + + if (id > 0) + ret_value = H5I_TYPE(id); + + HDassert(ret_value >= H5I_BADID && (int)ret_value < H5I_next_type_g); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_get_type() */ + +/*------------------------------------------------------------------------- + * Function: H5I_is_file_object + * + * Purpose: Convenience function to determine if an ID represents + * a file object. + * + * In H5O calls, you can't use object_verify to ensure + * the ID was of the correct class since there's no + * H5I_OBJECT ID class. + * + * Return: Success: TRUE/FALSE + * Failure: FAIL + * + *------------------------------------------------------------------------- + */ +htri_t +H5I_is_file_object(hid_t id) +{ + H5I_type_t type = H5I_get_type(id); + htri_t ret_value = FAIL; + + FUNC_ENTER_NOAPI(FAIL); + + /* Fail if the ID type is out of range */ + if (type < 1 || type >= H5I_NTYPES) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID type out of range"); + + /* Return TRUE if the ID is a file object (dataset, group, map, or committed + * datatype), FALSE otherwise. + */ + if (H5I_DATASET == type || H5I_GROUP == type || H5I_MAP == type) + ret_value = TRUE; + else if (H5I_DATATYPE == type) { + + H5T_t *dt = NULL; + + if (NULL == (dt = (H5T_t *)H5I_object(id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to get underlying datatype struct"); + + ret_value = H5T_is_named(dt); + } + else + ret_value = FALSE; + +done: + FUNC_LEAVE_NOAPI(ret_value); +} /* H5I_is_file_object() */ + +/*------------------------------------------------------------------------- + * Function: H5I__remove_verify + * + * Purpose: Removes the specified ID from its type, first checking that + * the ID's type is the same as the ID type supplied as an argument + * + * Return: Success: A pointer to the object that was removed, the + * same pointer which would have been found by + * calling H5I_object(). + * Failure: NULL + * + * Programmer: James Laird + * Nat Furrer + * + *------------------------------------------------------------------------- + */ +void * +H5I__remove_verify(hid_t id, H5I_type_t type) +{ + void *ret_value = NULL; /*return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Argument checking will be performed by H5I_remove() */ + + /* Verify that the type of the ID is correct */ + if (type == H5I_TYPE(id)) + ret_value = H5I_remove(id); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__remove_verify() */ + +/*------------------------------------------------------------------------- + * Function: H5I__remove_common + * + * Purpose: Common code to remove a specified ID from its type. + * + * Return: Success: A pointer to the object that was removed, the + * same pointer which would have been found by + * calling H5I_object(). + * Failure: NULL + * + * Programmer: Quincey Koziol + * October 3, 2013 + * + *------------------------------------------------------------------------- + */ +static void * +H5I__remove_common(H5I_type_info_t *type_info, hid_t id) +{ + H5I_id_info_t *info = NULL; /* Pointer to the current ID */ + void * ret_value = NULL; /* Return value */ + + FUNC_ENTER_STATIC + + /* 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_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node from skip list") + + /* 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") + ret_value = (void *)info->object; /* (Casting away const OK -QAK) */ + H5_GCC_DIAG_ON("cast-qual") + + info = H5FL_FREE(H5I_id_info_t, info); + + /* Decrement the number of IDs in the type */ + (type_info->id_count)--; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__remove_common() */ + +/*------------------------------------------------------------------------- + * Function: H5I_remove + * + * Purpose: Removes the specified ID from its type. + * + * Return: Success: A pointer to the object that was removed, the + * same pointer which would have been found by + * calling H5I_object(). + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +void * +H5I_remove(hid_t id) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the ID type */ + H5I_type_t type = H5I_BADID; /* ID's type */ + void * ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* Check arguments */ + type = H5I_TYPE(id); + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") + type_info = H5I_type_info_array_g[type]; + if (type_info == NULL || type_info->init_count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid type") + + /* Remove the node from the type */ + if (NULL == (ret_value = H5I__remove_common(type_info, id))) + HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_remove() */ + +/*------------------------------------------------------------------------- + * Function: H5I_dec_ref + * + * Purpose: Decrements the number of references outstanding for an ID. + * This will fail if the type is not a reference counted type. + * The ID type's 'free' function will be called for the ID + * if the reference count for the ID reaches 0 and a free + * function has been defined at type creation time. + * + * Return: Success: New reference count + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +int +H5I_dec_ref(hid_t id) +{ + H5I_id_info_t *info = NULL; /* Pointer to the ID */ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI((-1)) + + /* Sanity check */ + HDassert(id >= 0); + + /* General lookup of the ID */ + if (NULL == (info = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID") + + /* If this is the last reference to the object then invoke the type's + * free method on the object. If the free method is undefined or + * successful then remove the object from the type; otherwise leave + * the object in the type without decrementing the reference + * count. If the reference count is more than one then decrement the + * reference count without calling the free method. + * + * Beware: the free method may call other H5I functions. + * + * If an object is closing, we can remove the ID even though the free + * method might fail. This can happen when a mandatory filter fails to + * write when a dataset is closed and the chunk cache is flushed to the + * file. We have to close the dataset anyway. (SLU - 2010/9/7) + */ + if (1 == info->count) { + H5I_type_info_t *type_info; /*ptr to the type */ + + /* Get the ID's type */ + type_info = H5I_type_info_array_g[H5I_TYPE(id)]; + + H5_GCC_DIAG_OFF("cast-qual") + /* (Casting away const OK -QAK) */ + if (!type_info->cls->free_func || (type_info->cls->free_func)((void *)info->object) >= 0) { + /* Remove the node from the type */ + if (NULL == H5I__remove_common(type_info, id)) + HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, (-1), "can't remove ID node") + ret_value = 0; + } /* end if */ + else + ret_value = -1; + H5_GCC_DIAG_ON("cast-qual") + } /* end if */ + else { + --(info->count); + ret_value = (int)info->count; + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_dec_ref() */ + +/*------------------------------------------------------------------------- + * Function: H5I_dec_app_ref + * + * Purpose: Wrapper for case of modifying the application ref. + * count for an ID as well as normal reference count. + * + * Return: Success: New app. reference count + * Failure: -1 + * + * Programmer: Quincey Koziol + * Sept 16, 2010 + * + *------------------------------------------------------------------------- + */ +int +H5I_dec_app_ref(hid_t id) +{ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI((-1)) + + /* Sanity check */ + HDassert(id >= 0); + + /* Call regular decrement reference count routine */ + if ((ret_value = H5I_dec_ref(id)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count") + + /* Check if the ID still exists */ + if (ret_value > 0) { + H5I_id_info_t *info = NULL; /* Pointer to the ID info */ + + /* General lookup of the ID */ + if (NULL == (info = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID") + + /* Adjust app_ref */ + --(info->app_count); + HDassert(info->count >= info->app_count); + + /* Set return value */ + ret_value = (int)info->app_count; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_dec_app_ref() */ + +/*------------------------------------------------------------------------- + * Function: H5I_dec_app_ref_always_close + * + * Purpose: Wrapper for case of always closing the ID, even when the free + * routine fails + * + * Return: Success: New app. reference count + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +int +H5I_dec_app_ref_always_close(hid_t id) +{ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI((-1)) + + /* Sanity check */ + HDassert(id >= 0); + + /* Call application decrement reference count routine */ + ret_value = H5I_dec_app_ref(id); + + /* Check for failure */ + if (ret_value < 0) { + /* + * If an object is closing, we can remove the ID even though the free + * method might fail. This can happen when a mandatory filter fails to + * write when a dataset is closed and the chunk cache is flushed to the + * file. We have to close the dataset anyway. (SLU - 2010/9/7) + */ + H5I_remove(id); + + HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, (-1), "can't decrement ID ref count") + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_dec_app_ref_always_close() */ + +/*------------------------------------------------------------------------- + * Function: H5I_inc_ref + * + * Purpose: Increment the reference count for an object. + * + * Return: Success: The new reference count + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +int +H5I_inc_ref(hid_t id, hbool_t app_ref) +{ + H5I_id_info_t *info = NULL; /* Pointer to the ID info */ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI((-1)) + + /* Sanity check */ + HDassert(id >= 0); + + /* General lookup of the ID */ + if (NULL == (info = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID") + + /* Adjust reference counts */ + ++(info->count); + if (app_ref) + ++(info->app_count); + + /* Set return value */ + ret_value = (int)(app_ref ? info->app_count : info->count); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_inc_ref() */ + +/*------------------------------------------------------------------------- + * Function: H5I_get_ref + * + * Purpose: Retrieve the reference count for an object. + * + * Return: Success: The reference count + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +int +H5I_get_ref(hid_t id, hbool_t app_ref) +{ + H5I_id_info_t *info = NULL; /* Pointer to the ID */ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI((-1)) + + /* Sanity check */ + HDassert(id >= 0); + + /* General lookup of the ID */ + if (NULL == (info = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "can't locate ID") + + /* Set return value */ + ret_value = (int)(app_ref ? info->app_count : info->count); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_get_ref() */ + +/*------------------------------------------------------------------------- + * Function: H5I__inc_type_ref + * + * Purpose: Increment the reference count for an ID type. + * + * Return: Success: The new reference count + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +int +H5I__inc_type_ref(H5I_type_t type) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the type */ + int ret_value = -1; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(type > 0 && (int)type < H5I_next_type_g); + + /* Check arguments */ + type_info = H5I_type_info_array_g[type]; + if (NULL == type_info) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type") + + /* Set return value */ + ret_value = (int)(++(type_info->init_count)); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__inc_type_ref() */ + +/*------------------------------------------------------------------------- + * Function: H5I_dec_type_ref + * + * Purpose: Decrements the reference count on an entire type of IDs. + * If the type reference count becomes zero then the type is + * destroyed along with all IDs in that type regardless of + * their reference counts. Destroying IDs involves calling + * the free-func for each ID's object and then adding the ID + * struct to the ID free list. + * Returns the number of references to the type on success; a + * return value of 0 means that the type will have to be + * re-initialized before it can be used again (and should probably + * be set to H5I_UNINIT). + * + * Return: Success: Number of references to type + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +int +H5I_dec_type_ref(H5I_type_t type) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the ID type */ + herr_t ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI((-1)) + + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, (-1), "invalid type number") + + type_info = H5I_type_info_array_g[type]; + if (type_info == NULL || type_info->init_count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type") + + /* Decrement the number of users of the ID type. If this is the + * last user of the type then release all IDs from the type and + * free all memory it used. The free function is invoked for each ID + * being freed. + */ + if (1 == type_info->init_count) { + H5I__destroy_type(type); + ret_value = 0; + } + else { + --(type_info->init_count); + ret_value = (herr_t)type_info->init_count; + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_dec_type_ref() */ + +/*------------------------------------------------------------------------- + * Function: H5I__get_type_ref + * + * Purpose: Retrieve the reference count for an ID type. + * + * Return: Success: The reference count + * + * Failure: -1 + * + *------------------------------------------------------------------------- + */ +int +H5I__get_type_ref(H5I_type_t type) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the type */ + int ret_value = -1; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(type >= 0); + + /* Check arguments */ + type_info = H5I_type_info_array_g[type]; + if (!type_info) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type") + + /* Set return value */ + ret_value = (int)type_info->init_count; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__get_type_ref() */ + +/*------------------------------------------------------------------------- + * Function: H5I__iterate_cb + * + * Purpose: Callback routine for H5I_iterate, invokes "user" callback + * function, and then sets return value, based on the result of + * that callback. + * + * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1) + * Failure: H5_ITER_ERROR (-1) + * + *------------------------------------------------------------------------- + */ +static int +H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) +{ + H5I_id_info_t * info = (H5I_id_info_t *)_item; /* Pointer to the ID info */ + H5I_iterate_ud_t *udata = (H5I_iterate_ud_t *)_udata; /* User data for callback */ + int ret_value = H5_ITER_CONT; /* Callback return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Only invoke the callback function if this ID is visible externally and + * its reference count is positive. + */ + if ((!udata->app_ref) || (info->app_count > 0)) { + H5I_type_t type = udata->obj_type; + void * object; + herr_t cb_ret_val; + + /* 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") + object = H5I__unwrap((void *)info->object, type); /* Casting away const OK */ + H5_GCC_DIAG_ON("cast-qual") + + /* Invoke callback function */ + cb_ret_val = (*udata->user_func)((void *)object, info->id, udata->user_udata); + + /* Set the return value based on the callback's return value */ + if (cb_ret_val > 0) + ret_value = H5_ITER_STOP; /* terminate iteration early */ + else if (cb_ret_val < 0) + ret_value = H5_ITER_ERROR; /* indicate failure (which terminates iteration) */ + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__iterate_cb() */ + +/*------------------------------------------------------------------------- + * Function: H5I_iterate + * + * Purpose: Apply function FUNC to each member of type TYPE (with + * non-zero application reference count if app_ref is TRUE). + * Stop if FUNC returns a non zero value (i.e. anything + * other than H5_ITER_CONT). + * + * If FUNC returns a positive value (i.e. H5_ITER_STOP), + * return SUCCEED. + * + * If FUNC returns a negative value (i.e. H5_ITER_ERROR), + * return FAIL. + * + * The FUNC should take a pointer to the object and the + * udata as arguments and return non-zero to terminate + * siteration, and zero to continue. + * + * Limitation: Currently there is no way to start the iteration from + * where a previous iteration left off. + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +herr_t +H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the type */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check arguments */ + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + type_info = H5I_type_info_array_g[type]; + + /* 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 */ + + /* Set up iterator user data */ + iter_udata.user_func = func; + iter_udata.user_udata = udata; + iter_udata.app_ref = app_ref; + 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_ATOM, H5E_BADITER, FAIL, "iteration failed") + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_iterate() */ + +/*------------------------------------------------------------------------- + * Function: H5I__find_id + * + * Purpose: Given an object ID find the info struct that describes the + * object. + * + * Return: Success: A pointer to the object's info struct. + * + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +H5I_id_info_t * +H5I__find_id(hid_t id) +{ + H5I_type_t type; /* ID's type */ + H5I_type_info_t *type_info = NULL; /* Pointer to the type */ + H5I_id_info_t * ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_NOERR + + /* Check arguments */ + type = H5I_TYPE(id); + if (type <= H5I_BADID || (int)type >= H5I_next_type_g) + HGOTO_DONE(NULL) + type_info = H5I_type_info_array_g[type]; + if (!type_info || type_info->init_count <= 0) + HGOTO_DONE(NULL) + + /* Check for same ID as we have looked up last time */ + if (type_info->last_id_info && type_info->last_id_info->id == id) + ret_value = type_info->last_id_info; + else { + /* Locate the ID node for the ID */ + ret_value = (H5I_id_info_t *)H5SL_search(type_info->ids, &id); + + /* Remember this ID */ + type_info->last_id_info = ret_value; + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__find_id() */ + +/*------------------------------------------------------------------------- + * Function: H5I__find_id_cb + * + * Purpose: Callback for searching for an ID with a specific pointer + * + * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1) + * Failure: H5_ITER_ERROR (-1) + * + *------------------------------------------------------------------------- + */ +static int +H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) +{ + H5I_id_info_t * info = (H5I_id_info_t *)_item; /* Pointer to the ID info */ + H5I_get_id_ud_t *udata = (H5I_get_id_ud_t *)_udata; /* Pointer to user data */ + H5I_type_t type = udata->obj_type; + const void * object = NULL; + int ret_value = H5_ITER_CONT; /* Return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(info); + HDassert(udata); + + /* Get a pointer to the VOL connector's data */ + H5_GCC_DIAG_OFF("cast-qual") + object = H5I__unwrap((void *)info->object, type); /* Casting away const OK */ + H5_GCC_DIAG_ON("cast-qual") + + /* Check for a match */ + if (object == udata->object) { + udata->ret_id = info->id; + ret_value = H5_ITER_STOP; + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I__find_id_cb() */ + +/*------------------------------------------------------------------------- + * Function: H5I_find_id + * + * Purpose: Return the ID of an object by searching through the ID list + * for the type. + * + * Return: SUCCEED/FAIL + * (id will be set to H5I_INVALID_HID on errors or not found) + * + *------------------------------------------------------------------------- + */ +herr_t +H5I_find_id(const void *object, H5I_type_t type, hid_t *id) +{ + H5I_type_info_t *type_info = NULL; /* Pointer to the type */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(id); + + *id = H5I_INVALID_HID; + + type_info = H5I_type_info_array_g[type]; + if (!type_info || type_info->init_count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + + /* 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 */ + + /* Set up iterator user data */ + udata.object = object; + udata.obj_type = type; + 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_ATOM, H5E_BADITER, FAIL, "iteration failed") + + *id = udata.ret_id; + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_find_id() */ diff --git a/src/H5Imodule.h b/src/H5Imodule.h index 62b1406..7fc6af0 100644 --- a/src/H5Imodule.h +++ b/src/H5Imodule.h @@ -11,22 +11,27 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 + * Programmer: Quincey Koziol + * Saturday, September 12, 2015 * - * Purpose: This file contains declarations which define macros for the - * H5I package. Including this header means that the source file - * is part of the H5I package. + * Purpose: This file contains declarations which define macros for the + * H5I package. Including this header means that the source file + * is part of the H5I package. */ #ifndef _H5Imodule_H #define _H5Imodule_H /* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error - * reporting macros. + * reporting macros. */ #define H5I_MODULE #define H5_MY_PKG H5I #define H5_MY_PKG_ERR H5E_ATOM #define H5_MY_PKG_INIT NO +/**\defgroup H5I H5I + * \brief Identifier Interface + * \todo Describe concisely what the functions in this module are about. + */ + #endif /* _H5Imodule_H */ diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index 25b4a97..5d9af13 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -30,13 +30,14 @@ #include "H5Iprivate.h" /* Other private headers needed by this file */ +#include "H5SLprivate.h" /* Skip Lists */ /**************************/ /* Package Private Macros */ /**************************/ /* - * Number of bits to use for ID Type in each atom. Increase if more types + * Number of bits to use for ID Type in each ID. Increase if more types * are needed (though this will decrease the number of available IDs per * type). This is the only number that must be changed since all other bit * field sizes and masks are calculated from TYPE_BITS. @@ -47,23 +48,62 @@ #define H5I_MAX_NUM_TYPES TYPE_MASK /* - * Number of bits to use for the Atom index in each atom (assumes 8-bit + * Number of bits to use for the ID index in each ID (assumes 8-bit * bytes). We don't use the sign bit. */ #define ID_BITS ((sizeof(hid_t) * 8) - (TYPE_BITS + 1)) #define ID_MASK (((hid_t)1 << ID_BITS) - 1) -/* Map an atom to an ID type number */ +/* Map an ID to an ID type number */ #define H5I_TYPE(a) ((H5I_type_t)(((hid_t)(a) >> ID_BITS) & TYPE_MASK)) /****************************/ /* Package Private Typedefs */ /****************************/ +/* ID information structure used */ +typedef struct H5I_id_info_t { + hid_t id; /* ID for this info */ + unsigned count; /* Ref. count for this ID */ + unsigned app_count; /* Ref. count of application visible IDs */ + const void *object; /* Pointer associated with the ID */ +} H5I_id_info_t; + +/* Type information structure used */ +typedef struct H5I_type_info_t { + const H5I_class_t *cls; /* Pointer to ID class */ + unsigned init_count; /* # of times this type has been initialized */ + 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_type_info_t; + +/*****************************/ +/* Package Private Variables */ +/*****************************/ + +/* 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 */ +H5_DLLVAR int H5I_next_type_g; + /******************************/ /* Package Private Prototypes */ /******************************/ +H5_DLL int H5I__destroy_type(H5I_type_t type); +H5_DLL void * H5I__remove_verify(hid_t id, H5I_type_t type); +H5_DLL int H5I__inc_type_ref(H5I_type_t type); +H5_DLL int H5I__get_type_ref(H5I_type_t type); +H5_DLL H5I_id_info_t *H5I__find_id(hid_t id); + /* Testing functions */ #ifdef H5I_TESTING H5_DLL ssize_t H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached); diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index d4d1721..d8d80f9 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -42,7 +42,7 @@ /****************************/ typedef struct H5I_class_t { - H5I_type_t type_id; /* Class ID for the type */ + H5I_type_t type; /* Class "value" for the type */ unsigned flags; /* Class behavior flags */ unsigned reserved; /* Number of reserved IDs for this type */ /* [A specific number of type entries may be @@ -86,7 +86,7 @@ H5_DLL herr_t H5I_find_id(const void *object, H5I_type_t type, hid_t *id /*o /* Functions that manipulate objects */ H5_DLL void * H5I_object(hid_t id); -H5_DLL void * H5I_object_verify(hid_t id, H5I_type_t id_type); +H5_DLL void * H5I_object_verify(hid_t id, H5I_type_t type); H5_DLL void * H5I_remove(hid_t id); H5_DLL void * H5I_subst(hid_t id, const void *new_object); H5_DLL htri_t H5I_is_file_object(hid_t id); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 697777c..9c5b5d4 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -21,37 +21,41 @@ /* Public headers needed by this file */ #include "H5public.h" -/* - * Library type values. Start with `1' instead of `0' because it makes the - * tracing output look better when hid_t values are large numbers. Change the - * TYPE_BITS in H5I.c if the MAXID gets larger than 32 (an assertion will - * fail otherwise). +/** + * Library type values. + * \internal Library type values. Start with `1' instead of `0' because it + * makes the tracing output look better when hid_t values are large + * numbers. Change the TYPE_BITS in H5I.c if the MAXID gets larger + * than 32 (an assertion will fail otherwise). * - * When adding types here, add a section to the 'misc19' test in test/tmisc.c - * to verify that the H5I{inc|dec|get}_ref() routines work correctly with it. + * When adding types here, add a section to the 'misc19' test in + * test/tmisc.c to verify that the H5I{inc|dec|get}_ref() routines + * work correctly with it. \endinternal */ typedef enum H5I_type_t { - H5I_UNINIT = (-2), /* uninitialized type */ - H5I_BADID = (-1), /* invalid Type */ - H5I_FILE = 1, /* type ID for File objects */ - H5I_GROUP, /* type ID for Group objects */ - H5I_DATATYPE, /* type ID for Datatype objects */ - H5I_DATASPACE, /* type ID for Dataspace objects */ - H5I_DATASET, /* type ID for Dataset objects */ - H5I_MAP, /* type ID for Map objects */ - H5I_ATTR, /* type ID for Attribute objects */ - H5I_VFL, /* type ID for virtual file layer */ - H5I_VOL, /* type ID for virtual object layer */ - H5I_GENPROP_CLS, /* type ID for generic property list classes */ - H5I_GENPROP_LST, /* type ID for generic property lists */ - H5I_ERROR_CLASS, /* type ID for error classes */ - H5I_ERROR_MSG, /* type ID for error messages */ - H5I_ERROR_STACK, /* type ID for error stacks */ - H5I_SPACE_SEL_ITER, /* type ID for dataspace selection iterator */ - H5I_NTYPES /* number of library types, MUST BE LAST! */ + H5I_UNINIT = (-2), /**< uninitialized type */ + H5I_BADID = (-1), /**< invalid Type */ + H5I_FILE = 1, /**< type ID for File objects */ + H5I_GROUP, /**< type ID for Group objects */ + H5I_DATATYPE, /**< type ID for Datatype objects */ + H5I_DATASPACE, /**< type ID for Dataspace objects */ + H5I_DATASET, /**< type ID for Dataset objects */ + H5I_MAP, /**< type ID for Map objects */ + H5I_ATTR, /**< type ID for Attribute objects */ + H5I_VFL, /**< type ID for virtual file layer */ + H5I_VOL, /**< type ID for virtual object layer */ + H5I_GENPROP_CLS, /**< type ID for generic property list classes */ + H5I_GENPROP_LST, /**< type ID for generic property lists */ + H5I_ERROR_CLASS, /**< type ID for error classes */ + H5I_ERROR_MSG, /**< type ID for error messages */ + H5I_ERROR_STACK, /**< type ID for error stacks */ + H5I_SPACE_SEL_ITER, /**< type ID for dataspace selection iterator */ + H5I_NTYPES /**< number of library types, MUST BE LAST! */ } H5I_type_t; -/* Type of atoms to return to users */ +/** + * Type of IDs to return to users + */ typedef int64_t hid_t; #define PRIdHID PRId64 @@ -59,13 +63,18 @@ typedef int64_t hid_t; #define PRIXHID PRIX64 #define PRIoHID PRIo64 +/** + * The size of identifiers + */ #define H5_SIZEOF_HID_T H5_SIZEOF_INT64_T -/* An invalid object ID. This is also negative for error return. */ +/** + * An invalid object ID. This is also negative for error return. + */ #define H5I_INVALID_HID (-1) -/* - * Function for freeing objects. This function will be called with an object +/** + * A function for freeing objects. This function will be called with an object * ID type number and a pointer to the object. The function should free the * object and return non-negative to indicate that the object * can be removed from the ID type. If the function returns negative @@ -73,11 +82,19 @@ typedef int64_t hid_t; */ typedef herr_t (*H5I_free_t)(void *); -/* Type of the function to compare objects & keys */ +/** + * The type of a function to compare objects & keys + */ +//! [H5I_search_func_t_snip] typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key); +//! [H5I_search_func_t_snip] -/* Type of the H5Iiterate callback function */ +/** + * The type of H5Iiterate() callback functions + */ +//! [H5I_iterate_func_t_snip] typedef herr_t (*H5I_iterate_func_t)(hid_t id, void *udata); +//! [H5I_iterate_func_t_snip] #ifdef __cplusplus extern "C" { @@ -85,26 +102,562 @@ extern "C" { /* Public API functions */ -H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object); -H5_DLL void * H5Iobject_verify(hid_t id, H5I_type_t id_type); -H5_DLL void * H5Iremove_verify(hid_t id, H5I_type_t id_type); +/** + * \ingroup H5I + * + * \brief Registers an 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 object for which a new ID is created + * + * \return \hid_t{object} + * + * \details H5Iregister() allocates and returns a new ID for an object. + * + * \details The \p type parameter is the identifier for the ID type to which + * this new ID will belong. This identifier must have been created by + * a call to H5Iregister_type(). + * + * \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 + * and returned via a call to H5Iobject_verify(). + * + */ +H5_DLL hid_t H5Iregister(H5I_type_t type, const void *object); +/** + * \ingroup H5I + * + * \brief Returns the object referenced by an ID + * + * \param[in] id ID to be dereferenced + * \param[in] type The identifier type + + * + * \return Pointer to the object referenced by \p id on success, NULL on failure. + * + * \details H5Iobject_verify() returns a pointer to the memory referenced by id + * after verifying that \p id is of type \p type. This function is + * analogous to dereferencing a pointer in C with type checking. + * + * \note H5Iobject_verify() does not change the ID it is called on in any way + * (as opposed to H5Iremove_verify(), which removes the ID from its + * type’s hash table). + * + * \see H5Iregister() + * + */ +H5_DLL void *H5Iobject_verify(hid_t id, H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Removes an ID from its type + * + * \param[in] id The ID to be removed from its type + * \param[in] type The identifier type + + * + * \return Returns a pointer to the memory referred to by \p id on success, + * NULL on failure. + * + * \details H5Iremove_verify() first ensures that \p id belongs to \p type. + * If so, it removes \p id from its type and returns the pointer + * to the memory it referred to. This pointer is the same pointer that + * was placed in storage by H5Iregister(). If id does not belong to + * \p type, then NULL is returned. + * + * The \p id parameter is the ID which is to be removed from its type. + * + * The \p type parameter is the identifier for the ID type which \p id + * is supposed to belong to. This identifier must have been created by + * a call to H5Iregister_type(). + * + * \note This function does NOT deallocate the memory that \p id refers to. + * The pointer returned by H5Iregister() must be deallocated by the user + * to avoid memory leaks. + * + */ +H5_DLL void *H5Iremove_verify(hid_t id, H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Retrieves the type of an object + * + * \obj_id{id} + * + * \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 + * invalid, the function returns #H5I_BADID. + * + * This function is of particular use in determining the type of + * object closing function (H5Dclose(), H5Gclose(), etc.) to call + * after a call to H5Rdereference(). + * + * \note Note that this function returns only the type of object that \p id + * would identify if it were valid; it does not determine whether \p id + * is valid identifier. Validity can be determined with a call to + * H5Iis_valid(). + * + */ H5_DLL H5I_type_t H5Iget_type(hid_t id); -H5_DLL hid_t H5Iget_file_id(hid_t id); -H5_DLL ssize_t H5Iget_name(hid_t id, char *name /*out*/, size_t size); -H5_DLL int H5Iinc_ref(hid_t id); -H5_DLL int H5Idec_ref(hid_t id); -H5_DLL int H5Iget_ref(hid_t id); +/** + * \ingroup H5I + * + * \brief Retrieves an identifier for the file containing the specified object + * + * \obj_id{id} + * + * \return \hid_t{file} + * + * \details H5Iget_file_id() returns the identifier of the file associated with + * the object referenced by \p id. + * + * \note Note that the HDF5 library permits an application to close a file + * while objects within the file remain open. If the file containing the + * object \p id is still open, H5Iget_file_id() will retrieve the + * existing file identifier. If there is no existing file identifier for + * the file, i.e., the file has been closed, H5Iget_file_id() will reopen + * the file and return a new file identifier. In either case, the file + * identifier must eventually be released using H5Fclose(). + * + * \since 1.6.3 + * + */ +H5_DLL hid_t H5Iget_file_id(hid_t id); +/** + * \ingroup H5I + * + * \brief Retrieves a name of an object based on the object identifier + * + * \obj_id{id} + * \param[out] name A buffer for thename associated with the identifier + * \param[in] size The size of the \p name buffer; usually the size of + * the name in bytes plus 1 for a NULL terminator + * + * \return ssize_t + * + * \details H5Iget_name() retrieves a name for the object identified by \p id. + * + * \details 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 H5Iget_name() call can be made. + * The return value of this call will be the size in bytes of the + * object name. That value, plus 1 for a NULL terminator, is then + * assigned to size for a second H5Iget_name() call, which will + * retrieve the actual name. + * + * If the object identified by \p id is an attribute, as determined + * via H5Iget_type(), H5Iget_name() retrieves the name of the object + * to which that attribute is attached. To retrieve the name of the + * attribute itself, use H5Aget_name(). + * + * If there is no name associated with the object identifier or if the + * name is NULL, H5Iget_name() returns 0 (zero). + * + * \note 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. When possible, H5Iget_name() returns the path with which + * the object was opened. + * + * \since 1.6.0 + * + */ +H5_DLL ssize_t H5Iget_name(hid_t id, char *name /*out*/, size_t size); +/** + * \ingroup H5I + * + * \brief Increments the reference count for an object + * + * \obj_id{id} + * + * \return Returns a non-negative reference count of the object ID after + * incrementing it if successful; otherwise a negative value is + * returned. + * + * \details H5Iinc_ref() increments the reference count of the object + * identified by \p id. + * + * The reference count for an object ID is attached to the information + * about an object in memory and has no relation to the number of + * links to an object on disk. + * + * The reference count for a newly created object will be 1. Reference + * counts for objects may be explicitly modified with this function or + * with H5Idec_ref(). When an object ID's reference count reaches + * zero, the object will be closed. Calling an object ID's \c close + * function decrements the reference count for the ID which normally + * closes the object, but if the reference count for the ID has been + * incremented with this function, the object will only be closed when + * the reference count reaches zero with further calls to H5Idec_ref() + * or the object ID's \c close function. + * + * If the object ID was created by a collective parallel call (such as + * H5Dcreate(), H5Gopen(), etc.), the reference count should be + * modified by all the processes which have copies of the ID. + * Generally this means that group, dataset, attribute, file and named + * datatype IDs should be modified by all the processes and that all + * other types of IDs are safe to modify by individual processes. + * + * This function is of particular value when an application is + * maintaining multiple copies of an object ID. The object ID can be + * incremented when a copy is made. Each copy of the ID can then be + * safely closed or decremented and the HDF5 object will be closed + * when the reference count for that that object drops to zero. + * + * \since 1.6.2 + * + */ +H5_DLL int H5Iinc_ref(hid_t id); +/** + * \ingroup H5I + * + * \brief Decrements the reference count for an object + * + * \obj_id{id} + * + * \return Returns a non-negative reference count of the object ID after + * decrementing it, if successful; otherwise a negative value is + * returned. + * + * \details H5Idec_ref() decrements the reference count of the object + * identified by \p id. + * + * The reference count for an object ID is attached to the information + * about an object in memory and has no relation to the number of + * links to an object on disk. + * + * The reference count for a newly created object will be 1. Reference + * counts for objects may be explicitly modified with this function or + * with H5Iinc_ref(). When an object identifier’s reference count + * reaches zero, the object will be closed. Calling an object + * identifier’s \c close function decrements the reference count for + * the identifier which normally closes the object, but if the + * reference count for the identifier has been incremented with + * H5Iinc_ref(), the object will only be closed when the reference + * count reaches zero with further calls to this function or the + * object identifier’s \c close function. + * + * If the object ID was created by a collective parallel call (such as + * H5Dcreate(), H5Gopen(), etc.), the reference count should be + * modified by all the processes which have copies of the ID. + * Generally this means that group, dataset, attribute, file and named + * datatype IDs should be modified by all the processes and that all + * other types of IDs are safe to modify by individual processes. + * + * This function is of particular value when an application is + * maintaining multiple copies of an object ID. The object ID can be + * incremented when a copy is made. Each copy of the ID can then be + * safely closed or decremented and the HDF5 object will be closed + * when the reference count for that that object drops to zero. + * + * \since 1.6.2 + * + */ +H5_DLL int H5Idec_ref(hid_t id); +/** + * \ingroup H5I + * + * \brief Retrieves the reference count for an object + * + * \obj_id{id} + * + * \return Returns a non-negative current reference count of the object + * identifier if successful; otherwise a negative value is returned. + * + * \details H5Iget_ref() retrieves the reference count of the object identified + * by \p id. + * + * The reference count for an object identifier is attached to the + * information about an object in memory and has no relation to the + * number of links to an object on disk. + * + * The function H5Iis_valid() is used to determine whether a specific + * object identifier is valid. + * + * \since 1.6.2 + * + */ +H5_DLL int H5Iget_ref(hid_t id); +/** + * \ingroup H5I + * + * \brief Creates and returns a new ID type + * + * \param[in] hash_size Minimum hash table size (in entries) used to store IDs + * for the new type + * \param[in] reserved Number of reserved IDs for the new type + * \param[in] free_func Function used to deallocate space for a single ID + * + * \return Returns the type identifier on success, negative on failure. + * + * \details H5Iregister_type() allocates space for a new ID type and returns an + * identifier for it. + * + * The \p hash_size parameter indicates the minimum size of the hash + * table used to store IDs in the new type. + * + * The \p reserved parameter indicates the number of IDs in this new + * type to be reserved. Reserved IDs are valid IDs which are not + * associated with any storage within the library. + * + * The \p free_func parameter is a function pointer to a function + * which returns an herr_t and accepts a \c void*. The purpose of this + * function is to deallocate memory for a single ID. It will be called + * by H5Iclear_type() and H5Idestroy_type() on each ID. This function + * is NOT called by H5Iremove_verify(). The \c void* will be the same + * pointer which was passed in to the H5Iregister() function. The \p + * free_func function should return 0 on success and -1 on failure. + * + */ H5_DLL H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func); -H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force); -H5_DLL herr_t H5Idestroy_type(H5I_type_t type); -H5_DLL int H5Iinc_type_ref(H5I_type_t type); -H5_DLL int H5Idec_type_ref(H5I_type_t type); -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); -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); -H5_DLL htri_t H5Itype_exists(H5I_type_t type); -H5_DLL htri_t H5Iis_valid(hid_t id); +/** + * \ingroup H5I + * + * \brief Deletes all identifiers of the given type + * + * \param[in] type Identifier of identifier type which is to be cleared of identifiers + * \param[in] force Whether or not to force deletion of all identifiers + * + * \return \herr_t + * + * \details H5Iclear_type() deletes all identifiers of the type identified by + * the argument \p type. + * + * The identifier type's free function is first called on all of these + * identifiers to free their memory, then they are removed from the + * type. + * + * If the \p force flag is set to false, only those identifiers whose + * reference counts are equal to 1 will be deleted, and all other + * identifiers will be entirely unchanged. If the force flag is true, + * all identifiers of this type will be deleted. + * + */ +H5_DLL herr_t H5Iclear_type(H5I_type_t type, hbool_t force); +/** + * \ingroup H5I + * + * \brief Removes an identifier type and all identifiers within that type + * + * \param[in] type Identifier of identifier type which is to be destroyed + * + * \return \herr_t + * + * \details H5Idestroy_type deletes an entire identifier type \p type. All + * identifiers of this type are destroyed and no new identifiers of + * this type can be registered. + * + * The type’s free function is called on all of the identifiers which + * are deleted by this function, freeing their memory. In addition, + * all memory used by this type’s hash table is freed. + * + * Since the H5I_type_t values of destroyed identifier types are + * reused when new types are registered, it is a good idea to set the + * variable holding the value of the destroyed type to #H5I_UNINIT. + * + */ +H5_DLL herr_t H5Idestroy_type(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Increments the reference count on an ID type + * + * \param[in] type The identifier of the type whose reference count is to be incremented + * + * \return Returns the current reference count on success, negative on failure. + * + * \details H5Iinc_type_ref() increments the reference count on an ID type. The + * reference count is used by the library to indicate when an ID type + * can be destroyed. + * + * The type parameter is the identifier for the ID type whose + * reference count is to be incremented. This identifier must have + * been created by a call to H5Iregister_type(). + * + */ +H5_DLL int H5Iinc_type_ref(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Decrements the reference count on an identifier type + * + * \param[in] type The identifier of the type whose reference count is to be decremented + * + * \return Returns the current reference count on success, negative on failure. + * + * \details H5Idec_type_ref() decrements the reference count on an identifier + * type. The reference count is used by the library to indicate when + * an identifier type can be destroyed. If the reference count reaches + * zero, this function will destroy it. + * + * The type parameter is the identifier for the identifier type whose + * reference count is to be decremented. This identifier must have + * been created by a call to H5Iregister_type(). + * + */ +H5_DLL int H5Idec_type_ref(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Retrieves the reference count on an ID type + * + * \param[in] type The identifier of the type whose reference count is to be retieved + * + * \return Returns the current reference count on success, negative on failure. + * + * \details H5Iget_type_ref() retrieves the reference count on an ID type. The + * reference count is used by the library to indicate when an ID type + * can be destroyed. + * + * The type parameter is the identifier for the ID type whose + * reference count is to be retrieved. This identifier must have been + * created by a call to H5Iregister_type(). + * + */ +H5_DLL int H5Iget_type_ref(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Finds the memory referred to by an ID within the given ID type such + * that some criterion is satisfied + * + * \param[in] type The identifier of the type to be searched + * \param[in] func The function defining the search criteria + * \param[in] key A key for the search function + * + * \return Returns a pointer to the object which satisfies the search function + * on success, NULL on failure. + * + * \details H5Isearch() searches through a given ID type to find an object that + * satisfies the criteria defined by \p func. If such an object is + * found, the pointer to the memory containing this object is + * returned. Otherwise, NULL is returned. To do this, \p func is + * called on every member of type \p type. The first member to satisfy + * \p func is returned. + * + * The \p type parameter is the identifier for the ID type which is to + * be searched. This identifier must have been created by a call to + * H5Iregister_type(). + * + * The parameter \p func is a function pointer to a function which + * takes three parameters. The first parameter is a \c void* and will + * be a pointer to the object to be tested. This is the same object + * that was placed in storage using H5Iregister(). The second + * parameter is a hid_t and is the ID of the object to be tested. The + * last parameter is a \c void*. This is the \p key parameter and can + * be used however the user finds helpful, or it can be ignored if it + * is not needed. \p func returns 0 if the object it is testing does + * not pass its criteria. A non-zero value should be returned if the + * object does pass its criteria. H5I_search_func_t is defined in + * H5Ipublic.h and is shown below. + * \snippet this H5I_search_func_t_snip + * The \p key parameter will be passed to the search function as a + * parameter. It can be used to further define the search at run-time. + * + */ +H5_DLL void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key); +/** + * \ingroup H5I + * + * \brief Calls a callback for each member of the identifier type specified + * + * \param[in] type The identifier type + * \param[in] op The callback function + * \param[in,out] op_data The data for the callback function + * + * \return The last value returned by \p op + * + * \details H5Iiterate() calls the callback function \p op for each member of + * the identifier type \p type. The callback function type for \p op, + * H5I_iterate_func_t, is defined in H5Ipublic.h as: + * \snippet this H5I_iterate_func_t_snip + * \p op takes as parameters the identifier and a pass through of + * \p op_data, and returns an herr_t. + * + * A positive return from op will cause the iteration to stop and + * H5Iiterate() will return the value returned by \p op. A negative + * return from \p op will cause the iteration to stop and H5Iiterate() + * will return failure. A zero return from \p op will allow iteration + * to continue, as long as there are other identifiers remaining in + * type. + * + * \since 1.12.0 + * + */ +H5_DLL herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data); +/** + * \ingroup H5I + * + * \brief Returns the number of identifiers in a given identifier type + * + * \param[in] type The identifier type + * \param[out] num_members Number of identifiers of the specified identifier type + * + * \return \herr_t + * + * \details H5Inmembers() returns the number of identifiers of the identifier + * type specified in \p type. + * + * The number of identifiers is returned in \p num_members. If no + * identifiers of this type have been registered, the type does not + * exist, or it has been destroyed, \p num_members is returned with + * the value 0. + * + */ +H5_DLL herr_t H5Inmembers(H5I_type_t type, hsize_t *num_members); +/** + * \ingroup H5I + * + * \brief Determines whether an identifier type is registered + * + * \param[in] type Identifier type + * + * \return \htri_t + * + * \details H5Itype_exists() determines whether the given identifier type, + * \p type, is registered with the library. + * + * \since 1.8.0 + * + */ +H5_DLL htri_t H5Itype_exists(H5I_type_t type); +/** + * \ingroup H5I + * + * \brief Determines whether an identifier is valid + * + * \obj_id{id} + * + * \return \htri_t + * + * \details H5Iis_valid() determines whether the identifier \p id is valid. + * + * \details Valid identifiers are those that have been obtained by an + * application and can still be used to access the original target. + * Examples of invalid identifiers include: + * \li Out of range values: negative, for example + * \li Previously-valid identifiers that have been released: + * for example, a dataset identifier for which the dataset has + * been closed + * + * H5Iis_valid() can be used with any type of identifier: object + * identifier, property list identifier, attribute identifier, error + * message identifier, etc. When necessary, a call to H5Iget_type() + * can determine the type of the object that \p id identifies. + * + * \since 1.8.3 + * + */ +H5_DLL htri_t H5Iis_valid(hid_t id); #ifdef __cplusplus } diff --git a/src/H5Itest.c b/src/H5Itest.c index 83e0a84..ea0de2a 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -11,10 +11,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Quincey Koziol - * Tuesday, July 27, 2010 - * - * Purpose: ID testing functions. +/* + * H5Itest.c - ID testing functions */ /****************/ @@ -28,7 +26,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ @@ -1078,7 +1078,7 @@ H5Lregister(const H5L_class_t *cls) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*x", cls); + H5TRACE1("e", "*#", cls); /* Check args */ if (cls == NULL) @@ -1279,7 +1279,7 @@ H5Literate2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIo*hx*x", group_id, idx_type, order, idx_p, op, op_data); + H5TRACE6("e", "iIiIo*hLI*x", group_id, idx_type, order, idx_p, op, op_data); /* Check arguments */ id_type = H5I_get_type(group_id); @@ -1341,7 +1341,7 @@ H5Literate_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id); + H5TRACE8("e", "i*sIiIo*hLI*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id); /* Check arguments */ if (!group_name) @@ -1415,7 +1415,7 @@ H5Lvisit2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIiIox*x", group_id, idx_type, order, op, op_data); + H5TRACE5("e", "iIiIoLI*x", group_id, idx_type, order, op, op_data); /* Check args */ id_type = H5I_get_type(group_id); @@ -1482,7 +1482,7 @@ H5Lvisit_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIox*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id); + H5TRACE7("e", "i*sIiIoLI*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id); /* Check args */ if (!group_name) diff --git a/src/H5Ldeprec.c b/src/H5Ldeprec.c index 843469f..2adc1fe 100644 --- a/src/H5Ldeprec.c +++ b/src/H5Ldeprec.c @@ -149,7 +149,7 @@ H5Literate1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIo*hx*x", group_id, idx_type, order, idx_p, op, op_data); + H5TRACE6("e", "iIiIo*hLi*x", group_id, idx_type, order, idx_p, op, op_data); /* Check arguments */ id_type = H5I_get_type(group_id); @@ -226,7 +226,7 @@ H5Literate_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id); + H5TRACE8("e", "i*sIiIo*hLi*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id); /* Check arguments */ if (!group_name) @@ -487,7 +487,7 @@ H5Lvisit1(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterat herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIiIox*x", group_id, idx_type, order, op, op_data); + H5TRACE5("e", "iIiIoLi*x", group_id, idx_type, order, op, op_data); /* Check args */ id_type = H5I_get_type(group_id); @@ -570,7 +570,7 @@ H5Lvisit_by_name1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIox*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id); + H5TRACE7("e", "i*sIiIoLi*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id); /* Check args */ if (!group_name) diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h index 043a865..ad737d6 100644 --- a/src/H5Lmodule.h +++ b/src/H5Lmodule.h @@ -29,4 +29,12 @@ #define H5_MY_PKG_ERR H5E_LINK #define H5_MY_PKG_INIT YES +/**\defgroup H5L H5L + * \brief Link Interface + * \todo Describe concisely what the functions in this module are about. + * + * \defgroup TRAV Link Traversal + * \ingroup H5L + */ + #endif /* _H5Lmodule_H */ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index be920c2..e930a15 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -34,14 +34,21 @@ /* Public Macros */ /*****************/ -/* Maximum length of a link's name */ -/* (encoded in a 32-bit unsigned integer) */ +/** + * \brief Maximum length of a link's name + * + * 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) */ -/* Macro to indicate operation occurs on same location */ +/** + * \brief Macro to indicate operation occurs on same location + */ #define H5L_SAME_LOC (hid_t)0 -/* Current version of the H5L_class_t struct */ +/** + * \brief Current version of the H5L_class_t struct + */ #define H5L_LINK_CLASS_T_VERS 1 #ifdef __cplusplus @@ -52,88 +59,123 @@ extern "C" { /* Public Typedefs */ /*******************/ -/* Link class types. - * Values less than 64 are reserved for the HDF5 library's internal use. - * Values 64 to 255 are for "user-defined" link class types; these types are - * defined by HDF5 but their behavior can be overridden by users. - * Users who want to create new classes of links should contact the HDF5 - * development team at help@hdfgroup.org. - * These values can never change because they appear in HDF5 files. +/** + * \brief Link class types. + * + * Values less than 64 are reserved for the HDF5 library's internal use. Values + * 64 to 255 are for "user-defined" link class types; these types are defined + * by HDF5 but their behavior can be overridden by users. Users who want to + * create new classes of links should contact the HDF5 development team at + * mailto:help@hdfgroup.org. These values can never change because they appear + * in HDF5 files. */ typedef enum { - H5L_TYPE_ERROR = (-1), /* Invalid link type id */ - H5L_TYPE_HARD = 0, /* Hard link id */ - H5L_TYPE_SOFT = 1, /* Soft link id */ - H5L_TYPE_EXTERNAL = 64, /* External link id */ - H5L_TYPE_MAX = 255 /* Maximum link type id */ + H5L_TYPE_ERROR = (-1), /**< Invalid link type id */ + H5L_TYPE_HARD = 0, /**< Hard link id */ + H5L_TYPE_SOFT = 1, /**< Soft link id */ + H5L_TYPE_EXTERNAL = 64, /**< External link id */ + H5L_TYPE_MAX = 255 /**< Maximum link type id */ } H5L_type_t; -/* Maximum value link value for "built-in" link types */ +/** + * \brief Maximum value link value for "built-in" link types + */ #define H5L_TYPE_BUILTIN_MAX H5L_TYPE_SOFT -/* Link ids at or above this value are "user-defined" link types. */ +/** + * \brief Link ids at or above this value are "user-defined" link types. + */ #define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL +/** + * \brief Maximum link id value for "user-defined" link types. + */ +#define H5L_TYPE_UD_MAX H5L_TYPE_MAX -/* Information struct for link (for H5Lget_info2/H5Lget_info_by_idx2) - * H5O_token_t version used in VOL layer and future public API calls +/** + * \brief Information struct for links */ +//! [H5L_info2_t_snip] typedef struct { - H5L_type_t type; /* Type of link */ - hbool_t corder_valid; /* Indicate if creation order is valid */ - int64_t corder; /* Creation order */ - H5T_cset_t cset; /* Character set of link name */ + H5L_type_t type; /**< Type of link */ + hbool_t corder_valid; /**< Indicate if creation order is valid */ + int64_t corder; /**< Creation order */ + H5T_cset_t cset; /**< Character set of link name */ union { - H5O_token_t token; /* Token of location that hard link points to */ - size_t val_size; /* Size of a soft link or UD link value */ + H5O_token_t token; /**< Token of location that hard link points to */ + 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 */ -/* Link creation callback */ +/** + * \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); - -/* Callback for when the link is moved */ +/** + * \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); - -/* Callback for when the link is copied */ +/** + * \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); - -/* Callback during link traversal */ +/** + * \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); - -/* Callback for when the link is deleted */ +/** + * \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); - -/* Callback for querying the link */ -/* Returns the size of the buffer needed */ +/** + * \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 */ + 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] -/* Prototype for H5Literate2/H5Literate_by_name2() operator - * H5O_token_t version used in VOL layer and future public API calls +/** + * \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] typedef herr_t (*H5L_iterate2_t)(hid_t group, const char *name, const H5L_info2_t *info, void *op_data); +//! [H5L_iterate2_t_snip] -/* Callback for external link traversal */ +/** + * \brief Callback for external link traversal + */ typedef herr_t (*H5L_elink_traverse_t)(const char *parent_file_name, const char *parent_group_name, const char *child_file_name, const char *child_object_name, unsigned *acc_flags, hid_t fapl_id, void *op_data); @@ -145,49 +187,1407 @@ typedef herr_t (*H5L_elink_traverse_t)(const char *parent_file_name, const char /*********************/ /* Public Prototypes */ /*********************/ +/** + * \ingroup H5L + * + * \brief Moves a link within an HDF5 file + * + * \fgdta_loc_id{src_loc} + * \param[in] src_name Original link name + * \fgdta_loc_id{dst_loc} + * \param[in] dst_name New link name + * \lcpl_id + * \lapl_id + * + * \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 + * accomplished as an atomic operation. + * + * \p src_loc and \p src_name identify the original link. + * \p src_loc is the original location identifier; \p src_name is + * the path to the link and is interpreted relative to \p src_loc. + * + * \p dst_loc and \p dst_name identify the new link. \p dst_loc is + * either a file or group identifier; \p dst_name is the path to + * the link and is interpreted relative to \p dst_loc. + * + * \p lcpl_id and \p lapl_id are the link creation and link access + * property lists, respectively, associated with the new link, + * \p dst_name. + * + * Through these property lists, several properties are available to + * govern the behavior of H5Lmove(). The property controlling creation + * of missing intermediate groups is set in the link creation property + * list with H5Pset_create_intermediate_group(); H5Lmove() ignores any + * other properties in the link creation property list. Properties + * controlling character encoding, link traversals, and external link + * prefixes are set in the link access property list with + * H5Pset_char_encoding(), H5Pset_nlinks(), and H5Pset_elink_prefix(), + * respectively. + * + * \note Note that H5Lmove() does not modify the value of the link; the new + * link points to the same object as the original link pointed to. + * Furthermore, if the object pointed to by the original link was already + * open with a valid object identifier, that identifier will remain valid + * after the call to H5Lmove(). + * + * \attention Exercise care in moving links as it is possible to render data in + * a file inaccessible with H5Lmove(). If the link being moved is on + * the only path leading to an HDF5 object, that object may become + * permanently inaccessible in the file. + * + * \since 1.8.0 + * + *------------------------------------------------------------------------- + */ H5_DLL herr_t H5Lmove(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Creates an identical copy of a link with the same creation time and + * target. The new link can have a different name and be in a different + * location than the original. + * + * \fgdt_loc_id{src_loc} + * \param[in] src_name Name of the link to be copied + * \fgdt_loc_id{dst_loc} + * \param[in] dst_name Name to be assigned to the new copy + * \lcpl_id + * \lapl_id + * \return \herr_t + * + * \details H5Lcopy() copies the link specified by \p src_name from the location + * specified by \p src_loc_id to the location specified by + * \p dst_loc_id. The new copy of the link is created with the name + * \p dst_name. + * + * If \p dst_loc_id is a file identifier, \p dst_name will be + * interpreted relative to that file’s root group. + * + * The new link is created with the creation and access property lists + * specified by \p lcpl_id and \p lapl_id. The interpretation of + * \p lcpl_id is limited in the manner described in the next paragraph. + * + * H5Lcopy() retains the creation time and the target of the original + * link. However, since the link may be renamed, the character + * encoding is that specified in \p lcpl_id rather than that of the + * original link. Other link creation properties are ignored. + * + * If the link is a soft link, also known as a symbolic link, its + * target is interpreted relative to the location of the copy. + * + * Several properties are available to govern the behavior of + * H5Lcopy(). These properties are set in the link creation and access + * property lists, \p lcpl_id and \p lapl_id, respectively. The + * property controlling creation of missing intermediate groups is set + * in the link creation property list with + * H5Pset_create_intermediate_group(); this function ignores any + * other properties in the link creation property list. Properties + * controlling character encoding, link traversals, and external link + * prefixes are set in the link access property list with + * H5Pset_char_encoding(), H5Pset_nlinks(), and + * H5Pset_elink_prefix(). + * + * \note H5Lcopy() does not affect the object that the link points to. + * + * \attention H5Lcopy() cannot copy hard links across files as a hard link is + * not valid without a target object; to copy objects from one file + * to another, see H5Ocopy(). + * + * \see H5Ocopy() + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Creates a hard link to an object + * + * \fgdta_loc_id{cur_loc} + * \param[in] cur_name Name of the target object, which must already exist + * \fgdta_loc_id{dst_loc} + * \param[in] dst_name The name of the new link + * \lcpl_id + * \lapl_id + * + * \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. + * + * \p cur_loc and \p cur_name specify the location + * and name, respectively, of the target object, i.e., the object that + * the new hard link points to. \p dst_loc and \p dst_name specify the + * location and name, respectively, of the new hard link. + * + * \p cur_name and \p dst_name are interpreted relative to \p cur_loc + * and \p dst_loc, respectively. If \p cur_loc and \p dst_loc are the + * same location, the HDF5 macro #H5L_SAME_LOC can be used for either + * parameter (but not both). + * + * \p lcpl_id and \p lapl_id are the link creation and access property + * lists associated with the new link. + * + * \note Hard and soft links are for use only if the target object is in the + * current file. If the desired target object is in a different file from + * the new link, an external link may be created with + * H5Lcreate_external(). + * + * \note The HDF5 library keeps a count of all hard links pointing to an + * object; if the hard link count reaches zero (0), the object will be + * deleted from the file. Creating new hard links to an object will + * prevent it from being deleted if other links are removed. The + * library maintains no similar count for soft links and they can dangle. + * + * \note The new link may be one of many that point to that object. + * + * \since 1.8.0 + * + */ 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 H5L + * + * \brief Creates a soft link + * + * \param[in] link_target An HDF5 path name + * \fgdta_loc_id{link_loc_id} + * \param[in] link_name The name of the new link + * \lcpl_id + * \lapl_id + * + * \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. + * + * \p link_target specifies the HDF5 path name the soft link contains. + * \p link_target can be an arbitrary HDF5 path name and is + * interpreted only at lookup time. This path may be absolute in the + * file or relative to \p link_loc_id. + * + * \p link_loc_id and \p link_name specify the location and name, + * respectively, of the new soft link. \p link_name is interpreted + * relative to \p link_loc_id and must contain only the name of the soft + * link; \p link_name may not contain any additional path elements. + * + * If \p link_loc_id is a group identifier, the object pointed to by + * \p link_name will be accessed as a member of that group. If + * \p link_loc_id is a file identifier, the object will be accessed as a + * member of the file's root group. + * + * \p lcpl_id and \p lapl_id are the link creation and access property + * lists associated with the new link. + * + * For instance, if target_path is \c ./foo, \p link_loc_id specifies + * \c ./x/y/bar, and the name of the new link is \c new_link, then a + * subsequent request for \c ./x/y/bar/new_link will return same the + * object as would be found at \c ./foo. + * + * \note H5Lcreate_soft() is for use only if the target object is in the + * current file. If the desired target object is in a different file from + * the new link, use H5Lcreate_external() to create an external link. + * + * \note Soft links and external links are also known as symbolic links as they + * use a name to point to an object; hard links employ an object’s + * address in the file. + * + * \note Unlike hard links, a soft link in an HDF5 file is allowed to dangle, + * meaning that the target object need not exist at the time that the + * link is created. + * + * \note The HDF5 library does not keep a count of soft links as it does of + * hard links. + * + * \note The new link may be one of many that point to that object. + * + * \see H5Lcreate_hard(), H5Lcreate_external() + * + * \since 1.8.0 + * + + */ 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 H5L + * + * \brief Removes a link from a group + * + * \fgdta_loc_id + * \param[in] name Name of the link to delete + * \lapl_id + * + * \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. + * + * If the link being removed is a hard link, H5Ldelete() also + * decrements the link count for the object to which name points. + * Unless there is a duplicate hard link in that group, this action + * removes the object to which name points from the group that + * previously contained it. + * + * Object headers keep track of how many hard links refer to an + * object; when the hard link count, also referred to as the reference + * count, reaches zero, the object can be removed from the file. The + * file space associated will then be released, i.e., identified in + * memory as freespace. Objects which are open are not removed until + * all identifiers to the object are closed. + * + * \attention Exercise caution in the use of H5Ldelete(); if the link being + * removed is on the only path leading to an HDF5 object, that + * object may become permanently inaccessible in the file. + * + * \see H5Lcreate_hard(), H5Lcreate_soft(), H5Lcreate_external() + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Removes the \Emph{n}-th link in a group + * + * \fgdta_loc_id + * \param[in] group_name Name of subject group + * \param[in] idx_type Index or field which determines the order + * \param[in] order Order within field or index + * \param[in] n Link for which to retrieve information + * \lapl_id + * + * \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. + * + * If \p loc_id specifies the group in which the link resides, + * \p group_name can be a dot (\c .). + * + * \see H5Ldelete() + * + * \since 1.8.0 + * + */ 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 H5L + * + * \brief Returns the value of a link + * + * \fgdta_loc_id + * \param[in] name Link name + * \param[out] buf The buffer to hold the link value + * \param[in] size Maximum number of bytes of link value to be returned + * \lapl_id + * + * \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 + * buffer. + * + * \p size is the size of \p buf and should be the size of the link + * value being returned. This size value can be determined through a + * call to H5Lget_info(); it is returned in the \c val_size field of + * the \ref H5L_info_t \c struct. + * + * If \p size is smaller than the size of the returned value, then the + * string stored in \p buf will be truncated to \p size bytes. For + * soft links, this means that the value will not be null terminated. + * + * In the case of external links, the target file and object names are + * extracted from \p buf by calling H5Lunpack_elink_val(). + * + * The link class of link \p name can be determined with a call to + * H5Lget_info(). + * + * \p lapl_id specifies the link access property list associated with + * the link \p name. In the general case, when default link access + * properties are acceptable, this can be passed in as #H5P_DEFAULT. An + * example of a situation that requires a non-default link access + * property list is when the link is an external link; an external + * link may require that a link prefix be set in a link access + * property list (see H5Pset_elink_prefix()). + * + * This function should be used only after H5Lget_info() has been + * called to verify that \p name is a symbolic link. This can be + * deteremined from the \c link_type field of the \ref H5L_info_t + * \c struct. + * + * \note This function will fail if called on a hard link. + * + * \see H5Lget_val_by_idx() + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf /*out*/, size_t size, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Retrieves value of the \Emph{n}-th link in a group, according to the order within an index + * + * \fgdta_loc_id + * \param[in] group_name Group name + * \param[in] idx_type Type of index + * \param[in] order Order within field or index + * \param[in] n Link position for which to retrieve information + * \param[out] buf The buffer to hold the link value + * \param[in] size Maximum number of bytes of link value to be returned + * \lapl_id + * + * \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. + * + * For soft links, the value is an HDF5 path name. + * + * For external links, this is a compound value containing file and + * path name information; to use this external link information, it + * must first be decoded with H5Lunpack_elink_val() + * + * For user-defined links, this value will be described in the + * definition of the user-defined link type. + * + * \p loc_id specifies the location identifier of the group specified + * by \p group_name. + * + * \p group_name specifies the group in which the link exists. If + * \p loc_id already specifies the group in which the link exists, + * \p group_name must be a dot (\c .). + * + * The size in bytes of link_val is specified in \p size. The size + * value can be determined through a call to H5Lget_info_by_idx(); it + * is returned in the \c val_size field of the \ref H5L_info_t + * \c struct. If + * size is smaller than the size of the returned value, then the + * string stored in link_val will be truncated to size bytes. For soft + * links, this means that the value will not be null terminated. + * + * If the type of the link is unknown or uncertain, H5Lget_val_by_idx() + * should be called only after the type has been determined via a call + * to H5Lget_info_by_idx(). + * + * \note This function will fail if called on a hard link. + * + * \see H5Lget_val() + * + * \since 1.8.0 + * + */ H5_DLL 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); +/** + * \ingroup H5L + * + * \brief Determines whether a link with the specified name exists in a group + * + * \fgdta_loc_id + * \param[in] name Link name + * \lapl_id + * + * \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. + * + * Note that H5Lexists() verifies only that the target link exists. If + * name includes either a relative path or an absolute path to the + * target link, intermediate steps along the path must be verified + * before the existence of the target link can be safely checked. If + * the path is not verified and an intermediate element of the path + * does not exist, H5Lexists() will fail. The example in the next + * paragraph illustrates one step-by-step method for verifying the + * existence of a link with a relative or absolute path. + * + * \Bold{Example:} Use the following steps to verify the existence of + * the link \c datasetD in the \c group group1/group2/softlink_to_group3/, + * where \c group1 is a member of the group specified by \c loc_id: + * + * 1. First use H5Lexists() to verify that \c group1 exists. + * 2. If \c group1 exists, use H5Lexists() again, this time with name + * set to \c group1/group2, to verify that \c group2 exists. + * 3. If \c group2 exists, use H5Lexists() with name set to + * \c group1/group2/softlink_to_group3 to verify that + * \c softlink_to_group3 exists. + * 4. If \c softlink_to_group3 exists, you can now safely use + * H5Lexists() with \c name set to + * \c group1/group2/softlink_to_group3/datasetD to verify that the + * target link, \c datasetD, exists. + * + * If the link to be verified is specified with an absolute path, the + * same approach should be used, but starting with the first link in + * the file’s root group. For instance, if \c datasetD were in + * \c /group1/group2/softlink_to_group3, the first call to H5Lexists() + * would have name set to \c /group1. + * + * Note that this is an outline and does not include all necessary + * details. Depending on circumstances, for example, you may need to + * verify that an intermediate link points to a group and that a soft + * link points to an existing target. + * + * \note The behavior of H5Lexists() was changed in the 1.10 release in the + * case where the root group, \c "/", is the name of the link. This + * change is described below: + * <ol> + * <li>Let \c file denote a valid HDF5 file identifier, and let \c lapl + * denote a valid link access property list identifier. A call to + * H5Lexists() with arguments \c file, \c "/", and \c lapl + * returns a positive value; in other words, + * \Code{H5Lexists(file, "/", lapl)} returns a positive value. + * In HDF5 version 1.8.16, this function returns 0.</li> + * <li>Let \c root denote a valid HDF5 group identifier that refers to the + * root group of an HDF5 file, and let \c lapl denote a valid link + * access property list identifier. A call to H5Lexists() with + * arguments c root, \c "/", and \c lapl returns a positive value; + * in other words, \Code{H5Lexists(root, "/", lapl)} returns a postive + * value. In HDF5 version 1.8.16, this function returns 0.</li> + * </ol> + * Note that the function accepts link names and path names. This is + * potentially misleading to callers, and we plan to separate the + * functionality for link names and path names in a future release. + * + * \attention H5Lexists() checks the existence of only the final element in a + * relative or absolute path; it does not check any other path + * elements. The function will therefore fail when both of the + * following conditions exist: + * - \c name is not local to the group specified by \c loc_id or, + * if \c loc_id is something other than a group identifier, \c name + * is not local to the root group. + * - Any element of the relative path or absolute path in name, + * except the target link, does not exist. + * + * \version 1.10.0 Function behavior changed in this release. (See the note.) + * \since 1.8.0 + * + */ H5_DLL htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id); -H5_DLL herr_t H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo /*out*/, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Returns information about a link + * + * \fgdta_loc_id + * \param[in] name Link name + * \param[out] linfo Buffer in which link information is returned + * \lapl_id + * + * \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. + * + * The location identifier, \p loc_id, specifies the location of the + * link. A link name, \p name, interpreted relative to \p loc_id, + * specifies the link being queried. + * + * \p lapl_id is the link access property list associated with the + * link name. In the general case, when default link access properties + * are acceptable, this can be passed in as #H5P_DEFAULT. An example + * of a situation that requires a non-default link access property + * list is when the link is an external link; an external link may + * require that a link prefix be set in a link access property list + * (see H5Pset_elink_prefix()). + * + * H5Lget_info2() returns information about name in the data structure + * H5L_info2_t, which is described below and defined in H5Lpublic.h. + * This structure is returned in the buffer \p linfo. + * \snippet this H5L_info2_t_snip + * In the above struct, \c type specifies the link class. Valid values + * include the following: + * \link_types + * There will be additional valid values if user-defined links have + * been registered. + * + * \p corder specifies the link’s creation order position while + * \p corder_valid indicates whether the value in corder is valid. + * + * If \p corder_valid is \c TRUE, the value in \p corder is known to + * be valid; if \p corder_valid is \c FALSE, the value in \p corder is + * presumed to be invalid; \p corder starts at zero (0) and is + * incremented by one (1) as new links are created. But + * higher-numbered entries are not adjusted when a lower-numbered link + * is deleted; the deleted link's creation order position is simply + * left vacant. In such situations, the value of \p corder for the + * last link created will be larger than the number of links remaining + * in the group. + * + * \p cset specifies the character set in which the link name is + * encoded. Valid values include the following: + * \csets + * This value is set with H5Pset_char_encoding(). + * + * \c token is the location that a hard link points to, and + * \c val_size is the size of a soft link or user defined link value. + * H5O_token_t is used in the VOL layer. It is defined in H5public.h + * as: + * \snippet H5public.h H5O_token_t_snip + * + * If the link is a symbolic link, \c val_size will be the length of + * the link value, e.g., the length of the HDF5 path name with a null + * terminator. + * + * \since 1.12.0 + * + */ +H5_DLL herr_t H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Retrieves metadata for a link in a group, according to the order + * within a field or index + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in] n Link position for which to retrieve information + * \param[out] linfo Buffer in which link information is returned + * \lapl_id + * + * \return \herr_t + * + * \details H5get_info_by_idx2() returns the metadata for a link in a group + * according to a specified field or index and a specified order. The + * link for which information is to be returned is specified by \p + * idx_type, \p order, and \p n as follows: + * + * - \p idx_type specifies the field by which the links in \p + * group_name are ordered. The links may be indexed on this field, + * in which case operations seeking specific links are likely to + * complete more quickly. + * - \p order specifies the order in which + * the links are to be referenced for the purposes of this function. + * - \p n specifies the position of the subject link. Note that this + * count is zero-based; 0 (zero) indicates that the function will + * return the value of the first link; if \p n is 5, the function + * will return the value of the sixth link; etc. + * + * For example, assume that \p idx_type, \p order, and \p n are + * #H5_INDEX_NAME, #H5_ITER_DEC, and 5, respectively. #H5_INDEX_NAME + * indicates that the links are accessed in lexicographic order by + * their names. #H5_ITER_DEC specifies that the list be traversed in + * reverse order, or in decremented order. And 5 specifies that this + * call to the function will return the metadata for the 6th link + * (\c n + 1) from the end. + * + * See H5Literate2() for a list of valid values and further discussion + * regarding \p idx_type and \p order. + * + * If \p loc_id specifies the group in which the link resides, + * \p group_name can be a dot (\c .). + * + * \since 1.12.0 + * + * \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 /*out*/, - hid_t lapl_id); + H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Retrieves name of the \Emph{n}-th link in a group, according to the + * order within a specified field or index + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in] n Link position for which to retrieve information + * \param[out] name Buffer in which link name is returned + * \param[in] size Size in bytes of \p name + * \lapl_id + * + * \return Returns the size of the link name if successful; otherwise returns a + * negative value. + * + * \details H5get_name_by_idx() retrieves the name of the \Emph{n}-th link in a + * group, according to the specified order, \p order, within a specified + * field or index, \p idx_type. + * + * \p idx_type specifies the index that is used. Valid values include + * the following: + * \indexes + * + * \p order specifies the order in which objects are inspected along + * the index specified in \p idx_type. Valid values include the + * following: + * \orders + * + * If \p loc_id specifies the group in which the link resides, + * \p group_name can be a dot (\c .). + * + * The size in bytes of name is specified in \p size. If \p size is + * unknown, it can be determined via an initial H5Lget_name_by_idx() + * call with name set to NULL; the function's return value will be the + * size of the name. + * + * \note Please note that in order for the specified index to correspond to the + * creation order index, \p order must be set to #H5_ITER_INC or + * #H5_ITER_DEC when calling H5Lget_name_by_idx(). \note The index \p n + * passed to H5Lget_name_by_idx() is the index of the link within the + * link table, sorted according to \p order and \p idx_type. If order is + * #H5_ITER_NATIVE, then the link table is not sorted, and it does not + * matter what \p idx_type is. Specifying #H5_ITER_NATIVE does not + * guarantee any particular order, only that it remains consistent. + * + * \since 1.8.0 + * + */ H5_DLL 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); -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); -H5_DLL 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, H5L_iterate2_t op, void *op_data, - hid_t lapl_id); -H5_DLL herr_t H5Lvisit2(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, - void *op_data); -H5_DLL 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); - +/** + * \ingroup TRAV + * + * \brief Iterates over links in a group, with user callback routine, + * according to the order within an index. + * + * \group_id{grp_id} + * \idx_type + * \order + * \param[in,out] idx Pointer to an iteration index to allow + * continuing a previous iteration + * \op + * \op_data + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \details H5Literate2() iterates through the links in a file or + * group, \p group_id, in the order of the specified + * index, \p idx_type, using a user-defined callback routine + * \p op. H5Literate2() does not recursively follow links into + * subgroups of the specified group. + * + * Three parameters are used to manage progress of the iteration: + * \p idx_type, \p order, and \p idx_p. + * + * \p idx_type specifies the index to be used. If the links 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. + * + * \p order specifies the order in which objects are to be inspected + * along the index \p idx_type. + * + * \p idx_p tracks the iteration and allows an iteration to be + * resumed if it was stopped before all members were processed. It is + * passed in by the application with a starting point and returned by + * the library with the point at which the iteration stopped. + * + * \p op_data is a user-defined pointer to the data required to + * process links in the course of the iteration. This pointer is + * passed back to each step of the iteration in the \p op callback + * function's \p op_data parameter. \p op is invoked for each link + * encounter. + * + * \p op_data is passed to and from each iteration and can be used to + * supply or aggregate information across iterations. + * + * \remark Same pattern of behavior as H5Giterate(). + * + * \note This function is also available through the H5Literate() macro. + * + * \warning The behavior of H5Literate2() is undefined if the link + * membership of \p group_id changes during the iteration. + * This does not limit the ability to change link destinations + * while iterating, but caution is advised. + * + * + * \since 1.12.0 + * + * \see H5Literate_by_name2(), H5Lvisit2(), H5Lvisit_by_name2() + * + */ +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 TRAV + * + * \brief Iterates through links in a group + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in,out] idx iteration position at which to start (\Emph{IN}) or + * position at which an interrupted iteration may be restarted + * (\Emph{OUT}) + * \op + * \op_data + * \lapl_id + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \details H5Literate_by_name2() iterates through the links in a group + * specified by \p loc_id and \p group_name, in the order of the + * specified index, \p idx_type, using a user-defined callback routine + * \p op. H5Literate_by_name2() does not recursively follow links into + * subgroups of the specified group. + * + * \p idx_type specifies the index to be used. If the links 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 + * + * \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 + * + * \p idx_p allows an interrupted iteration to be resumed; it is + * passed in by the application with a starting point and returned by + * the library with the point at which the iteration stopped. + * + * \note H5Literate_by_name2() is not recursive. In particular, if a member of + * \p group_name is found to be a group, call it \c subgroup_a, + * H5Literate_by_name2() does not examine the members of \c subgroup_a. + * When recursive iteration is required, the application must handle the + * recursion, explicitly calling H5Literate_by_name2() on discovered + * subgroups. + * + * \note H5Literate_by_name2() assumes that the membership of the group being + * iterated over remains unchanged through the iteration; if any of the + * links in the group change during the iteration, the function’s + * behavior is undefined. Note, however, that objects pointed to by the + * links can be modified. + * + * \note H5Literate_by_name2() is the same as H5Literate2(), except that + * H5Literate2() always proceeds in alphanumeric order. + * + * \since 1.12.0 + * + * \see H5Literate(), H5Lvisit() + * + */ +H5_DLL 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, H5L_iterate2_t op, void *op_data, + hid_t lapl_id); +/** + * \ingroup TRAV + * + * \brief Recursively visits all links starting from a specified group + * + * \group_id{grp_id} + * \idx_type + * \order + * \op + * \op_data + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \details H5Lvisit2() is a recursive iteration function to visit all links in + * and below a group in an HDF5 file, thus providing a mechanism for + * an application to perform a common set of operations across all of + * those links or a dynamically selected subset. For non-recursive + * iteration across the members of a group, see H5Literate2(). + * + * The group serving as the root of the iteration is specified by its + * group or file identifier, \p group_id. + * + * Two parameters are used to establish the iteration: \p idx_type and + * \p order. + * + * \p idx_type specifies the index to be used. If the links 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 + * + * Note that the index type passed in \p idx_type is a best effort + * setting. If the application passes in a value indicating iteration + * in creation order and a group is encountered that was not tracked + * in creation order, that group will be iterated over in + * lexicographic order by name, or name order. (Name order is the + * native 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 + * + * \p op is a callback function of type \ref H5L_iterate2_t that is invoked + * for each link encountered. + * \snippet this H5L_iterate2_t_snip + * + * The \ref H5L_info2_t struct is defined (in H5Lpublic.h) as follows: + * \snippet this H5L_info2_t_snip + * + * The possible return values from the callback function, and the + * effect of each, are as follows: + * \li Zero causes the visit iterator to continue, returning zero when + * all group members have been processed. + * \li A positive value causes the visit iterator to immediately + * return that positive value, indicating short-circuit success. + * \li A negative value causes the visit iterator to immediately + * return that value, indicating failure. + * + * The H5Lvisit2() \p op_data parameter is a user-defined pointer to + * the data required to process links in the course of the iteration. + * This pointer is passed back to each step of the iteration in the + * \p op callback function's \p op_data parameter. + * + * H5Lvisit2() and H5Ovisit2() are companion functions: one for + * examining and operating on links; the other for examining and + * operating on the objects that those links point to. Both functions + * ensure that by the time the function completes successfully, every + * link or object below the specified point in the file has been + * presented to the application for whatever processing the + * application requires. + * + * \since 1.12.0 + * + * \see H5Literate() + * + */ +H5_DLL herr_t H5Lvisit2(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate2_t op, + void *op_data); +/** + * \ingroup TRAV + * + * \brief Recursively visits all links starting from a specified group + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \op + * \op_data + * \lapl_id + * + * \return \herr_t + * + * \details H5Lvisit_by_name2() is a recursive iteration function to visit all + * links in and below a group in an HDF5 file, thus providing a + * mechanism for an application to perform a common set of operations + * across all of those links or a dynamically selected subset. For + * non-recursive iteration across the members of a group, see + * H5Literate2(). + * + * The group serving as the root of the iteration is specified by the + * \p loc_id / \p group_name parameter pair. \p loc_id specifies a + * file or group; group_name specifies either a group in the file + * (with an absolute name based in the file’s root group) or a group + * relative to \p loc_id. If \p loc_id fully specifies the group that + * is to serve as the root of the iteration, group_name should be '.' + * (a dot). (Note that when \p loc_id fully specifies the the group + * that is to serve as the root of the iteration, the user may wish to + * consider using H5Lvisit2() instead of H5Lvisit_by_name2().) + * + * Two parameters are used to establish the iteration: \p idx_type and + * \p order. + * + * \p idx_type specifies the index to be used. If the links 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 unnecesary, so the iteration may + * begin more quickly. Valid values include the following: + * \indexes + * + * Note that the index type passed in \p idx_type is a best effort + * setting. If the application passes in a value indicating iteration + * in creation order and a group is encountered that was not tracked + * in creation order, that group will be iterated over in + * lexicographic order by name, or name order. (Name order is the + * native 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 \p op callback function, the related \ref H5L_info2_t + * \c struct, and the effect that the callback function's return value + * has on the application are described in H5Lvisit2(). + * + * The H5Lvisit_by_name2() \p op_data parameter is a user-defined + * pointer to the data required to process links 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. + * + * \p lapl_id is a link access property list. In the general case, + * when default link access properties are acceptable, this can be + * passed in as #H5P_DEFAULT. An example of a situation that requires + * a non-default link access property list is when the link is an + * external link; an external link may require that a link prefix be + * set in a link access property list (see H5Pset_elink_prefix()). + * + * H5Lvisit_by_name2() and H5Ovisit_by_name2() are companion + * functions: one for examining and operating on links; the other for + * examining and operating on the objects that those links point to. + * Both functions ensure that by the time the function completes + * successfully, every link or object below the specified point in the + * file has been presented to the application for whatever processing + * the application requires. + * + * \since 1.12.0 + * + */ +H5_DLL 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); /* UD link functions */ +/** + * \ingroup H5L + * + * \brief Creates a link of a user-defined type + * + * \loc_id{link_loc_id} + * \param[in] link_name Link name + * \param[in] link_type User-defined link class + * \param[in] udata User-supplied link information + * \param[in] udata_size Size of udata buffer + * \lcpl_id + * \lapl_id + * + * \return \herr_t + * + * \details H5Lcreate_ud() creates a link of user-defined type \p link_type + * named \p link_name at the location specified in \p link_loc_id with + * user-specified data \p udata. + * + * \p link_name is interpreted relative to \p link_loc_id. + * + * Valid values for the link class of the new link, \p link_type, + * include #H5L_TYPE_EXTERNAL and any user-defined link classes that + * have been registered with the library. See H5Lregister() for + * further information. + * + * The format of the information pointed to by \p udata is defined by + * the user. \p udata_size specifies the size of the \p udata buffer. + * \p udata may be NULL if \p udata_size is zero (0). + * + * The property lists specified by \p lcpl_id and \p lapl_id specify + * properties used to create and access the link. + * + * \note The external link type, #H5L_TYPE_EXTERNAL, included in the HDF5 + * library distribution, is implemented as a user-defined link type. This + * was done, in part, to provide a model for the implementation of other + * user-defined links. + * + * \since 1.8.0 + * + */ H5_DLL 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); +/** + * \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 + * + * \return \htri_t + * + * \details H5Lis_registered() tests whether a user-defined link class is + * currently registered, either by the HDF5 library or by the user + * through the use of H5Lregister(). + * + * \note A link class must be registered to create new links of that type or to + * traverse existing links of that type. + * + * \since 1.8.0 + * + */ H5_DLL htri_t H5Lis_registered(H5L_type_t id); /* External link functions */ +/** + * \ingroup H5L + * + * \brief Decodes external link information + * + * \param[in] ext_linkval Buffer containing external link information + * \param[in] link_size Size, in bytes, of the \p ext_linkval buffer + * \param[out] flags External link flags, packed as a bitmap (\Emph{Reserved as + * a bitmap for flags; no flags are currently defined, so the + * only valid value * is 0.}) + * \param[out] filename Returned filename \param[out] obj_path Returned + * object path, relative to \p filename + * + * \return \herr_t + * + * \details H5Lunpack_elink_val() decodes the external link information + * returned by H5Lget_val() in the \p ext_linkval buffer. + * + * \p ext_linkval should be the buffer set by H5Lget_val() and will + * consist of two NULL-terminated strings, the filename and object + * path, one after the other. + * + * Given this buffer, H5Lunpack_elink_val() creates pointers to the + * filename and object path within the buffer and returns them in + * \p filename and \p obj_path, unless they are passed in as NULL. + * + * H5Lunpack_elink_val() requires that \p ext_linkval contain a + * concatenated pair of null-terminated strings, so use of this + * function on a string that is not an external link \p udata buffer + * may result in a segmentation fault. This failure can be avoided by + * adhering to the following procedure: + * <ol> + * <li>Call H5Lget_info() to get the link type and the size of the + * link value.<li> + * <li>Verify that the link is an external link, i.e., that its link + * type is #H5L_TYPE_EXTERNAL.</li> + * <li>Call H5Lget_val() to get the link value.</li> + * <li>Call H5Lunpack_elink_val() to unpack that value.</li> + * </ol> + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lunpack_elink_val(const void *ext_linkval /*in*/, size_t link_size, unsigned *flags, const char **filename /*out*/, const char **obj_path /*out*/); +/** + * \ingroup H5L + * + * \brief Creates an external link, a soft link to an object in a different file. + * + * \param[in] file_name Name of the target file containing the target object. + * \param[in] obj_name Path within the target file to the target object + * \fgdt_loc_id{link_loc_id} + * \param[in] link_name Name of the new link, relative to \p link_loc_id + * \lcpl_id + * \lapl_id + * \return \herr_t + * + * \details H5Lcreate_external() creates a new external link. An external link + * is a soft link to an object in a different HDF5 file from the + * location of the link, i.e., to an external object. + * + * \p file_name identifies the target file containing the target + * object; \p obj_name specifies the path of the target object within + * that file. \p obj_name must be an absolute pathname in + * \p file_name, i.e., it must start at the target file’s root group, + * but it is not interpreted until an application attempts to traverse + * it. + * + * \p link_loc_id and \p link_name specify the location and name, + * respectively, of the new link. \p link_name is interpreted relative + * to \p link_loc_id. + * + * \p lcpl_id is the link creation property list used in creating the + * new link. + * + * \p lapl_id is the link access property list used in traversing the + * new link. Note that an external file opened by the traversal of an + * external link is always opened with the weak file close degree + * property setting, #H5F_CLOSE_WEAK (see H5Pset_fclose_degree()); + * any file close degree property setting in \p lapl_id is ignored. + * + * An external link behaves similarly to a soft link, and like a soft + * link in an HDF5 file, it may dangle: the target file and object + * need not exist at the time that the external link is created. + * + * When the external link \p link_name is accessed, the library will + * search for the target file \p file_name as described below: + * + * - If \p 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_EXT_PREFIX and will try to prepend each prefix + * to \p file_name to form a new \p file_name. + * - If the new \p file_name does not exist or if \c HDF5_EXT_PREFIX + * is not set, the library will get the prefix set via + * H5Pset_elink_prefix() and prepend it to \p file_name to form a + * new \p file_name. + * - If the new \p file_name does not exist or no prefix is being + * set by H5Pset_elink_prefix(), then the path of the file + * associated with \p link_loc_id 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 file_name to form a new + * \p file_name. + * - If the new \p file_name does not exist, then the library will + * look for \p file_name and will return failure/success + * accordingly. + * - If \p file_name is an absolute pathname, the library will first + * try to find \p file_name. If \p file_name does not exist, + * \p file_name is stripped of directory paths to form a new + * \p file_name. The search for the new \p file_name then follows + * the same steps as described above for a relative pathname. See + * examples below illustrating how target_file_name is stripped to + * form a new \p file_name. + * + * Note that \p file_name is considered to be an absolute pathname + * when the following condition is true: + * + * - For Unix, the first character of \p file_name is a slash (\c /). + * For example, consider a \p file_name of \c /tmp/A.h5. + * If that target file does not exist, the new \p file_name after + * stripping will be \c A.h5. + * - For Windows, there are 6 cases: + * -# \p file_name is an absolute drive with absolute pathname. + * For example, consider a \p file_name of \c /tmp/A.h5. If that + * target file does not exist, the new \p file_name after + * stripping will be \c A.h5. + * -# \p file_name is an absolute pathname without specifying drive + * name. For example, consider a \p file_name of \c /tmp/A.h5. + * If that target file does not exist, the new \p file_name after + * stripping will be \c A.h5. + * -# \p file_name is an absolute drive with relative pathname. + * For example, consider a \p file_name of \c /tmp/A.h5. If that + * target file does not exist, the new \p file_name after + * stripping will be \c tmp\A.h5. + * -# \p file_name is in UNC (Uniform Naming Convention) format with + * server name, share name, and pathname. For example, consider + * a \p file_name of \c /tmp/A.h5. If that target file does not + * exist, the new \p file_name after stripping will be \c A.h5. + * -# \p file_name is in Long UNC (Uniform Naming Convention) format + * with server name, share name, and pathname. For example, + * consider a \p file_name of \c /tmp/A.h5. If that target file + * does not exist, the new \p file_name after stripping will be + * \c A.h5. + * -# \p file_name is in Long UNC (Uniform Naming Convention) format + * with an absolute drive and an absolute pathname. For example, + * consider a \p file_name of \c /tmp/A.h5. If that target file + * does not exist, the new \p file_name after stripping will be + * \c A.h5. + * + * The library opens target file \p file_name with the file access + * property list that is set via H5Pset_elink_fapl() when the external + * link link_name is accessed. If no such property list is set, the + * library uses the file access property list associated with the file + * of \p link_loc_id to open the target file. + * + * If an application requires additional control over file access + * flags or the file access property list, see H5Pset_elink_cb(); this + * function enables the use of an external link callback function as + * described in H5L_elink_traverse_t(). + * + * \attention A file close degree property setting (H5Pset_fclose_degree()) in + * the external link file access property list or in the external + * link callback function will be ignored. A file opened by means of + * traversing an external link is always opened with the weak file + * close degree property setting, #H5F_CLOSE_WEAK . + * + * \see H5Lcreate_hard(), H5Lcreate_soft(), H5Lcreate_ud() + * + * \since 1.8.0 + */ 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); @@ -205,49 +1605,507 @@ H5_DLL herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hi /* Typedefs */ /* Information struct for link (for H5Lget_info1/H5Lget_info_by_idx1) */ +//! [H5L_info1_t_snip] typedef struct { - H5L_type_t type; /* Type of link */ - hbool_t corder_valid; /* Indicate if creation order is valid */ - int64_t corder; /* Creation order */ - H5T_cset_t cset; /* Character set of link name */ + H5L_type_t type; /**< Type of link */ + hbool_t corder_valid; /**< Indicate if creation order is valid */ + int64_t corder; /**< Creation order */ + H5T_cset_t cset; /**< Character set of link name */ union { - haddr_t address; /* Address hard link points to */ - size_t val_size; /* Size of a soft link or UD link value */ + haddr_t address; /**< Address hard link points to */ + 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 */ +/** 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 */ +/** 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 */ + 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; -/* Prototype for H5Literate1/H5Literate_by_name1() operator */ +/** Prototype for H5Literate1() / H5Literate_by_name1() operator */ +//! [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] /* Function prototypes */ +/** + * \ingroup H5L + * + * \brief Returns information about a link + * + * \fgdta_loc_id + * \param[in] name Link name + * \param[out] linfo Buffer in which link information is returned + * \lapl_id + * + * \return \herr_t + * + * \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. + * + * The location identifier, \p loc_id, specifies the location of the + * link. A link name, \p name, interpreted relative to \p loc_id, + * specifies the link being queried. + * + * \p lapl_id is the link access property list associated with the + * link \p name. In the general case, when default link access + * properties are acceptable, this can be passed in as #H5P_DEFAULT. + * An example of a situation that requires a non-default link access + * property list is when the link is an external link; an external + * link may require that a link prefix be set in a link access + * property list (see H5Pset_elink_prefix()). + * + * H5Lget_info1() returns information about name in the data structure + * \ref H5L_info1_t, which is described below and defined in + * H5Lpublic.h. This structure is returned in the buffer \p linfo. + * \snippet this H5L_info1_t_snip + * In the above struct, type specifies the link class. Valid values + * include the following: + * \link_types + * There will be additional valid values if user-defined links have + * been registered. + * + * \c corder specifies the link’s creation order position while + * \c corder_valid indicates whether the value in \c corder is valid. + * + * If \c corder_valid is \c TRUE, the value in \c corder is known to + * be valid; if \c corder_valid is \c FALSE, the value in \c corder is + * presumed to be invalid; + * + * \c corder starts at zero (0) and is incremented by one (1) as new + * links are created. But higher-numbered entries are not adjusted + * when a lower-numbered link is deleted; the deleted link’s creation + * order position is simply left vacant. In such situations, the value + * of \c corder for the last link created will be larger than the + * number of links remaining in the group. + * + * \c cset specifies the character set in which the link name is + * encoded. Valid values include the following: + * \csets + * This value is set with H5Pset_char_encoding(). + * + * \c address and \c val_size are returned for hard and symbolic + * links, respectively. Symbolic links include soft and external links + * and some user-defined links. + * + * If the link is a hard link, \c address specifies the file address + * that the link points to. + * + * If the link is a symbolic link, \c val_size will be the length of + * the link value, e.g., the length of the HDF5 path name with a null + * terminator. + * + * \version 1.12.0 Function was deprecated. + * \version 1.8.2 Fortran subroutine added in this release. + * \version 1.8.4 Fortran subroutine syntax changed in this release. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lget_info1(hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t lapl_id); +/** + * \ingroup H5L + * + * \brief Retrieves metadata for a link in a group, according to the order + * within a field or index + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in] n Link position for which to retrieve information + * \param[out] linfo Buffer in which link information is returned + * \lapl_id + * + * \return \herr_t + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Lget_info_by_idx2() and the macro + * H5Lget_info_by_idx(). + * + * \details H5get_info_by_idx1() returns the metadata for a link in a group + * according to a specified field or index and a specified order. + * + * The link for which information is to be returned is specified by \p + * idx_type, \p order, and \p n as follows: + * + * - \p idx_type specifies the field by which the links in \p + * group_name are ordered. The links may be indexed on this field, + * in which case operations seeking specific links are likely to + * complete more quickly. + * - \p order specifies the order in which + * the links are to be referenced for the purposes of this function. + * - \p n specifies the position of the subject link. Note that this + * count is zero-based; 0 (zero) indicates that the function will + * return the value of the first link; if \p n is 5, the function + * will return the value of the sixth link; etc. + * + * For example, assume that \p idx_type, \p order, and \p n are + * #H5_INDEX_NAME, #H5_ITER_DEC, and 5, respectively. #H5_INDEX_NAME + * indicates that the links are accessed in lexicographic order by + * their names. #H5_ITER_DEC specifies that the list be traversed in + * reverse order, or in decremented order. And 5 specifies that this + * call to the function will return the metadata for the 6th link + * (\c n + 1) from the end. + * + * See H5Literate1() for a list of valid values and further discussion + * regarding \p idx_type and \p order. + * + * If \p loc_id specifies the group in which the link resides, + * \p group_name can be a dot (\c .). + * + * \version 1.12.0 Function was renamed to H5Lget_index_by_idx1() and deprecated. + * \version 1.8.4 Fortran subroutine syntax changed in this release. + * \version 1.8.2 Fortran subroutine added in this release. + * + * \since 1.8.0 + * + */ H5_DLL 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); +/** + * \ingroup TRAV + * + * \brief Iterates over links in a group, with user callback routine, + * according to the order within an index. + * + * \group_id{grp_id} + * \idx_type + * \order + * \param[in,out] idx Pointer to an iteration index to allow + * continuing a previous iteration + * \op + * \op_data + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \deprecated Deprecated in favor of H5Literate2(). + * + * \details H5Literate1() iterates through the links in a file or + * group, \p group_id, in the order of the specified + * index, \p idx_type, using a user-defined callback routine + * \p op. H5Literate1() does not recursively follow links into + * subgroups of the specified group. + * + * Three parameters are used to manage progress of the iteration: + * \p idx_type, \p order, and \p idx_p. + * + * \p idx_type specifies the index to be used. If the links 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. + * + * \p order specifies the order in which objects are to be inspected + * along the index \p idx_type. + * + * \p idx_p tracks the iteration and allows an iteration to be + * resumed if it was stopped before all members were processed. It is + * passed in by the application with a starting point and returned by + * the library with the point at which the iteration stopped. + * + * \p op_data is a user-defined pointer to the data required to + * process links in the course of the iteration. This pointer is + * passed back to each step of the iteration in the \p op callback + * function's \p op_data parameter. \p op is invoked for each link + * encounter. + * + * \p op_data is passed to and from each iteration and can be used to + * supply or aggregate information across iterations. + * + * \remark Same pattern of behavior as H5Giterate(). + * + * \note This function is also available through the H5Literate() macro. + * + * \warning The behavior of H5Literate1() is undefined if the link + * membership of \p group_id changes during the iteration. + * This does not limit the ability to change link destinations + * while iterating, but caution is advised. + * + * + * \version 1.12.0 Function was deprecated in this release. + * \since 1.8.0 + * + * \see H5Literate_by_name2(), H5Lvisit2(), H5Lvisit_by_name2() + * + */ H5_DLL herr_t H5Literate1(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5L_iterate1_t op, void *op_data); +/** + * \ingroup TRAV + * + * \brief Iterates through links in a group by its name + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \param[in,out] idx iteration position at which to start (\Emph{IN}) or + * position at which an interrupted iteration may be restarted + * (\Emph{OUT}) + * \op + * \op_data + * \lapl_id + * + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Literate_by_name2() or the macro + * H5Literate_by_name(). + * + * \details H5Literate_by_name1() iterates through the links in a group + * specified by \p loc_id and \p group_name, in the order of the + * specified index, \p idx_type, using a user-defined callback routine + * \p op. H5Literate_by_name1() does not recursively follow links into + * subgroups of the specified group. + * + * \p idx_type specifies the index to be used. If the links 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 + * + * \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 + * + * \p idx allows an interrupted iteration to be resumed; it is + * passed in by the application with a starting point and returned by + * the library with the point at which the iteration stopped. + * + * \note H5Literate_by_name1() is not recursive. In particular, if a member of + * \p group_name is found to be a group, call it \c subgroup_a, + * H5Literate_by_name1() does not examine the members of \c subgroup_a. + * When recursive iteration is required, the application must handle the + * recursion, explicitly calling H5Literate_by_name1() on discovered + * subgroups. + * + * \note H5Literate_by_name1() assumes that the membership of the group being + * iterated over remains unchanged through the iteration; if any of the + * links in the group change during the iteration, the function’s + * behavior is undefined. Note, however, that objects pointed to by the + * links can be modified. + * + * \note H5Literate_by_name1() is the same as H5Giterate(), except that + * H5Giterate() always proceeds in lexicographic order. + * + * \version 1.12.0 Function H5Literate_by_name() was renamed to + * H5Literate_by_name1() and deprecated. + * \version 1.8.8 Fortran subroutine added. + * + * \since 1.8.0 + * + */ H5_DLL 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, H5L_iterate1_t op, void *op_data, hid_t lapl_id); +/** + * \ingroup TRAV + * + * \brief Recursively visits all links starting from a specified group + * + * \group_id{grp_id} + * \idx_type + * \order + * \op + * \op_data + * + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Lvisit2() or the macro H5Lvisit(). + * + * \details H5Lvisit1() is a recursive iteration function to visit all links in + * and below a group in an HDF5 file, thus providing a mechanism for + * an application to perform a common set of operations across all of + * those links or a dynamically selected subset. For non-recursive + * iteration across the members of a group, see H5Literate1(). + * + * The group serving as the root of the iteration is specified by its + * group or file identifier, \p group_id. + * + * Two parameters are used to establish the iteration: \p idx_type and + * \p order. + * + * \p idx_type specifies the index to be used. If the links 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 + * + * Note that the index type passed in \p idx_type is a best effort + * setting. If the application passes in a value indicating iteration + * in creation order and a group is encountered that was not tracked + * in creation order, that group will be iterated over in + * lexicographic order by name, or name order. (Name order is the + * native 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 + * + * \p op is a callback function of type \ref H5L_iterate1_t that is invoked + * for each link encountered. + * \snippet this H5L_iterate1_t_snip + * + * The \ref H5L_info1_t struct is defined (in H5Lpublic.h) as follows: + * \snippet this H5L_info1_t_snip + * + * The possible return values from the callback function, and the + * effect of each, are as follows: + * \li Zero causes the visit iterator to continue, returning zero when + * all group members have been processed. + * \li A positive value causes the visit iterator to immediately + * return that positive value, indicating short-circuit success. + * \li A negative value causes the visit iterator to immediately + * return that value, indicating failure. + * + * The H5Lvisit1() \p op_data parameter is a user-defined pointer to + * the data required to process links in the course of the iteration. + * This pointer is passed back to each step of the iteration in the + * \p op callback function's \p op_data parameter. + * + * H5Lvisit1() and H5Ovisit1() are companion functions: one for + * examining and operating on links; the other for examining and + * operating on the objects that those links point to. Both functions + * ensure that by the time the function completes successfully, every + * link or object below the specified point in the file has been + * presented to the application for whatever processing the + * application requires. + * + * \version 1.12.0 Function was renamed from H5Lvisit() to H5Lvisit1() and + * deprecated. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Lvisit1(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate1_t op, void *op_data); +/** + * \ingroup TRAV + * + * \brief Recursively visits all links starting from a specified group + * + * \loc_id + * \param[in] group_name Group name + * \idx_type + * \order + * \op + * \op_data + * \lapl_id + * + * \return \success{The return value of the first operator that returns + * non-zero, or zero if all members were processed with no + * operator returning non-zero.} + * \return \failure{Negative if an error occurs in the library, or the negative + * value returned by one of the operators.} + * + * \deprecated As of HDF5-1.12 this function has been deprecated in favor of + * the function H5Lvisit_by_name2() or the macro H5Lvisit_by_name(). + * + * \details H5Lvisit_by_name1() is a recursive iteration function to visit all + * links in and below a group in an HDF5 file, thus providing a + * mechanism for an application to perform a common set of operations + * across all of those links or a dynamically selected subset. For + * non-recursive iteration across the members of a group, see + * H5Literate1(). + * + * The group serving as the root of the iteration is specified by the + * \p loc_id / \p group_name parameter pair. \p loc_id specifies a + * file or group; group_name specifies either a group in the file + * (with an absolute name based in the file’s root group) or a group + * relative to \p loc_id. If \p loc_id fully specifies the group that + * is to serve as the root of the iteration, group_name should be '.' + * (a dot). (Note that when \p loc_id fully specifies the the group + * that is to serve as the root of the iteration, the user may wish to + * consider using H5Lvisit1() instead of H5Lvisit_by_name1().) + * + * Two parameters are used to establish the iteration: \p idx_type and + * \p order. + * + * \p idx_type specifies the index to be used. If the links 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 unnecesary, so the iteration may + * begin more quickly. Valid values include the following: + * \indexes + * + * Note that the index type passed in \p idx_type is a best effort + * setting. If the application passes in a value indicating iteration + * in creation order and a group is encountered that was not tracked + * in creation order, that group will be iterated over in + * lexicographic order by name, or name order. (Name order is the + * native 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 \p op callback function, the related \ref H5L_info1_t + * \c struct, and the effect that the callback function's return value + * has on the application are described in H5Lvisit1(). + * + * The H5Lvisit_by_name1() \p op_data parameter is a user-defined + * pointer to the data required to process links 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. + * + * \p lapl_id is a link access property list. In the general case, + * when default link access properties are acceptable, this can be + * passed in as #H5P_DEFAULT. An example of a situation that requires + * a non-default link access property list is when the link is an + * external link; an external link may require that a link prefix be + * set in a link access property list (see H5Pset_elink_prefix()). + * + * H5Lvisit_by_name1() and H5Ovisit_by_name1() are companion + * functions: one for examining and operating on links; the other for + * examining and operating on the objects that those links point to. + * Both functions ensure that by the time the function completes + * successfully, every link or object below the specified point in the + * file has been presented to the application for whatever processing + * the application requires. + * + * \version 1.12.0 Function renamed from H5Lvisit_by_name() to + * H5Lvisit_by_name1() and deprecated. + * + * \since 1.8.0 + * + */ H5_DLL 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); @@ -38,7 +38,6 @@ /********************/ /* Local Prototypes */ /********************/ - static herr_t H5M__close_cb(H5VL_object_t *map_vol_obj); /*********************/ @@ -618,13 +617,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Mget_count(hid_t map_id, hsize_t *count, hid_t dxpl_id) +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 */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE3("e", "i*hi", map_id, count, dxpl_id); + H5TRACE3("e", "ixi", map_id, count, dxpl_id); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP))) @@ -845,7 +844,7 @@ H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "i*hix*xi", map_id, idx, key_mem_type_id, op, op_data, dxpl_id); + H5TRACE6("e", "i*hiMI*xi", map_id, idx, key_mem_type_id, op, op_data, dxpl_id); /* Check arguments */ if (key_mem_type_id < 0) @@ -873,7 +872,7 @@ H5Miterate(hid_t map_id, hsize_t *idx, hid_t key_mem_type_id, H5M_iterate_t op, /* 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") + HGOTO_ERROR(H5E_MAP, H5E_BADITER, ret_value, "unable to iterate over keys") done: FUNC_LEAVE_API(ret_value) @@ -919,7 +918,7 @@ H5Miterate_by_name(hid_t loc_id, const char *map_name, hsize_t *idx, hid_t key_m herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*s*hix*xii", loc_id, map_name, idx, key_mem_type_id, op, op_data, dxpl_id, lapl_id); + H5TRACE8("e", "i*s*hiMI*xii", loc_id, map_name, idx, key_mem_type_id, op, op_data, dxpl_id, lapl_id); /* Check arguments */ if (!map_name) @@ -1202,7 +1202,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ - } /* end if */ + } /* end if */ else { htri_t merged; /* Whether node was merged */ H5MF_sect_ud_t udata; /* User data for callback */ @@ -1369,7 +1369,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: H5MF__aggr_try_extend = %t\n", FUNC, ret_value); -#endif /* H5MF_ALLOC_DEBUG_MORE */ +#endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ /* If no extension so far, try to extend into a free-space section */ @@ -1395,7 +1395,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi "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); -#endif /* H5MF_ALLOC_DEBUG_MORE */ +#endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ /* For paged aggregation and a metadata block: try to extend into page end threshold */ @@ -1406,7 +1406,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi ret_value = TRUE; #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Try to extend into the page end threshold = %t\n", FUNC, ret_value); -#endif /* H5MF_ALLOC_DEBUG_MORE */ +#endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ } /* end if */ } /* allow_extend */ @@ -2944,7 +2944,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) HDassert(fs_stat.serial_sect_count > 0); HDassert(fs_stat.alloc_sect_size > 0); HDassert(fs_stat.alloc_sect_size == fs_stat.sect_size); -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end if */ else { HDassert(!H5F_addr_defined(fs_stat.addr)); diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 597da76..473c1dc 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -648,7 +648,7 @@ H5MF__sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: section is dropped\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ - } /* end if */ + } /* 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; @@ -656,7 +656,7 @@ H5MF__sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) 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 */ + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -52,8 +52,7 @@ /* Memory allocation "block", wrapped around each allocation */ struct H5MM_block_t; /* Forward declaration for typedef */ typedef struct H5MM_block_t { - unsigned char - sig[H5MM_SIG_SIZE]; /* Signature for the block, to indicate it was allocated with H5MM* interface */ + unsigned char sig[H5MM_SIG_SIZE]; /* Signature for the block, to indicate it was allocated with H5MM* interface */ struct H5MM_block_t *next; /* Pointer to next block in the list of allocated blocks */ struct H5MM_block_t *prev; /* Pointer to previous block in the list of allocated blocks */ union { @@ -70,7 +69,7 @@ typedef struct H5MM_block_t { /********************/ /* Local Prototypes */ /********************/ -#if defined H5_MEMORY_ALLOC_SANITY_CHECK +#if defined H5_MEMORY_ALLOC_SANITY_CHECK static hbool_t H5MM__is_our_block(void *mem); static void H5MM__sanity_check_block(const H5MM_block_t *block); static void H5MM__sanity_check(void *mem); @@ -271,7 +270,7 @@ H5MM_malloc(size_t size) H5MM_block_head_s.u.info.in_use = TRUE; H5MM_init_s = TRUE; - } /* end if */ + } /* end if */ #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ if (size) { @@ -309,10 +308,10 @@ H5MM_malloc(size_t size) } /* end if */ else ret_value = NULL; -#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ +#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ ret_value = HDmalloc(size); #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ - } /* end if */ + } /* end if */ else ret_value = NULL; @@ -352,10 +351,10 @@ H5MM_calloc(size_t size) #if defined H5_MEMORY_ALLOC_SANITY_CHECK if (NULL != (ret_value = H5MM_malloc(size))) HDmemset(ret_value, 0, size); -#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ +#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ ret_value = HDcalloc((size_t)1, size); #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ - } /* end if */ + } /* end if */ else ret_value = NULL; @@ -417,14 +416,14 @@ H5MM_realloc(void *mem, size_t size) } else ret_value = H5MM_xfree(mem); -#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ +#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ ret_value = HDrealloc(mem, size); /* Some platforms do not return NULL if size is zero. */ if (0 == size) ret_value = NULL; #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ - } /* end else */ + } /* end else */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5MM_realloc() */ @@ -542,10 +541,10 @@ H5MM_xfree(void *mem) } else HDfree(mem); -#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ +#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ HDfree(mem); #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ - } /* end if */ + } /* end if */ FUNC_LEAVE_NOAPI(NULL) } /* end H5MM_xfree() */ @@ -642,8 +641,8 @@ H5MM_get_alloc_stats(H5_alloc_stats_t *stats) stats->total_alloc_blocks_count = H5MM_total_alloc_blocks_count_s; stats->curr_alloc_blocks_count = H5MM_curr_alloc_blocks_count_s; stats->peak_alloc_blocks_count = H5MM_peak_alloc_blocks_count_s; - } /* end if */ -#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ + } /* end if */ +#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ if (stats) HDmemset(stats, 0, sizeof(H5_alloc_stats_t)); #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index d957686..7c34a98 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -48,7 +48,7 @@ H5_DLL void * H5MM_xfree(void *mem); H5_DLL void * H5MM_xfree_const(const void *mem); H5_DLL void * H5MM_memcpy(void *dest, const void *src, size_t n); H5_DLL herr_t H5MM_get_alloc_stats(H5_alloc_stats_t *stats); -#if defined H5_MEMORY_ALLOC_SANITY_CHECK +#if defined H5_MEMORY_ALLOC_SANITY_CHECK H5_DLL void H5MM_sanity_check_all(void); H5_DLL void H5MM_final_sanity_check(void); #endif /* H5_MEMORY_ALLOC_SANITY_CHECK */ @@ -522,14 +522,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo, unsigned fields) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*xIu", loc_id, oinfo, fields); + H5TRACE3("e", "ixIu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -567,14 +567,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oget_info_by_name3(hid_t loc_id, const char *name, H5O_info2_t *oinfo, unsigned fields, hid_t lapl_id) +H5Oget_info_by_name3(hid_t loc_id, const char *name, 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 */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*xIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id); /* Check args */ if (!name) @@ -625,14 +626,14 @@ done: */ 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, unsigned fields, hid_t lapl_id) + 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 */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIoh*xIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); + H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -684,14 +685,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo, unsigned fields) +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 */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*xIu", loc_id, oinfo, fields); + H5TRACE3("e", "ixIu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -729,7 +730,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oinfo, unsigned fields, +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 */ @@ -737,7 +738,7 @@ H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oi herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*xIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id); /* Check args */ if (!name) @@ -788,14 +789,14 @@ done: */ 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, unsigned fields, hid_t lapl_id) + 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 */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIoh*xIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); + H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -953,14 +954,14 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) +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 */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "i*sz", obj_id, comment, bufsize); + H5TRACE3("Zs", "ixz", obj_id, comment, bufsize); /* Get the object */ if (NULL == (vol_obj = H5VL_vol_object(obj_id))) @@ -996,14 +997,14 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t bufsize, hid_t lapl_id) +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 */ FUNC_ENTER_API((-1)) - H5TRACE5("Zs", "i*s*szi", loc_id, name, comment, bufsize, lapl_id); + H5TRACE5("Zs", "i*sxzi", loc_id, name, comment, bufsize, lapl_id); /* Check args */ if (!name || !*name) @@ -1076,7 +1077,7 @@ H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate2 herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIox*xIu", obj_id, idx_type, order, op, op_data, fields); + H5TRACE6("e", "iIiIoOI*xIu", obj_id, idx_type, order, op, op_data, fields); /* Check args */ if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) @@ -1150,7 +1151,7 @@ H5Ovisit_by_name3(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIox*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id); + H5TRACE8("e", "i*sIiIoOI*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id); /* Check args */ if (!obj_name) diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 778e77e..a2ca561 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -995,10 +995,10 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) default: #ifdef NDEBUG HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "unknown action from metadata cache") -#else /* NDEBUG */ +#else /* NDEBUG */ HDassert(0 && "Unknown action?!?"); #endif /* NDEBUG */ - } /* end switch */ + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1284,7 +1284,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image unsigned chunkno; /* Current chunk's index */ #ifndef NDEBUG unsigned nullcnt; /* Count of null messages (for sanity checking gaps in chunks) */ -#endif /* NDEBUG */ +#endif /* NDEBUG */ hbool_t mesgs_modified = FALSE; /* Whether any messages were modified when the object header was deserialized */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c index 1838234..7d1b721 100644 --- a/src/H5Odeprec.c +++ b/src/H5Odeprec.c @@ -385,14 +385,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo) +H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo /*out*/) { H5VL_object_t * vol_obj = NULL; /* Object of loc_id */ H5VL_loc_params_t loc_params; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", loc_id, oinfo); + H5TRACE2("e", "ix", loc_id, oinfo); /* Check args */ if (!oinfo) @@ -425,14 +425,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo, hid_t lapl_id) +H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*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 */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*s*xi", loc_id, name, oinfo, lapl_id); + H5TRACE4("e", "i*sxi", loc_id, name, oinfo, lapl_id); /* Check args */ if (!name) @@ -480,14 +480,14 @@ done: */ herr_t H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n, H5O_info1_t *oinfo, hid_t lapl_id) + hsize_t n, H5O_info1_t *oinfo /*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 */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, oinfo, lapl_id); + H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, oinfo, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -538,7 +538,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo, unsigned fields) +H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo /*out*/, unsigned fields) { H5VL_object_t * vol_obj; /* Object of loc_id */ H5VL_loc_params_t loc_params; @@ -546,7 +546,7 @@ H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo, unsigned fields) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*xIu", loc_id, oinfo, fields); + H5TRACE3("e", "ixIu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -593,7 +593,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo, unsigned fields, hid_t lapl_id) +H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/, unsigned fields, + hid_t lapl_id) { H5VL_object_t * vol_obj; /* Object of loc_id */ H5VL_loc_params_t loc_params; @@ -601,7 +602,7 @@ H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo, unsigne herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*xIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id); /* Check args */ if (!name) @@ -661,7 +662,7 @@ done: */ herr_t H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n, H5O_info1_t *oinfo, unsigned fields, hid_t lapl_id) + hsize_t n, H5O_info1_t *oinfo /*out*/, unsigned fields, hid_t lapl_id) { H5VL_object_t * vol_obj; /* Object of loc_id */ H5VL_loc_params_t loc_params; @@ -669,7 +670,7 @@ H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIoh*xIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); + H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -756,7 +757,7 @@ H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1 herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIiIox*x", obj_id, idx_type, order, op, op_data); + H5TRACE5("e", "iIiIoOi*x", obj_id, idx_type, order, op, op_data); /* Check args */ if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) @@ -831,7 +832,7 @@ H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIox*xi", loc_id, obj_name, idx_type, order, op, op_data, lapl_id); + H5TRACE7("e", "i*sIiIoOi*xi", loc_id, obj_name, idx_type, order, op, op_data, lapl_id); /* Check args */ if (!obj_name) @@ -920,7 +921,7 @@ H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate1 herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIiIox*xIu", obj_id, idx_type, order, op, op_data, fields); + H5TRACE6("e", "iIiIoOi*xIu", obj_id, idx_type, order, op, op_data, fields); /* Check args */ if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) @@ -1009,7 +1010,7 @@ H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_it herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIox*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id); + H5TRACE8("e", "i*sIiIoOi*xIui", loc_id, obj_name, idx_type, order, op, op_data, fields, lapl_id); /* Check args */ if (!obj_name) diff --git a/src/H5Odtype.c b/src/H5Odtype.c index c8cd954..b6e986d 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -81,7 +81,7 @@ static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE *stream, int in if (H5T__upgrade_version((DT), (VERS)) < 0) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade " CLASS " encoding version") \ *(IOF) |= H5O_DECODEIO_DIRTY; \ - } /* end if */ + } /* end if */ #endif /* H5_STRICT_FORMAT_CHECKS */ /* This message derives from H5O message class */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 47e6502..0661726 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -102,25 +102,25 @@ const H5O_msg_class_t *const H5O_msg_class_g[] = { H5O_MSG_LAYOUT, /*0x0008 Data Layout */ #ifdef H5O_ENABLE_BOGUS H5O_MSG_BOGUS_VALID, /*0x0009 "Bogus valid" (for testing) */ -#else /* H5O_ENABLE_BOGUS */ +#else /* H5O_ENABLE_BOGUS */ NULL, /*0x0009 "Bogus valid" (for testing) */ -#endif /* H5O_ENABLE_BOGUS */ - H5O_MSG_GINFO, /*0x000A Group information */ - H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ - H5O_MSG_ATTR, /*0x000C Attribute */ - H5O_MSG_NAME, /*0x000D Object name */ - H5O_MSG_MTIME, /*0x000E Object modification date and time */ - H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ - H5O_MSG_CONT, /*0x0010 Object header continuation */ - H5O_MSG_STAB, /*0x0011 Symbol table */ - H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ - H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ - H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ - H5O_MSG_AINFO, /*0x0015 Attribute information */ - H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ - H5O_MSG_FSINFO, /*0x0017 Free-space manager info */ - H5O_MSG_MDCI, /*0x0018 Metadata cache image */ - H5O_MSG_UNKNOWN /*0x0019 Placeholder for unknown message */ +#endif /* H5O_ENABLE_BOGUS */ + H5O_MSG_GINFO, /*0x000A Group information */ + H5O_MSG_PLINE, /*0x000B Data storage -- filter pipeline */ + H5O_MSG_ATTR, /*0x000C Attribute */ + H5O_MSG_NAME, /*0x000D Object name */ + H5O_MSG_MTIME, /*0x000E Object modification date and time */ + H5O_MSG_SHMESG, /*0x000F File-wide shared message table */ + H5O_MSG_CONT, /*0x0010 Object header continuation */ + H5O_MSG_STAB, /*0x0011 Symbol table */ + H5O_MSG_MTIME_NEW, /*0x0012 New Object modification date and time */ + H5O_MSG_BTREEK, /*0x0013 Non-default v1 B-tree 'K' values */ + H5O_MSG_DRVINFO, /*0x0014 Driver info settings */ + H5O_MSG_AINFO, /*0x0015 Attribute information */ + H5O_MSG_REFCOUNT, /*0x0016 Object's ref. count */ + H5O_MSG_FSINFO, /*0x0017 Free-space manager info */ + H5O_MSG_MDCI, /*0x0018 Metadata cache image */ + H5O_MSG_UNKNOWN /*0x0019 Placeholder for unknown message */ }; /* Format version bounds for object header */ @@ -1076,7 +1076,7 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to bring it into memory */ #ifndef NDEBUG size_t chkcnt = oh->nchunks; /* Count of chunks (for sanity checking) */ -#endif /* NDEBUG */ +#endif /* NDEBUG */ /* Bring the chunk into the cache */ /* (which adds to the object header) */ @@ -1124,7 +1124,7 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) (oh->nmesgs + udata.common.merged_null_msgs) != udata.v1_pfx_nmesgs) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "corrupt object header - incorrect # of messages") #endif /* H5_STRICT_FORMAT_CHECKS */ - } /* end if */ + } /* end if */ #ifdef H5O_DEBUG H5O__assert(oh); diff --git a/src/H5Opkg.h b/src/H5Opkg.h index eece6b0..fac5269 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -277,10 +277,10 @@ struct H5O_t { /* (This is to simulate a bug in earlier * versions of the library) */ -#endif /* H5O_ENABLE_BAD_MESG_COUNT */ +#endif /* H5O_ENABLE_BAD_MESG_COUNT */ #ifndef NDEBUG size_t ndecode_dirtied; /* Number of messages dirtied by decoding */ -#endif /* NDEBUG */ +#endif /* NDEBUG */ /* Chunk management information (not stored) */ size_t rc; /* Reference count of [continuation] chunks using this structure */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 7638666..8e338cc 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -29,22 +29,22 @@ typedef struct H5O_t H5O_t; typedef struct H5O_fill_t H5O_fill_t; /* Include the public header file for this API */ -#include "H5Opublic.h" /* Object header functions */ +#include "H5Opublic.h" /* Object header functions */ /* Public headers needed by this file */ -#include "H5Dpublic.h" /* Dataset functions */ -#include "H5Lpublic.h" /* Link functions */ -#include "H5Spublic.h" /* Dataspace functions */ +#include "H5Dpublic.h" /* Dataset functions */ +#include "H5Lpublic.h" /* Link functions */ +#include "H5Spublic.h" /* Dataspace functions */ /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Fprivate.h" /* File access */ -#include "H5HGprivate.h" /* Global Heaps */ +#include "H5HGprivate.h" /* Global Heaps */ #include "H5SLprivate.h" /* Skip lists */ #include "H5Tprivate.h" /* Datatype functions */ -#include "H5VLprivate.h" -#include "H5Zprivate.h" /* I/O pipeline filters */ +#include "H5VLprivate.h" /* Virtual Object Layer */ +#include "H5Zprivate.h" /* I/O pipeline filters */ /* Forward references of package typedefs */ typedef struct H5O_msg_class_t H5O_msg_class_t; diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index b34eb76..83702eb 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -138,8 +138,11 @@ H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UN flags = *p++; /* Get or determine the type of the extent */ - if (version >= H5O_SDSPACE_VERSION_2) + if (version >= H5O_SDSPACE_VERSION_2) { sdim->type = (H5S_class_t)*p++; + if (sdim->type != H5S_SIMPLE && sdim->rank > 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "invalid rank for scalar or NULL dataspace") + } /* end if */ else { /* Set the dataspace type to be simple or scalar as appropriate */ if (sdim->rank > 0) @@ -248,13 +251,15 @@ H5O__sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) *p++ = 0; /*reserved*/ } /* end else */ - /* Current & maximum dimensions */ - if (sdim->rank > 0) { - for (u = 0; u < sdim->rank; u++) - H5F_ENCODE_LENGTH(f, p, sdim->size[u]); - if (flags & H5S_VALID_MAX) { + /* Encode dataspace dimensions for simple dataspaces */ + if (H5S_SIMPLE == sdim->type) { + /* Encode current & maximum dimensions */ + if (sdim->rank > 0) { for (u = 0; u < sdim->rank; u++) - H5F_ENCODE_LENGTH(f, p, sdim->max[u]); + H5F_ENCODE_LENGTH(f, p, sdim->size[u]); + if (flags & H5S_VALID_MAX) + for (u = 0; u < sdim->rank; u++) + H5F_ENCODE_LENGTH(f, p, sdim->max[u]); } /* end if */ } /* end if */ diff --git a/src/H5Oshared.h b/src/H5Oshared.h index aafa069..a8f76aa 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -72,10 +72,10 @@ H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *iofla #ifdef H5_STRICT_FORMAT_CHECKS if (*ioflags & H5O_DECODEIO_DIRTY) HGOTO_ERROR(H5E_OHDR, H5E_UNSUPPORTED, NULL, "unable to mark shared message dirty") -#else /* H5_STRICT_FORMAT_CHECKS */ +#else /* H5_STRICT_FORMAT_CHECKS */ *ioflags &= ~H5O_DECODEIO_DIRTY; #endif /* H5_STRICT_FORMAT_CHECKS */ - } /* end if */ + } /* end if */ else { /* Decode native message directly */ if (NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, open_oh, mesg_flags, ioflags, p_size, p))) @@ -237,7 +237,7 @@ H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg) /* Decrement the reference count on the native message directly */ if (H5O_SHARED_DELETE_REAL(f, open_oh, _mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for native message") - } /* end else */ + } /* end else */ #endif /* H5O_SHARED_DELETE_REAL */ done: @@ -288,7 +288,7 @@ H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg) /* Increment the reference count on the native message directly */ if (H5O_SHARED_LINK_REAL(f, open_oh, _mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "unable to increment ref count for native message") - } /* end else */ + } /* end else */ #endif /* H5O_SHARED_LINK_REAL */ done: @@ -333,7 +333,7 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_ if (NULL == (dst_mesg = H5O_SHARED_COPY_FILE_REAL(file_src, H5O_SHARED_TYPE, _native_src, file_dst, recompute_size, cpy_info, udata))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy native message to another file") -#else /* H5O_SHARED_COPY_FILE_REAL */ +#else /* H5O_SHARED_COPY_FILE_REAL */ /* No copy file callback defined, just copy the message itself */ if (NULL == (dst_mesg = (H5O_SHARED_TYPE->copy)(_native_src, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy native message") @@ -173,7 +173,7 @@ H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE8("i", "i*sx*xx*xx*x", parent, name, cls_create, create_data, cls_copy, copy_data, cls_close, + H5TRACE8("i", "i*sPc*xPo*xPl*x", parent, name, cls_create, create_data, cls_copy, copy_data, cls_close, close_data); /* Check arguments. */ @@ -414,8 +414,8 @@ H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_p herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE11("e", "i*sz*xxxxxxxx", cls_id, name, size, def_value, prp_create, prp_set, prp_get, prp_delete, - prp_copy, prp_cmp, prp_close); + H5TRACE11("e", "i*sz*xPCPSPGPDPOPMPL", cls_id, name, size, def_value, prp_create, prp_set, prp_get, + prp_delete, prp_copy, prp_cmp, prp_close); /* Check arguments. */ if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) @@ -598,7 +598,7 @@ H5Pinsert2(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_s herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE10("e", "i*sz*xxxxxxx", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, + H5TRACE10("e", "i*sz*xPSPGPDPOPMPL", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, prp_cmp, prp_close); /* Check arguments. */ @@ -756,14 +756,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Pget_size(hid_t id, const char *name, size_t *size) +H5Pget_size(hid_t id, const char *name, size_t *size /*out*/) { H5P_genclass_t *pclass; /* Property class to query */ H5P_genplist_t *plist; /* Property list to query */ herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*s*z", id, name, size); + H5TRACE3("e", "i*sx", id, name, size); /* Check arguments. */ if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) @@ -961,14 +961,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Pget_nprops(hid_t id, size_t *nprops) +H5Pget_nprops(hid_t id, size_t *nprops /*out*/) { H5P_genplist_t *plist; /* Property list to query */ H5P_genclass_t *pclass; /* Property class to query */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*z", id, nprops); + H5TRACE2("e", "ix", id, nprops); /* Check arguments. */ if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) @@ -1199,7 +1199,7 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) int ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("Is", "i*Isx*x", id, idx, iter_func, iter_data); + H5TRACE4("Is", "i*IsPi*x", id, idx, iter_func, iter_data); /* Check arguments. */ if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) @@ -1262,13 +1262,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Pget(hid_t plist_id, const char *name, void *value) +H5Pget(hid_t plist_id, const char *name, void *value /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*s*x", plist_id, name, value); + H5TRACE3("e", "i*sx", plist_id, name, value); /* Check arguments. */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) @@ -104,12 +104,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLget_loading_state(unsigned int *plugin_control_mask) +H5PLget_loading_state(unsigned *plugin_control_mask /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "*Iu", plugin_control_mask); + H5TRACE1("e", "x", plugin_control_mask); if (NULL == plugin_control_mask) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_control_mask parameter cannot be NULL") diff --git a/src/H5PLmodule.h b/src/H5PLmodule.h index 8bf11ce..6e6a088 100644 --- a/src/H5PLmodule.h +++ b/src/H5PLmodule.h @@ -27,4 +27,9 @@ #define H5_MY_PKG_ERR H5E_PLUGIN #define H5_MY_PKG_INIT YES +/**\defgroup H5PL H5PL + * \brief Plugins + * \todo Describe what programmatically controlling dynamically loaded plugins (H5PL) is all about + */ + #endif /* _H5PLmodule_H */ diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 3879dc6..ff4dc0e 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -693,7 +693,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_path() */ -#else /* H5_HAVE_WIN32_API */ +#else /* H5_HAVE_WIN32_API */ static herr_t H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *found, const char *dir, const void **plugin_info) diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index a54cce0..a08c78d 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -28,14 +28,20 @@ */ #define H5PL_NO_PLUGIN "::" -/* Plugin type used by the plugin library */ +//! [H5PL_type_t_snip] + +/** + * Plugin type (bit-position) used by the plugin library + */ typedef enum H5PL_type_t { - H5PL_TYPE_ERROR = -1, /* Error */ - H5PL_TYPE_FILTER = 0, /* Filter */ - H5PL_TYPE_VOL = 1, /* VOL driver */ - H5PL_TYPE_NONE = 2 /* This must be last! */ + H5PL_TYPE_ERROR = -1, /**< Error */ + H5PL_TYPE_FILTER = 0, /**< Filter */ + H5PL_TYPE_VOL = 1, /**< VOL driver */ + H5PL_TYPE_NONE = 2 /**< Sentinel: This must be last! */ } H5PL_type_t; +//! [H5PL_type_t_snip] + /* Common dynamic plugin type flags used by the set/get_loading_state functions */ #define H5PL_FILTER_PLUGIN 0x0001 #define H5PL_VOL_PLUGIN 0x0002 @@ -46,15 +52,175 @@ extern "C" { #endif /* plugin state */ -H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_control_mask); -H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_control_mask /*out*/); -H5_DLL herr_t H5PLappend(const char *search_path); -H5_DLL herr_t H5PLprepend(const char *search_path); -H5_DLL herr_t H5PLreplace(const char *search_path, unsigned int index); -H5_DLL herr_t H5PLinsert(const char *search_path, unsigned int index); -H5_DLL herr_t H5PLremove(unsigned int index); +/** + * \ingroup H5PL + * \brief Controls the loadability of dynamic plugin types + * + * \param[in] plugin_control_mask The list of dynamic plugin types to enable or disable.\n + * A plugin bit set to 0 (zero) prevents use of that dynamic plugin.\n + * A plugin bit set to 1 (one) enables use of that dynamic plugin.\n + * Setting \p plugin_control_mask to a negative value enables all dynamic + * plugin types.\n + * Setting \p plugin_control_mask to 0 (zero) disables all dynamic plugin\n + * types. + * \return \herr_t + * + * \details H5PLset_loading_state() uses one argument to enable or disable individual plugin types. + * + * \details The \p plugin_control_mask parameter is an encoded integer in which each bit controls a specific + * plugin type. Bit positions allocated to date are specified in \ref H5PL_type_t as follows: + * \snippet this H5PL_type_t_snip + * + * A plugin bit set to 0 (zero) prevents the use of the dynamic plugin type corresponding to that bit + * position. A plugin bit set to 1 (one) allows the use of that dynamic plugin type. + * + * All dynamic plugin types can be enabled by setting \p plugin_control_mask to a negative value. A + * value of 0 (zero) will disable all dynamic plugin types. + * + * The loading of external dynamic plugins can be controlled during runtime with an environment + * variable, \c HDF5_PLUGIN_PRELOAD. H5PLset_loading_state() inspects the \c HDF5_PLUGIN_PRELOAD + * environment variable every time it is called. If the environment variable is set to the special + * \c :: string, all dynamic plugins are disabled. + * + * \warning The environment variable \c HDF5_PLUGIN_PRELOAD controls the loading of dynamic plugin types at + * runtime. If it is set to disable all plugin types, then it will disable them for \Emph{all} + * running programs that access the same variable instance. + * + * \since 1.8.15 + * + */ +H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_control_mask); +/** + * \ingroup H5PL + * \brief Queries the loadability of dynamic plugin types + * + * \param[out] plugin_control_mask List of dynamic plugin types that are enabled or disabled.\n + * A plugin bit set to 0 (zero) indicates that that the dynamic plugin type is + * disabled.\n + * 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. + * \return \herr_t + * + * \details H5PLget_loading_state() retrieves the bitmask that controls whether a certain type of plugins + * (e.g.: filters, VOL drivers) will be loaded by the HDF5 library. + * + * Bit positions allocated to date are specified in \ref H5PL_type_t as follows: + * \snippet this H5PL_type_t_snip + * + * \since 1.8.15 + * + */ +H5_DLL herr_t H5PLget_loading_state(unsigned int *plugin_control_mask /*out*/); +/** + * \ingroup H5PL + * \brief Inserts a plugin path at the end of the plugin search path list + * + * \param[in] search_path A plugin path + * \return \herr_t + * + * \details H5PLappend() inserts a plugin path at the end of the plugin search path list. + * + * \since 1.10.1 + * + */ +H5_DLL herr_t H5PLappend(const char *search_path); +/** + * \ingroup H5PL + * \brief Inserts a plugin path at the beginning of the plugin search path list + * + * \param[in] search_path A plugin path + * \return \herr_t + * + * \details H5PLprepend() inserts a plugin path at the end of the plugin search path list. + * + * \since 1.10.1 + * + */ +H5_DLL herr_t H5PLprepend(const char *search_path); +/** + * \ingroup H5PL + * \brief Replaces the path at the specified index in the plugin search path list + * + * \param[in] search_path A plugin path + * \param[in] index Index + * \return \herr_t + * + * \details H5PLreplace() replaces a plugin path at the specified index in the plugin search path list. + * + * \since 1.10.1 + * + */ +H5_DLL herr_t H5PLreplace(const char *search_path, unsigned int index); +/** + * \ingroup H5PL + * \brief Inserts a path at the specified index in the plugin search path list + * + * \param[in] search_path A plugin path + * \param[in] index Index + * \return \herr_t + * + * \details H5PLinsert() inserts a plugin path at the specified index in the plugin search path list, + * moving other paths after \p index. + * + * \since 1.10.1 + * + */ +H5_DLL herr_t H5PLinsert(const char *search_path, unsigned int index); +/** + * \ingroup H5PL + * \brief Removes a plugin path at a specified index from the plugin search path list + * + * \param[in] index Index + * \return \herr_t + * + * \details H5PLremove() removes a plugin path at the specified \p index and compacts the plugin search path + * list. + * + * \since 1.10.1 + * + */ +H5_DLL herr_t H5PLremove(unsigned int index); +/** + * \ingroup H5PL + * \brief Queries the plugin search path list at the specified index + * + * \param[in] index Index + * \param[out] path_buf Pathname + * \param[in] buf_size Size of \p path_buf + * \return Returns the length of the path, a non-negative value, if successful; otherwise returns a negative + * value. + * + * \details H5PLget() queries the plugin path at a specified index. If \p path_buf is non-NULL then it writes + * up to \p buf_size bytes into that buffer and always returns the length of the path name. + * + * If \p path_buf is NULL, this function will simply return the number of characters required to + * store the path name, ignoring \p path_buf and \p buf_size. + * + * If an error occurs then the buffer pointed to by \p path_buf (NULL or non-NULL) is unchanged and + * the function returns a negative value. If a zero is returned for the name's length, then there is + * no path name associated with the index. and the \p path_buf buffer will be unchanged. + * + * \since 1.10.1 + * + */ H5_DLL ssize_t H5PLget(unsigned int index, char *path_buf /*out*/, size_t buf_size); -H5_DLL herr_t H5PLsize(unsigned int *num_paths /*out*/); +/** + * \ingroup H5PL + * \brief Retrieves the number of stored plugin paths + * + * \param[out] num_paths Current length of the plugin search path list + * \return \herr_t + * + * \details H5PLsize() retrieves the number of paths stored in the plugin search path list. + * + * \since 1.10.1 + * + */ +H5_DLL herr_t H5PLsize(unsigned int *num_paths /*out*/); #ifdef __cplusplus } diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 057509e..cf62bce 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -804,14 +804,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) +H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots /*out*/, size_t *rdcc_nbytes /*out*/, + double *rdcc_w0 /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ H5P_genplist_t *def_plist; /* Default file access property list */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*z*z*d", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0); + H5TRACE4("e", "ixxx", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) @@ -1103,13 +1104,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view) +H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Dv", plist_id, view); + H5TRACE2("e", "ix", plist_id, view); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) @@ -1246,13 +1247,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size) +H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*h", plist_id, gap_size); + H5TRACE2("e", "ix", plist_id, gap_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) @@ -1292,7 +1293,7 @@ H5Pset_append_flush(hid_t plist_id, unsigned ndims, const hsize_t *boundary, H5D herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIu*hx*x", plist_id, ndims, boundary, func, udata); + H5TRACE5("e", "iIu*hDA*x", plist_id, ndims, boundary, func, udata); /* Check arguments */ if (0 == ndims) @@ -1345,7 +1346,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_append_cb_t *func, void **udata) +H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_append_cb_t *func /*out*/, + void **udata /*out*/) { H5P_genplist_t * plist; /* property list pointer */ H5D_append_flush_t info; @@ -1353,7 +1355,7 @@ H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_appe herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIu*h*x**x", plist_id, ndims, boundary, func, udata); + H5TRACE5("e", "iIu*hxx", plist_id, ndims, boundary, func, udata); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) @@ -1428,7 +1430,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Pget_efile_prefix(hid_t plist_id, char *prefix, size_t size) +H5Pget_efile_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ char * my_prefix; /* Library's copy of the prefix */ @@ -1436,7 +1438,7 @@ H5Pget_efile_prefix(hid_t plist_id, char *prefix, size_t size) ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "i*sz", plist_id, prefix, size); + H5TRACE3("Zs", "ixz", plist_id, prefix, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) @@ -1518,7 +1520,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size) +H5Pget_virtual_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ char * my_prefix; /* Library's copy of the prefix */ @@ -1526,7 +1528,7 @@ H5Pget_virtual_prefix(hid_t plist_id, char *prefix, size_t size) ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "i*sz", plist_id, prefix, size); + H5TRACE3("Zs", "ixz", plist_id, prefix, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 8c525e5..685313e 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -313,7 +313,7 @@ static const H5O_layout_t H5D_def_layout_compact_g = H5D_DEF_LAYOUT_COMPACT; static const H5O_layout_t H5D_def_layout_contig_g = H5D_DEF_LAYOUT_CONTIG; static const H5O_layout_t H5D_def_layout_chunk_g = H5D_DEF_LAYOUT_CHUNK; static const H5O_layout_t H5D_def_layout_virtual_g = H5D_DEF_LAYOUT_VIRTUAL; -#else /* H5_HAVE_C99_DESIGNATED_INITIALIZER */ +#else /* H5_HAVE_C99_DESIGNATED_INITIALIZER */ static H5O_layout_t H5D_def_layout_compact_g = H5D_DEF_LAYOUT_COMPACT; static H5O_layout_t H5D_def_layout_contig_g = H5D_DEF_LAYOUT_CONTIG; static H5O_layout_t H5D_def_layout_chunk_g = H5D_DEF_LAYOUT_CHUNK; @@ -2773,14 +2773,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_chunk_opts(hid_t plist_id, unsigned *options) +H5Pget_chunk_opts(hid_t plist_id, unsigned *options /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ H5O_layout_t layout; /* Layout information for setting chunk info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", plist_id, options); + H5TRACE2("e", "ix", plist_id, options); #ifndef H5_HAVE_C99_DESIGNATED_INITIALIZER /* If the compiler doesn't support C99 designated initializers, check if @@ -3800,14 +3800,14 @@ done: *----------------------------------------------------------------------------- */ herr_t -H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize) +H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize /*out*/) { hbool_t setting = FALSE; H5P_genplist_t *plist = NULL; herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", dcpl_id, minimize); + H5TRACE2("e", "ix", dcpl_id, minimize); if (NULL == minimize) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "receiving pointer cannot be NULL") diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index d80c153..d44cd5c 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -220,8 +220,8 @@ H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_p herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE10("e", "i*sz*xxxxxxx", cls_id, name, size, def_value, prp_create, prp_set, prp_get, prp_delete, - prp_copy, prp_close); + H5TRACE10("e", "i*sz*xPCPSPGPDPOPL", cls_id, name, size, def_value, prp_create, prp_set, prp_get, + prp_delete, prp_copy, prp_close); /* Check arguments. */ if (NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(cls_id, H5I_GENPROP_CLS))) @@ -404,7 +404,7 @@ H5Pinsert1(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_s herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "i*sz*xxxxxx", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, + H5TRACE9("e", "i*sz*xPSPGPDPOPL", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, prp_close); /* Check arguments. */ @@ -545,7 +545,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "iFfh", plist_id, strategy, threshold); + H5TRACE3("e", "iFth", plist_id, strategy, threshold); if ((unsigned)in_strategy >= H5F_FILE_SPACE_NTYPES) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid strategy") @@ -606,7 +606,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy, hsize_t *threshold) +H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy /*out*/, hsize_t *threshold /*out*/) { H5F_fspace_strategy_t new_strategy; /* File space strategy type */ hbool_t new_persist; /* Persisting free-space or not */ @@ -614,7 +614,7 @@ H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy, hsize_t *thre herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*Ff*h", plist_id, strategy, threshold); + H5TRACE3("e", "ixx", plist_id, strategy, threshold); /* Get current file space info */ if (H5Pget_file_space_strategy(plist_id, &new_strategy, &new_persist, &new_threshold) < 0) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 09eadfa..abe8166 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -1314,7 +1314,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) H5Z_cb_t cb_struct; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", plist_id, func, op_data); + H5TRACE3("e", "iZF*x", plist_id, func, op_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1353,7 +1353,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat H5T_conv_cb_t cb_struct; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", plist_id, op, operate_data); + H5TRACE3("e", "iTE*x", plist_id, op, operate_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1385,14 +1385,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void **operate_data) +H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op /*out*/, void **operate_data /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ H5T_conv_cb_t cb_struct; herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", plist_id, op, operate_data); + H5TRACE3("e", "ixx", plist_id, op, operate_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1577,7 +1577,7 @@ H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func, void *alloc_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ix*xx*x", plist_id, alloc_func, alloc_info, free_func, free_info); + H5TRACE5("e", "iMa*xMf*x", plist_id, alloc_func, alloc_info, free_func, free_info); /* Check arguments */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1945,13 +1945,14 @@ H5P__dxfr_mpio_chunk_opt_hard_dec(const void **_pp, void *_value) *------------------------------------------------------------------------- */ herr_t -H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode) +H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, + H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode /*out*/) { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Do", plist_id, actual_chunk_opt_mode); + H5TRACE2("e", "ix", plist_id, actual_chunk_opt_mode); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1980,13 +1981,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode) +H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode /*out*/) { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Di", plist_id, actual_io_mode); + H5TRACE2("e", "ix", plist_id, actual_io_mode); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -2013,14 +2014,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause, - uint32_t *global_no_collective_cause) +H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause /*out*/, + uint32_t *global_no_collective_cause /*out*/) { H5P_genplist_t *plist; herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*Iu*Iu", plist_id, local_no_collective_cause, global_no_collective_cause); + H5TRACE3("e", "ixx", plist_id, local_no_collective_cause, global_no_collective_cause); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index f9a730d..dd14e92 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -493,7 +493,7 @@ static const hbool_t H5F_def_coll_md_write_flag_g = H5F_ACS_COLL_MD_WRITE_FLAG_DEF; /* Default setting for the collective metedata write flag */ static const MPI_Comm H5F_def_mpi_params_comm_g = H5F_ACS_MPI_PARAMS_COMM_DEF; /* Default MPI communicator */ static const MPI_Info H5F_def_mpi_params_info_g = H5F_ACS_MPI_PARAMS_INFO_DEF; /* Default MPI info struct */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ static const H5AC_cache_image_config_t H5F_def_mdc_initCacheImageCfg_g = H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEF; /* Default metadata cache image settings */ static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; /* Default page buffer size */ @@ -1551,13 +1551,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) +H5Pget_family_offset(hid_t fapl_id, hsize_t *offset /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*h", fapl_id, offset); + H5TRACE2("e", "ix", fapl_id, offset); /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) @@ -1629,13 +1629,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) +H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Mt", fapl_id, type); + H5TRACE2("e", "ix", fapl_id, type); /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) @@ -1723,13 +1723,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) +H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots /*out*/, size_t *rdcc_nbytes /*out*/, + double *rdcc_w0 /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*Is*z*z*d", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); + H5TRACE5("e", "i*Isxxx", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -1775,7 +1776,7 @@ H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "i*CC", plist_id, config_ptr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -1816,23 +1817,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) +H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "ix", plist_id, config); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* validate the config_ptr */ - if (config_ptr == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") - - if (config_ptr->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION) + /* validate the config ptr */ + if (config == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config ptr on entry.") + if (config->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown image config version.") /* If we ever support multiple versions of H5AC_cache_config_t, we @@ -1841,7 +1841,7 @@ H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr) */ /* Get the current initial metadata cache resize configuration */ - if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config_ptr) < 0) + if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get metadata cache initial image config") done: @@ -1868,7 +1868,7 @@ H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "i*Cc", plist_id, config_ptr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -1897,7 +1897,7 @@ done: * Purpose: Retrieve the metadata cache initial resize configuration * from the target FAPL. * - * Observe that the function will fail if config_ptr is + * Observe that the function will fail if config is * NULL, or if config_ptr->version specifies an unknown * version of H5AC_cache_config_t. * @@ -1909,23 +1909,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) +H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", plist_id, config_ptr); + H5TRACE2("e", "ix", plist_id, config); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* validate the config_ptr */ - if (config_ptr == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") - - if (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) + /* validate the config ptr */ + if (config == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config ptr on entry.") + if (config->version != H5AC__CURR_CACHE_CONFIG_VERSION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.") /* If we ever support multiple versions of H5AC_cache_config_t, we @@ -1934,7 +1933,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) */ /* Get the current initial metadata cache resize configuration */ - if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, config_ptr) < 0) + if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, config) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get metadata cache initial resize config") done: @@ -2067,13 +2066,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree) +H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Fd", plist_id, degree); + H5TRACE2("e", "ix", plist_id, degree); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2438,7 +2437,6 @@ H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high) /* Check args */ if (low < 0 || low > H5F_LIBVER_LATEST) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "low bound is not valid") - if (high < 0 || high > H5F_LIBVER_LATEST) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "high bound is not valid") @@ -2490,15 +2488,13 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low /*out*/, H5F_libver_t *hi HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Get values */ - if (low) { + if (low) if (H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, low) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get low bound for library format versions") - } - if (high) { + if (high) if (H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get high bound for library format versions") - } done: FUNC_LEAVE_API(ret_value) @@ -2558,13 +2554,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size) +H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", plist_id, efc_size); + H5TRACE2("e", "ix", plist_id, efc_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2663,22 +2659,22 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_file_image * - * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * Purpose: If the file image exists and buf is not NULL, * allocate a buffer of the correct size, copy the image into * the new buffer, and return the buffer to the caller in - * *buf_ptr_ptr. Do this using the file image callbacks + * *buf. Do this using the file image callbacks * if defined. * * NB: It is the responsibility of the caller to free the - * buffer whose address is returned in *buf_ptr_ptr. Do + * buffer whose address is returned in *buf. Do * this using free if the file image callbacks are not * defined, or with whatever method is appropriate if * the callbacks are defined. * - * If buf_ptr_ptr is not NULL, and no image exists, set - * *buf_ptr_ptr to NULL. + * If buf is not NULL, and no image exists, set + * *buf to NULL. * - * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * If buf_len is not NULL, set *buf_len equal * to the length of the file image if it exists, and * to 0 if it does not. * @@ -2690,14 +2686,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) +H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/) { H5P_genplist_t * fapl; /* Property list pointer */ H5FD_file_image_info_t image_info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i**x*z", fapl_id, buf_ptr_ptr, buf_len_ptr); + H5TRACE3("e", "ixx", fapl_id, buf, buf_len); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -2712,11 +2708,11 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ - if (buf_len_ptr != NULL) - *buf_len_ptr = image_info.size; + if (buf_len != NULL) + *buf_len = image_info.size; /* Duplicate the image if desired, using callbacks if available */ - if (buf_ptr_ptr != NULL) { + if (buf != NULL) { void *copy_ptr = NULL; /* Copy of memory image */ if (image_info.buffer != NULL) { @@ -2741,7 +2737,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) H5MM_memcpy(copy_ptr, image_info.buffer, image_info.size); } /* end if */ - *buf_ptr_ptr = copy_ptr; + *buf = copy_ptr; } /* end if */ done: @@ -2772,7 +2768,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, callbacks_ptr); + H5TRACE2("e", "i*DI", fapl_id, callbacks_ptr); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -2826,7 +2822,7 @@ done: } /* end H5Pset_file_image_callbacks() */ /*------------------------------------------------------------------------- - * Function: H5Pget_file_image_callbacks + * Function: H5Pget_file_image_callbacks * * Purpose: Sets the callbacks for file images. Some file drivers allow * the use of user-defined callbacks for allocating, freeing and @@ -2841,14 +2837,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr) +H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks /*out*/) { H5P_genplist_t * fapl; /* Property list pointer */ H5FD_file_image_info_t info; /* File image info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", fapl_id, callbacks_ptr); + H5TRACE2("e", "ix", fapl_id, callbacks); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -2861,17 +2857,17 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* verify file image field consistency */ HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); - /* verify that callbacks_ptr is not NULL */ - if (NULL == callbacks_ptr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + /* verify that callbacks is not NULL */ + if (NULL == callbacks) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks ptr") /* Transfer values to parameters */ - *callbacks_ptr = info.callbacks; + *callbacks = info.callbacks; /* Copy udata if it exists */ if (info.callbacks.udata != NULL) { HDassert(info.callbacks.udata_copy); - if ((callbacks_ptr->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0) + if ((callbacks->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy udata") } /* end if */ @@ -4149,7 +4145,7 @@ H5Pset_object_flush_cb(hid_t plist_id, H5F_flush_cb_t func, void *udata) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", plist_id, func, udata); + H5TRACE3("e", "iFF*x", plist_id, func, udata); /* Check if the callback function is NULL and the user data is non-NULL. * This is almost certainly an error as the user data will not be used. */ @@ -4185,14 +4181,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func, void **udata) +H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func /*out*/, void **udata /*out*/) { H5P_genplist_t * plist; /* Property list pointer */ H5F_object_flush_t flush_info; herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", plist_id, func, udata); + H5TRACE3("e", "ixx", plist_id, func, udata); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -4272,15 +4268,15 @@ done: *------------------------------------------------------------------------- */ 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) +H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled /*out*/, char *location /*out*/, + size_t *location_size /*out*/, hbool_t *start_on_access /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ char * location_ptr; /* Pointer to location string */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*b*s*z*b", plist_id, is_enabled, location, location_size, start_on_access); + H5TRACE5("e", "ixxxx", plist_id, is_enabled, location, location_size, start_on_access); /* Get the property list structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -4309,7 +4305,7 @@ H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled, char *location, size *location_size = HDstrlen(location_ptr) + 1; else *location_size = 0; - } + } /* end if */ done: FUNC_LEAVE_API(ret_value) @@ -4583,13 +4579,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close) +H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close /*out*/) { H5P_genplist_t *plist; /* property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", fapl_id, evict_on_close); + H5TRACE2("e", "ix", fapl_id, evict_on_close); /* Compare the property list's class against the other class */ if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) @@ -4670,13 +4666,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking, hbool_t *ignore_when_disabled) +H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking /*out*/, hbool_t *ignore_when_disabled /*out*/) { H5P_genplist_t *plist; /* property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*b*b", fapl_id, use_file_locking, ignore_when_disabled); + H5TRACE3("e", "ixx", fapl_id, use_file_locking, ignore_when_disabled); /* Make sure this is a fapl */ if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) @@ -4844,12 +4840,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective) +H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective /*out*/) { herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", plist_id, is_collective); + H5TRACE2("e", "ix", plist_id, is_collective); /* Compare the property list's class against the other class */ /* (Dataset, group, attribute, and named datype access property lists @@ -4933,13 +4929,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mpi_params(hid_t plist_id, MPI_Comm *comm, MPI_Info *info) +H5Pget_mpi_params(hid_t plist_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*Mc*Mi", plist_id, comm, info); + H5TRACE3("e", "ixx", plist_id, comm, info); /* Make sure that the property list is a fapl */ if (TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) @@ -5383,13 +5379,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective) +H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", plist_id, is_collective); + H5TRACE2("e", "ix", plist_id, is_collective); /* Compare the property list's class against the other class */ if (TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) @@ -5470,13 +5466,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc) +H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size /*out*/, unsigned *min_meta_perc /*out*/, + unsigned *min_raw_perc /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*z*Iu*Iu", plist_id, buf_size, min_meta_perc, min_raw_perc); + H5TRACE4("e", "ixxx", plist_id, buf_size, min_meta_perc, min_raw_perc); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -5620,13 +5617,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_vol_id(hid_t plist_id, hid_t *vol_id) +H5Pget_vol_id(hid_t plist_id, hid_t *vol_id /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*i", plist_id, vol_id); + H5TRACE2("e", "ix", plist_id, vol_id); /* Get property list for ID */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) @@ -5666,13 +5663,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_vol_info(hid_t plist_id, void **vol_info) +H5Pget_vol_info(hid_t plist_id, void **vol_info /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i**x", plist_id, vol_info); + H5TRACE2("e", "ix", plist_id, vol_info); /* Get property list for ID */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index fbf9aac..5da0e4c 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -366,13 +366,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_userblock(hid_t plist_id, hsize_t *size) +H5Pget_userblock(hid_t plist_id, hsize_t *size /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*h", plist_id, size); + H5TRACE2("e", "ix", plist_id, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -458,13 +458,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr, size_t *sizeof_size) +H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr /*out*/, size_t *sizeof_size /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*z*z", plist_id, sizeof_addr, sizeof_size); + H5TRACE3("e", "ixx", plist_id, sizeof_addr, sizeof_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -564,7 +564,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out */, unsigned *lk /*out */) +H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out*/, unsigned *lk /*out*/) { unsigned btree_k[H5B_NUM_BTREE_ID]; H5P_genplist_t *plist; /* Property list pointer */ @@ -654,7 +654,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out */) +H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out*/) { unsigned btree_k[H5B_NUM_BTREE_ID]; H5P_genplist_t *plist; /* Property list pointer */ @@ -825,13 +825,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_shared_mesg_nindexes(hid_t plist_id, unsigned *nindexes) +H5Pget_shared_mesg_nindexes(hid_t plist_id, unsigned *nindexes /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", plist_id, nindexes); + H5TRACE2("e", "ix", plist_id, nindexes); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -924,8 +924,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type_flags, - unsigned *min_mesg_size) +H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type_flags /*out*/, + unsigned *min_mesg_size /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ unsigned nindexes; /* Number of SOHM indexes */ @@ -934,7 +934,7 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iIu*Iu*Iu", plist_id, index_num, mesg_type_flags, min_mesg_size); + H5TRACE4("e", "iIuxx", plist_id, index_num, mesg_type_flags, min_mesg_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -1219,13 +1219,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list, unsigned *min_btree) +H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list /*out*/, unsigned *min_btree /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*Iu*Iu", plist_id, max_list, min_btree); + H5TRACE3("e", "ixx", plist_id, max_list, min_btree); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -1304,14 +1304,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_file_space_strategy(hid_t plist_id, H5F_fspace_strategy_t *strategy, hbool_t *persist, - hsize_t *threshold) +H5Pget_file_space_strategy(hid_t plist_id, H5F_fspace_strategy_t *strategy /*out*/, hbool_t *persist /*out*/, + hsize_t *threshold /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*Ff*b*h", plist_id, strategy, persist, threshold); + H5TRACE4("e", "ixxx", plist_id, strategy, persist, threshold); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -1455,13 +1455,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_file_space_page_size(hid_t plist_id, hsize_t *fsp_size) +H5Pget_file_space_page_size(hid_t plist_id, hsize_t *fsp_size /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*h", plist_id, fsp_size); + H5TRACE2("e", "ix", plist_id, fsp_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) diff --git a/src/H5Pint.c b/src/H5Pint.c index 001f62b..f67e4d7 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -5012,9 +5012,9 @@ done: herr_t H5P_close(void *_plist) { - H5P_genclass_t *tclass; /* Temporary class pointer */ + H5P_genclass_t *tclass; /* Temporary class pointer */ H5P_genplist_t *plist = (H5P_genplist_t *)_plist; - H5SL_t * seen = NULL; /* Skip list to hold names of properties already seen */ + H5SL_t * seen = NULL; /* Skip list to hold names of properties already seen */ size_t nseen; /* Number of items 'seen' */ hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ size_t ndel; /* Number of items deleted */ diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 8640b89..08cc5c8 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -946,13 +946,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_nlinks(hid_t plist_id, size_t *nlinks) +H5Pget_nlinks(hid_t plist_id, size_t *nlinks /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*z", plist_id, nlinks); + H5TRACE2("e", "ix", plist_id, nlinks); if (!nlinks) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer passed in"); @@ -1021,7 +1021,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Pget_elink_prefix(hid_t plist_id, char *prefix, size_t size) +H5Pget_elink_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ char * my_prefix; /* Library's copy of the prefix */ @@ -1029,7 +1029,7 @@ H5Pget_elink_prefix(hid_t plist_id, char *prefix, size_t size) ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "i*sz", plist_id, prefix, size); + H5TRACE3("Zs", "ixz", plist_id, prefix, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS))) @@ -1180,13 +1180,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_elink_acc_flags(hid_t lapl_id, unsigned *flags) +H5Pget_elink_acc_flags(hid_t lapl_id, unsigned *flags /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", lapl_id, flags); + H5TRACE2("e", "ix", lapl_id, flags); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) @@ -1223,7 +1223,7 @@ H5Pset_elink_cb(hid_t lapl_id, H5L_elink_traverse_t func, void *op_data) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", lapl_id, func, op_data); + H5TRACE3("e", "iLt*x", lapl_id, func, op_data); /* Check if the callback function is NULL and the user data is non-NULL. * This is almost certainly an error as the user data will not be used. */ @@ -1260,14 +1260,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func, void **op_data) +H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func /*out*/, void **op_data /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ H5L_elink_cb_t cb_info; /* Callback info struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", lapl_id, func, op_data); + H5TRACE3("e", "ixx", lapl_id, func, op_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) diff --git a/src/H5Pmapl.c b/src/H5Pmapl.c index a1f0fae..ca9c5c0 100644 --- a/src/H5Pmapl.c +++ b/src/H5Pmapl.c @@ -182,13 +182,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size, size_t *key_alloc_size) +H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size /*out*/, size_t *key_alloc_size /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*z*z", mapl_id, key_prefetch_size, key_alloc_size); + H5TRACE3("e", "ixx", mapl_id, key_prefetch_size, key_alloc_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(mapl_id, H5P_MAP_ACCESS))) diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h index d8cc430..b9e1180 100644 --- a/src/H5Pmodule.h +++ b/src/H5Pmodule.h @@ -29,4 +29,47 @@ #define H5_MY_PKG_ERR H5E_PLIST #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. + * + * 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. + * + * \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 + * + * \defgroup GPLO General Property List Operations + * \ingroup H5P + * \defgroup GPLOA General Property List Operations (Advanced) + * \ingroup H5P + * \defgroup FCPL File Creation Properties + * \ingroup H5P + * \defgroup FAPL File Access Properties + * \ingroup H5P + * \defgroup GCPL Group Creation Properties + * \ingroup H5P + * \defgroup ALCAPL Attribute and Link Creation Properties + * \ingroup H5P + * \defgroup LAPL Link Access Properties + * \ingroup H5P + * \defgroup DCPL Dataset Creation Properties + * \ingroup H5P + * \defgroup DAPL Dataset Access Properties + * \ingroup H5P + * \defgroup DXPL Dataset Transfer Properties + * \ingroup H5P + * \defgroup OCPL Object Creation Properties + * \ingroup H5P + * \defgroup OCPPL Object Copy Properties + * \ingroup H5P + */ + #endif /* _H5Pmodule_H */ diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index bd6be75..387ecdc 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -251,13 +251,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact, unsigned *min_dense) +H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact /*out*/, unsigned *min_dense /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*Iu*Iu", plist_id, max_compact, min_dense); + H5TRACE3("e", "ixx", plist_id, max_compact, min_dense); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) @@ -342,12 +342,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_attr_creation_order(hid_t plist_id, unsigned *crt_order_flags) +H5Pget_attr_creation_order(hid_t plist_id, unsigned *crt_order_flags /*out*/) { herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*Iu", plist_id, crt_order_flags); + H5TRACE2("e", "ix", plist_id, crt_order_flags); /* Get values */ if (crt_order_flags) { @@ -445,12 +445,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times) +H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times /*out*/) { herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", plist_id, track_times); + H5TRACE2("e", "ix", plist_id, track_times); /* Get values */ if (track_times) { @@ -931,13 +931,13 @@ done: herr_t H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*/, size_t *cd_nelmts /*in_out*/, unsigned cd_values[] /*out*/, size_t namelen, - char name[] /*out*/, unsigned *filter_config) + char name[] /*out*/, unsigned *filter_config /*out*/) { H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "iZfx*zxzx*Iu", plist_id, id, flags, cd_nelmts, cd_values, namelen, name, filter_config); + H5TRACE8("e", "iZfx*zxzxx", plist_id, id, flags, cd_nelmts, cd_values, namelen, name, filter_config); /* Check args */ if (cd_nelmts || cd_values) { diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 1f4b31e..f05afb0 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -837,7 +837,7 @@ H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ix*x", plist_id, func, op_data); + H5TRACE3("e", "iOs*x", plist_id, func, op_data); /* Check if the callback function is NULL and the user data is non-NULL. * This is almost certainly an error as the user data will not be used. */ @@ -878,14 +878,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data) +H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func /*out*/, void **op_data /*out*/) { H5P_genplist_t * plist; /* Property list pointer */ H5O_mcdt_cb_info_t cb_info; /* Callback info struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*x**x", plist_id, func, op_data); + H5TRACE3("e", "ixx", plist_id, func, op_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index 166f1f2..075eae0 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -86,8 +86,7 @@ struct H5P_genclass_t { char * name; /* Name of property list class */ H5P_plist_type_t type; /* Type of property */ size_t nprops; /* Number of properties in class */ - unsigned - plists; /* Number of property lists that have been created since the last modification to the class */ + unsigned plists; /* Number of property lists that have been created since the last modification to the class */ unsigned classes; /* Number of classes that have been derived since the last modification to the class */ unsigned ref_count; /* Number of outstanding ID's open on this class object */ hbool_t deleted; /* Whether this class has been deleted and is waiting for dependent classes & proplists diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index ffcdd99..a978895 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -232,11 +232,153 @@ H5_DLLVAR hid_t H5P_LST_REFERENCE_ACCESS_ID_g; /*********************/ /* Generic property list routines */ + +/** + * \ingroup GPLO + * + * \brief Terminates access to a property list + * + * \plist_id + * + * \return \herr_t + * + * \details H5Pclose() terminates access to a property list. All property + * lists should be closed when the application is finished + * accessing them. This frees resources used by the property + * list. + * + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pclose(hid_t plist_id); +/** + * \ingroup GPLO + * + * \brief Creates a new property list as an instance of a property list class + * + * \plistcls_id{cls_id} + * + * \return \hid_t{property list} + * + * \details H5Pcreate() creates a new property list as an instance of + * some property list class. The new property list is initialized + * with default values for the specified class. The classes are as + * follows: + * + * <table> + * <tr> + * <th>Class Identifier</th> + * <th>Class Name</th> + * <th>Comments</th> + * </tr> + * <tr> + * <td>#H5P_ATTRIBUTE_CREATE</td> + * <td>attribute create</td> + * <td>Properties for attribute creation</td> + * </tr> + * <tr> + * <td>#H5P_DATASET_ACCESS</td> + * <td>dataset access</td> + * <td>Properties for dataset access</td> + * </tr> + * <tr> + * <td>#H5P_DATASET_CREATE</td> + * <td>dataset create</td> + * <td>Properties for dataset creation</td> + * </tr> + * <tr> + * <td>#H5P_DATASET_XFER</td> + * <td>data transfer</td> + * <td>Properties for raw data transfer</td> + * </tr> + * <tr> + * <td>#H5P_DATATYPE_ACCESS</td> + * <td>datatype access</td> + * <td>Properties for datatype access</td> + * </tr> + * <tr> + * <td>#H5P_DATATYPE_CREATE</td> + * <td>datatype create</td> + * <td>Properties for datatype creation</td> + * </tr> + * <tr> + * <td>#H5P_FILE_ACCESS</td> + * <td>file access</td> + * <td>Properties for file access</td> + * </tr> + * <tr> + * <td>#H5P_FILE_CREATE</td> + * <td>file create</td> + * <td>Properties for file creation</td> + * </tr> + * <tr> + * <td>#H5P_FILE_MOUNT</td> + * <td>file mount</td> + * <td>Properties for file mounting</td> + * </tr> + * <tr valign="top"> + * <td>#H5P_GROUP_ACCESS</td> + * <td>group access</td> + * <td>Properties for group access</td> + * </tr> + * <tr> + * <td>#H5P_GROUP_CREATE</td> + * <td>group create</td> + * <td>Properties for group creation</td> + * </tr> + * <tr> + * <td>#H5P_LINK_ACCESS</td> + * <td>link access</td> + * <td>Properties governing link traversal when accessing objects</td> + * </tr> + * <tr> + * <td>#H5P_LINK_CREATE</td> + * <td>link create</td> + * <td>Properties governing link creation</td> + * </tr> + * <tr> + * <td>#H5P_OBJECT_COPY</td> + * <td>object copy</td> + * <td>Properties governing the object copying process</td> + * </tr> + * <tr> + * <td>#H5P_OBJECT_CREATE</td> + * <td>object create</td> + * <td>Properties for object creation</td> + * </tr> + * <tr> + * <td>#H5P_STRING_CREATE</td> + * <td>string create</td> + * <td>Properties for character encoding when encoding strings or + * object names</td> + * </tr> + * <tr> + * <td>#H5P_VOL_INITIALIZE</td> + * <td>vol initialize</td> + * <td>Properties for VOL initialization</td> + * </tr> + * </table> + * + * This property list must eventually be closed with H5Pclose(); + * otherwise, errors are likely to occur. + * + * \version 1.12.0 The #H5P_VOL_INITIALIZE property list class was added + * \version 1.8.15 For each class, the class name returned by + * H5Pget_class_name() was added. + * The list of possible Fortran values was updated. + * \version 1.8.0 The following property list classes were added at this + * release: #H5P_DATASET_ACCESS, #H5P_GROUP_CREATE, + * #H5P_GROUP_ACCESS, #H5P_DATATYPE_CREATE, + * #H5P_DATATYPE_ACCESS, #H5P_ATTRIBUTE_CREATE + * + * \since 1.0.0 + * + */ +H5_DLL hid_t H5Pcreate(hid_t cls_id); H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data); H5_DLL char * H5Pget_class_name(hid_t pclass_id); -H5_DLL hid_t H5Pcreate(hid_t cls_id); H5_DLL herr_t H5Pregister2(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, @@ -262,10 +404,80 @@ H5_DLL herr_t H5Pcopy_prop(hid_t dst_id, hid_t src_id, const char *name); H5_DLL herr_t H5Premove(hid_t plist_id, const char *name); H5_DLL herr_t H5Punregister(hid_t pclass_id, const char *name); H5_DLL herr_t H5Pclose_class(hid_t plist_id); -H5_DLL herr_t H5Pclose(hid_t plist_id); H5_DLL hid_t H5Pcopy(hid_t plist_id); /* Object creation property list (OCPL) routines */ + +/** + * \ingroup OCPL + * + * \brief Returns information about a filter in a pipeline + * + * \todo Signature for H5Pget_filter2 is different in H5Pocpl.c than in + * H5Ppublic.h + * + * \plist_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 + * 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] filter_config Bit field, as described in H5Zget_filter_info() + * + * \return Returns a negative value on failure, and the filter identifier + * if successful (see #H5Z_filter_t): + * - #H5Z_FILTER_DEFLATE Data compression filter, + * employing the gzip algorithm + * - #H5Z_FILTER_SHUFFLE Data shuffling filter + * - #H5Z_FILTER_FLETCHER32 Error detection filter, employing the + * Fletcher32 checksum algorithm + * - #H5Z_FILTER_SZIP Data compression filter, employing the + * SZIP algorithm + * - #H5Z_FILTER_NBIT Data compression filter, employing the + * N-bit algorithm + * - #H5Z_FILTER_SCALEOFFSET Data compression filter, employing the + * scale-offset algorithm + * + * \details H5Pget_filter2() returns information about a filter specified by + * its filter number, in a filter pipeline specified by the property + * list with which it is associated. + * + * \p plist_id must be a dataset or group creation property list. + * + * \p idx is a value between zero and N-1, as described in + * H5Pget_nfilters(). The function will return a negative value if + * the filter number is out of range. + * + * The structure of the \p flags argument is discussed in + * H5Pset_filter(). + * + * On input, \p cd_nelmts indicates the number of entries in the + * \p cd_values array, as allocated by the caller; on return, + * \p cd_nelmts contains the number of values defined by the filter. + * + * If \p name is a pointer to an array of at least \p namelen bytes, + * the filter name will be copied into that array. The name will be + * null terminated if \p namelen is large enough. The filter name + * returned will be the name appearing in the file, the name + * registered for the filter, or an empty string. + * + * \p filter_config is the bit field described in + * H5Zget_filter_info(). + * + * \version 1.8.5 Function extended to work with group creation property + * lists. + * \since 1.8.0 + * + */ +H5_DLL H5Z_filter_t H5Pget_filter2(hid_t plist_id, unsigned idx, + unsigned int *flags/*out*/, + size_t *cd_nelmts/*out*/, + unsigned cd_values[]/*out*/, + size_t namelen, char name[], + unsigned *filter_config /*out*/); H5_DLL herr_t H5Pset_attr_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dense); H5_DLL herr_t H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact, unsigned *min_dense); H5_DLL herr_t H5Pset_attr_creation_order(hid_t plist_id, unsigned crt_order_flags); @@ -277,9 +489,6 @@ H5_DLL herr_t H5Pmodify_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int H5_DLL herr_t H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int c_values[]); H5_DLL int H5Pget_nfilters(hid_t plist_id); -H5_DLL H5Z_filter_t H5Pget_filter2(hid_t plist_id, unsigned filter, unsigned int *flags /*out*/, - size_t *cd_nelmts /*out*/, unsigned cd_values[] /*out*/, size_t namelen, - char name[], unsigned *filter_config /*out*/); H5_DLL herr_t H5Pget_filter_by_id2(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*/, unsigned *filter_config /*out*/); @@ -379,10 +588,592 @@ H5_DLL herr_t H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size, unsigned unsigned *min_raw_per); /* Dataset creation property list (DCPL) routines */ -H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); + +/** + * \ingroup DCPL + * + * \brief Retrieves the size of chunks for the raw data of a chunked + * layout dataset + * + * \dcpl_id{plist_id} + * \param[in] max_ndims Size of the \p dims array + * \param[out] dim Array to store the chunk dimensions + * + * \return Returns chunk dimensionality if successful; + * otherwise returns a negative value. + * + * \details H5Pget_chunk() retrieves the size of chunks for the raw data + * of a chunked layout dataset. This function is only valid for + * dataset creation property lists. At most, \p max_ndims elements + * of \p dim will be initialized. + * + * \since 1.0.0 + * + */ +H5_DLL int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Retrieves the edge chunk option setting from a dataset creation + * property list + * + * \dcpl_id{plist_id} + * \param[out] opts Edge chunk option flag. Valid values are described in + * H5Pset_chunk_opts(). The option status can be + * retrieved using the bitwise AND operator ( & ). For + * example, the expression + * (opts&#H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) will + * evaluate to #H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS if + * that option has been enabled. Otherwise, it will + * evaluate to 0 (zero). + * + * \return \herr_t + * + * \details H5Pget_chunk_opts() retrieves the edge chunk option setting + * stored in the dataset creation property list \p plist_id. + * + * \since 1.10.0 + * + */ +H5_DLL herr_t H5Pget_chunk_opts(hid_t plist_id, unsigned *opts); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Retrieves the time when fill values are written to a dataset + * + * \dcpl_id{plist_id} + * \param[out] fill_time Setting for the timing of writing fill values to + * the dataset + * + * \return \herr_t + * + * \details H5Pget_fill_time() examines the dataset creation property list + * \p plist_id to determine when fill values are to be written to + * a dataset. Valid values returned in \p fill_time are as + * follows: + * + * <table> + * <tr> + * <td>#H5D_FILL_TIME_IFSET</td> + * <td>Fill values are written to the dataset when storage + * space is allocated only if there is a user-defined fill + * value, i.e., one set with H5Pset_fill_value(). (Default) + * </td> + * </tr> + * <tr> + * <td>#H5D_FILL_TIME_ALLOC</td> + * <td>Fill values are written to the dataset when storage + * space is allocated.</td> + * </tr> + * <tr> + * <td>#H5D_FILL_TIME_NEVER</td> + * <td>Fill values are never written to the dataset.</td> + * </tr> + * </table> + * + * \note H5Pget_fill_time() is designed to work in coordination with the + * dataset fill value and dataset storage allocation time properties, + * retrieved with the functions H5Pget_fill_value() and + * H5Pget_alloc_time(). + * + * \since 1.6.0 + * + */ +H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t + *fill_time/*out*/); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Retrieves a dataset fill value + * + * \dcpl_id{plist_id} + * \param[in] type_id Datatype identifier for the value passed via + * \p value + * \param[out] value Pointer to buffer to contain the returned + * fill value + * + * \return \herr_t + * + * \details H5Pget_fill_value() returns the dataset fill value defined in + * the dataset creation property list \p plist_id. The fill value + * is returned through the \p value pointer and will be converted + * to the datatype specified by \p type_id. This datatype may + * differ from the fill value datatype in the property list, but + * the HDF5 library must be able to convert between the two + * datatypes. + * + * If the fill value is undefined, i.e., set to NULL in the + * property list, H5Pget_fill_value() will return an error. + * H5Pfill_value_defined() should be used to check for this + * condition before H5Pget_fill_value() is called. + * + * Memory must be allocated by the calling application. + * + * \note H5Pget_fill_value() is designed to coordinate with the dataset + * storage allocation time and fill value write time properties, + * which can be retrieved with the functions H5Pget_alloc_time() + * and H5Pget_fill_time(), respectively. + * + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, + void *value/*out*/); +/** + *------------------------------------------------------------------------- + * \ingroup DCPL + * + * \brief Returns the layout of the raw data for a dataset + * + * \dcpl_id{plist_id} + * + * \return Returns the layout type (a non-negative value) of a dataset + * creation property list if successful. Valid return values are: + * - #H5D_COMPACT: Raw data is stored in the object header in the + * file. + * - #H5D_CONTIGUOUS: Raw data is stored separately from the object + * header in one contiguous chunk in the file. + * - #H5D_CHUNKED: Raw data is stored separately from the object + * header in chunks in separate locations in the + * file. + * - #H5D_VIRTUAL: Raw data is drawn from multiple datasets in + * different files. + * \return + * Otherwise, returns a negative value indicating failure. + * + * \details H5Pget_layout() returns the layout of the raw data for a + * dataset. This function is only valid for dataset creation + * property lists. + * + * Note that a compact storage layout may affect writing data to + * the dataset with parallel applications. See the H5Dwrite() + * documentation for details. + * + * \version 1.10.0 #H5D_VIRTUAL added in this release. + * + * \since 1.0.0 + * + */ H5_DLL H5D_layout_t H5Pget_layout(hid_t plist_id); -H5_DLL herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]); -H5_DLL int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[] /*out*/); +/** + *------------------------------------------------------------------------- + * \ingroup DCPL + * + * \brief Sets the size of the chunks used to store a chunked layout + * dataset + * + * \dcpl_id{plist_id} + * \param[in] ndims The number of dimensions of each chunk + * \param[in] dim An array defining the size, in dataset elements, of + * each chunk + * + * \return \herr_t + * \details H5Pset_chunk() sets the size of the chunks used to store a + * chunked layout dataset. This function is only valid for dataset + * creation property lists. + * + * The \p ndims parameter currently must be the same size as the + * rank of the dataset. + * + * The values of the \p dim array define the size of the chunks + * to store the dataset's raw data. The unit of measure for \p dim + * values is dataset elements. + * + * As a side-effect of this function, the layout of the dataset is + * changed to #H5D_CHUNKED, if it is not already so set. + * + * \note Chunk size cannot exceed the size of a fixed-size dataset. For + * example, a dataset consisting of a 5x4 fixed-size array cannot be + * defined with 10x10 chunks. Chunk maximums: + * - The maximum number of elements in a chunk is 2<sup>32</sup>-1 which + * is equal to 4,294,967,295. If the number of elements in a chunk is + * set via H5Pset_chunk() to a value greater than 2<sup>32</sup>-1, + * then H5Pset_chunk() will fail. + * - The maximum size for any chunk is 4GB. If a chunk that is larger + * than 4GB attempts to be written with H5Dwrite(), then H5Dwrite() + * will fail. + * + * \see H5Pset_layout(), H5Dwrite() + * + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Sets the edge chunk option in a dataset creation property list + * + * \dcpl_id{plist_id} + * \param[in] opts Edge chunk option flag. Valid values are: + * \li #H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS + * When enabled, filters are not applied to partial + * edge chunks. When disabled, partial edge chunks are + * filtered. Enabling this option will improve + * performance when appending to the dataset and, when + * compression filters are used, prevent reallocation + * of these chunks. Datasets created with this option + * enabled will be inaccessible with HDF5 library + * versions before Release 1.10. Default: \e Disabled + * \li 0 (zero) Disables option; partial edge chunks + * will be compressed. + * + * \return \herr_t + * + * \details H5Pset_chunk_opts() sets the edge chunk option in the + * dataset creation property list \p dcpl_id. + * + * The available option is detailed in the parameters section. + * Only chunks that are not completely filled by the dataset’s + * dataspace are affected by this option. Such chunks are + * referred to as partial edge chunks. + * + * \note \b Motivation: H5Pset_chunk_opts() is used to specify storage + * options for chunks on the edge of a dataset’s dataspace. This + * capability allows the user to tune performance in cases where + * the dataset size may not be a multiple of the chunk size and + * the handling of partial edge chunks can impact performance. + * + * \since 1.10.0 + * + */ +H5_DLL herr_t H5Pset_chunk_opts(hid_t plist_id, unsigned opts); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Sets the time when fill values are written to a dataset + * + * \dcpl_id{plist_id} + * \param[in] fill_time When to write fill values to a dataset + * + * \return \herr_t + * + * \details H5Pset_fill_time() sets up the timing for writing fill values + * to a dataset. This property is set in the dataset creation + * property list \p plist_id. Timing is specified in \p fill_time + * with one of the following values: + * + * <table> + * <tr> + * <td>#H5D_FILL_TIME_IFSET</td> + * <td>Write fill values to the dataset when storage space is + * allocated only if there is a user-defined fill value, + * i.e.,one set with H5Pset_fill_value(). (Default)</td> + * </tr> + * <tr> + * <td>#H5D_FILL_TIME_ALLOC</td> + * <td>Write fill values to the dataset when storage space is + * allocated.</td> + * </tr> + * <tr> + * <td>#H5D_FILL_TIME_NEVER</td> + * <td>Never write fill values to the dataset.</td> + * </tr> + * </table> + * + * \note H5Pset_fill_time() is designed for coordination with the dataset + * fill value and dataset storage allocation time properties, set + * with the functions H5Pset_fill_value() and H5Pset_alloc_time(). + * See H5Dcreate() for further cross-references. + * + * \since 1.6.0 + * + */ +H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Sets the fill value for a dataset + * + * \dcpl_id{plist_id} + * \param[in] type_id Datatype of \p value + * \param[in] value Pointer to buffer containing value to use as + * fill value + * + * \return \herr_t + * + * \details H5Pset_fill_value() sets the fill value for a dataset in the + * dataset creation property list. \p value is interpreted as + * being of datatype \p type_id. This datatype may differ from + * that of the dataset, but the HDF5 library must be able to + * convert \p value to the dataset datatype when the dataset is + * created. + * + * The default fill value is 0 (zero), which is interpreted + * according to the actual dataset datatype. + * + * Setting \p value to NULL indicates that the fill value is to + * be undefined. + * + * \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. This function allows the user application + * to set that fill value; the functions H5Dfill() and + * H5Pset_fill_time(), respectively, provide the ability to apply the + * fill value on demand or to set up its automatic application. + * + * \note A fill value should be defined so that it is appropriate for the + * application. While the HDF5 default fill value is 0 (zero), it is + * often appropriate to use another value. It might be useful, for + * example, to use a value that is known to be impossible for the + * application to legitimately generate. + * + * \note H5Pset_fill_value() is designed to work in concert with + * H5Pset_alloc_time() and H5Pset_fill_time(). H5Pset_alloc_time() + * and H5Pset_fill_time() govern the timing of dataset storage + * allocation and fill value write operations and can be important in + * tuning application performance. + * + * \note See H5Dcreate() for further cross-references. + * + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, + const void *value); +/** + *------------------------------------------------------------------------- + * + * \ingroup DCPL + * + * \brief Sets up use of the shuffle filter + * + * \dcpl_id{plist_id} + * + * \return \herr_t + * + * \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. + * All the bytes from one consistent byte position of each data + * element are placed together in one block; all bytes from a + * second consistent byte position of each data element are placed + * together a second block; etc. For example, given three data + * elements of a 4-byte datatype stored as 012301230123, shuffling + * will re-order data as 000111222333. This can be a valuable step + * in an effective compression algorithm because the bytes in each + * byte position are often closely related to each other and + * putting them together can increase the compression ratio. + * + * As implied above, the primary value of the shuffle filter lies + * in its coordinated use with a compression filter; it does not + * provide data compression when used alone. When the shuffle + * filter is applied to a dataset immediately prior to the use of + * a compression filter, the compression ratio achieved is often + * superior to that achieved by the use of a compression filter + * without the shuffle filter. + * + * \since 1.6.0 + * + */ +H5_DLL herr_t H5Pset_shuffle(hid_t plist_id); +/** + *------------------------------------------------------------------------- + * \ingroup DCPL + * + * \brief Sets the type of storage used to store the raw data for a dataset + * + * \dcpl_id{plist_id} + * \param[in] layout Type of storage layout for raw data + * + * \return \herr_t + * \details H5Pset_layout() sets the type of storage used to store the raw + * data for a dataset. This function is only valid for dataset + * creation property lists. + * + * Valid values for \p layout are: + * - #H5D_COMPACT: Store raw data in the dataset object header + * in file. This should only be used for datasets + * with small amounts of raw data. The raw data + * size limit is 64K (65520 bytes). Attempting + * to create a dataset with raw data larger than + * this limit will cause the H5Dcreate() call to + * fail. + * - #H5D_CONTIGUOUS: Store raw data separately from the object + * header in one large chunk in the file. + * - #H5D_CHUNKED: Store raw data separately from the object header + * as chunks of data in separate locations in + * the file. + * - #H5D_VIRTUAL: Draw raw data from multiple datasets in + * different files. + * + * Note that a compact storage layout may affect writing data to + * the dataset with parallel applications. See the note in + * H5Dwrite() documentation for details. + * \version 1.10.0 #H5D_VIRTUAL added in this release. + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); +/** + *------------------------------------------------------------------------- + * \ingroup DCPL + * + * \brief Sets up use of the SZIP compression filter + * + * \dcpl_id{plist_id} + * \param[in] options_mask A bit-mask conveying the desired SZIP options; + * Valid values are #H5_SZIP_EC_OPTION_MASK and + * #H5_SZIP_NN_OPTION_MASK. + * \param[in] pixels_per_block The number of pixels or data elements in each + * data block + * + * \return \herr_t + * + * \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. + * + * Before proceeding, all users should review the “Limitations” + * section below. + * + * Users familiar with SZIP outside the HDF5 context may benefit + * from reviewing the Note “For Users Familiar with SZIP in Other + * Contexts” below. + * + * In the text below, the term pixel refers to an HDF5 data element. + * This terminology derives from SZIP compression's use with image + * data, where pixel referred to an image pixel. + * + * The SZIP \p bits_per_pixel value (see Note, below) is automatically + * set, based on the HDF5 datatype. SZIP can be used with atomic + * datatypes that may have size of 8, 16, 32, or 64 bits. + * Specifically, a dataset with a datatype that is 8-, 16-, 32-, or + * 64-bit signed or unsigned integer; char; or 32- or 64-bit float + * can be compressed with SZIP. See Note, below, for further + * discussion of the the SZIP \p bits_per_pixel setting. + * + * SZIP options are passed in an options mask, \p options_mask, + * as follows. + * + * <table> + * <tr> + * <th>Option</th> + * <th>Description (Mutually exclusive; select one.)</th> + * </tr> + * <tr> + * <td>#H5_SZIP_EC_OPTION_MASK</td> + * <td>Selects entropy coding method</td> + * </tr> + * <tr> + * <td>#H5_SZIP_NN_OPTION_MASK</td> + * <td>Selects nearest neighbor coding method</td> + * </tr> + * </table> + * + * The following guidelines can be used in determining which + * option to select: + * + * - The entropy coding method, the EC option specified by + * #H5_SZIP_EC_OPTION_MASK, is best suited for data that has been + * processed. The EC method works best for small numbers. + * - The nearest neighbor coding method, the NN option specified + * by #H5_SZIP_NN_OPTION_MASK, preprocesses the data then the + * applies EC method as above. + * + * Other factors may affect results, but the above criteria + * provides a good starting point for optimizing data compression. + * + * SZIP compresses data block by block, with a user-tunable block + * size. This block size is passed in the parameter + * \p pixels_per_block and must be even and not greater than 32, + * with typical values being 8, 10, 16, or 32. This parameter + * affects compression ratio; the more pixel values vary, the + * smaller this number should be to achieve better performance. + * + * In HDF5, compression can be applied only to chunked datasets. + * If \p pixels_per_block is bigger than the total number of + * elements in a dataset chunk, H5Pset_szip() will succeed but + * the subsequent call to H5Dcreate() will fail; the conflict + * can be detected only when the property list is used. + * + * To achieve optimal performance for SZIP compression, it is + * recommended that a chunk's fastest-changing dimension be equal + * to N times \p pixels_per_block where N is the maximum number of + * blocks per scan line allowed by the SZIP library. In the + * current version of SZIP, N is set to 128. + * + * SZIP compression is an optional HDF5 filter. + * + * \b Limitations: + * + * - SZIP compression cannot be applied to compound, array, + * variable-length, enumeration, or any other user-defined + * datatypes. If an SZIP filter is set in a dataset creation + * property list used to create a dataset containing a + * non-allowed datatype, the call to H5Dcreate() will fail; the + * conflict can be detected only when the property list is used. + * - Users should be aware that there are factors that affect one’s + * rights and ability to use SZIP compression by reviewing the + * SZIP copyright notice. + * + * \note \b For \b Users \b Familiar \b with \b SZIP \b in \b Other \b Contexts: + * + * \note The following notes are of interest primarily to those who have + * used SZIP compression outside of the HDF5 context. + * In non-HDF5 applications, SZIP typically requires that the user + * application supply additional parameters: + * - \p pixels_in_object, the number of pixels in the object to + * be compressed + * - \p bits_per_pixel, the number of bits per pixel + * - \p pixels_per_scanline, the number of pixels per scan line + * + * \note These values need not be independently supplied in the HDF5 + * environment as they are derived from the datatype and dataspace, + * which are already known. In particular, HDF5 sets + * \p pixels_in_object to the number of elements in a chunk and + * \p bits_per_pixel to the size of the element or pixel datatype. + * + * \note The following algorithm is used to set \p pixels_per_scanline: + * - If the size of a chunk's fastest-changing dimension, size, + * is greater than 4K, set \p pixels_per_scanline to 128 times + * \p pixels_per_block. + * - If size is less than 4K but greater than \p pixels_per_block, + * set \p pixels_per_scanline to the minimum of size and 128 + * times \p pixels_per_block. + * - If size is less than \p pixels_per_block but greater than the + * number elements in the chunk, set \p pixels_per_scanline to + * the minimum of the number elements in the chunk and 128 times + * \p pixels_per_block. + * + * \note The HDF5 datatype may have precision that is less than the full + * size of the data element, e.g., an 11-bit integer can be defined + * using H5Tset_precision(). To a certain extent, SZIP can take + * advantage of the precision of the datatype to improve compression: + * - If the HDF5 datatype size is 24-bit or less and the offset of + * the bits in the HDF5 datatype is zero (see H5Tset_offset() or + * H5Tget_offset()), the data is the in lowest N bits of the data + * element. In this case, the SZIP \p bits_per_pixel is set to the + * precision of the HDF5 datatype. + * - If the offset is not zero, the SZIP \p bits_per_pixel will be + * set to the number of bits in the full size of the data element. + * - If the HDF5 datatype precision is 25-bit to 32-bit, the SZIP + * \p bits_per_pixel will be set to 32. + * - If the HDF5 datatype precision is 33-bit to 64-bit, the SZIP + * \p bits_per_pixel will be set to 64. + * + * \note HDF5 always modifies the options mask provided by the user to set up + * usage of RAW_OPTION_MASK, ALLOW_K13_OPTION_MASK, and one of + * LSB_OPTION_MASK or MSB_OPTION_MASK, depending on endianness of the + * datatype. + * + * \since 1.6.0 + * + *-------------------------------------------------------------------------- + */ +H5_DLL herr_t H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block); 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); H5_DLL herr_t H5Pget_virtual_count(hid_t dcpl_id, size_t *count /*out*/); @@ -391,22 +1182,14 @@ H5_DLL hid_t H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index); H5_DLL ssize_t H5Pget_virtual_filename(hid_t dcpl_id, size_t index, char *name /*out*/, size_t size); H5_DLL ssize_t H5Pget_virtual_dsetname(hid_t dcpl_id, size_t index, char *name /*out*/, size_t size); H5_DLL herr_t H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size); -H5_DLL herr_t H5Pset_chunk_opts(hid_t plist_id, unsigned opts); -H5_DLL herr_t H5Pget_chunk_opts(hid_t plist_id, unsigned *opts); H5_DLL int H5Pget_external_count(hid_t plist_id); H5_DLL herr_t H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out*/, off_t *offset /*out*/, hsize_t *size /*out*/); -H5_DLL herr_t H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block); -H5_DLL herr_t H5Pset_shuffle(hid_t plist_id); H5_DLL herr_t H5Pset_nbit(hid_t plist_id); H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_factor); -H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value); -H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value /*out*/); H5_DLL herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time); H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time /*out*/); -H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); -H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time /*out*/); H5_DLL herr_t H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize); H5_DLL herr_t H5Pset_dset_no_attrs_hint(hid_t dcpl_id, hbool_t minimize); @@ -526,6 +1309,59 @@ H5_DLL herr_t H5Pinsert1(hid_t plist_id, const char *name, size_t size, vo H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close); H5_DLL herr_t H5Pencode1(hid_t plist_id, void *buf, size_t *nalloc); +/** + *------------------------------------------------------------------------- + * \ingroup OCPL + * + * \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,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 the filter identifier if successful; Otherwise returns + * a negative value. See: #H5Z_filter_t + * + * \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. + * + * \p plist_id must be a dataset or group creation property list. + * + * \p filter is a value between zero and N-1, as described in + * H5Pget_nfilters(). The function will return a negative value + * if the filter number is out of range. + * + * The structure of the \p flags argument is discussed in + * H5Pset_filter(). + * + * On input, \p cd_nelmts indicates the number of entries in the + * \p cd_values array, as allocated by the caller; on return, + * \p cd_nelmts contains the number of values defined by the filter. + * + * If \p name is a pointer to an array of at least \p namelen + * bytes, the filter name will be copied into that array. The name + * will be null terminated if \p namelen is large enough. The + * filter name returned will be the name appearing in the file, the + * name registered for the filter, or an empty string. + * + * \version 1.8.5 Function extended to work with group creation property + * lists. + * \version 1.8.0 N-bit and scale-offset filters added. + * \version 1.8.0 Function H5Pget_filter() renamed to H5Pget_filter1() and + * deprecated in this release. + * \version 1.6.4 \p filter parameter type changed to unsigned. + * + */ 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[]); @@ -724,7 +724,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type) +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 */ @@ -733,7 +733,7 @@ H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*Rri*Ot", ref_ptr, rapl_id, obj_type); + H5TRACE3("e", "*Rrix", ref_ptr, rapl_id, obj_type); /* Check args */ if (ref_ptr == NULL) @@ -784,13 +784,13 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Rget_file_name(const H5R_ref_t *ref_ptr, char *buf, size_t size) +H5Rget_file_name(const H5R_ref_t *ref_ptr, char *buf /*out*/, size_t size) { hid_t loc_id; /* Reference location ID */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "*Rr*sz", ref_ptr, buf, size); + H5TRACE3("Zs", "*Rrxz", ref_ptr, buf, size); /* Check args */ if (ref_ptr == NULL) @@ -833,7 +833,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf, size_t size) +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 */ @@ -842,7 +842,7 @@ H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf, size_t size) ssize_t ret_value = 0; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE4("Zs", "*Rri*sz", ref_ptr, rapl_id, buf, size); + H5TRACE4("Zs", "*Rrixz", ref_ptr, rapl_id, buf, size); /* Check args */ if (ref_ptr == NULL) @@ -892,12 +892,12 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *buf, size_t size) +H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *buf /*out*/, size_t size) { ssize_t ret_value; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "*Rr*sz", ref_ptr, buf, size); + H5TRACE3("Zs", "*Rrxz", ref_ptr, buf, size); /* Check args */ if (ref_ptr == NULL) @@ -15,25 +15,76 @@ * Reference counted string algorithms. * * These are used for various internal strings which get copied multiple times. + * They also efficiently handle dynamically allocations and appends. * */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5RSprivate.h" /* Reference-counted strings */ +/****************/ +/* Module Setup */ +/****************/ + +#include "H5RSmodule.h" /* This source code file is part of the H5RS module */ + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5RSprivate.h" /* Reference-counted strings */ + +/****************/ +/* Local Macros */ +/****************/ + +/* Initial buffer size to allocate */ +#define H5RS_ALLOC_SIZE 256 + +/******************/ +/* Local Typedefs */ +/******************/ /* Private typedefs & structs */ struct H5RS_str_t { char * s; /* String to be reference counted */ - unsigned wrapped; /* Indicates that the string to be ref-counted is not copied */ + char * end; /* Pointer to terminating NUL character at the end of the string */ + size_t len; /* Current length of the string */ + size_t max; /* Size of allocated buffer */ + hbool_t wrapped; /* Indicates that the string to be ref-counted is not copied */ unsigned n; /* Reference count of number of pointers sharing string */ }; +/********************/ +/* Package Typedefs */ +/********************/ + +/********************/ +/* Local Prototypes */ +/********************/ +static herr_t H5RS__xstrdup(H5RS_str_t *rs, const char *s); +static herr_t H5RS__prepare_for_append(H5RS_str_t *rs); +static herr_t H5RS__resize_for_append(H5RS_str_t *rs, size_t len); + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + +/*******************/ +/* Local Variables */ +/*******************/ + /* Declare a free list to manage the H5RS_str_t struct */ H5FL_DEFINE_STATIC(H5RS_str_t); /* Declare the PQ free list for the wrapped strings */ -H5FL_BLK_DEFINE(str_buf); +H5FL_BLK_DEFINE_STATIC(str_buf); /*-------------------------------------------------------------------------- NAME @@ -41,11 +92,12 @@ H5FL_BLK_DEFINE(str_buf); PURPOSE Duplicate the string being reference counted USAGE - char *H5RS__xstrdup(s) + herr_t H5RS__xstrdup(rs, s) + H5RS_str_t *rs; IN/OUT: Ref-counted string to hold duplicated string const char *s; IN: String to duplicate RETURNS - Returns a pointer to a new string on success, NULL on failure. + Non-negative on success/Negative on failure DESCRIPTION Duplicate a string buffer being reference counted. Use this instead of [H5MM_][x]strdup, in order to use the free-list memory routines. @@ -54,28 +106,148 @@ H5FL_BLK_DEFINE(str_buf); EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static char * -H5RS__xstrdup(const char *s) +static herr_t +H5RS__xstrdup(H5RS_str_t *rs, const char *s) { - char *ret_value; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_STATIC - if (s) { - size_t len = HDstrlen(s) + 1; + /* Sanity check */ + HDassert(rs); - ret_value = (char *)H5FL_BLK_MALLOC(str_buf, len); - HDassert(ret_value); - HDstrncpy(ret_value, s, len); + if (s) { + size_t len = HDstrlen(s); + + /* Determine size of buffer to allocate */ + rs->max = H5RS_ALLOC_SIZE; + while ((len + 1) > rs->max) + rs->max *= 2; + + /* Allocate the underlying string */ + if (NULL == (rs->s = (char *)H5FL_BLK_MALLOC(str_buf, rs->max))) + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, FAIL, "memory allocation failed") + if (len) + HDmemcpy(rs->s, s, len); + rs->end = rs->s + len; + *rs->end = '\0'; + rs->len = len; } /* end if */ - else - ret_value = NULL; + else { + /* Free previous string, if one */ + if (rs->s) { + H5FL_BLK_FREE(str_buf, rs->s); + rs->s = rs->end = NULL; + rs->max = rs->len = 0; + } /* end if */ + else { + /* Sanity checks */ + HDassert(NULL == rs->end); + HDassert(0 == rs->max); + HDassert(0 == rs->len); + } /* end else */ + } /* end else */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS__xstrdup() */ /*-------------------------------------------------------------------------- NAME + H5RS__prepare_for_append + PURPOSE + Prepare a ref-counted string for an append + USAGE + herr_t H5RS__prepare_for_append(rs) + H5RS_str_t *rs; IN/OUT: Ref-counted string to hold duplicated string + RETURNS + Non-negative on success/Negative on failure + DESCRIPTION + Allocate space for a string, or duplicate a wrapped string, in preparation + for appending another string. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5RS__prepare_for_append(H5RS_str_t *rs) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(rs); + + if (NULL == rs->s) { + rs->max = H5RS_ALLOC_SIZE; + if (NULL == (rs->s = (char *)H5FL_BLK_MALLOC(str_buf, rs->max))) + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, FAIL, "memory allocation failed") + rs->end = rs->s; + *rs->s = '\0'; + rs->len = 0; + } /* end if */ + else { + /* If the ref-counted string started life as a wrapper around an + * existing string, duplicate the string now, so we can modify it. + */ + if (rs->wrapped) { + if (H5RS__xstrdup(rs, rs->s) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, FAIL, "can't copy string") + rs->wrapped = FALSE; + } /* end if */ + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS__prepare_for_append() */ + +/*-------------------------------------------------------------------------- + NAME + H5RS__resize_for_append + PURPOSE + Resize ref-counted string buffer to accommodate appending another string + USAGE + herr_t H5RS__resize_for_append(rs, len) + H5RS_str_t *rs; IN/OUT: Ref-counted string to hold duplicated string + size_t len; IN: Additional length to accommodate + RETURNS + Non-negative on success/Negative on failure + DESCRIPTION + Resize a ref-counted string buffer to be large enough to accommodate + another string of a specified length. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5RS__resize_for_append(H5RS_str_t *rs, size_t len) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(rs); + + /* Check if buffer should be re-allocated */ + if (len >= (rs->max - rs->len)) { + /* Allocate a large enough buffer */ + while (len >= (rs->max - rs->len)) + rs->max *= 2; + if (NULL == (rs->s = (char *)H5FL_BLK_REALLOC(str_buf, rs->s, rs->max))) + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, FAIL, "memory allocation failed") + rs->end = rs->s + rs->len; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS__resize() */ + +/*-------------------------------------------------------------------------- + NAME H5RS_create PURPOSE Create a reference counted string @@ -96,18 +268,19 @@ H5RS__xstrdup(const char *s) H5RS_str_t * H5RS_create(const char *s) { - H5RS_str_t *ret_value; /* Return value */ + H5RS_str_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Allocate ref-counted string structure */ - if (NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) - HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") + if (NULL == (ret_value = H5FL_CALLOC(H5RS_str_t))) + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s = H5RS__xstrdup(s); - ret_value->wrapped = 0; - ret_value->n = 1; + if (s) + if (H5RS__xstrdup(ret_value, s) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, NULL, "can't copy string") + ret_value->n = 1; done: FUNC_LEAVE_NOAPI(ret_value) @@ -135,63 +308,233 @@ done: H5RS_str_t * H5RS_wrap(const char *s) { - H5RS_str_t *ret_value; /* Return value */ + H5RS_str_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) /* Allocate ref-counted string structure */ if (NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) - HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s = (char *)s; - ret_value->wrapped = 1; + ret_value->s = (char *)s; + ret_value->len = HDstrlen(s); + ret_value->end = ret_value->s + ret_value->len; + + ret_value->wrapped = TRUE; + ret_value->max = 0; /* Wrapped, not allocated */ ret_value->n = 1; done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_wrap() */ -/*-------------------------------------------------------------------------- - NAME - H5RS_own - PURPOSE - Transfer ownership of a regular string to a reference counted string - USAGE - H5RS_str_t *H5RS_own(s) - const char *s; IN: String to transfer ownership of +/*------------------------------------------------------------------------- + * Function: H5RS_asprintf_cat + * + * Purpose: This function appends formatted output to a ref-counted string, + * allocating the managed string if necessary. The formatting + * string is printf() compatible. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Friday, September 18, 2020 + * + *------------------------------------------------------------------------- + */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the sprintf() calls with + * 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_ATTR_FORMAT(printf, 2, 3) +herr_t +H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...) +{ + va_list args1, args2; + size_t out_len; + herr_t ret_value = SUCCEED; /* Return value */ - RETURNS - Returns a pointer to a new ref-counted string on success, NULL on failure. - DESCRIPTION - Transfer ownership of a dynamically allocated string to a reference counted - string. The routine which passed in the string should not attempt to free - it, the reference counting string routines will do that when the reference - count drops to zero. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -H5RS_str_t * -H5RS_own(char *s) + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(rs); + HDassert(fmt); + + /* Prepare the [possibly wrapped or empty] ref-counted string for an append */ + if (H5RS__prepare_for_append(rs) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") + + /* Attempt to write formatted output into the managed string */ + HDva_start(args1, fmt); + HDva_copy(args2, args1); + while ((out_len = (size_t)HDvsnprintf(rs->end, (rs->max - rs->len), fmt, args1)) >= (rs->max - rs->len)) { + /* Allocate a large enough buffer */ + if (H5RS__resize_for_append(rs, out_len) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer") + + /* Restart the va_list */ + HDva_end(args1); + HDva_copy(args1, args2); + } /* end while */ + + /* Increment the size & end of the string */ + rs->len += out_len; + rs->end += out_len; + + /* Finish access to varargs */ + HDva_end(args1); + HDva_end(args2); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS_asprintf_cat() */ +H5_GCC_DIAG_ON("format-nonliteral") + +/*------------------------------------------------------------------------- + * Function: H5RS_acat + * + * Purpose: This function appends a character string to a ref-counted string, + * allocating the managed string if necessary. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Friday, September 18, 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5RS_acat(H5RS_str_t *rs, const char *s) { - H5RS_str_t *ret_value; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI(FAIL) - /* Allocate ref-counted string structure */ - if (NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) - HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") + /* Sanity checks */ + HDassert(rs); + HDassert(s); - /* Set the internal fields */ - ret_value->s = s; - ret_value->wrapped = 0; - ret_value->n = 1; + /* Concatenate the provided string on to the managed string */ + if (*s) { + size_t len = HDstrlen(s); + + /* Allocate the underlying string, if necessary */ + if (H5RS__prepare_for_append(rs) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") + + /* Increase the managed string's buffer size if necessary */ + if ((rs->len + len) >= rs->max) + if (H5RS__resize_for_append(rs, len) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer") + + /* Append the string */ + HDmemcpy(rs->end, s, len); + rs->end += len; + *rs->end = '\0'; + rs->len += len; + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5RS_own() */ +} /* end H5RS_acat() */ + +/*------------------------------------------------------------------------- + * Function: H5RS_ancat + * + * Purpose: This function appends at most 'n' characters from a string + * to a ref-counted string, allocating the managed string if + * necessary. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Friday, September 18, 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5RS_ancat(H5RS_str_t *rs, const char *s, size_t n) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(rs); + HDassert(s); + + /* Concatenate the provided string on to the managed string */ + if (n && *s) { + size_t len = HDstrlen(s); + + /* Limit characters to copy to the minimum of 'n' and 'len' */ + n = MIN(len, n); + + /* Allocate the underlying string, if necessary */ + if (H5RS__prepare_for_append(rs) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") + + /* Increase the managed string's buffer size if necessary */ + if ((rs->len + n) >= rs->max) + if (H5RS__resize_for_append(rs, n) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer") + + /* Append the string */ + HDmemcpy(rs->end, s, n); + rs->end += n; + *rs->end = '\0'; + rs->len += n; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS_ancat() */ + +/*------------------------------------------------------------------------- + * Function: H5RS_aputc + * + * Purpose: This function appends a character to a ref-counted string, + * allocating the managed string if necessary. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Friday, September 18, 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5RS_aputc(H5RS_str_t *rs, int c) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(rs); + HDassert(c); + + /* Allocate the underlying string, if necessary */ + if (H5RS__prepare_for_append(rs) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") + + /* Increase the managed string's buffer size if necessary */ + if ((rs->len + 1) >= rs->max) + if (H5RS__resize_for_append(rs, 1) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer") + + /* Append the current character */ + *rs->end++ = (char)c; + rs->len++; + *rs->end = '\0'; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5RS_aputc() */ /*-------------------------------------------------------------------------- NAME @@ -252,7 +595,9 @@ H5RS_decr(H5RS_str_t *rs) herr_t H5RS_incr(H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(rs); @@ -263,14 +608,16 @@ H5RS_incr(H5RS_str_t *rs) * scope appropriately. */ if (rs->wrapped) { - rs->s = H5RS__xstrdup(rs->s); - rs->wrapped = 0; + if (H5RS__xstrdup(rs, rs->s) < 0) + HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, FAIL, "can't copy string") + rs->wrapped = FALSE; } /* end if */ /* Increment reference count for string */ rs->n++; - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_incr() */ /*-------------------------------------------------------------------------- @@ -307,53 +654,6 @@ H5RS_dup(H5RS_str_t *ret_value) /*-------------------------------------------------------------------------- NAME - H5RS_dup_str - PURPOSE - "Duplicate" a regular string into a ref-counted string - USAGE - H5RS_str_t H5RS_dup_str(s) - const char *s; IN: Regular string to duplicate - - RETURNS - Returns a pointer to ref-counted string on success, NULL on failure. - DESCRIPTION - Duplicate a regular string into a ref-counted string. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -H5RS_str_t * -H5RS_dup_str(const char *s) -{ - char * new_str; /* Duplicate of string */ - size_t path_len; /* Length of the path */ - H5RS_str_t *ret_value; - - FUNC_ENTER_NOAPI(NULL) - - /* Sanity check */ - HDassert(s); - - /* Get the length of the string */ - path_len = HDstrlen(s); - - /* Allocate space for the string */ - if (NULL == (new_str = (char *)H5FL_BLK_MALLOC(str_buf, path_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Copy name for full path */ - HDstrncpy(new_str, s, (path_len + 1)); - - /* Create reference counted string for path */ - ret_value = H5RS_own(new_str); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5RS_dup_str() */ - -/*-------------------------------------------------------------------------- - NAME H5RS_cmp PURPOSE Compare two ref-counted strings diff --git a/src/H5RSmodule.h b/src/H5RSmodule.h new file mode 100644 index 0000000..9b4819f --- /dev/null +++ b/src/H5RSmodule.h @@ -0,0 +1,32 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Saturday, October 10, 2020 + * + * Purpose: This file contains declarations which define macros for the + * H5RS package. Including this header means that the source file + * is part of the H5RS package. + */ +#ifndef _H5RSmodule_H +#define _H5RSmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5RS_MODULE +#define H5_MY_PKG H5RS +#define H5_MY_PKG_ERR H5E_RS +#define H5_MY_PKG_INIT NO + +#endif /* _H5RSmodule_H */ diff --git a/src/H5RSprivate.h b/src/H5RSprivate.h index d1f24cf..eb9e8d8 100644 --- a/src/H5RSprivate.h +++ b/src/H5RSprivate.h @@ -45,11 +45,13 @@ typedef struct H5RS_str_t H5RS_str_t; /********************/ H5_DLL H5RS_str_t *H5RS_create(const char *s); H5_DLL H5RS_str_t *H5RS_wrap(const char *s); -H5_DLL H5RS_str_t *H5RS_own(char *s); H5_DLL herr_t H5RS_decr(H5RS_str_t *rs); H5_DLL herr_t H5RS_incr(H5RS_str_t *rs); H5_DLL H5RS_str_t *H5RS_dup(H5RS_str_t *s); -H5_DLL H5RS_str_t *H5RS_dup_str(const char *s); +H5_DLL herr_t H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...) H5_ATTR_FORMAT(printf, 2, 3); +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 char * H5RS_get_str(const H5RS_str_t *rs); diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 1ec0350..6eb3def 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -481,7 +481,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type) +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 */ @@ -491,7 +491,7 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iRt*x*Ot", id, ref_type, ref, obj_type); + H5TRACE4("e", "iRt*xx", id, ref_type, ref, obj_type); /* Check args */ if (buf == NULL) @@ -693,7 +693,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Rget_name(hid_t id, H5R_type_t ref_type, const void *ref, char *name, size_t size) +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 */ @@ -703,7 +703,7 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *ref, char *name, size_t s ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE5("Zs", "iRt*x*sz", id, ref_type, ref, name, size); + H5TRACE5("Zs", "iRt*xxz", id, ref_type, ref, name, size); /* Check args */ if (buf == NULL) diff --git a/src/H5Rint.c b/src/H5Rint.c index 8f3163a..60f8131 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -746,8 +746,10 @@ H5R__copy(const H5R_ref_priv_t *src_ref, H5R_ref_priv_t *dst_ref) dst_ref->info.obj.filename = NULL; /* Set location ID and hold reference to it */ - if (H5R__set_loc_id(dst_ref, src_ref->loc_id, TRUE, TRUE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "cannot set reference location ID") + dst_ref->loc_id = src_ref->loc_id; + if (H5I_inc_ref(dst_ref->loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINC, FAIL, "incrementing location ID failed") + dst_ref->app_ref = TRUE; } done: @@ -2233,7 +2233,7 @@ H5SL_release(H5SL_t *slist) HGOTO_ERROR(H5E_SLIST, H5E_CANTFREE, FAIL, "can't release skip list nodes") done: - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_release() */ /*-------------------------------------------------------------------------- @@ -266,7 +266,7 @@ H5SM__type_to_flag(unsigned type_id, unsigned *type_flag) switch (type_id) { case H5O_FILL_ID: type_id = H5O_FILL_NEW_ID; - /* Fall through... */ + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case H5O_SDSPACE_ID: @@ -1092,7 +1092,7 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id, if (defer_flags & H5SM_WAS_DEFERRED) #ifndef NDEBUG deferred_type = ((H5O_shared_t *)mesg)->type; -#else /* NDEBUG */ +#else /* NDEBUG */ if ((((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_HERE) && (((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_SOHM)) HGOTO_DONE(FALSE); @@ -1411,7 +1411,7 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t if (defer) HDmemset(&shared.u, 0, sizeof(shared.u)); #endif /* H5_USING_MEMCHECKER */ - } /* end if */ + } /* end if */ else { htri_t share_in_ohdr; /* Whether the new message can be shared in another object's header */ @@ -1770,7 +1770,7 @@ H5SM__decr_ref(void *record, void *op_data, hbool_t *changed) */ static herr_t H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, const H5O_shared_t *mesg, - unsigned *cache_flags, size_t * /*out*/ mesg_size, void ** /*out*/ encoded_mesg) + unsigned *cache_flags, size_t *mesg_size /*out*/, void **encoded_mesg /*out*/) { H5SM_list_t * list = NULL; H5SM_mesg_key_t key; diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 6b3d750..4f53d49 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -2126,7 +2126,7 @@ H5S__hyper_iter_get_seq_list_opt(H5S_sel_iter_t *iter, size_t maxseq, size_t max /* Decrement number of blocks */ fast_dim_count--; } /* end while */ -#else /* NO_DUFFS_DEVICE */ +#else /* NO_DUFFS_DEVICE */ { size_t duffs_index; /* Counting index for Duff's device */ @@ -2138,31 +2138,38 @@ H5S__hyper_iter_get_seq_list_opt(H5S_sel_iter_t *iter, size_t maxseq, size_t max case 0: do { DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 7: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 6: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 5: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 4: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 3: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 2: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 1: DUFF_GUTS } while (--duffs_index > 0); } /* end switch */ } -#endif /* NO_DUFFS_DEVICE */ +#endif /* NO_DUFFS_DEVICE */ #undef DUFF_GUTS /* Increment offset in destination buffer */ @@ -4766,13 +4773,13 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, hsize_t numblo --------------------------------------------------------------------------*/ herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numblocks, - hsize_t buf[/*numblocks*/]) + hsize_t buf[/*numblocks*/] /*out*/) { H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ihh*[a2]h", spaceid, startblock, numblocks, buf); + H5TRACE4("e", "ihhx", spaceid, startblock, numblocks, buf); /* Check args */ if (buf == NULL) @@ -10101,7 +10108,7 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons case H5S_SEL_POINTS: /* Can't combine hyperslab operations and point selections currently */ if (op == H5S_SELECT_SET) /* Allow only "set" operation to proceed */ break; - /* Else fall through to error */ + /* FALLTHROUGH (to error) */ H5_ATTR_FALLTHROUGH case H5S_SEL_ERROR: @@ -11742,7 +11749,7 @@ done: for (u = 0; u < H5S_MAX_RANK; u++) HDassert(!udata.ps_span_info[u]); - } /* end block */ + } /* end block */ #endif /* NDEBUG */ FUNC_LEAVE_NOAPI(ret_value) @@ -12351,14 +12358,15 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[]) +H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[] /*out*/, hsize_t stride[] /*out*/, + hsize_t count[] /*out*/, hsize_t block[] /*out*/) { H5S_t * space; /* Dataspace to query */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*h*h*h*h", spaceid, start, stride, count, block); + H5TRACE5("e", "ixxxx", spaceid, start, stride, count, block); /* Check args */ if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) diff --git a/src/H5Smodule.h b/src/H5Smodule.h index 11494ee..6e8208b 100644 --- a/src/H5Smodule.h +++ b/src/H5Smodule.h @@ -29,4 +29,31 @@ #define H5_MY_PKG_ERR H5E_DATASPACE #define H5_MY_PKG_INIT YES +/**\defgroup H5S H5S + * \brief Dataspace Interface + * + * \details The Dataspace Interface provides functions for creating and + * working with dataspaces. + * + * A dataspace has two roles: + * + * \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. + * + * 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. + * + */ + #endif /* _H5Smodule_H */ diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 76b2753..adb528e 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -280,26 +280,21 @@ typedef struct { H5S_sel_copy_func_t copy; /* Method to make a copy of a selection */ H5S_sel_release_func_t release; /* Method to release current selection */ H5S_sel_is_valid_func_t is_valid; /* Method to determine if current selection is valid for dataspace */ - H5S_sel_serial_size_func_t - serial_size; /* Method to determine number of bytes required to store current selection */ + H5S_sel_serial_size_func_t serial_size; /* Method to determine number of bytes required to store current selection */ H5S_sel_serialize_func_t serialize; /* Method to store current selection in "serialized" form (a byte sequence suitable for storing on disk) */ H5S_sel_deserialize_func_t deserialize; /* Method to store create selection from "serialized" form (a byte sequence suitable for storing on disk) */ - H5S_sel_bounds_func_t - bounds; /* Method to determine to smallest n-D bounding box containing the current selection */ - H5S_sel_offset_func_t - offset; /* Method to determine linear offset of initial element in selection within dataspace */ + H5S_sel_bounds_func_t bounds; /* Method to determine to smallest n-D bounding box containing the current selection */ + H5S_sel_offset_func_t offset; /* Method to determine linear offset of initial element in selection within dataspace */ H5S_sel_unlim_dim_func_t unlim_dim; /* Method to get unlimited dimension of selection (or -1 for none) */ H5S_sel_num_elem_non_unlim_func_t num_elem_non_unlim; /* Method to get the number of elements in a slice through the unlimited dimension */ H5S_sel_is_contiguous_func_t is_contiguous; /* Method to determine if current selection is contiguous */ H5S_sel_is_single_func_t is_single; /* Method to determine if current selection is a single block */ H5S_sel_is_regular_func_t is_regular; /* Method to determine if current selection is "regular" */ - H5S_sel_shape_same_func_t - shape_same; /* Method to determine if two dataspaces' selections are the same shape */ - H5S_sel_intersect_block_func_t - intersect_block; /* Method to determine if a dataspaces' selection intersects a block */ + H5S_sel_shape_same_func_t shape_same; /* Method to determine if two dataspaces' selections are the same shape */ + H5S_sel_intersect_block_func_t intersect_block; /* Method to determine if a dataspaces' selection intersects a block */ H5S_sel_adjust_u_func_t adjust_u; /* Method to adjust a selection by an offset */ H5S_sel_adjust_s_func_t adjust_s; /* Method to adjust a selection by an offset (signed) */ H5S_sel_project_scalar project_scalar; /* Method to construct scalar dataspace projection */ @@ -352,20 +347,13 @@ typedef struct H5S_sel_iter_class_t { H5S_sel_type type; /* Type of selection (all, none, points or hyperslab) */ /* Methods on selections */ - H5S_sel_iter_coords_func_t - iter_coords; /* Method to retrieve the current coordinates of iterator for current selection */ - H5S_sel_iter_block_func_t - iter_block; /* Method to retrieve the current block of iterator for current selection */ - H5S_sel_iter_nelmts_func_t - iter_nelmts; /* Method to determine number of elements left in iterator for current selection */ - H5S_sel_iter_has_next_block_func_t - iter_has_next_block; /* Method to query if there is another block left in the selection */ - H5S_sel_iter_next_func_t - iter_next; /* Method to move selection iterator to the next element in the selection */ - H5S_sel_iter_next_block_func_t - iter_next_block; /* Method to move selection iterator to the next block in the selection */ - H5S_sel_iter_get_seq_list_func_t - iter_get_seq_list; /* Method to retrieve a list of offset/length sequences for selection iterator */ + H5S_sel_iter_coords_func_t iter_coords; /* Method to retrieve the current coordinates of iterator for current selection */ + H5S_sel_iter_block_func_t iter_block; /* Method to retrieve the current block of iterator for current selection */ + H5S_sel_iter_nelmts_func_t iter_nelmts; /* Method to determine number of elements left in iterator for current selection */ + H5S_sel_iter_has_next_block_func_t iter_has_next_block; /* Method to query if there is another block left in the selection */ + H5S_sel_iter_next_func_t iter_next; /* Method to move selection iterator to the next element in the selection */ + H5S_sel_iter_next_block_func_t iter_next_block; /* Method to move selection iterator to the next block in the selection */ + H5S_sel_iter_get_seq_list_func_t iter_get_seq_list; /* Method to retrieve a list of offset/length sequences for selection iterator */ H5S_sel_iter_release_func_t iter_release; /* Method to release iterator for current selection */ } H5S_sel_iter_class_t; diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 3e65836..c58e7a7 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -1572,13 +1572,14 @@ H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, hsize_t n REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, hsize_t buf[/*numpoints*/]) +H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, + hsize_t buf[/*numpoints*/] /*out*/) { H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ihh*[a2]h", spaceid, startpoint, numpoints, buf); + H5TRACE4("e", "ihhx", spaceid, startpoint, numpoints, buf); /* Check args */ if (NULL == buf) diff --git a/src/H5Spublic.h b/src/H5Spublic.h index f0aa6dc..c16af93 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -120,17 +120,288 @@ typedef enum { extern "C" { #endif -/* Operations on dataspaces */ +/* Operations on dataspaces and dataspace selections */ + +/** + * \ingroup H5S + * + * \brief Releases and terminates access to a dataspace + * + * \space_id + * + * \return \herr_t + * + * \details H5Sclose() releases a dataspace. Further access through the + * dataspace identifier is illegal. Failure to release a dataspace with this + * call will result in resource leaks. + * + * \version 1.4.0 Fortran subroutine introduced in this release. + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Sclose(hid_t space_id); +/** + * \ingroup H5S + * + * \brief Creates a new dataspace of a specified type + * + * \param[in] type Type of dataspace to be created + * + * \return \hid_t{dataspace} + * + * \details H5Screate() creates a new dataspace of a particular type. Currently + * supported types are #H5S_SCALAR, #H5S_SIMPLE, and #H5S_NULL. + * + * Further dataspace types may be added later. + * + * A scalar dataspace, #H5S_SCALAR, has a single element, though that + * element may be of a complex datatype, such as a compound or array + * datatype. By convention, the rank of a scalar dataspace is always \p 0 + * (zero); think of it geometrically as a single, dimensionless point, + * though that point can be complex. + * + * A simple dataspace, #H5S_SIMPLE, consists of a regular array of elements. + * + * A null dataspace, #H5S_NULL, has no data elements. + * + * The dataspace identifier returned by this function can be released with + * H5Sclose() so that resource leaks will not occur. + * + * \version 1.4.0 Fortran subroutine introduced. + * \since 1.0.0 + * + */ H5_DLL hid_t H5Screate(H5S_class_t type); +/** + * \ingroup H5S + * \brief Creates a new simple dataspace and opens it for access + * + * \param[in] rank Number of dimensions of dataspace + * \param[in] dims Array specifying the size of each dimension + * \param[in] maxdims Array specifying the maximum size of each dimension + * + * \return \hid_t{dataspace} + * + * \details H5Screate_simple() creates a new simple dataspace and opens it + * for access, returning a dataspace identifier. + * + * \p rank is the number of dimensions used in the dataspace. + * + * \p dims is a one-dimensional array of size rank specifying the + * size of each dimension of the dataset. \p maxdims is an array of the + * same size specifying the upper limit on the size of each dimension. + * + * Any element of \p dims can be \p 0 (zero). Note that no data can + * be written to a dataset if the size of any dimension of its current + * dataspace is \p 0. This is sometimes a useful initial state for a dataset. + * + * \p maxdims may be the null pointer, in which case the upper limit is + * the same as \p dims. Otherwise, no element of \p maxdims + * should be smaller than the corresponding element of \p dims. + * + * If an element of \p maxdims is #H5S_UNLIMITED, the maximum size of the + * corresponding dimension is unlimited. + * + * Any dataset with an unlimited dimension must also be chunked; see + * H5Pset_chunk(). Similarly, a dataset must be chunked if \p dims does + * not equal \p maxdims. + * + * The dataspace identifier returned from this function must be released with + * H5Sclose() or resource leaks will occur. + * + * \note Once a dataspace has been created, specific regions or elements in + * the dataspace can be selected and selections can be removed, as well. + * For example, H5Sselect_hyperslab() selects a region in a dataspace and + * H5Sselect_elements() selects array elements in a dataspace. These + * functions are used for subsetting. H5Sselect_none() removes all + * selections from a dataspace and is used in Parallel HDF5 when a process + * does not have or need to write data. + * + * \version 1.4.0 Fortran subroutine introduced. + * + * \since 1.0.0 + * + */ H5_DLL hid_t H5Screate_simple(int rank, const hsize_t dims[], const hsize_t maxdims[]); +/*--------------------------------------------------------------------------*/ +/**\ingroup H5S + * + * \brief Determines the number of elements in a dataspace selection + * + * \space_id{spaceid} + * + * \return Returns the number of elements in the selection if successful; + * otherwise returns a negative value. + * + * \details H5Sget_select_npoints() determines the number of elements in + * the current selection of a dataspace. It works with any + * selection type, and is the correct way to retrieve the number + * of elements in a selection. + * + * \version 1.4.0 Fortran subroutine introduced in this release. + * \since 1.0.0 + * + */ +H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid); +/*-------------------------------------------------------------------------*/ +/**\ingroup H5S + * + * \brief Retrieves dataspace dimension size and maximum size + * + * \space_id + * \param[out] dims Pointer to array to store the size of each dimension + * \param[out] maxdims Pointer to array to store the maximum size of each + * dimension + * + * \return Returns the number of dimensions in the dataspace if successful; + * otherwise returns a negative value. + * + * \details H5Sget_simple_extent_dims() returns the size and maximum sizes + * of each dimension of a dataspace \p space_id through the \p dims + * and \p maxdims parameters. + * + * Either or both of \p dims and \p maxdims may be NULL. + * + * If a value in the returned array \p maxdims is #H5S_UNLIMITED (-1), + * the maximum size of that dimension is unlimited. + * + * \version 1.4.0 Fortran subroutine introduced. + * \since 1.0.0 + * + */ +H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[], + hsize_t maxdims[]); +/*-------------------------------------------------------------------------*/ +/**\ingroup H5S + * + * \brief Determines the dimensionality of a dataspace + * + * \space_id + * + * \return Returns the number of dimensions in the dataspace if successful; + * otherwise returns a negative value. + * + * \details H5Sget_simple_extent_ndims() determines the dimensionality (or + * rank) of a dataspace. + * + * \version 1.4.0 Fortran subroutine introduced. + * \since 1.0.0 + * + */ +H5_DLL int H5Sget_simple_extent_ndims(hid_t space_id); +/*--------------------------------------------------------------------------*/ +/**\ingroup H5S + * + * \brief Selects a hyperslab region to add to the current selected region + * + * \space_id + * \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 H5Sselect_hyperslab() selects a hyperslab region to add to the + * current selected region for the dataspace specified by + * \p space_id. + * + * The \p start, \p stride, \p count, and \p block arrays must be the + * same size as the rank of the dataspace. For example, if the + * dataspace is 4-dimensional, each of these parameters must be a + * 1-dimensional array of size 4. + * + * The selection operator \p op determines how the new selection + * is to be combined with the already existing selection for the + * dataspace. The following operators are supported: + * + * <table> + * <tr> + * <td>#H5S_SELECT_SET</td> + * <td>Replaces the existing selection with the + * parameters from this call. Overlapping blocks + * are not supported with this operator.</td> + * </tr> + * <tr> + * <td>#H5S_SELECT_OR</td> + * <td>Adds the new selection to the existing selection. + * (Binary OR)</td> + * </tr> + * <tr> + * <td>#H5S_SELECT_AND</td> + * <td>Retains only the overlapping portions of the + * new selection and the existing selection. + * (Binary AND)</td> + * </tr> + * <tr> + * <td>#H5S_SELECT_XOR</td> + * <td>Retains only the elements that are members of + * the new selection or the existing selection, + * excluding elements that are members of both + * selections. (Binary exclusive-OR, XOR) + * </td> + * </tr> + * <tr> + * <td>#H5S_SELECT_NOTB</td> + * <td>Retains only elements of the existing selection + * that are not in the new selection.</td> + * </tr> + * <tr> + * <td>#H5S_SELECT_NOTA</td> + * <td>Retains only elements of the new selection that + * are not in the existing selection.</td> + * </tr> + * </table> + * + * The \p start array specifies the offset of the starting element + * of the specified hyperslab. + * + * The \p stride array chooses array locations from the dataspace with + * each value in the \p stride array determining how many elements to + * move in each dimension. Setting a value in the \p stride array to + * \p 1 moves to each element in that dimension of the dataspace; + * setting a value of \p 2 in allocation in the \p stride array moves + * to every other element in that dimension of the dataspace. In + * other words, the \p stride determines the number of elements to + * move from the \p start location in each dimension. Stride values + * of \p 0 are not allowed. If the \p stride parameter is NULL, a + * contiguous hyperslab is selected (as if each value in the \p stride + * array were set to \p 1). + * + * The \p count array determines how many blocks to select from the + * dataspace, in each dimension. + * + * The \p block array determines the size of the element block + * selected from the dataspace. If the \p block parameter is set to + * NULL, the block size defaults to a single element in each dimension + * (as if each value in the \p block array were set to \p 1). + * + * For example, consider a 2-dimensional dataspace with hyperslab + * selection settings as follows: the \p start offset is specified as + * [1,1], \p stride is [4,4], \p count is [3,7], and \p block is [2,2]. + * In C, these settings will specify a hyperslab consisting of 21 + * 2x2 blocks of array elements starting with location (1,1) with the + * selected blocks at locations (1,1), (5,1), (9,1), (1,5), (5,5), etc.; + * in Fortran, they will specify a hyperslab consisting of 21 2x2 + * blocks of array elements starting with location (2,2) with the + * selected blocks at locations (2,2), (6,2), (10,2), (2,6), (6,6), etc. + * + * Regions selected with this function call default to C order + * iteration when I/O is performed. + * + * \version 1.4.0 Fortran subroutine introduced in this release. + * \since 1.0.0 + * + */ +H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, + const hsize_t start[], const hsize_t stride[], const hsize_t count[], + const hsize_t block[]); H5_DLL herr_t H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[], const hsize_t max[]); H5_DLL hid_t H5Scopy(hid_t space_id); -H5_DLL herr_t H5Sclose(hid_t space_id); H5_DLL herr_t H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl); H5_DLL hid_t H5Sdecode(const void *buf); H5_DLL hssize_t H5Sget_simple_extent_npoints(hid_t space_id); -H5_DLL int H5Sget_simple_extent_ndims(hid_t space_id); -H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[], hsize_t maxdims[]); H5_DLL htri_t H5Sis_simple(hid_t space_id); H5_DLL H5S_class_t H5Sget_simple_extent_type(hid_t space_id); H5_DLL herr_t H5Sset_extent_none(hid_t space_id); @@ -139,7 +410,6 @@ H5_DLL htri_t H5Sextent_equal(hid_t sid1, hid_t sid2); /* Operations on dataspace selections */ H5_DLL H5S_sel_type H5Sget_select_type(hid_t spaceid); -H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid); H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id); H5_DLL htri_t H5Sselect_valid(hid_t spaceid); H5_DLL herr_t H5Sselect_adjust(hid_t spaceid, const hssize_t *offset); @@ -153,8 +423,6 @@ H5_DLL herr_t H5Sselect_elements(hid_t space_id, H5S_seloper_t op, size_t num_ H5_DLL hssize_t H5Sget_select_elem_npoints(hid_t spaceid); H5_DLL herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, hsize_t buf[/*numpoints*/]); -H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], - const hsize_t _stride[], const hsize_t count[], const hsize_t _block[]); H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], const hsize_t _stride[], const hsize_t count[], const hsize_t _block[]); H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id); diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 023ab80..231f35e 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -602,13 +602,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Sget_select_bounds(hid_t spaceid, hsize_t start[], hsize_t end[]) +H5Sget_select_bounds(hid_t spaceid, hsize_t start[] /*out*/, hsize_t end[] /*out*/) { H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*h*h", spaceid, start, end); + H5TRACE3("e", "ixx", spaceid, start, end); /* Check args */ if (start == NULL || end == NULL) @@ -3056,14 +3056,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes, - hsize_t *off, size_t *len) +H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq /*out*/, + size_t *nbytes /*out*/, hsize_t *off /*out*/, size_t *len /*out*/) { H5S_sel_iter_t *sel_iter; /* Dataspace selection iterator to operate on */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "izz*z*z*h*z", sel_iter_id, maxseq, maxbytes, nseq, nbytes, off, len); + H5TRACE7("e", "izzxxxx", sel_iter_id, maxseq, maxbytes, nseq, nbytes, off, len); /* Check args */ if (NULL == (sel_iter = (H5S_sel_iter_t *)H5I_object_verify(sel_iter_id, H5I_SPACE_SEL_ITER))) @@ -2714,7 +2714,7 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_c herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); + H5TRACE5("e", "Te*siiTC", pers, name, src_id, dst_id, func); /* Check args */ if (H5T_PERS_HARD != pers && H5T_PERS_SOFT != pers) @@ -2867,7 +2867,7 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); + H5TRACE5("e", "Te*siiTC", pers, name, src_id, dst_id, func); /* Check arguments */ if (src_id > 0 && (NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)))) @@ -2901,14 +2901,14 @@ done: *------------------------------------------------------------------------- */ H5T_conv_t -H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) +H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata /*out*/) { H5T_t * src, *dst; H5T_path_t *path; H5T_conv_t ret_value; /* Return value */ FUNC_ENTER_API(NULL) - H5TRACE3("x", "ii**x", src_id, dst_id, pcdata); + H5TRACE3("TC", "iix", src_id, dst_id, pcdata); /* Check args */ if (NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || @@ -11,31 +11,80 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* private headers */ -#include "H5private.h" /*library */ -#include "H5Eprivate.h" /*error handling */ -#include "H5MMprivate.h" /*memory management functions */ +/* + * 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. + * + * 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. + */ + +/****************/ +/* Module Setup */ +/****************/ + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_THREADSAFE -/* Module specific data structures */ +/****************/ +/* Local Macros */ +/****************/ -/* cancelability structure */ +/******************/ +/* Local Typedefs */ +/******************/ + +/* Cancelability structure */ typedef struct H5TS_cancel_struct { int previous_state; unsigned int cancel_count; } H5TS_cancel_t; +/* Function pointer typedef for thread callback function */ +typedef void *(*H5TS_thread_cb_t)(void *); + +/********************/ +/* Local Prototypes */ +/********************/ +static void H5TS__key_destructor(void *key_val); + +/*********************/ +/* Package Variables */ +/*********************/ + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + /* Global variable definitions */ #ifdef H5_HAVE_WIN_THREADS H5TS_once_t H5TS_first_init_g; -#else /* H5_HAVE_WIN_THREADS */ +#else /* H5_HAVE_WIN_THREADS */ H5TS_once_t H5TS_first_init_g = PTHREAD_ONCE_INIT; #endif /* H5_HAVE_WIN_THREADS */ -H5TS_key_t H5TS_errstk_key_g; -H5TS_key_t H5TS_funcstk_key_g; -H5TS_key_t H5TS_apictx_key_g; -H5TS_key_t H5TS_cancel_key_g; + +/* Thread-local keys, used by other interfaces */ +H5TS_key_t H5TS_errstk_key_g; /* Error stack */ +#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 */ + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Thread-local keys, used in this module */ +static H5TS_key_t H5TS_cancel_key_s; /* Thread cancellation state */ #ifndef H5_HAVE_WIN_THREADS @@ -64,12 +113,13 @@ static H5TS_key_t H5TS_tid_key; /*-------------------------------------------------------------------------- * NAME - * H5TS_key_destructor + * H5TS__key_destructor * * USAGE - * H5TS_key_destructor() + * H5TS__key_destructor() * * RETURNS + * None * * DESCRIPTION * Frees the memory for a key. Called by each thread as it exits. @@ -82,12 +132,16 @@ static H5TS_key_t H5TS_tid_key; *-------------------------------------------------------------------------- */ static void -H5TS_key_destructor(void *key_val) +H5TS__key_destructor(void *key_val) { + FUNC_ENTER_STATIC_NAMECHECK_ONLY + /* Use HDfree here instead of H5MM_xfree(), to avoid calling the H5CS routines */ if (key_val != NULL) HDfree(key_val); -} + + FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY +} /* end H5TS__key_destructor() */ #ifndef H5_HAVE_WIN_THREADS @@ -114,10 +168,10 @@ H5TS_tid_destructor(void *_v) return; /* TBD use an atomic CAS */ - pthread_mutex_lock(&H5TS_tid_mtx); + HDpthread_mutex_lock(&H5TS_tid_mtx); tid->next = H5TS_tid_next_free; H5TS_tid_next_free = tid; - pthread_mutex_unlock(&H5TS_tid_mtx); + HDpthread_mutex_unlock(&H5TS_tid_mtx); } /*-------------------------------------------------------------------------- @@ -137,8 +191,8 @@ H5TS_tid_destructor(void *_v) static void H5TS_tid_init(void) { - pthread_mutex_init(&H5TS_tid_mtx, NULL); - pthread_key_create(&H5TS_tid_key, H5TS_tid_destructor); + HDpthread_mutex_init(&H5TS_tid_mtx, NULL); + HDpthread_key_create(&H5TS_tid_key, H5TS_tid_destructor); } /*-------------------------------------------------------------------------- @@ -168,7 +222,7 @@ H5TS_tid_init(void) uint64_t H5TS_thread_id(void) { - H5TS_tid_t *tid = pthread_getspecific(H5TS_tid_key); + H5TS_tid_t *tid = HDpthread_getspecific(H5TS_tid_key); H5TS_tid_t proto_tid; /* An ID is already assigned. */ @@ -182,20 +236,19 @@ H5TS_thread_id(void) * point `tid` at `proto_tid` if we need to allocate some * memory. */ - pthread_mutex_lock(&H5TS_tid_mtx); + HDpthread_mutex_lock(&H5TS_tid_mtx); if ((tid = H5TS_tid_next_free) != NULL) H5TS_tid_next_free = tid->next; else if (H5TS_tid_next_id != UINT64_MAX) { tid = &proto_tid; tid->id = ++H5TS_tid_next_id; } - pthread_mutex_unlock(&H5TS_tid_mtx); + HDpthread_mutex_unlock(&H5TS_tid_mtx); /* If a prototype ID record was established, copy it to the heap. */ - if (tid == &proto_tid) { + if (tid == &proto_tid) if ((tid = HDmalloc(sizeof(*tid))) != NULL) *tid = proto_tid; - } if (tid == NULL) return 0; @@ -204,7 +257,7 @@ H5TS_thread_id(void) * to it. */ tid->next = NULL; - if (pthread_setspecific(H5TS_tid_key, tid) != 0) { + if (HDpthread_setspecific(H5TS_tid_key, tid) != 0) { H5TS_tid_destructor(tid); return 0; } @@ -237,6 +290,8 @@ H5TS_pthread_first_thread_init(void) H5_g.H5_libinit_g = FALSE; /* Library hasn't been initialized */ H5_g.H5_libterm_g = FALSE; /* Library isn't being shutdown */ + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + #ifdef H5_HAVE_WIN32_API #ifdef PTW32_STATIC_LIB pthread_win32_process_attach_np(); @@ -244,25 +299,29 @@ H5TS_pthread_first_thread_init(void) #endif /* initialize global API mutex lock */ - pthread_mutex_init(&H5_g.init_lock.atomic_lock, NULL); - pthread_cond_init(&H5_g.init_lock.cond_var, NULL); + HDpthread_mutex_init(&H5_g.init_lock.atomic_lock, NULL); + HDpthread_cond_init(&H5_g.init_lock.cond_var, NULL); H5_g.init_lock.lock_count = 0; /* Initialize integer thread identifiers. */ H5TS_tid_init(); /* initialize key for thread-specific error stacks */ - pthread_key_create(&H5TS_errstk_key_g, H5TS_key_destructor); + HDpthread_key_create(&H5TS_errstk_key_g, H5TS__key_destructor); +#ifdef H5_HAVE_CODESTACK /* initialize key for thread-specific function stacks */ - pthread_key_create(&H5TS_funcstk_key_g, H5TS_key_destructor); + HDpthread_key_create(&H5TS_funcstk_key_g, H5TS__key_destructor); +#endif /* H5_HAVE_CODESTACK */ /* initialize key for thread-specific API contexts */ - pthread_key_create(&H5TS_apictx_key_g, H5TS_key_destructor); + HDpthread_key_create(&H5TS_apictx_key_g, H5TS__key_destructor); /* initialize key for thread cancellability mechanism */ - pthread_key_create(&H5TS_cancel_key_g, H5TS_key_destructor); -} + HDpthread_key_create(&H5TS_cancel_key_s, H5TS__key_destructor); + + FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY +} /* end H5TS_pthread_first_thread_init() */ #endif /* H5_HAVE_WIN_THREADS */ /*-------------------------------------------------------------------------- @@ -288,32 +347,39 @@ H5TS_pthread_first_thread_init(void) herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex) { + herr_t ret_value = 0; + + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + #ifdef H5_HAVE_WIN_THREADS EnterCriticalSection(&mutex->CriticalSection); - return 0; -#else /* H5_HAVE_WIN_THREADS */ - herr_t ret_value = pthread_mutex_lock(&mutex->atomic_lock); - +#else /* H5_HAVE_WIN_THREADS */ + /* Acquire the library lock */ + ret_value = HDpthread_mutex_lock(&mutex->atomic_lock); if (ret_value) - return ret_value; + HGOTO_DONE(ret_value); - if (mutex->lock_count && pthread_equal(pthread_self(), mutex->owner_thread)) { + /* Check if this thread already owns the lock */ + if (mutex->lock_count && HDpthread_equal(HDpthread_self(), mutex->owner_thread)) /* already owned by self - increment count */ mutex->lock_count++; - } else { - /* if owned by other thread, wait for condition signal */ + /* Wait until the lock is released by current owner thread */ while (mutex->lock_count) - pthread_cond_wait(&mutex->cond_var, &mutex->atomic_lock); + HDpthread_cond_wait(&mutex->cond_var, &mutex->atomic_lock); /* After we've received the signal, take ownership of the mutex */ - mutex->owner_thread = pthread_self(); + mutex->owner_thread = HDpthread_self(); mutex->lock_count = 1; - } + } /* end else */ - return pthread_mutex_unlock(&mutex->atomic_lock); + /* Release the library lock */ + ret_value = HDpthread_mutex_unlock(&mutex->atomic_lock); #endif /* H5_HAVE_WIN_THREADS */ -} + +done: + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) +} /* end H5TS_mutex_lock() */ /*-------------------------------------------------------------------------- * NAME @@ -338,30 +404,36 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) herr_t H5TS_mutex_unlock(H5TS_mutex_t *mutex) { + herr_t ret_value = 0; + + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + #ifdef H5_HAVE_WIN_THREADS /* Releases ownership of the specified critical section object. */ LeaveCriticalSection(&mutex->CriticalSection); - return 0; -#else /* H5_HAVE_WIN_THREADS */ - herr_t ret_value = pthread_mutex_lock(&mutex->atomic_lock); +#else /* H5_HAVE_WIN_THREADS */ + /* Decrement the lock count for this thread */ + ret_value = HDpthread_mutex_lock(&mutex->atomic_lock); if (ret_value) - return ret_value; - + HGOTO_DONE(ret_value); mutex->lock_count--; + ret_value = HDpthread_mutex_unlock(&mutex->atomic_lock); - ret_value = pthread_mutex_unlock(&mutex->atomic_lock); - + /* If the lock count drops to zero, signal the condition variable, to + * wake another thread. + */ if (mutex->lock_count == 0) { int err; - err = pthread_cond_signal(&mutex->cond_var); + err = HDpthread_cond_signal(&mutex->cond_var); if (err != 0) ret_value = err; } /* end if */ - - return ret_value; #endif /* H5_HAVE_WIN_THREADS */ + +done: + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_mutex_unlock */ /*-------------------------------------------------------------------------- @@ -375,12 +447,12 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) * 0 on success non-zero error code on error. * * DESCRIPTION - * Creates a cancelation counter for a thread if it is the first time + * Creates a cancellation counter for a thread if it is the first time * the thread is entering the library. * * if counter value is zero, then set cancelability type of the thread * to PTHREAD_CANCEL_DISABLE as thread is entering the library and store - * the previous cancelability type into cancelation counter. + * the previous cancelability type into cancellation counter. * Increase the counter value by 1. * * PROGRAMMER: Chee Wai LEE @@ -391,15 +463,20 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) herr_t H5TS_cancel_count_inc(void) { -#ifdef H5_HAVE_WIN_THREADS - /* unsupported; just return 0 */ - return SUCCEED; -#else /* H5_HAVE_WIN_THREADS */ +#ifndef H5_HAVE_WIN_THREADS H5TS_cancel_t *cancel_counter; - herr_t ret_value = SUCCEED; +#endif /* H5_HAVE_WIN_THREADS */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NAMECHECK_ONLY - cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); +#ifdef H5_HAVE_WIN_THREADS + /* unsupported */ +#else /* H5_HAVE_WIN_THREADS */ + /* Acquire the thread's cancellation counter */ + cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_s); + /* Check if it's created yet */ if (!cancel_counter) { /* * First time thread calls library - create new counter and associate @@ -409,24 +486,31 @@ H5TS_cancel_count_inc(void) * order to avoid codestack calls. */ cancel_counter = (H5TS_cancel_t *)HDcalloc(1, sizeof(H5TS_cancel_t)); + if (NULL == cancel_counter) + HGOTO_DONE(FAIL); + + /* Set the thread's cancellation counter with the new object */ + ret_value = HDpthread_setspecific(H5TS_cancel_key_s, (void *)cancel_counter); + if (ret_value) { + HDfree(cancel_counter); + HGOTO_DONE(FAIL); + } /* end if */ + } /* end if */ - if (!cancel_counter) { - HERROR(H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed"); - return FAIL; - } - - ret_value = pthread_setspecific(H5TS_cancel_key_g, (void *)cancel_counter); - } - + /* Check if thread entering library */ if (cancel_counter->cancel_count == 0) - /* thread entering library */ - ret_value = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cancel_counter->previous_state); + /* Set cancellation state to 'disable', and remember previous state */ + ret_value = HDpthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cancel_counter->previous_state); + /* Increment # of times the library API was re-entered, to avoid resetting + * previous cancellation state until the final API routine is returning. + */ ++cancel_counter->cancel_count; - - return ret_value; #endif /* H5_HAVE_WIN_THREADS */ -} + +done: + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) +} /* end H5TS_cancel_count_inc() */ /*-------------------------------------------------------------------------- * NAME @@ -440,7 +524,7 @@ H5TS_cancel_count_inc(void) * * DESCRIPTION * If counter value is one, then set cancelability type of the thread - * to the previous cancelability type stored in the cancelation counter. + * to the previous cancelability type stored in the cancellation counter. * (the thread is leaving the library). * * Decrement the counter value by 1. @@ -453,23 +537,30 @@ H5TS_cancel_count_inc(void) herr_t H5TS_cancel_count_dec(void) { -#ifdef H5_HAVE_WIN_THREADS - /* unsupported; will just return 0 */ - return SUCCEED; -#else /* H5_HAVE_WIN_THREADS */ - register H5TS_cancel_t *cancel_counter; - herr_t ret_value = SUCCEED; +#ifndef H5_HAVE_WIN_THREADS + H5TS_cancel_t *cancel_counter; +#endif /* H5_HAVE_WIN_THREADS */ + herr_t ret_value = SUCCEED; - cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_g); + FUNC_ENTER_NOAPI_NAMECHECK_ONLY +#ifdef H5_HAVE_WIN_THREADS + /* unsupported */ +#else /* H5_HAVE_WIN_THREADS */ + /* Acquire the thread's cancellation counter */ + cancel_counter = (H5TS_cancel_t *)H5TS_get_thread_local_value(H5TS_cancel_key_s); + + /* Check for leaving last API routine */ if (cancel_counter->cancel_count == 1) - ret_value = pthread_setcancelstate(cancel_counter->previous_state, NULL); + /* Reset to previous thread cancellation state, if last API */ + ret_value = HDpthread_setcancelstate(cancel_counter->previous_state, NULL); + /* Decrement cancellation counter */ --cancel_counter->cancel_count; - - return ret_value; #endif /* H5_HAVE_WIN_THREADS */ -} + + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) +} /* end H5TS_cancel_count_dec() */ #ifdef H5_HAVE_WIN_THREADS /*-------------------------------------------------------------------------- @@ -489,6 +580,8 @@ H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) { BOOL ret_value = TRUE; + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + /* Initialize the critical section (can't fail) */ InitializeCriticalSection(&H5_g.init_lock.CriticalSection); @@ -504,11 +597,9 @@ H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) if (TLS_OUT_OF_INDEXES == (H5TS_apictx_key_g = TlsAlloc())) ret_value = FALSE; - return ret_value; + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_win32_process_enter() */ -#endif /* H5_HAVE_WIN_THREADS */ -#ifdef H5_HAVE_WIN_THREADS /*-------------------------------------------------------------------------- * NAME * H5TS_win32_thread_enter @@ -526,6 +617,8 @@ H5TS_win32_thread_enter(void) { herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + /* Currently a placeholder function. TLS setup is performed * elsewhere in the library. * @@ -534,11 +627,9 @@ H5TS_win32_thread_enter(void) * is used. */ - return ret_value; + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_win32_thread_enter() */ -#endif /* H5_HAVE_WIN_THREADS */ -#ifdef H5_HAVE_WIN_THREADS /*-------------------------------------------------------------------------- * NAME * H5TS_win32_process_exit @@ -554,6 +645,7 @@ H5TS_win32_thread_enter(void) void H5TS_win32_process_exit(void) { + FUNC_ENTER_NOAPI_NAMECHECK_ONLY /* Windows uses a different thread local storage mechanism which does * not support auto-freeing like pthreads' keys. @@ -572,11 +664,9 @@ H5TS_win32_process_exit(void) #endif /* H5_HAVE_CODESTACK */ TlsFree(H5TS_apictx_key_g); - return; + FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY } /* H5TS_win32_process_exit() */ -#endif /* H5_HAVE_WIN_THREADS */ -#ifdef H5_HAVE_WIN_THREADS /*-------------------------------------------------------------------------- * NAME * H5TS_win32_thread_exit @@ -595,6 +685,8 @@ H5TS_win32_thread_exit(void) LPVOID lpvData; herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI_NAMECHECK_ONLY + /* Windows uses a different thread local storage mechanism which does * not support auto-freeing like pthreads' keys. * @@ -618,7 +710,7 @@ H5TS_win32_thread_exit(void) if (lpvData) LocalFree((HLOCAL)lpvData); - return ret_value; + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_win32_thread_exit() */ #endif /* H5_HAVE_WIN_THREADS */ @@ -638,12 +730,13 @@ H5TS_win32_thread_exit(void) *-------------------------------------------------------------------------- */ H5TS_thread_t -H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) +H5TS_create_thread(H5TS_thread_cb_t func, H5TS_attr_t *attr, void *udata) { H5TS_thread_t ret_value; -#ifdef H5_HAVE_WIN_THREADS + FUNC_ENTER_NOAPI_NAMECHECK_ONLY +#ifdef H5_HAVE_WIN_THREADS /* When calling C runtime functions, you should use _beginthread or * _beginthreadex instead of CreateThread. Threads created with * CreateThread risk being killed in low-memory situations. Since we @@ -658,12 +751,11 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) #else /* H5_HAVE_WIN_THREADS */ - pthread_create(&ret_value, attr, (void *(*)(void *))func, udata); + HDpthread_create(&ret_value, attr, (void *(*)(void *))func, udata); #endif /* H5_HAVE_WIN_THREADS */ - return ret_value; - + FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) } /* H5TS_create_thread */ #endif /* H5_HAVE_THREADSAFE */ diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index 700d879..dc85145 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -27,7 +27,7 @@ #ifdef H5_HAVE_THREADSAFE /* Public headers needed by this file */ #ifdef LATER -#include "H5TSpublic.h" /*Public API prototypes */ +#include "H5TSpublic.h" /* Public API prototypes */ #endif /* LATER */ #ifdef H5_HAVE_WIN_THREADS @@ -38,6 +38,8 @@ typedef struct H5TS_mutex_struct { CRITICAL_SECTION CriticalSection; } H5TS_mutex_t; + +/* Portability wrappers around Windows Threads types */ typedef CRITICAL_SECTION H5TS_mutex_simple_t; typedef HANDLE H5TS_thread_t; typedef HANDLE H5TS_attr_t; @@ -50,7 +52,7 @@ typedef INIT_ONCE H5TS_once_t; #define H5TS_SCOPE_PROCESS 0 #define H5TS_CALL_CONV WINAPI -/* Functions */ +/* Portability function aliases */ #define H5TS_get_thread_local_value(key) TlsGetValue(key) #define H5TS_set_thread_local_value(key, value) TlsSetValue(key, value) #define H5TS_attr_init(attr_ptr) 0 @@ -80,6 +82,8 @@ typedef struct H5TS_mutex_struct { pthread_cond_t cond_var; /* condition variable */ unsigned int lock_count; } H5TS_mutex_t; + +/* Portability wrappers around pthread types */ typedef pthread_t H5TS_thread_t; typedef pthread_attr_t H5TS_attr_t; typedef pthread_mutex_t H5TS_mutex_simple_t; @@ -91,7 +95,7 @@ typedef pthread_once_t H5TS_once_t; #define H5TS_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS #define H5TS_CALL_CONV /* unused - Windows only */ -/* Functions */ +/* Portability function aliases */ #define H5TS_get_thread_local_value(key) pthread_getspecific(key) #define H5TS_set_thread_local_value(key, value) pthread_setspecific(key, value) #define H5TS_attr_init(attr_ptr) pthread_attr_init((attr_ptr)) @@ -101,31 +105,31 @@ typedef pthread_once_t H5TS_once_t; #define H5TS_mutex_init(mutex) pthread_mutex_init(mutex, NULL) #define H5TS_mutex_lock_simple(mutex) pthread_mutex_lock(mutex) #define H5TS_mutex_unlock_simple(mutex) pthread_mutex_unlock(mutex) + +/* Pthread-only routines */ H5_DLL uint64_t H5TS_thread_id(void); +H5_DLL void H5TS_pthread_first_thread_init(void); #endif /* H5_HAVE_WIN_THREADS */ -/* External global variables */ -extern H5TS_once_t H5TS_first_init_g; -extern H5TS_key_t H5TS_errstk_key_g; -extern H5TS_key_t H5TS_funcstk_key_g; -extern H5TS_key_t H5TS_apictx_key_g; - -#if defined c_plusplus || defined __cplusplus -extern "C" { -#endif /* c_plusplus || __cplusplus */ - -H5_DLL void H5TS_pthread_first_thread_init(void); -H5_DLL herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex); -H5_DLL herr_t H5TS_mutex_unlock(H5TS_mutex_t *mutex); -H5_DLL herr_t H5TS_cancel_count_inc(void); -H5_DLL herr_t H5TS_cancel_count_dec(void); +/* Library-scope global variables */ +extern H5TS_once_t H5TS_first_init_g; /* Library initialization */ +extern H5TS_key_t H5TS_errstk_key_g; /* Error stacks */ +#ifdef H5_HAVE_CODESTACK +extern H5TS_key_t H5TS_funcstk_key_g; /* Function stacks */ +#endif /* H5_HAVE_CODESTACK */ +extern H5TS_key_t H5TS_apictx_key_g; /* API contexts */ + +/* Library-scope routines */ +/* (Only used within H5private.h macros) */ +H5_DLL herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex); +H5_DLL herr_t H5TS_mutex_unlock(H5TS_mutex_t *mutex); +H5_DLL herr_t H5TS_cancel_count_inc(void); +H5_DLL herr_t H5TS_cancel_count_dec(void); + +/* Testing routines */ H5_DLL H5TS_thread_t H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata); -#if defined c_plusplus || defined __cplusplus -} -#endif /* c_plusplus || __cplusplus */ - #else /* H5_HAVE_THREADSAFE */ #define H5TS_thread_id() ((uint64_t)0) diff --git a/src/H5Tarray.c b/src/H5Tarray.c index 5afe74c..0371437 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -255,13 +255,13 @@ H5T__get_array_ndims(const H5T_t *dt) *------------------------------------------------------------------------- */ int -H5Tget_array_dims2(hid_t type_id, hsize_t dims[]) +H5Tget_array_dims2(hid_t type_id, hsize_t dims[] /*out*/) { H5T_t *dt; /* pointer to array data type */ int ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("Is", "i*h", type_id, dims); + H5TRACE2("Is", "ix", type_id, dims); /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -383,13 +383,13 @@ done: *------------------------------------------------------------------------- */ int -H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int H5_ATTR_UNUSED perm[]) +H5Tget_array_dims1(hid_t type_id, hsize_t dims[] /*out*/, int H5_ATTR_UNUSED perm[] /*out*/) { H5T_t *dt; /* Array datatype to query */ int ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Is", "i*h*Is", type_id, dims, perm); + H5TRACE3("Is", "ixx", type_id, dims, perm); /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 5d0c5cd..758430b 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -120,9 +120,9 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED *path, int H5_ATTR_UNUSED *nprint /*i HDfprintf(H5DEBUG(T), " %-16s %10" PRIdHSIZE " %10u %8s %8s %8s %10s\n", path->name, path->stats.nelmts, path->stats.ncalls, timestrs.user, timestrs.system, timestrs.elapsed, bandwidth); - free(timestrs.user); - free(timestrs.system); - free(timestrs.elapsed); + HDfree(timestrs.user); + HDfree(timestrs.system); + HDfree(timestrs.elapsed); } #endif diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index b508dfd..fd545c2 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -29,4 +29,80 @@ #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 ARRAY Array Datatypes + * \ingroup H5T + * \defgroup ATOM Atomic Datatypes + * \ingroup H5T + * \defgroup COMPOUND Compound Datatypes + * \ingroup H5T + * \defgroup CONV Conversion Function + * \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 + * + * \defgroup PDT Predefined Datatypes + * \ingroup H5T + * \details What is a predefined HDF5 datatype? + * \todo Fill in the blanks! + * + * \defgroup PDTCPU By CPU + * \ingroup PDT + * \details CPU-specific datatypes + * \defgroup PDTALPHA DEC Alpha + * \ingroup PDTCPU + * \defgroup PDTX86 AMD & INTEL + * \ingroup PDTCPU + * \defgroup PDTMIPS SGI MIPS + * \ingroup PDTCPU + * + * \defgroup PDTIEEE IEEE + * \ingroup PDT + * \details The IEEE floating point types in big- and little-endian byte orders. + * + * \defgroup PDTSTD Standard Datatypes + * \ingroup PDT + * \details These are "standard" types. For instance, signed (2's complement) + * and unsigned integers of various sizes in big- and little-endian + * byte orders. + * + * \defgroup PDTUNIX UNIX-specific Datatypes + * \ingroup PDT + * \details Types which are particular to Unix. + * \todo Fill in the blanks! + * + * \defgroup PDTNAT Native Datatypes + * \ingroup PDT + * \details These are the datatypes detected during library \Emph{compilation} + * by \c H5detect(). Their names differ from other HDF5 datatype names + * as follows: + * \li Instead of a class name, precision and byte order as the last + * component, they have a C-like type name. + * \li If the type begins with \c U then it is the unsigned version of + * the integer type; other integer types are signed. + * \li The datatype \c LLONG corresponds C's \Code{long long} and + * \c LDOUBLE is \Code{long double}. These types might be the same + * as \c LONG and \c DOUBLE, respectively. + * \defgroup PDTC9x C9x Integer Datatypes + * \ingroup PDTNAT + * \details C9x integer types + * \todo Fill in the blanks! + * + * \defgroup PDTS Strings + * \ingroup PDT + * + */ + #endif /* _H5Tmodule_H */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 0261428..4f3d89d 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -338,8 +338,7 @@ typedef struct H5T_shared_t { H5T_class_t type; /*which class of type is this? */ size_t size; /*total size of an instance of this type */ unsigned version; /* Version of object header message to encode this object with */ - hbool_t - force_conv; /* Set if this type always needs to be converted and H5T__conv_noop cannot be called */ + hbool_t force_conv; /* Set if this type always needs to be converted and H5T__conv_noop cannot be called */ struct H5T_t * parent; /*parent type for derived datatypes */ H5VL_object_t *owned_vol_obj; /* Vol object owned by this type (free on close) */ union { diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 4675871..b3dc064 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -24,7 +24,7 @@ typedef struct H5T_t H5T_t; #include "H5Tpublic.h" /* Other public headers needed by this file */ -#include "H5MMpublic.h" /* Memory management */ +#include "H5MMpublic.h" /* Memory management */ /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 73a00b6..68a1d79 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -23,194 +23,245 @@ #define HOFFSET(S, M) (offsetof(S, M)) -/* These are the various classes of datatypes */ -/* If this goes over 16 types (0-15), the file format will need to change) */ +/** + * These are the various classes of datatypes + * internal If this goes over 16 types (0-15), the file format will need to + * change. + */ +//! [H5T_class_t_snip] typedef enum H5T_class_t { - H5T_NO_CLASS = -1, /*error */ - H5T_INTEGER = 0, /*integer types */ - H5T_FLOAT = 1, /*floating-point types */ - H5T_TIME = 2, /*date and time types */ - H5T_STRING = 3, /*character string types */ - H5T_BITFIELD = 4, /*bit field types */ - H5T_OPAQUE = 5, /*opaque types */ - H5T_COMPOUND = 6, /*compound types */ - H5T_REFERENCE = 7, /*reference types */ - H5T_ENUM = 8, /*enumeration types */ - H5T_VLEN = 9, /*Variable-Length types */ - H5T_ARRAY = 10, /*Array types */ - - H5T_NCLASSES /*this must be last */ + H5T_NO_CLASS = -1, /**< error */ + H5T_INTEGER = 0, /**< integer types */ + H5T_FLOAT = 1, /**< floating-point types */ + H5T_TIME = 2, /**< date and time types */ + H5T_STRING = 3, /**< character string types */ + H5T_BITFIELD = 4, /**< bit field types */ + H5T_OPAQUE = 5, /**< opaque types */ + H5T_COMPOUND = 6, /**< compound types */ + H5T_REFERENCE = 7, /**< reference types */ + H5T_ENUM = 8, /**< enumeration types */ + H5T_VLEN = 9, /**< variable-Length types */ + H5T_ARRAY = 10, /**< array types */ + + H5T_NCLASSES /**< sentinel: this must be last */ } H5T_class_t; +//! [H5T_class_t_snip] -/* Byte orders */ +/** + * Byte orders + */ +//! [H5T_order_t_snip] typedef enum H5T_order_t { - H5T_ORDER_ERROR = -1, /*error */ - H5T_ORDER_LE = 0, /*little endian */ - H5T_ORDER_BE = 1, /*bit endian */ - H5T_ORDER_VAX = 2, /*VAX mixed endian */ - H5T_ORDER_MIXED = 3, /*Compound type with mixed member orders */ - H5T_ORDER_NONE = 4 /*no particular order (strings, bits,..) */ + H5T_ORDER_ERROR = -1, /**< error */ + H5T_ORDER_LE = 0, /**< little endian */ + H5T_ORDER_BE = 1, /**< bit endian */ + H5T_ORDER_VAX = 2, /**< VAX mixed endian */ + H5T_ORDER_MIXED = 3, /**< Compound type with mixed member orders */ + H5T_ORDER_NONE = 4 /**< no particular order (strings, bits,..) */ /*H5T_ORDER_NONE must be last */ } H5T_order_t; +//! [H5T_order_t_snip] -/* Types of integer sign schemes */ +/** + * Types of integer sign schemes + */ +//! [H5T_sign_t_snip] typedef enum H5T_sign_t { - H5T_SGN_ERROR = -1, /*error */ - H5T_SGN_NONE = 0, /*this is an unsigned type */ - H5T_SGN_2 = 1, /*two's complement */ + H5T_SGN_ERROR = -1, /**< error */ + H5T_SGN_NONE = 0, /**< this is an unsigned type */ + H5T_SGN_2 = 1, /**< two's complement */ - H5T_NSGN = 2 /*this must be last! */ + H5T_NSGN = 2 /** sentinel: this must be last! */ } H5T_sign_t; +//! [H5T_sign_t_snip] -/* Floating-point normalization schemes */ +/** + * Floating-point normalization schemes + */ +//! [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 */ - H5T_NORM_MSBSET = 1, /*msb of mantissa is always 1 */ - H5T_NORM_NONE = 2 /*not normalized */ + H5T_NORM_ERROR = -1, /**< error */ + H5T_NORM_IMPLIED = 0, /**< msb of mantissa isn't stored, always 1 */ + H5T_NORM_MSBSET = 1, /**< msb of mantissa is always 1 */ + H5T_NORM_NONE = 2 /**< not normalized */ /*H5T_NORM_NONE must be last */ } H5T_norm_t; +//! [H5T_norm_t_snip] -/* - * Character set to use for text strings. Do not change these values since - * they appear in HDF5 files! +/** + * Character set to use for text strings. + * \internal Do not change these values since they appear in HDF5 files! */ typedef enum H5T_cset_t { - H5T_CSET_ERROR = -1, /*error */ - H5T_CSET_ASCII = 0, /*US ASCII */ - H5T_CSET_UTF8 = 1, /*UTF-8 Unicode encoding */ - H5T_CSET_RESERVED_2 = 2, /*reserved for later use */ - H5T_CSET_RESERVED_3 = 3, /*reserved for later use */ - H5T_CSET_RESERVED_4 = 4, /*reserved for later use */ - H5T_CSET_RESERVED_5 = 5, /*reserved for later use */ - H5T_CSET_RESERVED_6 = 6, /*reserved for later use */ - H5T_CSET_RESERVED_7 = 7, /*reserved for later use */ - H5T_CSET_RESERVED_8 = 8, /*reserved for later use */ - H5T_CSET_RESERVED_9 = 9, /*reserved for later use */ - H5T_CSET_RESERVED_10 = 10, /*reserved for later use */ - H5T_CSET_RESERVED_11 = 11, /*reserved for later use */ - H5T_CSET_RESERVED_12 = 12, /*reserved for later use */ - H5T_CSET_RESERVED_13 = 13, /*reserved for later use */ - H5T_CSET_RESERVED_14 = 14, /*reserved for later use */ - H5T_CSET_RESERVED_15 = 15 /*reserved for later use */ + H5T_CSET_ERROR = -1, /**< error */ + H5T_CSET_ASCII = 0, /**< US ASCII */ + H5T_CSET_UTF8 = 1, /**< UTF-8 Unicode encoding */ + H5T_CSET_RESERVED_2 = 2, /**< reserved for later use */ + H5T_CSET_RESERVED_3 = 3, /**< reserved for later use */ + H5T_CSET_RESERVED_4 = 4, /**< reserved for later use */ + H5T_CSET_RESERVED_5 = 5, /**< reserved for later use */ + H5T_CSET_RESERVED_6 = 6, /**< reserved for later use */ + H5T_CSET_RESERVED_7 = 7, /**< reserved for later use */ + H5T_CSET_RESERVED_8 = 8, /**< reserved for later use */ + H5T_CSET_RESERVED_9 = 9, /**< reserved for later use */ + H5T_CSET_RESERVED_10 = 10, /**< reserved for later use */ + H5T_CSET_RESERVED_11 = 11, /**< reserved for later use */ + H5T_CSET_RESERVED_12 = 12, /**< reserved for later use */ + H5T_CSET_RESERVED_13 = 13, /**< reserved for later use */ + H5T_CSET_RESERVED_14 = 14, /**< reserved for later use */ + H5T_CSET_RESERVED_15 = 15 /**< reserved for later use */ } H5T_cset_t; -#define H5T_NCSET H5T_CSET_RESERVED_2 /*Number of character sets actually defined */ +#define H5T_NCSET H5T_CSET_RESERVED_2 /*Number of character sets actually defined */ -/* - * Type of padding to use in character strings. Do not change these values - * since they appear in HDF5 files! +/** + * Type of padding to use in character strings. + * \internal Do not change these values since they appear in HDF5 files! */ typedef enum H5T_str_t { - H5T_STR_ERROR = -1, /*error */ - H5T_STR_NULLTERM = 0, /*null terminate like in C */ - H5T_STR_NULLPAD = 1, /*pad with nulls */ - H5T_STR_SPACEPAD = 2, /*pad with spaces like in Fortran */ - H5T_STR_RESERVED_3 = 3, /*reserved for later use */ - H5T_STR_RESERVED_4 = 4, /*reserved for later use */ - H5T_STR_RESERVED_5 = 5, /*reserved for later use */ - H5T_STR_RESERVED_6 = 6, /*reserved for later use */ - H5T_STR_RESERVED_7 = 7, /*reserved for later use */ - H5T_STR_RESERVED_8 = 8, /*reserved for later use */ - H5T_STR_RESERVED_9 = 9, /*reserved for later use */ - H5T_STR_RESERVED_10 = 10, /*reserved for later use */ - H5T_STR_RESERVED_11 = 11, /*reserved for later use */ - H5T_STR_RESERVED_12 = 12, /*reserved for later use */ - H5T_STR_RESERVED_13 = 13, /*reserved for later use */ - H5T_STR_RESERVED_14 = 14, /*reserved for later use */ - H5T_STR_RESERVED_15 = 15 /*reserved for later use */ + H5T_STR_ERROR = -1, /**< error */ + H5T_STR_NULLTERM = 0, /**< null terminate like in C */ + H5T_STR_NULLPAD = 1, /**< pad with nulls */ + H5T_STR_SPACEPAD = 2, /**< pad with spaces like in Fortran */ + H5T_STR_RESERVED_3 = 3, /**< reserved for later use */ + H5T_STR_RESERVED_4 = 4, /**< reserved for later use */ + H5T_STR_RESERVED_5 = 5, /**< reserved for later use */ + H5T_STR_RESERVED_6 = 6, /**< reserved for later use */ + H5T_STR_RESERVED_7 = 7, /**< reserved for later use */ + H5T_STR_RESERVED_8 = 8, /**< reserved for later use */ + H5T_STR_RESERVED_9 = 9, /**< reserved for later use */ + H5T_STR_RESERVED_10 = 10, /**< reserved for later use */ + H5T_STR_RESERVED_11 = 11, /**< reserved for later use */ + H5T_STR_RESERVED_12 = 12, /**< reserved for later use */ + H5T_STR_RESERVED_13 = 13, /**< reserved for later use */ + H5T_STR_RESERVED_14 = 14, /**< reserved for later use */ + H5T_STR_RESERVED_15 = 15 /**< reserved for later use */ } H5T_str_t; -#define H5T_NSTR H5T_STR_RESERVED_3 /*num H5T_str_t types actually defined */ +#define H5T_NSTR H5T_STR_RESERVED_3 /*num H5T_str_t types actually defined */ -/* Type of padding to use in other atomic types */ +/** + * Type of padding to use in other atomic types + */ +//! [H5T_pad_t_snip] typedef enum H5T_pad_t { - H5T_PAD_ERROR = -1, /*error */ - H5T_PAD_ZERO = 0, /*always set to zero */ - H5T_PAD_ONE = 1, /*always set to one */ - H5T_PAD_BACKGROUND = 2, /*set to background value */ + H5T_PAD_ERROR = -1, /**< error */ + H5T_PAD_ZERO = 0, /**< always set to zero */ + H5T_PAD_ONE = 1, /**< always set to one */ + H5T_PAD_BACKGROUND = 2, /**< set to background value */ - H5T_NPAD = 3 /*THIS MUST BE LAST */ + H5T_NPAD = 3 /**< sentinal: THIS MUST BE LAST */ } H5T_pad_t; +//! [H5T_pad_t_snip] -/* Commands sent to conversion functions */ +/** + * 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_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? */ +/** + * 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_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 */ +/** + * 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_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 */ +/** + * 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_DONTCARE = -1, /**< wild card */ + H5T_PERS_HARD = 0, /**< hard conversion function */ + H5T_PERS_SOFT = 1 /**< soft conversion function */ } H5T_pers_t; -/* The order to retrieve atomic native datatype */ +/** + * The order to retrieve atomic native datatype + */ +//! [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 inscendent */ + H5T_DIR_ASCEND = 1, /**< in inscendent order */ + H5T_DIR_DESCEND = 2 /**< in descendent order */ } H5T_direction_t; +//! [H5T_direction_t_snip] -/* The exception type passed into the conversion callback function */ +/** + * 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(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_t; -/* The return value from conversion callback function H5T_conv_except_func_t */ +/** + * The return value from conversion callback function H5T_conv_except_func_t() + */ typedef enum H5T_conv_ret_t { - H5T_CONV_ABORT = -1, /*abort conversion */ - H5T_CONV_UNHANDLED = 0, /*callback function failed to handle the exception */ - H5T_CONV_HANDLED = 1 /*callback function handled the exception successfully */ + H5T_CONV_ABORT = -1, /**< abort conversion */ + H5T_CONV_UNHANDLED = 0, /**< callback function failed to handle the exception */ + H5T_CONV_HANDLED = 1 /**< callback function handled the exception successfully */ } H5T_conv_ret_t; -/* Variable Length Datatype struct in memory */ -/* (This is only used for VL sequences, not VL strings, which are stored in char *'s) */ +/** + * Variable Length Datatype struct in memory (This is only used for VL + * sequences, not VL strings, which are stored in char *'s) + */ typedef struct { - size_t len; /* Length of VL data (in base type units) */ - void * p; /* Pointer to VL data */ + size_t len; /**< Length of VL data (in base type units) */ + void * p; /**< Pointer to VL data */ } hvl_t; /* Variable Length String information */ -#define H5T_VARIABLE \ - ((size_t)( \ - -1)) /* Indicate that a string is variable length (null-terminated in C, instead of fixed length) */ +/** + * Indicate that a string is variable length (null-terminated in C, instead of + * fixed length) + */ +#define H5T_VARIABLE ((size_t)(-1)) /* Opaque information */ -#define H5T_OPAQUE_TAG_MAX 256 /* Maximum length of an opaque tag */ - /* This could be raised without too much difficulty */ +/** + * Maximum length of an opaque tag + * \internal This could be raised without too much difficulty + */ +#define H5T_OPAQUE_TAG_MAX 256 #ifdef __cplusplus extern "C" { #endif -/* All datatype conversion functions are... */ +/** + * 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. +/** + * Exception handler. If an exception like overflow happenes 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); @@ -226,9 +277,25 @@ typedef H5T_conv_ret_t (*H5T_conv_except_func_t)(H5T_conv_except_t except_type, /* * The IEEE floating point types in various byte orders. */ +/** + * \ingroup PDTIEEE + * 32-bit big-endian IEEE floating-point numbers + */ #define H5T_IEEE_F32BE (H5OPEN H5T_IEEE_F32BE_g) +/** + * \ingroup PDTIEEE + * 32-bit little-endian IEEE floating-point numbers + */ #define H5T_IEEE_F32LE (H5OPEN H5T_IEEE_F32LE_g) +/** + * \ingroup PDTIEEE + * 64-bit big-endian IEEE floating-point numbers + */ #define H5T_IEEE_F64BE (H5OPEN H5T_IEEE_F64BE_g) +/** + * \ingroup PDTIEEE + * 64-bit little-endian IEEE floating-point numbers + */ #define H5T_IEEE_F64LE (H5OPEN H5T_IEEE_F64LE_g) H5_DLLVAR hid_t H5T_IEEE_F32BE_g; H5_DLLVAR hid_t H5T_IEEE_F32LE_g; @@ -239,33 +306,141 @@ H5_DLLVAR hid_t H5T_IEEE_F64LE_g; * These are "standard" types. For instance, signed (2's complement) and * unsigned integers of various sizes and byte orders. */ -#define H5T_STD_I8BE (H5OPEN H5T_STD_I8BE_g) -#define H5T_STD_I8LE (H5OPEN H5T_STD_I8LE_g) -#define H5T_STD_I16BE (H5OPEN H5T_STD_I16BE_g) -#define H5T_STD_I16LE (H5OPEN H5T_STD_I16LE_g) -#define H5T_STD_I32BE (H5OPEN H5T_STD_I32BE_g) -#define H5T_STD_I32LE (H5OPEN H5T_STD_I32LE_g) -#define H5T_STD_I64BE (H5OPEN H5T_STD_I64BE_g) -#define H5T_STD_I64LE (H5OPEN H5T_STD_I64LE_g) -#define H5T_STD_U8BE (H5OPEN H5T_STD_U8BE_g) -#define H5T_STD_U8LE (H5OPEN H5T_STD_U8LE_g) -#define H5T_STD_U16BE (H5OPEN H5T_STD_U16BE_g) -#define H5T_STD_U16LE (H5OPEN H5T_STD_U16LE_g) -#define H5T_STD_U32BE (H5OPEN H5T_STD_U32BE_g) -#define H5T_STD_U32LE (H5OPEN H5T_STD_U32LE_g) -#define H5T_STD_U64BE (H5OPEN H5T_STD_U64BE_g) -#define H5T_STD_U64LE (H5OPEN H5T_STD_U64LE_g) -#define H5T_STD_B8BE (H5OPEN H5T_STD_B8BE_g) -#define H5T_STD_B8LE (H5OPEN H5T_STD_B8LE_g) -#define H5T_STD_B16BE (H5OPEN H5T_STD_B16BE_g) -#define H5T_STD_B16LE (H5OPEN H5T_STD_B16LE_g) -#define H5T_STD_B32BE (H5OPEN H5T_STD_B32BE_g) -#define H5T_STD_B32LE (H5OPEN H5T_STD_B32LE_g) -#define H5T_STD_B64BE (H5OPEN H5T_STD_B64BE_g) -#define H5T_STD_B64LE (H5OPEN H5T_STD_B64LE_g) -#define H5T_STD_REF_OBJ (H5OPEN H5T_STD_REF_OBJ_g) +/** + * \ingroup PDTSTD + * 8-bit big-endian signed integers + */ +#define H5T_STD_I8BE (H5OPEN H5T_STD_I8BE_g) +/** + * \ingroup PDTSTD + * 8-bit little-endian signed integers + */ +#define H5T_STD_I8LE (H5OPEN H5T_STD_I8LE_g) +/** + * \ingroup PDTSTD + * 16-bit big-endian signed integers + */ +#define H5T_STD_I16BE (H5OPEN H5T_STD_I16BE_g) +/** + * \ingroup PDTSTD + * 16-bit little-endian signed integers + */ +#define H5T_STD_I16LE (H5OPEN H5T_STD_I16LE_g) +/** + * \ingroup PDTSTD + * 32-bit big-endian signed integers + */ +#define H5T_STD_I32BE (H5OPEN H5T_STD_I32BE_g) +/** + * \ingroup PDTSTD + * 32-bit little-endian signed integers + */ +#define H5T_STD_I32LE (H5OPEN H5T_STD_I32LE_g) +/** + * \ingroup PDTSTD + * 64-bit big-endian signed integers + */ +#define H5T_STD_I64BE (H5OPEN H5T_STD_I64BE_g) +/** + * \ingroup PDTSTD + * 64-bit little-endian signed integers + */ +#define H5T_STD_I64LE (H5OPEN H5T_STD_I64LE_g) +/** + * \ingroup PDTSTD + * 8-bit big-endian unsigned integers + */ +#define H5T_STD_U8BE (H5OPEN H5T_STD_U8BE_g) +/** + * \ingroup PDTSTD + * 8-bit little-endian unsigned integers + */ +#define H5T_STD_U8LE (H5OPEN H5T_STD_U8LE_g) +/** + * \ingroup PDTSTD + * 16-bit big-endian unsigned integers + */ +#define H5T_STD_U16BE (H5OPEN H5T_STD_U16BE_g) +/** + * \ingroup PDTSTD + * 16-bit little-endian unsigned integers + */ +#define H5T_STD_U16LE (H5OPEN H5T_STD_U16LE_g) +/** + * \ingroup PDTSTD + * 32-bit big-endian unsigned integers + */ +#define H5T_STD_U32BE (H5OPEN H5T_STD_U32BE_g) +/** + * \ingroup PDTSTD + * 32-bit little-endian unsigned integers + */ +#define H5T_STD_U32LE (H5OPEN H5T_STD_U32LE_g) +/** + * \ingroup PDTSTD + * 64-bit big-endian unsigned integers + */ +#define H5T_STD_U64BE (H5OPEN H5T_STD_U64BE_g) +/** + * \ingroup PDTSTD + * 64-bit little-endian unsigned integers + */ +#define H5T_STD_U64LE (H5OPEN H5T_STD_U64LE_g) +/** + * \ingroup PDTSTD + * 8-bit big-endian bitfield + */ +#define H5T_STD_B8BE (H5OPEN H5T_STD_B8BE_g) +/** + * \ingroup PDTSTD + * 8-bit little-endian bitfield + */ +#define H5T_STD_B8LE (H5OPEN H5T_STD_B8LE_g) +/** + * \ingroup PDTSTD + * 16-bit big-endian bitfield + */ +#define H5T_STD_B16BE (H5OPEN H5T_STD_B16BE_g) +/** + * \ingroup PDTSTD + * 16-bit little-endian bitfield + */ +#define H5T_STD_B16LE (H5OPEN H5T_STD_B16LE_g) +/** + * \ingroup PDTSTD + * 32-bit big-endian bitfield + */ +#define H5T_STD_B32BE (H5OPEN H5T_STD_B32BE_g) +/** + * \ingroup PDTSTD + * 32-bit little-endian bitfield + */ +#define H5T_STD_B32LE (H5OPEN H5T_STD_B32LE_g) +/** + * \ingroup PDTSTD + * 64-bit big-endian bitfield + */ +#define H5T_STD_B64BE (H5OPEN H5T_STD_B64BE_g) +/** + * \ingroup PDTSTD + * 64-bit little-endian bitfield + */ +#define H5T_STD_B64LE (H5OPEN H5T_STD_B64LE_g) +/** + * \ingroup PDTSTD + * Object reference + */ +#define H5T_STD_REF_OBJ (H5OPEN H5T_STD_REF_OBJ_g) +/** + * \ingroup PDTSTD + * Dataset region reference + */ #define H5T_STD_REF_DSETREG (H5OPEN H5T_STD_REF_DSETREG_g) -#define H5T_STD_REF (H5OPEN H5T_STD_REF_g) +/** + * \ingroup PDTSTD + * Generic reference + */ +#define H5T_STD_REF (H5OPEN H5T_STD_REF_g) H5_DLLVAR hid_t H5T_STD_I8BE_g; H5_DLLVAR hid_t H5T_STD_I8LE_g; H5_DLLVAR hid_t H5T_STD_I16BE_g; @@ -297,9 +472,21 @@ H5_DLLVAR hid_t H5T_STD_REF_g; /* * Types which are particular to Unix. */ +/** + * \ingroup PDTUNIX + */ #define H5T_UNIX_D32BE (H5OPEN H5T_UNIX_D32BE_g) +/** + * \ingroup PDTUNIX + */ #define H5T_UNIX_D32LE (H5OPEN H5T_UNIX_D32LE_g) +/** + * \ingroup PDTUNIX + */ #define H5T_UNIX_D64BE (H5OPEN H5T_UNIX_D64BE_g) +/** + * \ingroup PDTUNIX + */ #define H5T_UNIX_D64LE (H5OPEN H5T_UNIX_D64LE_g) H5_DLLVAR hid_t H5T_UNIX_D32BE_g; H5_DLLVAR hid_t H5T_UNIX_D32LE_g; @@ -310,12 +497,20 @@ H5_DLLVAR hid_t H5T_UNIX_D64LE_g; * Types particular to the C language. String types use `bytes' instead * of `bits' as their size. */ +/** + * \ingroup PDTS + * String datatype in C (size defined in bytes rather than in bits) + */ #define H5T_C_S1 (H5OPEN H5T_C_S1_g) H5_DLLVAR hid_t H5T_C_S1_g; /* * Types particular to Fortran. */ +/** + * \ingroup PDTS + * String datatype in Fortran (as defined for the HDF5 C library) + */ #define H5T_FORTRAN_S1 (H5OPEN H5T_FORTRAN_S1_g) H5_DLLVAR hid_t H5T_FORTRAN_S1_g; @@ -323,63 +518,239 @@ H5_DLLVAR hid_t H5T_FORTRAN_S1_g; * These types are for Intel CPU's. They are little endian with IEEE * floating point. */ -#define H5T_INTEL_I8 H5T_STD_I8LE +/** + * \ingroup PDTX86 + * 8-bit little-endian signed (2's complement) integers for Intel CPUs + */ +#define H5T_INTEL_I8 H5T_STD_I8LE +/** + * \ingroup PDTX86 + * 16-bit little-endian signed (2's complement) integers for Intel CPUs + */ #define H5T_INTEL_I16 H5T_STD_I16LE +/** + * \ingroup PDTX86 + * 32-bit little-endian signed (2's complement) integers for Intel CPUs + */ #define H5T_INTEL_I32 H5T_STD_I32LE +/** + * \ingroup PDTX86 + * 64-bit little-endian signed (2's complement) integers for Intel CPUs + */ #define H5T_INTEL_I64 H5T_STD_I64LE -#define H5T_INTEL_U8 H5T_STD_U8LE +/** + * \ingroup PDTX86 + * 8-bit little-endian unsigned integers for Intel CPUs + */ +#define H5T_INTEL_U8 H5T_STD_U8LE +/** + * \ingroup PDTX86 + * 16-bit little-endian unsigned integers for Intel CPUs + */ #define H5T_INTEL_U16 H5T_STD_U16LE +/** + * \ingroup PDTX86 + * 32-bit little-endian unsigned integers for Intel CPUs + */ #define H5T_INTEL_U32 H5T_STD_U32LE +/** + * \ingroup PDTX86 + * 64-bit little-endian unsigned integers for Intel CPUs + */ #define H5T_INTEL_U64 H5T_STD_U64LE -#define H5T_INTEL_B8 H5T_STD_B8LE +/** + * \ingroup PDTX86 + * 8-bit little-endian bitfield for Intel CPUs + */ +#define H5T_INTEL_B8 H5T_STD_B8LE +/** + * \ingroup PDTX86 + * 16-bit little-endian bitfield for Intel CPUs + */ #define H5T_INTEL_B16 H5T_STD_B16LE +/** + * \ingroup PDTX86 + * 32-bit little-endian bitfield for Intel CPUs + */ #define H5T_INTEL_B32 H5T_STD_B32LE +/** + * \ingroup PDTX86 + * 64-bit little-endian bitfield for Intel CPUs + */ #define H5T_INTEL_B64 H5T_STD_B64LE +/** + * \ingroup PDTX86 + * 32-bit little-endian IEEE floating-point numbers for Intel CPUs + */ #define H5T_INTEL_F32 H5T_IEEE_F32LE +/** + * \ingroup PDTX86 + * 64-bit little-endian IEEE floating-point numbers for Intel CPUs + */ #define H5T_INTEL_F64 H5T_IEEE_F64LE /* * These types are for DEC Alpha CPU's. They are little endian with IEEE * floating point. */ -#define H5T_ALPHA_I8 H5T_STD_I8LE +/** + * \ingroup PDTALPHA + * 8-bit little-endian signed (2's complement) integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_I8 H5T_STD_I8LE +/** + * \ingroup PDTALPHA + * 16-bit little-endian signed (2's complement) integers for DEC Alpha CPUs + */ #define H5T_ALPHA_I16 H5T_STD_I16LE +/** + * \ingroup PDTALPHA + * 32-bit little-endian signed (2's complement) integers for DEC Alpha CPUs + */ #define H5T_ALPHA_I32 H5T_STD_I32LE +/** + * \ingroup PDTALPHA + * 64-bit little-endian signed (2's complement) integers for DEC Alpha CPUs + */ #define H5T_ALPHA_I64 H5T_STD_I64LE -#define H5T_ALPHA_U8 H5T_STD_U8LE +/** + * \ingroup PDTALPHA + * 8-bit little-endian unsigned integers for DEC Alpha CPUs + */ +#define H5T_ALPHA_U8 H5T_STD_U8LE +/** + * \ingroup PDTALPHA + * 16-bit little-endian unsigned integers for DEC Alpha CPUs + */ #define H5T_ALPHA_U16 H5T_STD_U16LE +/** + * \ingroup PDTALPHA + * 32-bit little-endian unsigned integers for DEC Alpha CPUs + */ #define H5T_ALPHA_U32 H5T_STD_U32LE +/** + * \ingroup PDTALPHA + * 64-bit little-endian unsigned integers for DEC Alpha CPUs + */ #define H5T_ALPHA_U64 H5T_STD_U64LE -#define H5T_ALPHA_B8 H5T_STD_B8LE +/** + * \ingroup PDTALPHA + * 8-bit little-endian bitfield for DEC Alpha CPUs + */ +#define H5T_ALPHA_B8 H5T_STD_B8LE +/** + * \ingroup PDTALPHA + * 16-bit little-endian bitfield for DEC Alpha CPUs + */ #define H5T_ALPHA_B16 H5T_STD_B16LE +/** + * \ingroup PDTALPHA + * 32-bit little-endian bitfield for DEC Alpha CPUs + */ #define H5T_ALPHA_B32 H5T_STD_B32LE +/** + * \ingroup PDTALPHA + * 64-bit little-endian bitfield for DEC Alpha CPUs + */ #define H5T_ALPHA_B64 H5T_STD_B64LE +/** + * \ingroup PDTALPHA + * 32-bit little-endian IEEE floating-point numbers for DEC Alpha CPUs + */ #define H5T_ALPHA_F32 H5T_IEEE_F32LE +/** + * \ingroup PDTALPHA + * 64-bit little-endian IEEE floating-point numbers for DEC Alpha CPUs + */ #define H5T_ALPHA_F64 H5T_IEEE_F64LE /* * These types are for MIPS cpu's commonly used in SGI systems. They are big * endian with IEEE floating point. */ -#define H5T_MIPS_I8 H5T_STD_I8BE +/** + * \ingroup PDTMIPS + * 8-bit big-endian signed (2's complement) integers for SGI MIPS CPUs + */ +#define H5T_MIPS_I8 H5T_STD_I8BE +/** + * \ingroup PDTMIPS + * 16-bit big-endian signed (2's complement) integers for SGI MIPS CPUs + */ #define H5T_MIPS_I16 H5T_STD_I16BE +/** + * \ingroup PDTMIPS + * 32-bit big-endian signed (2's complement) integers for SGI MIPS CPUs + */ #define H5T_MIPS_I32 H5T_STD_I32BE +/** + * \ingroup PDTMIPS + * 64-bit big-endian signed (2's complement) integers for SGI MIPS CPUs + */ #define H5T_MIPS_I64 H5T_STD_I64BE -#define H5T_MIPS_U8 H5T_STD_U8BE +/** + * \ingroup PDTMIPS + * 8-bit big-endian unsigned integers for SGI MIPS CPUs + */ +#define H5T_MIPS_U8 H5T_STD_U8BE +/** + * \ingroup PDTMIPS + * 16-bit big-endian unsigned integers for SGI MIPS CPUs + */ #define H5T_MIPS_U16 H5T_STD_U16BE +/** + * \ingroup PDTMIPS + * 32-bit big-endian unsigned integers for SGI MIPS CPUs + */ #define H5T_MIPS_U32 H5T_STD_U32BE +/** + * \ingroup PDTMIPS + * 64-bit big-endian unsigned integers for SGI MIPS CPUs + */ #define H5T_MIPS_U64 H5T_STD_U64BE -#define H5T_MIPS_B8 H5T_STD_B8BE +/** + * \ingroup PDTMIPS + * 8-bit big-endian bitfield for SGI MIPS CPUs + */ +#define H5T_MIPS_B8 H5T_STD_B8BE +/** + * \ingroup PDTMIPS + * 16-bit big-endian bitfield for SGI MIPS CPUs + */ #define H5T_MIPS_B16 H5T_STD_B16BE +/** + * \ingroup PDTMIPS + * 32-bit big-endian bitfield for SGI MIPS CPUs + */ #define H5T_MIPS_B32 H5T_STD_B32BE +/** + * \ingroup PDTMIPS + * 64-bit big-endian bitfield for SGI MIPS CPUs + */ #define H5T_MIPS_B64 H5T_STD_B64BE +/** + * \ingroup PDTMIPS + * 32-bit big-endian IEEE floating-point numbers for MIPS CPUs + */ #define H5T_MIPS_F32 H5T_IEEE_F32BE +/** + * \ingroup PDTMIPS + * 64-bit big-endian IEEE floating-point numbers for MIPS CPUs + */ #define H5T_MIPS_F64 H5T_IEEE_F64BE /* * The VAX floating point types (i.e. in VAX byte order) */ +/** + * \ingroup PDTALPHA + * 32-bit VAX byte order floating-point numbers for OpenVMS on DEC Alpha CPUs + */ #define H5T_VAX_F32 (H5OPEN H5T_VAX_F32_g) +/** + * \ingroup PDTALPHA + * 64-bit VAX byte order floating-point numbers for OpenVMS on DEC Alpha CPUs + */ #define H5T_VAX_F64 (H5OPEN H5T_VAX_F64_g) H5_DLLVAR hid_t H5T_VAX_F32_g; H5_DLLVAR hid_t H5T_VAX_F64_g; @@ -393,32 +764,128 @@ H5_DLLVAR hid_t H5T_VAX_F64_g; * to C's `long long' and LDOUBLE is `long double' (these types might be the * same as `LONG' and `DOUBLE' respectively). */ -#define H5T_NATIVE_CHAR (CHAR_MIN ? H5T_NATIVE_SCHAR : H5T_NATIVE_UCHAR) -#define H5T_NATIVE_SCHAR (H5OPEN H5T_NATIVE_SCHAR_g) -#define H5T_NATIVE_UCHAR (H5OPEN H5T_NATIVE_UCHAR_g) -#define H5T_NATIVE_SHORT (H5OPEN H5T_NATIVE_SHORT_g) +/** + * \ingroup PDTNAT + * C-style \c char + */ +#define H5T_NATIVE_CHAR (CHAR_MIN ? H5T_NATIVE_SCHAR : H5T_NATIVE_UCHAR) +/** + * \ingroup PDTNAT + * C-style \Code{signed char} + */ +#define H5T_NATIVE_SCHAR (H5OPEN H5T_NATIVE_SCHAR_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned char} + */ +#define H5T_NATIVE_UCHAR (H5OPEN H5T_NATIVE_UCHAR_g) +/** + * \ingroup PDTNAT + * C-style \Code{short} + */ +#define H5T_NATIVE_SHORT (H5OPEN H5T_NATIVE_SHORT_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned short} + */ #define H5T_NATIVE_USHORT (H5OPEN H5T_NATIVE_USHORT_g) -#define H5T_NATIVE_INT (H5OPEN H5T_NATIVE_INT_g) -#define H5T_NATIVE_UINT (H5OPEN H5T_NATIVE_UINT_g) -#define H5T_NATIVE_LONG (H5OPEN H5T_NATIVE_LONG_g) -#define H5T_NATIVE_ULONG (H5OPEN H5T_NATIVE_ULONG_g) -#define H5T_NATIVE_LLONG (H5OPEN H5T_NATIVE_LLONG_g) +/** + * \ingroup PDTNAT + * C-style \Code{int} + */ +#define H5T_NATIVE_INT (H5OPEN H5T_NATIVE_INT_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned int} + */ +#define H5T_NATIVE_UINT (H5OPEN H5T_NATIVE_UINT_g) +/** + * \ingroup PDTNAT + * C-style \Code{long} + */ +#define H5T_NATIVE_LONG (H5OPEN H5T_NATIVE_LONG_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned long} + */ +#define H5T_NATIVE_ULONG (H5OPEN H5T_NATIVE_ULONG_g) +/** + * \ingroup PDTNAT + * C-style \Code{long long} + */ +#define H5T_NATIVE_LLONG (H5OPEN H5T_NATIVE_LLONG_g) +/** + * \ingroup PDTNAT + * C-style \Code{unsigned long long} + */ #define H5T_NATIVE_ULLONG (H5OPEN H5T_NATIVE_ULLONG_g) -#define H5T_NATIVE_FLOAT (H5OPEN H5T_NATIVE_FLOAT_g) +/** + * \ingroup PDTNAT + * C-style \Code{float} + */ +#define H5T_NATIVE_FLOAT (H5OPEN H5T_NATIVE_FLOAT_g) +/** + * \ingroup PDTNAT + * C-style \Code{double} + */ #define H5T_NATIVE_DOUBLE (H5OPEN H5T_NATIVE_DOUBLE_g) #if H5_SIZEOF_LONG_DOUBLE != 0 +/** + * \ingroup PDTNAT + * C-style \Code{long double} + */ #define H5T_NATIVE_LDOUBLE (H5OPEN H5T_NATIVE_LDOUBLE_g) #endif -#define H5T_NATIVE_B8 (H5OPEN H5T_NATIVE_B8_g) -#define H5T_NATIVE_B16 (H5OPEN H5T_NATIVE_B16_g) -#define H5T_NATIVE_B32 (H5OPEN H5T_NATIVE_B32_g) -#define H5T_NATIVE_B64 (H5OPEN H5T_NATIVE_B64_g) +/** + * \ingroup PDTNAT + * HDF5 8-bit bitfield based on native types + */ +#define H5T_NATIVE_B8 (H5OPEN H5T_NATIVE_B8_g) +/** + * \ingroup PDTNAT + * HDF5 16-bit bitfield based on native types + */ +#define H5T_NATIVE_B16 (H5OPEN H5T_NATIVE_B16_g) +/** + * \ingroup PDTNAT + * HDF5 32-bit bitfield based on native types + */ +#define H5T_NATIVE_B32 (H5OPEN H5T_NATIVE_B32_g) +/** + * \ingroup PDTNAT + * HDF5 64-bit bitfield based on native types + */ +#define H5T_NATIVE_B64 (H5OPEN H5T_NATIVE_B64_g) +/** + * \ingroup PDTNAT + * HDF5 opaque unit based on native types + */ #define H5T_NATIVE_OPAQUE (H5OPEN H5T_NATIVE_OPAQUE_g) -#define H5T_NATIVE_HADDR (H5OPEN H5T_NATIVE_HADDR_g) -#define H5T_NATIVE_HSIZE (H5OPEN H5T_NATIVE_HSIZE_g) +/** + * \ingroup PDTNAT + * HDF5 address type based on native types + */ +#define H5T_NATIVE_HADDR (H5OPEN H5T_NATIVE_HADDR_g) +/** + * \ingroup PDTNAT + * HDF5 size type based on native types + */ +#define H5T_NATIVE_HSIZE (H5OPEN H5T_NATIVE_HSIZE_g) +/** + * \ingroup PDTNAT + * HDF5 signed size type based on native types + */ #define H5T_NATIVE_HSSIZE (H5OPEN H5T_NATIVE_HSSIZE_g) -#define H5T_NATIVE_HERR (H5OPEN H5T_NATIVE_HERR_g) -#define H5T_NATIVE_HBOOL (H5OPEN H5T_NATIVE_HBOOL_g) +/** + * \ingroup PDTNAT + * HDF5 error code type based on native types + */ +#define H5T_NATIVE_HERR (H5OPEN H5T_NATIVE_HERR_g) +/** + * \ingroup PDTNAT + * HDF5 Boolean type based on native types + */ +#define H5T_NATIVE_HBOOL (H5OPEN H5T_NATIVE_HBOOL_g) H5_DLLVAR hid_t H5T_NATIVE_SCHAR_g; H5_DLLVAR hid_t H5T_NATIVE_UCHAR_g; H5_DLLVAR hid_t H5T_NATIVE_SHORT_g; @@ -446,12 +913,30 @@ H5_DLLVAR hid_t H5T_NATIVE_HERR_g; H5_DLLVAR hid_t H5T_NATIVE_HBOOL_g; /* C9x integer types */ -#define H5T_NATIVE_INT8 (H5OPEN H5T_NATIVE_INT8_g) -#define H5T_NATIVE_UINT8 (H5OPEN H5T_NATIVE_UINT8_g) -#define H5T_NATIVE_INT_LEAST8 (H5OPEN H5T_NATIVE_INT_LEAST8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT8 (H5OPEN H5T_NATIVE_INT8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT8 (H5OPEN H5T_NATIVE_UINT8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_LEAST8 (H5OPEN H5T_NATIVE_INT_LEAST8_g) +/** + * \ingroup PDTC9x + */ #define H5T_NATIVE_UINT_LEAST8 (H5OPEN H5T_NATIVE_UINT_LEAST8_g) -#define H5T_NATIVE_INT_FAST8 (H5OPEN H5T_NATIVE_INT_FAST8_g) -#define H5T_NATIVE_UINT_FAST8 (H5OPEN H5T_NATIVE_UINT_FAST8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_FAST8 (H5OPEN H5T_NATIVE_INT_FAST8_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_FAST8 (H5OPEN H5T_NATIVE_UINT_FAST8_g) H5_DLLVAR hid_t H5T_NATIVE_INT8_g; H5_DLLVAR hid_t H5T_NATIVE_UINT8_g; H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST8_g; @@ -459,12 +944,30 @@ H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST8_g; H5_DLLVAR hid_t H5T_NATIVE_INT_FAST8_g; H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST8_g; -#define H5T_NATIVE_INT16 (H5OPEN H5T_NATIVE_INT16_g) -#define H5T_NATIVE_UINT16 (H5OPEN H5T_NATIVE_UINT16_g) -#define H5T_NATIVE_INT_LEAST16 (H5OPEN H5T_NATIVE_INT_LEAST16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT16 (H5OPEN H5T_NATIVE_INT16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT16 (H5OPEN H5T_NATIVE_UINT16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_LEAST16 (H5OPEN H5T_NATIVE_INT_LEAST16_g) +/** + * \ingroup PDTC9x + */ #define H5T_NATIVE_UINT_LEAST16 (H5OPEN H5T_NATIVE_UINT_LEAST16_g) -#define H5T_NATIVE_INT_FAST16 (H5OPEN H5T_NATIVE_INT_FAST16_g) -#define H5T_NATIVE_UINT_FAST16 (H5OPEN H5T_NATIVE_UINT_FAST16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_FAST16 (H5OPEN H5T_NATIVE_INT_FAST16_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_FAST16 (H5OPEN H5T_NATIVE_UINT_FAST16_g) H5_DLLVAR hid_t H5T_NATIVE_INT16_g; H5_DLLVAR hid_t H5T_NATIVE_UINT16_g; H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST16_g; @@ -472,12 +975,30 @@ H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST16_g; H5_DLLVAR hid_t H5T_NATIVE_INT_FAST16_g; H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST16_g; -#define H5T_NATIVE_INT32 (H5OPEN H5T_NATIVE_INT32_g) -#define H5T_NATIVE_UINT32 (H5OPEN H5T_NATIVE_UINT32_g) -#define H5T_NATIVE_INT_LEAST32 (H5OPEN H5T_NATIVE_INT_LEAST32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT32 (H5OPEN H5T_NATIVE_INT32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT32 (H5OPEN H5T_NATIVE_UINT32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_LEAST32 (H5OPEN H5T_NATIVE_INT_LEAST32_g) +/** + * \ingroup PDTC9x + */ #define H5T_NATIVE_UINT_LEAST32 (H5OPEN H5T_NATIVE_UINT_LEAST32_g) -#define H5T_NATIVE_INT_FAST32 (H5OPEN H5T_NATIVE_INT_FAST32_g) -#define H5T_NATIVE_UINT_FAST32 (H5OPEN H5T_NATIVE_UINT_FAST32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_FAST32 (H5OPEN H5T_NATIVE_INT_FAST32_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_FAST32 (H5OPEN H5T_NATIVE_UINT_FAST32_g) H5_DLLVAR hid_t H5T_NATIVE_INT32_g; H5_DLLVAR hid_t H5T_NATIVE_UINT32_g; H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST32_g; @@ -485,12 +1006,30 @@ H5_DLLVAR hid_t H5T_NATIVE_UINT_LEAST32_g; H5_DLLVAR hid_t H5T_NATIVE_INT_FAST32_g; H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST32_g; -#define H5T_NATIVE_INT64 (H5OPEN H5T_NATIVE_INT64_g) -#define H5T_NATIVE_UINT64 (H5OPEN H5T_NATIVE_UINT64_g) -#define H5T_NATIVE_INT_LEAST64 (H5OPEN H5T_NATIVE_INT_LEAST64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT64 (H5OPEN H5T_NATIVE_INT64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT64 (H5OPEN H5T_NATIVE_UINT64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_LEAST64 (H5OPEN H5T_NATIVE_INT_LEAST64_g) +/** + * \ingroup PDTC9x + */ #define H5T_NATIVE_UINT_LEAST64 (H5OPEN H5T_NATIVE_UINT_LEAST64_g) -#define H5T_NATIVE_INT_FAST64 (H5OPEN H5T_NATIVE_INT_FAST64_g) -#define H5T_NATIVE_UINT_FAST64 (H5OPEN H5T_NATIVE_UINT_FAST64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_INT_FAST64 (H5OPEN H5T_NATIVE_INT_FAST64_g) +/** + * \ingroup PDTC9x + */ +#define H5T_NATIVE_UINT_FAST64 (H5OPEN H5T_NATIVE_UINT_FAST64_g) H5_DLLVAR hid_t H5T_NATIVE_INT64_g; H5_DLLVAR hid_t H5T_NATIVE_UINT64_g; H5_DLLVAR hid_t H5T_NATIVE_INT_LEAST64_g; @@ -499,93 +1038,1838 @@ H5_DLLVAR hid_t H5T_NATIVE_INT_FAST64_g; H5_DLLVAR hid_t H5T_NATIVE_UINT_FAST64_g; /* Operations defined on all datatypes */ -H5_DLL hid_t H5Tcreate(H5T_class_t type, size_t size); -H5_DLL hid_t H5Tcopy(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Creates a new datatype. + * + * \param[in] type Class of datatype to create + * \param[in] size Size, in bytes, of the datatype being created + * + * \return \hid_t{datatype} + * + * \details H5Tcreate() creates a new datatype of the specified class with the + * specified number of bytes. This function is used only with the + * following datatype classes: + * - #H5T_COMPOUND + * - #H5T_OPAQUE + * - #H5T_ENUM + * - #H5T_STRING + * + * Other datatypes, including integer and floating-point datatypes, + * are typically created by using H5Tcopy() to copy and modify a + * predefined datatype. + * + * When creating a variable-length string datatype, \p size must + * be #H5T_VARIABLE. + * + * When creating a fixed-length string datatype, \p size will + * be the length of the string in bytes. The length of the + * string in characters will depend on i the encoding used; see + * H5Pset_char_encoding(). + * + * ENUMs created with this function have a signed native integer + * base datatype. Use H5Tenum_create() if a different integer base + * datatype is required. + * + * 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. + * + */ +H5_DLL hid_t H5Tcreate(H5T_class_t type, size_t size); +/** + * \ingroup H5T + * + * \brief Copies an existing datatype. + * + * \type_id + * + * \return \hid_t{datatype} + * + * \details H5Tcopy() makes a copy of an existing datatype. The returned type + * is always transient and unlocked. + * + * The \p type_id argument can be either a datatype identifier, + * a predefined datatype (defined in H5Tpublic.h), or a dataset + * identifier. If \p type_id is a dataset identifier, this function + * returns a transient, modifiable datatype which is a copy of the + * dataset's datatype. + * + * 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); +/** + * \ingroup H5T + * + * \brief Releases a datatype + * + * \type_id + * + * \return \herr_t + * + * \details H5Tclose() releases the datatype \p dtype_id. Further access + * through this datatype identifier is illegal. Failure to release + * a datatype with this call will result in resource leaks. + * + */ H5_DLL herr_t H5Tclose(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Determines whether two datatype identifiers refer to the same datatype + * + * \type_id{type1_id} + * \type_id{type2_id} + * + * \return \htri_t + * + * \details H5Tequal() determines whether two datatype identifiers refer to + * the same datatype. + * + * \since 1.6 or earlier + * + */ H5_DLL htri_t H5Tequal(hid_t type1_id, hid_t type2_id); +/** + * \ingroup H5T + * + * \brief Locks a datatype + * + * \type_id + * + * \return \herr_t + * + * \details H5Tlock() locks the datatype specified by the dtype_id identifier, + * making it read-only and non-destructible. This is normally done by + * the library for predefined datatypes so the application does not + * inadvertently change or delete a predefined type. Once a datatype + * is locked it can never be unlocked. + * + */ H5_DLL herr_t H5Tlock(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Commits a transient datatype, linking it into the file and creating + * a new committed datatype + * + * \fg_loc_id + * \param[in] name Name given to committed datatype + * \type_id Identifier of datatype to be committed and, upon function’s + * return, identifier for the committed datatype + * \lcpl_id + * \tcpl_id + * \tapl_id + * + * \return \herr_t + * + * \details H5Tcommit2() saves a transient datatype as an immutable committed + * datatype in a file. The datatype specified by \p dtype_id is + * committed to the file with the name name at the location specified + * by \p loc_id and with the datatype creation and access property + * lists \p tcpl_id and \p tapl_id, respectively. + * + * \p loc_id may be a file identifier, or a group identifier within + * that file. \p name may be either an absolute path in the file or + * a relative path from \p loc_id naming the newly-commited datatype. + * + * The link creation property list, \p lcpl_id, governs creation of + * the link(s) by which the new committed datatype is accessed and + * the creation of any intermediate groups that may be missing. + * + * Once commited, this datatype may be used to define the datatype + * of any other dataset or attribute in the file. + * + * This function will not accept a datatype that cannot actually hold + * information. This currently includes compound datatypes with no + * fields and enumerated datatypes with no members. + * + * Committed datatypes are sometimes referred to as named datatypes. + * + * \version 1.8.7 Function modified in this release to reject datatypes that + * will not accomodate actual data, such as a compound datatype + * with no fields or an enumerated datatype with no members. + * + * \since 1.8.0 + * + */ H5_DLL herr_t H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id); -H5_DLL hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id); +/** + * -------------------------------------------------------------------------- + * \ingroup H5T + * + * \brief Opens a committed (named) datatype + * + * \fgdta_loc_id + * \param[in] name Name of the datatype to open + * \tapl_id + * + * \return \hid_t{datatype} + * + * \details H5Topen2() opens a committed datatype at the location specified + * by \p loc_id and returns an identifier for the datatype. \p + * loc_id is either a file or group identifier. The identifier should + * eventually be closed by calling H5Tclose() to release resources. + * + * The committed datatype is opened with the datatype access property + * list tapl_id. + * + * \since 1.8.0 + * + */ +H5_DLL hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id); +/** + * \ingroup H5T + * + * \brief Commits a transient datatype to a file, creating a new named + * datatype, but does not link it into the file structure + * + * \fg_loc_id + * \type_id + * \tcpl_id + * \tapl_id + * + * \return \herr_t + * + * \details H5Tcommit_anon() commits a transient datatype (not immutable) + * to a file, turning it into a named datatype with the specified + * creation and property lists. With default property lists, + * #H5P_DEFAULT, H5Tcommit_anon() provides similar functionality to + * that of H5Tcommit(), with the differences described below. + * + * #H5P_DEFAULT can be passed in for the datatype creation property + * list identifier, \p tcpl_id. The datatype access property list + * identifier, \p tapl_id, is provided for future functionality and + * is not used at this time. This parameter should always be passed + * as the value #H5P_DEFAULT. + * + * Note that H5Tcommit_anon() does not link this newly-committed + * datatype into the file. After the H5Tcommit_anon() call, the + * datatype identifier \p type_id must be linked into the HDF5 file + * structure with H5Olink() or it will be deleted from the file when + * the file is closed. + * + * The differences between this function and H5Tcommit() are as follows: + * \li H5Tcommit_anon() explicitly includes property lists, + * which provides for greater control of the creation process + * and of the properties of the new named datatype. H5Tcommit() + * always uses default properties. + * \li H5Tcommit_anon() neither provides the new named datatype’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. + * + * This function will not accept a datatype that cannot actually + * hold data. This currently includes compound datatypes with no + * fields and enumerated datatypes with no members. + * + * \version 1.8.7 Function modified in this release to reject datatypes that + * will not accomodate actual data, such as a compound datatype + * with no fields or an enumerated datatype with no members. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id); -H5_DLL hid_t H5Tget_create_plist(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Returns a copy of a datatype's creation property list + * + * \type_id + * + * \return \hid_t{datatype creation property list} + * + * \details H5Tget_create_plist() returns a property list identifier + * for the datatype creation property list associated with the datatype + * specified by \p type_id. + * + * The creation property list identifier should be released with + * H5Pclose() to prevent memory leaks. + * + * \since 1.8.0 + * + */ +H5_DLL hid_t H5Tget_create_plist(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Determines whether a datatype is a committed type or a transient type + * + * \type_id + * + * \return \htri_t + * + * \details H5Tcommitted() queries a type to determine whether the type + * specified by the \p dtype_id identifier is a committed (formerly + * known as a \Emph{named}) type or a transient type. If this function returns + * a positive value, then the type is committed (that is, it has been + * committed, perhaps by some other application). Datasets which + * return committed datatypes with H5Dget_type() are able to share + * the datatype with other datasets in the same file. + * + * \version 1.8.0 Fortran API was added + * + * \since 1.6 or earlier + * + */ H5_DLL htri_t H5Tcommitted(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Encodes a datatype object description into a binary buffer + * + * \param[in] obj_id Identifier of the object to be encoded + * \param[in,out] buf Buffer for the object to be encoded into. + * \param[in,out] nalloc IN: The size of the allocated buffer + * OUT: The size of the buffer needed + * + * \return \herr_t + * + * \details H5Tencode() Given datatype identifier, H5Tencode() converts a + * datatype description into binary form in a buffer. Using this + * binary form in the buffer, a datatype object can be reconstructed + * using H5Tdecode() to return a new object handle (\ref hid_t) for + * this datatype. + * + * If the provided buffer is NULL, only the size of buffer needed is + * returned through \p nalloc. + * + * A preliminary H5Tencode() call can be made to find out the size + * of the buffer needed. This value is returned as \p nalloc. That + * value can then be assigned to \p nalloc for a second H5Tencode() + * call, which will retrieve the actual encoded object. + * + * If the library finds that \p nalloc is not big enough for the + * object, it simply returns the size of the buffer needed through + * \p nalloc without encoding the provided buffer. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tencode(hid_t obj_id, void *buf, size_t *nalloc); -H5_DLL hid_t H5Tdecode(const void *buf); +/** + * \ingroup H5T + * + * \brief Decodes a binary object description of datatype and return a new + * object handle + * + * \param[in] buf Buffer for the datatype object to be decoded + * + * \return \hid_t{datatype} + * + * \details H5Tdecode() Given an object description of datatype in binary in a + * buffer, H5Tdecode() reconstructs the HDF5 datatype object and + * returns a new object handle for it. The binary description of + * the object is encoded by H5Tencode(). User is responsible for + * passing in the right buffer. + * + * The datatype identifier returned by this function can be released + * with H5Tclose() when the identifier is no longer needed so that + * resource leaks will not develop. + * + */ +H5_DLL hid_t H5Tdecode(const void *buf); +/** + * \ingroup H5T + * + * \brief Flushes all buffers associated with a committed datatype to disk + * + * \type_id + * + * \return \herr_t + * + * \details H5Tflush() causes all buffers associated with a committed datatype + * \p type_id to be immediately flushed to disk without removing the + * data from the cache. + * + * HDF5 does not possess full control over buffering. H5Tflush() + * flushes the internal HDF5 buffers and then asks the operating + * system (the OS) to flush the system buffers for the open + * files. After that, the OS is responsible for ensuring that the + * data is actually flushed to disk. + * + * \return \herr_t + * + * \since 1.10.0 C function introduced with this release. + * + * \see H5Dflush() + * H5Drefresh() + * H5Tflush() + * H5Grefresh() + * H5Oflush() + * H5Orefresh() + * H5Tflush() + * H5Trefresh() + * H5Fstart_swmr_write() + * H5Pget_append_flush() + * H5Pget_object_flush_cb() + * H5Pset_append_flush() + * H5Pset_object_flush_cb() + * + */ H5_DLL herr_t H5Tflush(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Refreshes all buffers associated with a committed datatype + * + * \type_id + * + * \return \herr_t + * + * \details H5Trefresh() causes all buffers associated with a committed + * datatype to be cleared and immediately re-loaded with updated + * contents from disk. + * + * This function essentially closes the datatype, evicts all + * metadata associated with it from the cache, and then re-opens the + * datatype. The reopened datatype is automatically re-registered + * with the same identifier. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Trefresh(hid_t type_id); /* Operations defined on compound datatypes */ +/** + * \ingroup COMPOUND + * + * \brief Adds a new member to a compound datatype. + * + * \type_id{parent_id} + * \param[in] name Name of the field to insert + * \param[in] offset Offset in memory structure of the field to insert + * \param[in] member_id Datatype identifier of the field to insert + * + * \return \herr_t + * + * \details H5Tinsert() adds another member to the compound datatype, specified + * \p type_id. + * + * The new member has a \p name which must be unique within the + * compound datatype. The \p offset argument defines the start of the + * member in an instance of the compound datatype, and \p member_id + * is the datatype identifier of the new member. + * + * \note Members of a compound datatype do not have to be atomic + * datatypes; a compound datatype can have a member which is a + * compound datatype. + * + * \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); +/** + * \ingroup COMPOUND + * + * \brief Recursively removes padding from within a compound datatype + * + * \type_id + * + * \return \herr_t + * + * \details H5Tpack() recursively removes padding from within a compound + * datatype to make it more efficient (space-wise) to store that data. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tpack(hid_t type_id); /* Operations defined on enumeration datatypes */ -H5_DLL hid_t H5Tenum_create(hid_t base_id); +/** + * \ingroup ENUM + * + * \brief Creates a new enumeration datatype + * + * \param[in] base_id Datatype identifier for the base datatype. Must be an + * integer datatype + * + * \return \hid_t{enumeration datatype} + * + * \details H5Tenum_create() creates a new enumeration datatype based on the + * specified base datatype, dtype_id, which must be an integer datatype. + * + * If a particular architecture datatype is required, a little endian + * or big endian datatype for example, use a native datatype as the + * base datatype and use H5Tconvert() on values as they are read + * from or written to a dataset. + * + * \since 1.2.0 + * + */ +H5_DLL hid_t H5Tenum_create(hid_t base_id); +/** + * \ingroup ENUM + * + * \brief Inserts a new enumeration datatype member + * + * \type_id{type} + * \param[in] name Name of the new member + * \param[in] value Pointer to the value of the new member + * + * \return \herr_t + * + * \details H5Tenum_insert() inserts a new enumeration datatype member into an + * enumeration datatype. + * + * \p type_id is the datatype identifier for the enumeration datatype, + * \p name is the name of the new member, and \p value points to the + * value of the new member. + * + * \p name and \p value must both be unique within \p dtype_id. + * + * \p value points to data which must be of the integer base datatype + * used when the enumeration datatype was created. If a particular + * architecture datatype is required, a little endian or big endian + * datatype for example, use a native datatype as the base datatype + * and use H5Tconvert() on values as they are read from or written + * to a dataset. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tenum_insert(hid_t type, const char *name, const void *value); +/** + * \ingroup ENUM + * + * \brief Returns the symbol name corresponding to a specified member of an + * enumeration datatype + * + * \type_id{type} + * \param[in] value Value of the enumeration datatype + * \param[out] name Buffer for output of the symbol name + * \param[in] size Anticipated size of the symbol name, in bytes + * + * \return Returns a non-negative value if successful. Otherwise returns a + * negative value + * + * \details H5Tenum_nameof() finds the symbol name that corresponds to the + * specified \p value of the enumeration datatype \p type. + * + * At most \p size characters of the symbol \p name are copied into + * the \p name buffer. If the entire symbol name and null terminator + * do not fit in the name buffer, then as many characters as possible + * are copied (not null terminated) and the function fails. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tenum_nameof(hid_t type, const void *value, char *name /*out*/, size_t size); +/** + * \ingroup ENUM + * + * \brief Returns the value corresponding to a specified member of an + * enumeration datatype + * + * \type_id{type} + * \param[in] name Symbol name of the enumeration datatype + * \param[out] value Buffer for the value of the enumeration datatype + * + * \return \herr_t + * + * \details H5Tenum_valueof() finds the value that corresponds to the + * specified name of the enumeration datatype \p dtype_id. + * + * Values returned in \p value will be of the enumerated type’s + * base type, that is, the datatype used by H5Tenum_create() when + * the enumerated type was created. + * + * The \p value buffer must be at least large enough to hold a value + * of that base type. If the size is unknown, you can determine it + * with H5Tget_size(). + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tenum_valueof(hid_t type, const char *name, void *value /*out*/); /* Operations defined on variable-length datatypes */ +/** + * \ingroup VLEN + * + * \brief Creates a new variable-length array datatype + * + * \type_id{base_id}, the element type of the datatype to create + * + * \return \hid_t{variable-length datatype} + * + * \details H5Tvlen_create() creates a new one-dimensional array datatype of + * variable-length (VL) with the base datatype \p base_id. + * + * This one-dimensional array often represents a data sequence of the + * base datatype, such as characters for character sequences or vertex + * coordinates for polygon lists. The base type specified for the VL + * datatype can be any HDF5 datatype, including another VL datatype, a + * compound datatype, or an atomic datatype. + * + * When necessary, use H5Tget_super() to determine the base type of + * the VL datatype. + * + * The datatype identifier returned from this function should be + * released with H5Tclose() or resource leaks will result. Under + * certain circumstances, H5Dvlen_reclaim() must also be used. + * + * \attention H5Tvlen_create() cannot be used to create a variable-length + * string datatype. H5Tvlen_create() called with a string or + * 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. + * + */ H5_DLL hid_t H5Tvlen_create(hid_t base_id); /* Operations defined on array datatypes */ +/** + * \ingroup ARRAY + * + * \brief Creates an array datatype object + * + * \param[in] base_id Datatype identifier for the array base datatype + * \param[in] ndims Rank of the array + * \param[in] dim Size of each array dimension + * + * \return \hid_t{array datatype} + * + * \details H5Tarray_create2() creates a new array datatype object.\n\n + * \p base_id is the datatype of every element of the array, i.e., + * of the number at each position in the array. + * + * \p ndims is the number of dimensions and the size of each dimension + * is specified in the array \p dim. The value of \p rank is + * currently limited to #H5S_MAX_RANK and must be greater than 0 + * (zero). All dimension sizes specified in \p dim must be greater + * than 0 (zero). + * + * \since 1.8.0 + * + */ H5_DLL hid_t H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */]); -H5_DLL int H5Tget_array_ndims(hid_t type_id); -H5_DLL int H5Tget_array_dims2(hid_t type_id, hsize_t dims[]); +/** + * \ingroup ARRAY + * + * \brief Returns the rank of an array datatype + * + * \type_id + * + * \return Returns the rank of the array if successful; otherwise returns a + * negative value. + * + * \details H5Tget_array_ndims() returns the rank, i.e., the number of + * dimensions, of an array datatype object. + * + * \since 1.2.0 + * + */ +H5_DLL int H5Tget_array_ndims(hid_t type_id); +/** + * \ingroup ARRAY + * + * \brief Retrieves sizes of array dimensions + * + * \type_id + * \param[out] dims Sizes of array dimensions + * + * \return Returns the non-negative number of dimensions of the array type + * if successful; otherwise returns a negative value. + * + * \details H5Tget_array_dims2() returns the sizes of the dimensions of the + * specified array datatype object in the array \p dims. + * + * \since 1.2.0 + * + */ +H5_DLL int H5Tget_array_dims2(hid_t type_id, hsize_t dims[]); /* Operations defined on opaque datatypes */ +/** + * \ingroup OPAQUE + * + * \brief Tags an opaque datatype + * + * \type_id{type} of an opaque datatype + * \param[in] tag Descriptive ASCII string with which the opaque datatype is + * to be tagged + * + * \return \herr_t + * + * \details H5Tset_tag() tags an opaque datatype \p type with a descriptive + * ASCII identifier, \p tag. + * + * \p tag is intended to provide a concise description; the maximum + * size is hard-coded in the HDF5 library as 256 bytes + * (#H5T_OPAQUE_TAG_MAX). + * + * \version 1.6.5 The #H5T_OPAQUE_TAG_MAX macro constant, specifying the + * maximum size of an opaque datatype tag, was added in + * H5Tpublic.h. + * + */ H5_DLL herr_t H5Tset_tag(hid_t type, const char *tag); -H5_DLL char * H5Tget_tag(hid_t type); +/** + * \ingroup OPAQUE + * + * \brief Gets the tag associated with an opaque datatype + * + * \type_id{type} of an opaque datatype + * + * \return Returns a pointer to an allocated string if successful; otherwise + * returns NULL. + * + * \details H5Tget_tag() returns the tag associated with the opaque datatype + * \p type. + * + * \attention The tag is returned via a pointer to an allocated string, which + * the caller must free. + * + */ +H5_DLL char *H5Tget_tag(hid_t type); /* Querying property values */ -H5_DLL hid_t H5Tget_super(hid_t type); +/** + * \ingroup H5T + * + * \brief Returns the base datatype from which a datatype is derived + * + * \type_id{type} + * + * \return \hid_t{datatype} + * + * \details H5Tget_super() returns the base datatype from which the datatype + * \p type_id is derived. In the case of an enumeration type, the + * return value is an integer type. + * + * The datatype identifier returned by this function must be released + * with H5Tclose() when the identifier is no longer needed so that + * resource leaks will not develop. + * + */ +H5_DLL hid_t H5Tget_super(hid_t type); +/** + * \ingroup H5T + * + * \brief Returns a datatype class + * + * \type_id + * + * \return Returns the datatype class if successful; otherwise #H5T_NO_CLASS. + * + * \details H5Tget_class() returns the class of the datatype \p type_id. + * Valid class identifiers, as defined in H5Tpublic.h, are: + * \snippet this H5T_class_t_snip + * + * \note The library returns #H5T_STRING for both fixed-length and + * variable-length strings. + * + * \note Unsupported datatype: The time datatype class, #H5T_TIME, + * is not supported. If #H5T_TIME is used, the resulting data will + * be readable and modifiable only on the originating computing + * platform; it will not be portable to other platforms. + * + */ H5_DLL H5T_class_t H5Tget_class(hid_t type_id); -H5_DLL htri_t H5Tdetect_class(hid_t type_id, H5T_class_t cls); -H5_DLL size_t H5Tget_size(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Determines whether a datatype contains any datatypes of the given + * datatype class + * + * \type_id + * \param[in] cls Datatype class + * + * \return \htri_t + * + * \details H5Tdetect_class() determines whether the datatype specified in + * \p type_id contains any datatypes of the datatype class specified + * in \p dtype_class. + * + * This function is useful primarily in recursively examining all the + * fields and/or base types of compound, array, and variable-length + * datatypes. + * + * Valid class identifiers, as defined in H5Tpublic.h, are: + * \snippet this H5T_class_t_snip + * + * \since 1.6.0 + * + */ +H5_DLL htri_t H5Tdetect_class(hid_t type_id, H5T_class_t cls); +/** + * \ingroup H5T + * + * \brief Returns the size of a datatype + * + * \type_id + * + * \return Returns the size of the datatype in bytes if successful; otherwise, + * returns 0. + * + * \details H5Tget_size() returns the size of a datatype in bytes. + * \li For atomic datatypes, array datatypes, compound datatypes, and + * other datatypes of a constant size, the returned value is the + * size of the actual datatype in bytes. + * \li For variable-length string datatypes the returned value is + * the size of the pointer to the actual string, or \c sizeof(\c + * char \c *). This function does not return the size of actual + * variable-length string data. + * \li For variable-length sequence datatypes (see H5Tvlen_create()), + * the returned value is the size of the \p hvl_t struct, or \c + * sizeof(\p hvl_t). The \p hvl_t struct contains a pointer to the + * 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(). + * + */ +H5_DLL size_t H5Tget_size(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Returns the byte order of an atomic datatype + * + * \type_id + * + * \return Returns a byte order constant if successful; otherwise returns + * #H5T_ORDER_ERROR (-1) + * + * \details H5Tget_order() returns the byte order of an atomic datatype. + * Possible return values are: + * \snippet this H5T_order_t_snip + * Members of a compound datatype need not have the same byte + * order. If members of a compound datatype have more than one of + * little endian, big endian, or VAX byte order, H5Tget_order() will + * return #H5T_ORDER_MIXED for the compound datatype. A byte order of + * #H5T_ORDER_NONE will, however, be ignored; for example, if one or + * more members of a compound datatype have byte order #H5T_ORDER_NONE + * but all other members have byte order #H5T_ORDER_LE, H5Tget_order() + * will return #H5T_ORDER_LE for the compound datatype. + * + * \since 1.2.0 + * + */ H5_DLL H5T_order_t H5Tget_order(hid_t type_id); -H5_DLL size_t H5Tget_precision(hid_t type_id); -H5_DLL int H5Tget_offset(hid_t type_id); -H5_DLL herr_t H5Tget_pad(hid_t type_id, H5T_pad_t *lsb /*out*/, H5T_pad_t *msb /*out*/); -H5_DLL H5T_sign_t H5Tget_sign(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Returns the precision of an atomic datatype + * + * \type_id + * + * \return Returns the number of significant bits if successful; otherwise 0 + * + * \details H5Tget_precision() returns the precision of an atomic datatype + * (for example, integer or float) or a datatype whose base (parent) + * type is an atomic type (for example, array, enum and variable + * length). The precision is the number of significant bits which, + * unless padding is present, is 8 times larger than the value + * returned by H5Tget_size(). + * + * \since 1.2.0 + * + */ +H5_DLL size_t H5Tget_precision(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the bit offset of the first significant bit + * + * \type_id + * + * \return Returns an offset value if successful; otherwise returns a + * negative value. + * + * \details H5Tget_offset() retrieves the bit offset of the first significant + * bit. The significant bits of an atomic datum can be offset from the + * beginning of the memory for that datum by an amount of padding. The + * 'offset' property specifies the number of bits of padding that + * appear to the "right of" the value. That is, if we have a 32-bit + * datum with 16-bits of precision having the value 0x1122 then it + * will be laid out in memory as (from small byte address toward + * larger byte addresses): + * \code{.unparsed} + * 0: [ pad] [0x11] [0x22] [ pad] + * 1: [ pad] [0x22] [0x11] [ pad] + * 2: [0x11] [ pad] [ pad] [0x22] + * 3: [0x22] [ pad] [ pad] [0x11] + * \endcode + * + * \since 1.2.0 + * + */ +H5_DLL int H5Tget_offset(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the padding type of the least and most-significant bit padding + * + * \type_id + * \param[out] lsb Buffer for the least-significant bit padding type + * \param[out] msb Buffer for the most-significant bit padding type + * + * \return \herr_t + * + * \details H5Tget_pad() retrieves the padding type of the least and + * most-significant bit padding. Valid padding types are: + * \snippet this H5T_pad_t_snip + * + * \since 1.2.0 + * + */ +H5_DLL herr_t H5Tget_pad(hid_t type_id, H5T_pad_t *lsb /*out*/, H5T_pad_t *msb /*out*/); +/** + * \ingroup ATOM + * + * \brief Retrieves the sign type for an integer type + * + * \type_id + * + * \return Returns a valid sign type if successful; otherwise #H5T_SGN_ERROR (-1) + * + * \details H5Tget_sign() retrieves the sign type for an integer type. + * Valid types are: + * \snippet this H5T_sign_t_snip + * + * \since 1.2.0 + * + */ +H5_DLL H5T_sign_t H5Tget_sign(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves floating point datatype bit field information + * + * \type_id + * \param[out] spos Pointer to location to return floating-point sign bit + * \param[out] epos Pointer to location to return exponent bit-position + * \param[out] esize Pointer to location to return size of exponent in bits + * \param[out] mpos Pointer to location to return mantissa bit-position + * \param[out] msize Pointer to location to return size of mantissa in bits + * + * \return \herr_t + * + * \details H5Tget_fields() retrieves information about the locations of + * the various bit fields of a floating point datatype. The field + * positions are bit positions in the significant region of the + * datatype. Bits are numbered with the least significant bit number + * zero. Any (or even all) of the arguments can be null pointers. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tget_fields(hid_t type_id, size_t *spos /*out*/, size_t *epos /*out*/, size_t *esize /*out*/, size_t *mpos /*out*/, size_t *msize /*out*/); +/** + * \ingroup ATOM + * + * \brief Retrieves the exponent bias of a floating-point type + * + * \type_id + * + * \return Returns the bias if successful and 0, otherwise. + * + * \details H5Tget_ebias() retrieves the exponent bias of a floating-point type. + * + * \since 1.2.0 + * + */ H5_DLL size_t H5Tget_ebias(hid_t type_id); -H5_DLL H5T_norm_t H5Tget_norm(hid_t type_id); -H5_DLL H5T_pad_t H5Tget_inpad(hid_t type_id); -H5_DLL H5T_str_t H5Tget_strpad(hid_t type_id); -H5_DLL int H5Tget_nmembers(hid_t type_id); -H5_DLL char * H5Tget_member_name(hid_t type_id, unsigned membno); -H5_DLL int H5Tget_member_index(hid_t type_id, const char *name); -H5_DLL size_t H5Tget_member_offset(hid_t type_id, unsigned membno); +/** + * -------------------------------------------------------------------------- + * \ingroup ATOM + * + * \brief Retrieves mantissa normalization of a floating-point datatype + * + * \type_id + * + * \return Returns a valid normalization type if successful; otherwise + * returns #H5T_NORM_ERROR (-1) + * + * \details H5Tget_norm() retrieves the mantissa normalization of a + * floating-point datatype. Valid normalization types are: + * \snippet this H5T_norm_t_snip + * + * \since 1.2.0 + * + */ +H5_DLL H5T_norm_t H5Tget_norm(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the internal padding type for unused bits in floating-point + * datatypes + * + * \type_id + * + * \return Returns a valid padding type if successful; otherwise returns + * #H5T_PAD_ERROR (-1). + * + * \details H5Tget_inpad() retrieves the internal padding type for unused + * bits in floating-point datatypes. Valid padding types are: + * \snippet this H5T_pad_t_snip + * + * \since 1.2.0 + * + */ +H5_DLL H5T_pad_t H5Tget_inpad(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Retrieves the type of padding used for a string datatype + * + * \type_id + * + * \return Returns a valid string of the padding if successful; otherwise + * returns #H5T_STR_ERROR (-1) + * + * \details H5Tget_strpad() retrieves the type of padding used for a string + * datatype. + * + * The string padding type is set with H5Tset_strpad(). Possible + * values returned are: + * \str_pad_type + * + * \since 1.2.0 + * + */ +H5_DLL H5T_str_t H5Tget_strpad(hid_t type_id); +/** + * \ingroup COMPOUND + * + * \brief Retrieves the number of elements in a compound or enumeration datatype + * + * \type_id + * + * \return Returns the number of elements if successful; otherwise returns a + * negative value. + * + * \details H5Tget_nmembers() retrieves the number of fields in a compound + * datatype or the number of members of an enumeration datatype. + * + * \since 1.2.0 + * + */ +H5_DLL int H5Tget_nmembers(hid_t type_id); +/** + * \ingroup COMPOUND + * + * \brief Retrieves the name of a compound or enumeration datatype member + * + * \type_id + * \param[in] membno Zero-based index of the field or element + * + * \return Returns a valid pointer to a string allocated with malloc() if + * successful; otherwise returns NULL. + * + * \details H5Tget_member_name() retrieves the name of a field of a compound + * datatype or an element of an enumeration datatype. + * + * The index of the target field or element is specified in \p + * member_no. Compound datatype fields and enumeration datatype + * elements are stored in no particular order with index values of + * 0 through N-1, where N is the value returned by H5Tget_nmembers(). + * + * The HDF5 library allocates a buffer to receive the name of + * the field. The caller must subsequently free the buffer with + * H5free_memory(). + * + * \since 1.2.0 + * + */ +H5_DLL char *H5Tget_member_name(hid_t type_id, unsigned membno); +/** + * \ingroup COMPOUND + * + * \brief Retrieves the index of a compound or enumeration datatype member + * + * \type_id + * \param[in] name Name of the field or member + * + * \return \herr_t + * + * \details H5Tget_member_index() retrieves the index of a field of a compound + * datatype or an element of an enumeration datatype. + * + * The name of the target field or element is specified by \p name. + * + * Fields are stored in no particular order with index values of 0 + * through N-1, where N is the value returned by H5Tget_nmembers() . + * + * \since 1.2.0 + * + */ +H5_DLL int H5Tget_member_index(hid_t type_id, const char *name); +/** + * \ingroup COMPOUND + * + * \brief Retrieves the offset of a field of a compound datatype + * + * \type_id + * \param[in] membno Zero-based index of the field or element + * + * \return Returns the byte offset of the field if successful; otherwise + * returns 0 (zero). + * + * \details H5Tget_member_offset() retrieves the byte offset of the beginning + * of a field within a compound datatype with respect to the beginning + * of the compound datatype datum. + * + * Note that zero is a valid offset and that this function will fail + * only if a call to H5Tget_member_class() fails with the same arguments. + * + * \version 1.6.4 \p member_no parameter type changed to unsigned. + * + * \since 1.2.0 + * + */ +H5_DLL size_t H5Tget_member_offset(hid_t type_id, unsigned membno); +/** + * \ingroup COMPOUND + * + * \brief Returns datatype class of compound datatype member + * + * \type_id + * \param[in] membno Zero-based index of the field or element + * + * \return Returns the datatype class, a non-negative value, if successful; + * otherwise returns a negative value. + * + * \details Given a compound datatype, \p dtype_id, H5Tget_member_class() + * returns the datatype class of the member specified by \p member_no. + * + * Valid class identifiers, as defined in H5Tpublic.h, are: + * \snippet this H5T_class_t_snip + * + * \since 1.2.0 + * + */ H5_DLL H5T_class_t H5Tget_member_class(hid_t type_id, unsigned membno); -H5_DLL hid_t H5Tget_member_type(hid_t type_id, unsigned membno); -H5_DLL herr_t H5Tget_member_value(hid_t type_id, unsigned membno, void *value /*out*/); -H5_DLL H5T_cset_t H5Tget_cset(hid_t type_id); -H5_DLL htri_t H5Tis_variable_str(hid_t type_id); -H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); +/** + * \ingroup COMPOUND + * + * \brief Returns the datatype of the specified member + * + * \type_id + * \param[in] membno Zero-based index of the field or element + * + * \return Returns the identifier of a copy of the datatype of the field if + * successful; otherwise returns a negative value. + * + * \details H5Tget_member_type() returns the datatype of the specified member. + * The caller should invoke H5Tclose() to release resources associated + * with the type. + * + * \version 1.6.4 \p membno parameter type changed to unsigned. + * + * \since 1.2.0 + * + */ +H5_DLL hid_t H5Tget_member_type(hid_t type_id, unsigned membno); +/** + * \ingroup ENUM + * + * \brief Returns the value of an enumeration datatype member + * + * \type_id + * \param[in] membno Number of the enumeration datatype member + * \param[out] value Buffer for the value of the enumeration datatype member + * + * \return \herr_t + * + * \details H5Tget_member_value() returns the value of the enumeration datatype + * member \p member_no. + * + * The member value is returned in a user-supplied buffer pointed to + * by \p value. Values returned in \p value will be of the enumerated + * type’s base type, that is, the datatype used by H5Tenum_create() + * when the enumerated type was created. + * + * The value buffer must be at least large enough to hold a value + * of that base type. If the size is unknown, you can determine it + * with H5Tget_size(). + * + * \since 1.2.0 + * + */ +H5_DLL herr_t H5Tget_member_value(hid_t type_id, unsigned membno, void *value /*out*/); +/** + * \ingroup ATOM + * + * \brief Retrieves the character set type of a string datatype + * + * \type_id + * + * \return Returns a valid character set type if successful; otherwise + * #H5T_CSET_ERROR (-1). + * + * \details H5Tget_cset() retrieves the character set type of a string datatype. + * Valid character set types are: + * \csets + * + * \since 1.2.0 + * + */ +H5_DLL H5T_cset_t H5Tget_cset(hid_t type_id); +/** + * \ingroup ATOM + * + * \brief Determines whether datatype is a variable-length string + * + * \type_id + * + * \return Returns: + * \li a positive value if the specified datatype is a variable-length + * string + * \li 0 if the specified datatype is not a variable-length string + * \li a negative value when the function fails + * + * \details H5Tis_variable_str() determines whether the datatype identified + * by \p dtype_id is a variable-length string. + * + * This function can be used to distinguish between fixed and + * variable-length string datatypes. + * + * \since 1.6.0 + * + */ +H5_DLL htri_t H5Tis_variable_str(hid_t type_id); +/** + * \ingroup H5T + * + * \brief Returns the native datatype identifier of a specified datatype + * + * \type_id + * \param[in] direction Direction of search + * + * \return \hid_t{native datatype} + * + * \details H5Tget_native_type() returns the equivalent native datatype + * identifier for the datatype specified by \p type_id. + * + * H5Tget_native_type() is designed primarily to facilitate use of + * the H5Dread() function, for which users otherwise must undertake a + * multi-step process to determine the native datatype of a dataset + * prior to reading it into memory. This function can be used for + * the following purposes: + * + * \li To determine the native datatype of an atomic datatype + * \li To determine the base datatype of an array, enumerated, or + * variable-length datatype + * \li To determine the native atomic datatypes of the individual + * components of a compound datatype + * + * For example, if \p type_id is a compound datatype, the returned + * datatype identifier will be for a similar compound datatype with + * each element converted to the corresponding native datatype; + * nested compound datatypes will be unwound. If \p type_id is an + * array, the returned datatype identifier will be for the native + * datatype of a single array element. + * + * H5Tget_native_type() selects the first matching native datatype + * from the following list: + * + * \li #H5T_NATIVE_CHAR + * \li #H5T_NATIVE_SHORT + * \li #H5T_NATIVE_INT + * \li #H5T_NATIVE_LONG + * \li #H5T_NATIVE_LLONG + * + * \li #H5T_NATIVE_UCHAR + * \li #H5T_NATIVE_USHORT + * \li #H5T_NATIVE_UINT + * \li #H5T_NATIVE_ULONG + * \li #H5T_NATIVE_ULLONG + * + * \li #H5T_NATIVE_FLOAT + * \li #H5T_NATIVE_DOUBLE + * \li #H5T_NATIVE_LDOUBLE + * + * \li #H5T_NATIVE_B8 + * \li #H5T_NATIVE_B16 + * \li #H5T_NATIVE_B32 + * \li #H5T_NATIVE_B64 + * + * The direction parameter indicates the order in which the library + * searches for a native datatype match. Valid values for direction + * are as follows: + * \snippet this H5T_direction_t_snip + * + * H5Tget_native_type() is designed primarily for use with integer, + * floating point, and bitfield datatypes. String, time, opaque, and + * reference datatypes are returned as a copy of dtype_id. See above + * for compound, array, enumerated, and variable-length datatypes. + * + * The identifier returned by H5Tget_native_type() should eventually + * be closed by calling H5Tclose() to release resources. + * + * \note Please note that a datatype is actually an object + * identifier or handle returned from opening the datatype. It + * is not persistent and its value can be different from one HDF5 + * session to the next. + * + * \note H5Tequal() can be used to compare datatypes. + * + * \note 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. + * + * \since 1.6.0 + * + */ +H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); /* Setting property values */ +/** + * \ingroup H5T + * + * \brief Sets size for a datatype. + * + * \type_id + * \param[in] size New datatype size is bytes or #H5T_VARIABLE + * + * \return \herr_t + * + * \details H5Tset_size() sets the total size, \p size, in bytes, for a + * datatype. + * + * \p size must have a positive value, unless it is passed in as + * #H5T_VARIABLE and the datatype is a string datatype. + * + * \li Numeric datatypes: If the datatype is atomic and the size + * is decreased so that significant bits of the datatype extend + * beyond the edge of the new size, then the offset property of the + * datatype is decreased toward zero. If the offset becomes zero + * and the significant bits of the datatype still hang over the edge + * of the new size, then the number of significant bits is decreased. + * + * \li String or character datatypes: The size set for a string + * datatype should include space for the null-terminator character, + * otherwise it will not be stored on (or retrieved from) + * disk. Adjusting the size of a string automatically sets the + * precision to \p 8*size. + * + * \li Variable-length string datatypes: If \p dtype_id is a + * variable-length string, size must normally be set to #H5T_VARIABLE. + * + * \li Compound datatypes: This function may be used to increase or + * decrease the size of a compound datatype, but the function will + * fail if the new size is too small to accommodate all member fields. + * + * \li Ineligible datatypes: This function cannot be used with + * enumerated datatypes (#H5T_ENUM), array datatypes (#H5T_ARRAY), + * 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”. + * + */ H5_DLL herr_t H5Tset_size(hid_t type_id, size_t size); +/** + * \ingroup ATOM + * + * \brief Sets the byte order of a datatype + * + * \type_id + * \param[in] order Byte order constant + * + * \return \herr_t + * + * \details H5Tset_order() sets the byte order of a datatype.\n + * Byte order can currently be set to any of the following: + * \snippet this H5T_order_t_snip + * #H5T_ORDER_MIXED (3) is a valid value for order only when + * returned by the function H5Tget_order(); it cannot be set with + * H5Tset_order(). + * + * #H5T_ORDER_NONE (4) is a valid value for order, but it has no + * effect. It is valid only for fixed-length strings and object and + * region references and specifies “no particular order.” + * + * The byte order of a derived datatype is initially the same as + * that of the parent type, but can be changed with H5Tset_order(). + * + * This function cannot be used with a datatype after it has been + * committed. + * + * \note Special considerations: + * \li ENUM datatypes: Byte order must be set before any member on + * an ENUM is defined. + * \li Compound datatypes: Byte order is set individually on each member + * of a compound datatype; members of a compound datatype need not + * have the same byte order. + * \li Opaque datatypes: Byte order can be set but has no effect. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_order(hid_t type_id, H5T_order_t order); +/** + * \ingroup ATOM + * + * \brief Sets the precision of an atomic datatype + * + * \type_id + * \param[in] prec Number of bits of precision for datatype + * + * \return \herr_t + * + * \details H5Tset_precision() sets the precision of an atomic datatype. The + * precision is the number of significant bits which, unless + * padding is present, is 8 times larger than the value returned + * by H5Tget_size(). + * + * If the precision is increased then the offset is decreased and + * then the size is increased to insure that significant bits do not + * "hang over" the edge of the datatype. + * + * Changing the precision of an #H5T_STRING automatically changes + * the size as well. The precision must be a multiple of 8. + * + * When decreasing the precision of a floating point type, set the + * locations and sizes of the sign, mantissa, and exponent fields + * first. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_precision(hid_t type_id, size_t prec); +/** + * \ingroup ATOM + * + * \brief Sets the bit offset of the first significant bit + * + * \type_id + * \param[in] offset Offset of first significant bit + * + * \return \herr_t + * + * \details H5Tset_offset() sets the bit offset of the first significant + * bit. The significant bits of an atomic datum can be offset from + * the beginning of the memory for that datum by an amount of + * padding. The offset property specifies the number of bits of + * padding that appear “to the right of” the value. That is, + * if we have a 32-bit datum with 16-bits of precision having the + * value 0x1122, then it will be laid out in memory as (from small + * byte address toward larger byte addresses): + * \code{.unparsed} + * 0: [ pad] [0x11] [0x22] [ pad] + * 1: [ pad] [0x22] [0x11] [ pad] + * 2: [0x11] [ pad] [ pad] [0x22] + * 3: [0x22] [ pad] [ pad] [0x11] + * \endcode + * If the offset is incremented then the total size is incremented + * also if necessary to prevent significant bits of the value from + * hanging over the edge of the datatype. + * + * The offset of an #H5T_STRING cannot be set to anything but zero. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_offset(hid_t type_id, size_t offset); +/** + * \ingroup ATOM + * + * \brief Sets the least and most-significant bits padding types + * + * \type_id + * \param[in] lsb Padding type for least-significant bits + * \param[in] msb Padding type for most-significant bits + * + * \return \herr_t + * + * \details H5Tset_pad() sets the least and most-significant bits padding types. + * Available values are: + * \padding_type + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb); +/** + * \ingroup ATOM + * + * \brief Sets the sign property for an integer type + * + * \type_id + * \param[in] sign Sign type + * + * \return \herr_t + * + * \details H5Tset_sign() sets the sign property for an integer type: + * \sign_prop + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_sign(hid_t type_id, H5T_sign_t sign); +/** + * \ingroup ATOM + * + * \brief Sets locations and sizes of floating point bit fields + * + * \type_id + * \param[in] spos Sign position, i.e., the bit offset of the floating-point + * sign bit + * \param[in] epos Exponent bit position + * \param[in] esize Size of exponent in bits + * \param[in] mpos Mantissa bit position + * \param[in] msize Size of mantissa in bits + * + * \return \herr_t + * + * \details H5Tset_fields() sets the locations and sizes of the various + * floating-point bit fields. The field positions are bit positions + * in the significant region of the datatype. Bits are numbered with + * the least significant bit number zero. + * + * Fields are not allowed to extend beyond the number of bits of + * precision, nor are they allowed to overlap with one another. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize); +/** + * \ingroup ATOM + * + * \brief Sets the exponent bias of a floating-point type + * + * \type_id + * \param[in] ebias Exponent bias value + * + * \return \herr_t + * + * \details H5Tset_ebias() sets the exponent bias of a floating-point type. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_ebias(hid_t type_id, size_t ebias); +/** + * \ingroup ATOM + * + * \brief Sets the mantissa normalization of a floating-point datatype + * + * \type_id + * \param[in] norm Mantissa normalization type + * + * \return \herr_t + * + * \details H5Tset_norm() sets the mantissa normalization of a floating-point + * datatype. Valid normalization types are: + * \snippet this H5T_norm_t_snip + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_norm(hid_t type_id, H5T_norm_t norm); +/** + * \ingroup ATOM + * + * \brief Fills unused internal floating-point bits + * + * \type_id + * \param[in] pad Padding type + * + * \return \herr_t + * + * \details H5Tset_inpad() If any internal bits of a floating point-type are + * unused (that is, those significant bits which are not part of the + * sign, exponent, or mantissa), then H5Tset_inpad() will be filled + * according to the value of the padding value property inpad. Valid + * padding types are: + * \snippet this H5T_pad_t_snip + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_inpad(hid_t type_id, H5T_pad_t pad); +/** + * \ingroup ATOM + * + * \brief Sets character set to be used in a string or character datatype + * + * \type_id + * \param[in] cset Character set type + * + * \return \herr_t + * + * \details H5Tset_cset() sets the character set to be used in a dataset with + * a string or character datatype. + * + * Valid values for cset include the following: + * \csets + * For example, if the character set for the datatype \p type_id is set + * to #H5T_CSET_UTF8, string or character data of datatype dtype_id + * will be encoded using the UTF-8 Unicode character set. + * + * ASCII and UTF-8 Unicode are the only currently supported character + * encodings. Extended ASCII encodings (for example, ISO 8859) are + * not supported. This encoding policy is not enforced by the HDF5 + * library. Using encodings other than ASCII and UTF-8 can lead to + * compatibility and usability problems. + * + * Note that H5Tset_cset() sets the character set for a character or + * string datatype while H5Pset_char_encoding() sets the character + * set used for an HDF5 link or attribute name. + * + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tset_cset(hid_t type_id, H5T_cset_t cset); +/** + * \ingroup ATOM + * + * \brief Defines the type of padding used for character strings + * + * \type_id + * \param[in] strpad String padding type + * + * \return \herr_t + * + * \details H5Tset_strpad() defines the type of padding used for a string + * datatype. + * + * The method used to store character strings differs with the + * programming language. C usually null terminates strings while + * Fortran left-justifies and space-pads strings. + * + * Valid values of \p strpad are as follows: + * \str_pad_type + * When converting from a longer string to a shorter string, the + * behavior is as follows. If the shorter string is #H5T_STR_NULLPAD + * or #H5T_STR_SPACEPAD, then the string is simply truncated. If + * the short string is #H5T_STR_NULLTERM, it is truncated and a null + * terminator is appended. + * + * When converting from a shorter string to a longer string, the + * longer string is padded on the end by appending nulls or spaces. + * + * \since 1.2.0 + * + */ 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); -H5_DLL htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id); -H5_DLL herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background, - hid_t plist_id); -H5_DLL herr_t H5Treclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf); +/** + * \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 + * + * \brief Converts data from one specified datatype to another + * + * \type_id{src_id} of source datatype + * \type_id{dst_id} of destination datatype + * \param[in] nelmts Size of array \p buf + * \param[in,out] buf Array containing pre- and post-conversion values + * \param[in] background Optional background buffer + * \dxpl_id{plist_id} + * + * \return \herr_t + * + * \details H5Tconvert() converts \p nelmts elements from a source datatype, + * specified by \p src_id, to a destination datatype, \p dst_id. The + * source elements are packed in \p buf and on return the destination + * elements will be packed in \p buf. That is, the conversion is + * performed in place. + * + * The optional background buffer is for use with compound datatypes. + * It is an array of \p nelmts values for the destination datatype + * which can then be merged with the converted values to recreate the + * compound datatype. For instance, background might be an array of + * structs with the \c a and \c b fields already initialized and the + * conversion of buf supplies the \c c and \c d field values. + * + * The parameter \p plist_id contains the dataset transfer property list + * identifier which is passed to the conversion functions. As of + * Release 1.2, this parameter is only used to pass along the + * variable-length datatype custom allocation information. + * + * \note H5Tconvert() will not resize the buffer \p buf; it must be large + * 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. + * + */ +H5_DLL herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *background, + hid_t plist_id); +/** + * \ingroup VLEN + * + * \brief Reclaims the variable length (VL) datatype memory buffers + * + * \type_id + * \space_id + * \dxpl_id{plist_id} used to create the buffer + * \param[in] buf Pointer to the buffer to be reclaimed + * + * \return \herr_t + * + * \details H5Treclaim() reclaims memory buffers created to store VL datatypes. + * It only frees the variable length data in the selection defined in + * the dataspace specified by \p space_id. The dataset transfer + * property list \p plist_id is required to find the correct + * allocation and/or free methods for the variable-length data in the + * buffer. + * + * \since 1.12.0 + * + */ +H5_DLL herr_t H5Treclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf); /* Symbols defined for compatibility with previous versions of the HDF5 API. * @@ -598,11 +2882,140 @@ H5_DLL herr_t H5Treclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void /* Typedefs */ /* Function prototypes */ +/** + * \ingroup H5T + * + * \brief Commits a transient datatype to a file, creating a new named datatype + * + * \fg_loc_id + * \param[in] name Name given to committed datatype + * \param[in] type_id Identifier of datatype to be committed + * + * \return \herr_t + * + * \deprecated This function has been renamed from H5Tcommit() and is + * deprecated in favor of the macro #H5Tcommit or the function + * H5Tcommit2(). + * + * \details H5Tcommit1() commits the transient datatype (not immutable) to + * a file, turning it into a named datatype. + * + * The datatype \p dtype_id is committed as a named datatype at the + * location \p loc_id, which is either a file or group identifier, + * with the name \p name. + * + * \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. + * + * As is the case for any object in a group, the length of the name + * of a named datatype is not limited. + * + * See H5Tcommit_anon() for a discussion of the differences between + * H5Tcommit() and H5Tcommit_anon(). + * + * This function will not accept a datatype that cannot actually + * hold data. This currently includes compound datatypes with no + * fields and enumerated datatypes with no members. + * + * \version 1.8.7 Function modified in this release to reject datatypes that + * will not accommodate actual data, such as a compound datatype with + * no fields or an enumerated datatype with no members. + * \version 1.8.0 C function H5Tcommit() renamed to H5Tcommit1() and deprecated + * in this release. + * \since 1.2.0 + * + */ H5_DLL herr_t H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id); -H5_DLL hid_t H5Topen1(hid_t loc_id, const char *name); -H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], - const int perm[/* ndims */]); -H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]); +/** + * \ingroup H5T + * + * \brief Opens a named datatype + * + * \fg_loc_id + * \param[in] name A datatype name, defined within the specified file or group + * + * \return \herr_t + * + * \deprecated This function has been renamed from H5Topen() and is + * deprecated in favor of the macro #H5Topen or the function + * H5Topen2(). + * + * \details H5Topen1() opens a named datatype at the location specified by + * \p loc_id and returns an identifier for the datatype. \p loc_id + * can be either a file or group identifier. The identifier should + * eventually be closed by calling H5Tclose() to release resources. + * + * \version 1.8.0 Function H5Topen() renamed to H5Topen1() and deprecated in + * this release. + * + * \since 1.2.0 + * + */ +H5_DLL hid_t H5Topen1(hid_t loc_id, const char *name); +/** + * \ingroup ARRAY + * + * \brief Creates an array datatype object + * + * \param[in] base_id Datatype identifier for the array base datatype + * \param[in] ndims Rank of the array + * \param[in] dim Size of each array dimension + * \param[in] perm Dimension permutation (Currently not implemented.) + * + * \return \hid_t{array datatype} + * + * \deprecated This function has been renamed from H5Tarray_create() and is + * deprecated in favor of the macro #H5Tarray_create or the function + * H5Tarray_create2(). + * + * \details H5Tarray_create1() creates a new array datatype object.\n\n + * \p base_id is the datatype of every element of the array, i.e., + * of the number at each position in the array. + * + * \p rank is the number of dimensions and the size of each dimension + * is specified in the array dims. The value of rank is currently + * limited to #H5S_MAX_RANK and must be greater than 0 (zero). All + * dimension sizes specified in dims must be greater than 0 (zero). + * + * The array \p perm is designed to contain the dimension permutation, + * i.e. C versus FORTRAN array order. (The parameter perm is + * currently unused and is not yet implemented.) + * + * \version 1.8.0 Function H5Tarray_create() renamed to H5Tarray_create1() + * and deprecated in this release. + * \since 1.4.0 + * + */ +H5_DLL hid_t H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], + const int perm[/* ndims */]); +/** + * \ingroup ARRAY + * + * \brief Retrieves sizes of array dimensions + * + * \type_id + * \param[out] dims Sizes of array dimensions + * \param[out] perm Dimension permutations (This parameter is not used.) + * + * \return Returns the non-negative number of dimensions of the array type + * if successful; otherwise, returns a negative value. + * + * \deprecated This function has been renamed from H5Tget_array_dims() and is + * deprecated in favor of the macro #H5Tget_array_dims or the + * function H5Tget_array_dims2(). + * + * \details H5Tget_array_dims1() returns the sizes of the dimensions and + * the dimension permutations of the specified array datatype object. + * + * The sizes of the dimensions are returned in the array \p dims. + * + * \version 1.8.0 Function H5Tarray_create() renamed to H5Tarray_create1() + * and deprecated in this release. + * \since 1.2.0 + * + */ +H5_DLL int H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int perm[]); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Tref.c b/src/H5Tref.c index 7092a71..c71724f 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -513,7 +513,7 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, s /* Memory-to-memory conversion to support vlen conversion */ if (NULL == dst_file) { - HDmemcpy(dst_buf, src_buf, dst_size); + H5MM_memcpy(dst_buf, src_buf, dst_size); HGOTO_DONE(ret_value); } @@ -602,7 +602,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size /* Memory-to-memory conversion to support vlen conversion */ if (NULL == src_file) { - HDmemcpy(dst_buf, src_buf, src_size); + H5MM_memcpy(dst_buf, src_buf, src_size); HGOTO_DONE(ret_value); } @@ -650,6 +650,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size /* Pass the correct encoding version for the selection depending on the * file libver bounds, this is later retrieved in H5S hyper decode */ H5CX_set_libver_bounds(src_f); + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case H5R_OBJECT2: case H5R_ATTR: diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 0fdd113..2d373d1 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -626,7 +626,7 @@ H5T__vlen_mem_str_getptr(void *_vl) #ifdef H5_NO_ALIGNMENT_RESTRICTIONS char *s = *(char **)_vl; /* Pointer to the user's string information */ #else - char * s = NULL; /* Pointer to the user's string information */ + char *s = NULL; /* Pointer to the user's string information */ #endif FUNC_ENTER_STATIC_NOERR @@ -717,7 +717,7 @@ H5T__vlen_mem_str_read(H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, void *buf, #ifdef H5_NO_ALIGNMENT_RESTRICTIONS char *s = *(char **)_vl; /* Pointer to the user's string information */ #else - char *s; /* Pointer to the user's string information */ + char *s; /* Pointer to the user's string information */ #endif FUNC_ENTER_STATIC_NOERR diff --git a/src/H5UCprivate.h b/src/H5UCprivate.h index 2d6f40f..2687318 100644 --- a/src/H5UCprivate.h +++ b/src/H5UCprivate.h @@ -59,4 +59,4 @@ typedef struct H5UC_t { H5_DLL H5UC_t *H5UC_create(void *s, H5UC_free_func_t free_func); H5_DLL herr_t H5UC_decr(H5UC_t *rc); -#endif /* _H5RSprivate_H */ +#endif /* _H5UCprivate_H */ @@ -85,7 +85,7 @@ H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id) hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE2("i", "*xi", cls, vipl_id); + H5TRACE2("i", "*#i", cls, vipl_id); /* Check arguments */ if (!cls) @@ -757,13 +757,13 @@ done: *--------------------------------------------------------------------------- */ herr_t -H5VLretrieve_lib_state(void **state) +H5VLretrieve_lib_state(void **state /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ /* Must use this, to avoid modifying the API context stack in FUNC_ENTER */ FUNC_ENTER_API_NOINIT - H5TRACE1("e", "**x", state); + H5TRACE1("e", "x", state); /* Check args */ if (NULL == state) diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index 6abbf8d..460a170 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -29,7 +29,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ @@ -263,13 +263,13 @@ done: *--------------------------------------------------------------------------- */ herr_t -H5VLget_cap_flags(hid_t connector_id, unsigned *cap_flags) +H5VLget_cap_flags(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 - H5TRACE2("e", "i*Iu", connector_id, cap_flags); + H5TRACE2("e", "ix", connector_id, cap_flags); /* Check args */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -294,13 +294,13 @@ done: *--------------------------------------------------------------------------- */ herr_t -H5VLget_value(hid_t connector_id, H5VL_class_value_t *value) +H5VLget_value(hid_t connector_id, H5VL_class_value_t *value /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE2("e", "i*VC", connector_id, value); + H5TRACE2("e", "ix", connector_id, value); /* Check args */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -599,12 +599,12 @@ done: *--------------------------------------------------------------------------- */ herr_t -H5VLconnector_str_to_info(const char *str, hid_t connector_id, void **info) +H5VLconnector_str_to_info(const char *str, hid_t connector_id, void **info /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE3("e", "*si**x", str, connector_id, info); + H5TRACE3("e", "*six", str, connector_id, info); /* Call internal routine */ if (H5VL__connector_str_to_info(str, connector_id, info) < 0) @@ -698,13 +698,13 @@ done: *--------------------------------------------------------------------------- */ herr_t -H5VLget_wrap_ctx(void *obj, hid_t connector_id, void **wrap_ctx) +H5VLget_wrap_ctx(void *obj, hid_t connector_id, void **wrap_ctx /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE3("e", "*xi**x", obj, connector_id, wrap_ctx); + H5TRACE3("e", "*xix", obj, connector_id, wrap_ctx); /* Check args and get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -994,14 +994,15 @@ done: */ void * H5VLattr_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, const char *name, - hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req) + hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, + void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE10("*x", "*x*xi*siiiii**x", obj, loc_params, connector_id, name, type_id, space_id, acpl_id, - aapl_id, dxpl_id, req); + H5TRACE10("*x", "*x*#i*siiiiix", obj, loc_params, connector_id, name, type_id, space_id, acpl_id, aapl_id, + dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -1097,13 +1098,13 @@ done: */ void * H5VLattr_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, const char *name, - hid_t aapl_id, hid_t dxpl_id, void **req) + hid_t aapl_id, hid_t dxpl_id, void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("*x", "*x*xi*sii**x", obj, loc_params, connector_id, name, aapl_id, dxpl_id, req); + H5TRACE7("*x", "*x*#i*siix", obj, loc_params, connector_id, name, aapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -1194,13 +1195,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLattr_read(void *obj, hid_t connector_id, hid_t mem_type_id, void *buf, hid_t dxpl_id, void **req) +H5VLattr_read(void *obj, hid_t connector_id, hid_t mem_type_id, void *buf, 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", "*xii*xi**x", obj, connector_id, mem_type_id, buf, dxpl_id, req); + H5TRACE6("e", "*xii*xix", obj, connector_id, mem_type_id, buf, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -1292,13 +1293,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLattr_write(void *obj, hid_t connector_id, hid_t mem_type_id, const void *buf, hid_t dxpl_id, void **req) +H5VLattr_write(void *obj, hid_t connector_id, hid_t mem_type_id, const void *buf, 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", "*xii*xi**x", obj, connector_id, mem_type_id, buf, dxpl_id, req); + H5TRACE6("e", "*xii*xix", obj, connector_id, mem_type_id, buf, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -1398,14 +1400,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, +H5VLattr_get(void *obj, hid_t connector_id, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVai**xx", obj, connector_id, get_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVaixx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -1508,13 +1510,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, va_list arguments) + H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVbi**xx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); + H5TRACE7("e", "*x*#iVbixx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -1616,14 +1618,14 @@ done: *------------------------------------------------------------------------- */ 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) +H5VLattr_optional(void *obj, hid_t connector_id, H5VL_attr_optional_t opt_type, hid_t dxpl_id, + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVsi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVsixx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -1707,13 +1709,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLattr_close(void *obj, hid_t connector_id, hid_t dxpl_id, void **req) +H5VLattr_close(void *obj, hid_t connector_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 - H5TRACE4("e", "*xii**x", obj, connector_id, dxpl_id, req); + H5TRACE4("e", "*xiix", obj, connector_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -1813,13 +1815,13 @@ done: void * H5VLdataset_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, const char *name, hid_t lcpl_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id, - void **req) + void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE11("*x", "*x*xi*siiiiii**x", obj, loc_params, connector_id, name, lcpl_id, type_id, space_id, + H5TRACE11("*x", "*x*#i*siiiiiix", obj, loc_params, connector_id, name, lcpl_id, type_id, space_id, dcpl_id, dapl_id, dxpl_id, req); /* Check args and get class pointer */ @@ -1916,13 +1918,13 @@ done: */ void * H5VLdataset_open(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, const char *name, - hid_t dapl_id, hid_t dxpl_id, void **req) + hid_t dapl_id, hid_t dxpl_id, void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("*x", "*x*xi*sii**x", obj, loc_params, connector_id, name, dapl_id, dxpl_id, req); + H5TRACE7("*x", "*x*#i*siix", obj, loc_params, connector_id, name, dapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -2017,13 +2019,13 @@ done: */ herr_t H5VLdataset_read(void *obj, hid_t connector_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, - hid_t dxpl_id, void *buf, void **req) + hid_t dxpl_id, void *buf, void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE8("e", "*xiiiii*x**x", obj, connector_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, + H5TRACE8("e", "*xiiiii*xx", obj, connector_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, req); /* Check args and get class pointer */ @@ -2119,13 +2121,13 @@ done: */ herr_t H5VLdataset_write(void *obj, hid_t connector_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, - hid_t dxpl_id, const void *buf, void **req) + hid_t dxpl_id, const void *buf, void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE8("e", "*xiiiii*x**x", obj, connector_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, + H5TRACE8("e", "*xiiiii*xx", obj, connector_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, req); /* Check args and get class pointer */ @@ -2226,14 +2228,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLdataset_get(void *obj, hid_t connector_id, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, +H5VLdataset_get(void *obj, hid_t connector_id, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVci**xx", obj, connector_id, get_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVcixx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -2336,13 +2338,13 @@ done: */ 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) + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVdi**xx", obj, connector_id, specific_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVdixx", obj, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -2444,13 +2446,13 @@ done: */ 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) + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVti**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVtixx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -2551,13 +2553,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLdataset_close(void *obj, hid_t connector_id, hid_t dxpl_id, void **req) +H5VLdataset_close(void *obj, hid_t connector_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 - H5TRACE4("e", "*xii**x", obj, connector_id, dxpl_id, req); + H5TRACE4("e", "*xiix", obj, connector_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -2654,14 +2656,15 @@ done: */ void * H5VLdatatype_commit(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, 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) + hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, + void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE10("*x", "*x*xi*siiiii**x", obj, loc_params, connector_id, name, type_id, lcpl_id, tcpl_id, - tapl_id, dxpl_id, req); + H5TRACE10("*x", "*x*#i*siiiiix", obj, loc_params, connector_id, name, type_id, lcpl_id, tcpl_id, tapl_id, + dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -2757,13 +2760,13 @@ done: */ 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) + hid_t tapl_id, hid_t dxpl_id, void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("*x", "*x*xi*sii**x", obj, loc_params, connector_id, name, tapl_id, dxpl_id, req); + H5TRACE7("*x", "*x*#i*siix", obj, loc_params, connector_id, name, tapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -2863,14 +2866,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLdatatype_get(void *obj, hid_t connector_id, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, - va_list arguments) +H5VLdatatype_get(void *obj, hid_t connector_id, H5VL_datatype_get_t get_type, hid_t dxpl_id, + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVei**xx", obj, connector_id, get_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVeixx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -2977,13 +2980,13 @@ done: */ 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) + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVfi**xx", obj, connector_id, specific_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVfixx", obj, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -3086,13 +3089,13 @@ done: */ 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) + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVui**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVuixx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -3183,13 +3186,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLdatatype_close(void *obj, hid_t connector_id, hid_t dxpl_id, void **req) +H5VLdatatype_close(void *obj, hid_t connector_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 - H5TRACE4("e", "*xii**x", obj, connector_id, dxpl_id, req); + H5TRACE4("e", "*xiix", obj, connector_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -3283,7 +3286,8 @@ done: *------------------------------------------------------------------------- */ void * -H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, void **req) +H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, + void **req /*out*/) { H5P_genplist_t * plist; /* Property list pointer */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ @@ -3291,7 +3295,7 @@ H5VLfile_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("*x", "*sIuiii**x", name, flags, fcpl_id, fapl_id, dxpl_id, req); + H5TRACE6("*x", "*sIuiiix", name, flags, fcpl_id, fapl_id, dxpl_id, req); /* Get the VOL info from the fapl */ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -3386,7 +3390,7 @@ done: *------------------------------------------------------------------------- */ void * -H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req) +H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req /*out*/) { H5P_genplist_t * plist; /* Property list pointer */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ @@ -3394,7 +3398,7 @@ H5VLfile_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, vo void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE5("*x", "*sIuii**x", name, flags, fapl_id, dxpl_id, req); + H5TRACE5("*x", "*sIuiix", name, flags, fapl_id, dxpl_id, req); /* Get the VOL info from the fapl */ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -3498,14 +3502,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLfile_get(void *obj, hid_t connector_id, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, +H5VLfile_get(void *obj, hid_t connector_id, H5VL_file_get_t get_type, hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVgi**xx", obj, connector_id, get_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVgixx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -3643,13 +3647,13 @@ done: */ 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) + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVhi**xx", obj, connector_id, specific_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVhixx", obj, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -3748,14 +3752,14 @@ done: *------------------------------------------------------------------------- */ 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) +H5VLfile_optional(void *obj, hid_t connector_id, H5VL_file_optional_t opt_type, hid_t dxpl_id, + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVvi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVvixx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -3850,13 +3854,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLfile_close(void *obj, hid_t connector_id, hid_t dxpl_id, void **req) +H5VLfile_close(void *obj, hid_t connector_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 - H5TRACE4("e", "*xii**x", obj, connector_id, dxpl_id, req); + H5TRACE4("e", "*xiix", obj, connector_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -3952,13 +3956,13 @@ done: */ void * H5VLgroup_create(void *obj, const H5VL_loc_params_t *loc_params, hid_t connector_id, const char *name, - hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req) + hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE9("*x", "*x*xi*siiii**x", obj, loc_params, connector_id, name, lcpl_id, gcpl_id, gapl_id, dxpl_id, + H5TRACE9("*x", "*x*#i*siiiix", obj, loc_params, connector_id, name, lcpl_id, gcpl_id, gapl_id, dxpl_id, req); /* Check args and get class pointer */ @@ -4055,13 +4059,13 @@ done: */ 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) + hid_t gapl_id, hid_t dxpl_id, void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("*x", "*x*xi*sii**x", obj, loc_params, connector_id, name, gapl_id, dxpl_id, req); + H5TRACE7("*x", "*x*#i*siix", obj, loc_params, connector_id, name, gapl_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -4161,14 +4165,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, +H5VLgroup_get(void *obj, hid_t connector_id, H5VL_group_get_t get_type, hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVii**xx", obj, connector_id, get_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiViixx", obj, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -4271,13 +4275,13 @@ done: */ 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) + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVji**xx", obj, connector_id, specific_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVjixx", obj, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -4379,14 +4383,14 @@ done: *------------------------------------------------------------------------- */ 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) +H5VLgroup_optional(void *obj, hid_t connector_id, H5VL_group_optional_t opt_type, hid_t dxpl_id, + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVwi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVwixx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -4481,13 +4485,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLgroup_close(void *obj, hid_t connector_id, hid_t dxpl_id, void **req) +H5VLgroup_close(void *obj, hid_t connector_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 - H5TRACE4("e", "*xii**x", obj, connector_id, dxpl_id, req); + H5TRACE4("e", "*xiix", obj, connector_id, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -4613,15 +4617,15 @@ 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, + hid_t connector_id, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE9("e", "Vk*x*xiiii**xx", create_type, obj, loc_params, connector_id, lcpl_id, lapl_id, dxpl_id, - req, arguments); + H5TRACE9("e", "Vk*x*#iiiixx", create_type, obj, loc_params, connector_id, lcpl_id, lapl_id, dxpl_id, req, + arguments); /* Get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -4721,14 +4725,14 @@ done: 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) + 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", "*x*x*x*xiiii**x", src_obj, loc_params1, dst_obj, loc_params2, connector_id, lcpl_id, - lapl_id, dxpl_id, req); + H5TRACE9("e", "*x*#*x*#iiiix", src_obj, loc_params1, dst_obj, loc_params2, 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))) @@ -4828,14 +4832,14 @@ done: herr_t H5VLlink_move(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) + 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", "*x*x*x*xiiii**x", src_obj, loc_params1, dst_obj, loc_params2, connector_id, lcpl_id, - lapl_id, dxpl_id, req); + H5TRACE9("e", "*x*#*x*#iiiix", src_obj, loc_params1, dst_obj, loc_params2, 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))) @@ -4936,13 +4940,13 @@ 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, va_list arguments) + hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVli**xx", obj, loc_params, connector_id, get_type, dxpl_id, req, arguments); + H5TRACE7("e", "*x*#iVlixx", obj, loc_params, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5045,13 +5049,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, va_list arguments) + H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVmi**xx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); + H5TRACE7("e", "*x*#iVmixx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5152,14 +5156,14 @@ done: *------------------------------------------------------------------------- */ 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) +H5VLlink_optional(void *obj, hid_t connector_id, H5VL_link_optional_t opt_type, hid_t dxpl_id, + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVxi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVxixx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5254,13 +5258,13 @@ done: */ void * H5VLobject_open(void *obj, const H5VL_loc_params_t *params, hid_t connector_id, H5I_type_t *opened_type, - hid_t dxpl_id, void **req) + hid_t dxpl_id, void **req /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("*x", "*x*xi*Iti**x", obj, params, connector_id, opened_type, dxpl_id, req); + H5TRACE6("*x", "*x*#i*Itix", obj, params, connector_id, opened_type, dxpl_id, req); /* Check args and get class pointer */ if (NULL == obj) @@ -5364,14 +5368,14 @@ done: herr_t H5VLobject_copy(void *src_obj, const H5VL_loc_params_t *src_loc_params, const char *src_name, void *dst_obj, const H5VL_loc_params_t *dst_loc_params, const char *dst_name, hid_t connector_id, - hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req) + hid_t ocpypl_id, hid_t lcpl_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 - H5TRACE11("e", "*x*x*s*x*x*siiii**x", src_obj, src_loc_params, src_name, dst_obj, dst_loc_params, - dst_name, connector_id, ocpypl_id, lcpl_id, dxpl_id, req); + H5TRACE11("e", "*x*#*s*x*#*siiiix", src_obj, src_loc_params, src_name, dst_obj, dst_loc_params, dst_name, + connector_id, ocpypl_id, lcpl_id, dxpl_id, req); /* Check args and get class pointers */ if (NULL == src_obj || NULL == dst_obj) @@ -5475,13 +5479,13 @@ 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, va_list arguments) + hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVni**xx", obj, loc_params, connector_id, get_type, dxpl_id, req, arguments); + H5TRACE7("e", "*x*#iVnixx", obj, loc_params, connector_id, get_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5584,13 +5588,14 @@ 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, va_list arguments) + H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req /*out*/, + va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE7("e", "*x*xiVoi**xx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); + H5TRACE7("e", "*x*#iVoixx", obj, loc_params, connector_id, specific_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5695,14 +5700,14 @@ done: *------------------------------------------------------------------------- */ 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) +H5VLobject_optional(void *obj, hid_t connector_id, H5VL_object_optional_t opt_type, hid_t dxpl_id, + void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiVyi**xx", obj, connector_id, opt_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiVyixx", obj, connector_id, opt_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) @@ -5805,13 +5810,13 @@ done: */ herr_t H5VLintrospect_get_conn_cls(void *obj, hid_t connector_id, H5VL_get_conn_lvl_t lvl, - const H5VL_class_t **conn_cls) + const H5VL_class_t **conn_cls /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE4("e", "*xiVL**x", obj, connector_id, lvl, conn_cls); + H5TRACE4("e", "*xiVLx", obj, connector_id, lvl, conn_cls); /* Check args */ if (NULL == obj) @@ -5912,13 +5917,13 @@ done: */ herr_t H5VLintrospect_opt_query(void *obj, hid_t connector_id, H5VL_subclass_t subcls, int opt_type, - hbool_t *supported) + hbool_t *supported /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE5("e", "*xiVSIs*b", obj, connector_id, subcls, opt_type, supported); + H5TRACE5("e", "*xiVSIsx", obj, connector_id, subcls, opt_type, supported); /* Get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -6024,13 +6029,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLrequest_wait(void *req, hid_t connector_id, uint64_t timeout, H5ES_status_t *status) +H5VLrequest_wait(void *req, hid_t connector_id, uint64_t timeout, H5ES_status_t *status /*out*/) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE4("e", "*xiUL*Es", req, connector_id, timeout, status); + H5TRACE4("e", "*xiULx", req, connector_id, timeout, status); /* Get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -6141,7 +6146,7 @@ H5VLrequest_notify(void *req, hid_t connector_id, H5VL_request_notify_t cb, void herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE4("e", "*xix*x", req, connector_id, cb, ctx); + H5TRACE4("e", "*xiVN*x", req, connector_id, cb, ctx); /* Get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -6783,13 +6788,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLblob_get(void *obj, hid_t connector_id, const void *blob_id, void *buf, size_t size, void *ctx) +H5VLblob_get(void *obj, hid_t connector_id, const void *blob_id, void *buf /*out*/, size_t size, void *ctx) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xi*x*xz*x", obj, connector_id, blob_id, buf, size, ctx); + H5TRACE6("e", "*xi*xxz*x", obj, connector_id, blob_id, buf, size, ctx); /* Get class pointer */ if (NULL == obj) @@ -7495,13 +7500,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VLoptional(void *obj, hid_t connector_id, int op_type, hid_t dxpl_id, void **req, va_list arguments) +H5VLoptional(void *obj, hid_t connector_id, int op_type, hid_t dxpl_id, void **req /*out*/, va_list arguments) { H5VL_class_t *cls; /* VOL connector's class struct */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE6("e", "*xiIsi**xx", obj, connector_id, op_type, dxpl_id, req, arguments); + H5TRACE6("e", "*xiIsixx", obj, connector_id, op_type, dxpl_id, req, arguments); /* Check args and get class pointer */ if (NULL == obj) diff --git a/src/H5VLconnector.h b/src/H5VLconnector.h index 63ac910..2abdca3 100644 --- a/src/H5VLconnector.h +++ b/src/H5VLconnector.h @@ -438,39 +438,44 @@ typedef struct H5VL_token_class_t { herr_t (*from_str)(void *obj, H5I_type_t obj_type, const char *token_str, H5O_token_t *token); } H5VL_token_class_t; -/* Class information for each VOL connector */ +/** + * \ingroup H5VLDEV + * Class information for each VOL connector + */ +//! [H5VL_class_t_snip] typedef struct H5VL_class_t { /* Overall connector fields & callbacks */ - unsigned int version; /* VOL connector class struct version # */ - H5VL_class_value_t value; /* Value to identify connector */ - const char * name; /* Connector name (MUST be unique!) */ - unsigned cap_flags; /* Capability flags for connector */ - herr_t (*initialize)(hid_t vipl_id); /* Connector initialization callback */ - herr_t (*terminate)(void); /* Connector termination callback */ + unsigned int version; /**< VOL connector class struct version # */ + H5VL_class_value_t value; /**< Value to identify connector */ + const char * name; /**< Connector name (MUST be unique!) */ + unsigned cap_flags; /**< Capability flags for connector */ + herr_t (*initialize)(hid_t vipl_id); /**< Connector initialization callback */ + herr_t (*terminate)(void); /**< Connector termination callback */ /* VOL framework */ - H5VL_info_class_t info_cls; /* VOL info fields & callbacks */ - H5VL_wrap_class_t wrap_cls; /* VOL object wrap / retrieval callbacks */ + H5VL_info_class_t info_cls; /**< VOL info fields & callbacks */ + H5VL_wrap_class_t wrap_cls; /**< VOL object wrap / retrieval callbacks */ /* Data Model */ - H5VL_attr_class_t attr_cls; /* Attribute (H5A*) class callbacks */ - H5VL_dataset_class_t dataset_cls; /* Dataset (H5D*) class callbacks */ - H5VL_datatype_class_t datatype_cls; /* Datatype (H5T*) class callbacks */ - H5VL_file_class_t file_cls; /* File (H5F*) class callbacks */ - H5VL_group_class_t group_cls; /* Group (H5G*) class callbacks */ - H5VL_link_class_t link_cls; /* Link (H5L*) class callbacks */ - H5VL_object_class_t object_cls; /* Object (H5O*) class callbacks */ + H5VL_attr_class_t attr_cls; /**< Attribute (H5A*) class callbacks */ + H5VL_dataset_class_t dataset_cls; /**< Dataset (H5D*) class callbacks */ + H5VL_datatype_class_t datatype_cls; /**< Datatype (H5T*) class callbacks */ + H5VL_file_class_t file_cls; /**< File (H5F*) class callbacks */ + H5VL_group_class_t group_cls; /**< Group (H5G*) class callbacks */ + H5VL_link_class_t link_cls; /**< Link (H5L*) class callbacks */ + H5VL_object_class_t object_cls; /**< Object (H5O*) class callbacks */ /* Infrastructure / Services */ - H5VL_introspect_class_t introspect_cls; /* Container/connector introspection class callbacks */ - H5VL_request_class_t request_cls; /* Asynchronous request class callbacks */ - H5VL_blob_class_t blob_cls; /* 'Blob' class callbacks */ - H5VL_token_class_t token_cls; /* VOL connector object token class callbacks */ + H5VL_introspect_class_t introspect_cls; /**< Container/connector introspection class callbacks */ + H5VL_request_class_t request_cls; /**< Asynchronous request class callbacks */ + H5VL_blob_class_t blob_cls; /**< 'Blob' class callbacks */ + 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 */ + va_list arguments); /**< Optional callback */ } H5VL_class_t; +//! [H5VL_class_t_snip] /********************/ /* Public Variables */ @@ -485,10 +490,54 @@ extern "C" { #endif /* Helper routines for VOL connector authors */ +/** + * \ingroup H5VLDEV + * \brief Registers a new VOL connector + * + * \param[in] cls A pointer to the plugin structure to register + * \vipl_id + * \return \hid_t{VOL connector} + * + * \details H5VLregister_connector() registers a new VOL connector as a member + * of the virtual object layer class. This VOL connector identifier is + * good until the library is closed or the connector is unregistered. + * + * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL + * initialization property list of class #H5P_VOL_INITIALIZE created + * with H5Pcreate(). When created, this property list contains no + * library properties. If a VOL connector author decides that + * initialization-specific data are needed, they can be added to the + * empty list and retrieved by the connector in the VOL connector's + * initialize callback. Use of the VOL initialization property list is + * 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. + * + * 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); +/** + * \ingroup H5VLDEV + */ H5_DLL void *H5VLobject(hid_t obj_id); +/** + * \ingroup H5VLDEV + */ H5_DLL hid_t H5VLget_file_type(void *file_obj, hid_t connector_id, hid_t dtype_id); +/** + * \ingroup H5VLDEV + */ H5_DLL hid_t H5VLpeek_connector_id_by_name(const char *name); +/** + * \ingroup H5VLDEV + */ H5_DLL hid_t H5VLpeek_connector_id_by_value(H5VL_class_value_t value); #ifdef __cplusplus diff --git a/src/H5VLint.c b/src/H5VLint.c index cc5b8b7..32aa8fb 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -2325,11 +2325,10 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) /* If the datatype is already VOL-managed, the datatype's vol_obj * field will get clobbered later, so disallow this. */ - if (type == H5I_DATATYPE) { + if (type == H5I_DATATYPE) if (vol_wrap_ctx->connector->id == H5VL_NATIVE) if (TRUE == H5T_already_vol_managed((const H5T_t *)obj)) HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype") - } /* Wrap the object with VOL connector info */ if (NULL == (new_obj = H5VL__wrap_obj(obj, type))) diff --git a/src/H5VLmodule.h b/src/H5VLmodule.h index 1ff9137..91d61c9 100644 --- a/src/H5VLmodule.h +++ b/src/H5VLmodule.h @@ -27,4 +27,19 @@ #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 H5VLDEF Definitions + * \ingroup H5VL + * \defgroup H5VLDEV VOL Developer + * \ingroup H5VL + * \defgroup H5VLNAT Native VOL + * \ingroup H5VL + * \defgroup H5VLPT Pass-through VOL + * \ingroup H5VL + */ + #endif /* _H5VLmodule_H */ diff --git a/src/H5VLnative.h b/src/H5VLnative.h index b703c4f..b81f9c1 100644 --- a/src/H5VLnative.h +++ b/src/H5VLnative.h @@ -123,7 +123,13 @@ extern "C" { #endif /* Token <--> address converters */ +/** + * \ingroup H5VLNAT + */ H5_DLL herr_t H5VLnative_addr_to_token(hid_t loc_id, haddr_t addr, H5O_token_t *token); +/** + * \ingroup H5VLNAT + */ H5_DLL herr_t H5VLnative_token_to_addr(hid_t loc_id, H5O_token_t token, haddr_t *addr); /* Not really public but must be included here */ diff --git a/src/H5VLnative_object.c b/src/H5VLnative_object.c index ac717b0..81ff5ea 100644 --- a/src/H5VLnative_object.c +++ b/src/H5VLnative_object.c @@ -338,7 +338,7 @@ H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params, /* Lookup object */ case H5VL_OBJECT_LOOKUP: { - H5O_token_t *token = va_arg(arguments, H5O_token_t *); + H5O_token_t *token = HDva_arg(arguments, H5O_token_t *); HDassert(token); diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index eacb01e..4e967d9 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -2905,8 +2905,11 @@ H5VL_pass_through_request_specific(void *obj, H5VL_request_specific_t specific_t /* Finish use of copied vararg list */ va_end(tmp_arguments); } /* end if */ - else - assert(0 && "Unknown 'specific' operation"); + 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 */ return ret_value; } /* end H5VL_pass_through_request_specific() */ diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index 919a4b8..9c9d60a 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -28,39 +28,64 @@ /* VOL connector identifier values * These are H5VL_class_value_t values, NOT hid_t values! */ -#define H5_VOL_INVALID (-1) /* Invalid ID for VOL connector ID */ -#define H5_VOL_NATIVE 0 /* Native HDF5 file format VOL connector */ -#define H5_VOL_RESERVED 256 /* VOL connector IDs below this value are reserved for library use */ -#define H5_VOL_MAX 65535 /* Maximum VOL connector ID */ +/** + * \ingroup H5VLDEF + * Invalid ID for VOL connector ID + */ +#define H5_VOL_INVALID (-1) +/** + * \ingroup H5VLDEF + * Native HDF5 file format VOL connector + */ +#define H5_VOL_NATIVE 0 +/** + * \ingroup H5VLDEF + * VOL connector IDs below this value are reserved for library use + */ +#define H5_VOL_RESERVED 256 +/** + * \ingroup H5VLDEF + * Maximum VOL connector ID + */ +#define H5_VOL_MAX 65535 /*******************/ /* Public Typedefs */ /*******************/ -/* - * VOL connector identifiers. Values 0 through 255 are for connectors defined - * by the HDF5 library. Values 256 through 511 are available for testing new - * connectors. Subsequent values should be obtained from the HDF5 development - * team at help@hdfgroup.org. +/** + * \ingroup H5VLDEF + * + * \brief VOL connector identifiers. + * + * \details Values 0 through 255 are for connectors defined by the HDF5 + * library. Values 256 through 511 are available for testing new + * connectors. Subsequent values should be obtained from the HDF5 + * development team at mailto:help@hdfgroup.org. */ +//! [H5VL_class_value_t_snip] typedef int H5VL_class_value_t; +//! [H5VL_class_value_t_snip] -/* Enum type for each VOL subclass */ -/* (Used for various queries, etc) */ +/** + * \ingroup H5VLDEF + * \details Enum type for each VOL subclass + * (Used for various queries, etc) + */ typedef enum H5VL_subclass_t { - H5VL_SUBCLS_NONE, /* Operations outside of a subclass */ - H5VL_SUBCLS_INFO, /* 'Info' subclass */ - H5VL_SUBCLS_WRAP, /* 'Wrap' subclass */ - H5VL_SUBCLS_ATTR, /* 'Attribute' subclass */ - H5VL_SUBCLS_DATASET, /* 'Dataset' subclass */ - H5VL_SUBCLS_DATATYPE, /* 'Named datatype' subclass */ - H5VL_SUBCLS_FILE, /* 'File' subclass */ - H5VL_SUBCLS_GROUP, /* 'Group' subclass */ - H5VL_SUBCLS_LINK, /* 'Link' subclass */ - H5VL_SUBCLS_OBJECT, /* 'Object' subclass */ - H5VL_SUBCLS_REQUEST, /* 'Request' subclass */ - H5VL_SUBCLS_BLOB, /* 'Blob' subclass */ - H5VL_SUBCLS_TOKEN /* 'Token' subclass */ + H5VL_SUBCLS_NONE, /**< Operations outside of a subclass */ + H5VL_SUBCLS_INFO, /**< 'Info' subclass */ + H5VL_SUBCLS_WRAP, /**< 'Wrap' subclass */ + H5VL_SUBCLS_ATTR, /**< 'Attribute' subclass */ + H5VL_SUBCLS_DATASET, /**< 'Dataset' subclass */ + H5VL_SUBCLS_DATATYPE, /**< 'Named datatype' subclass */ + H5VL_SUBCLS_FILE, /**< 'File' subclass */ + H5VL_SUBCLS_GROUP, /**< 'Group' subclass */ + H5VL_SUBCLS_LINK, /**< 'Link' subclass */ + H5VL_SUBCLS_OBJECT, /**< 'Object' subclass */ + H5VL_SUBCLS_REQUEST, /**< 'Request' subclass */ + H5VL_SUBCLS_BLOB, /**< 'Blob' subclass */ + H5VL_SUBCLS_TOKEN /**< 'Token' subclass */ } H5VL_subclass_t; /********************/ @@ -75,17 +100,231 @@ typedef enum H5VL_subclass_t { extern "C" { #endif -H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id); -H5_DLL hid_t H5VLregister_connector_by_value(H5VL_class_value_t connector_value, hid_t vipl_id); -H5_DLL htri_t H5VLis_connector_registered_by_name(const char *name); -H5_DLL htri_t H5VLis_connector_registered_by_value(H5VL_class_value_t connector_value); -H5_DLL hid_t H5VLget_connector_id(hid_t obj_id); -H5_DLL hid_t H5VLget_connector_id_by_name(const char *name); -H5_DLL hid_t H5VLget_connector_id_by_value(H5VL_class_value_t connector_value); +/** + * \ingroup H5VL + * \brief Registers a new VOL connector by name + * + * \param[in] connector_name Connector name + * \vipl_id + * \return \hid_t{VOL connector} + * + * \details H5VLregister_connector_by_name() registers a new VOL connector with + * the name \p connector_name as a member of the virtual object layer + * class. This VOL connector identifier is good until the library is + * closed or the connector is unregistered. + * + * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL + * initialization property list of class #H5P_VOL_INITIALIZE created + * with H5Pcreate(). When created, this property list contains no + * library properties. If a VOL connector author decides that + * initialization-specific data are needed, they can be added to the + * empty list and retrieved by the connector in the VOL connector's + * initialize callback. Use of the VOL initialization property list is + * 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. + * + * \since 1.12.0 + */ +H5_DLL hid_t H5VLregister_connector_by_name(const char *connector_name, hid_t vipl_id); +/** + * \ingroup H5VL + * \brief Registers a new VOL connector by value + * + * \param[in] connector_value Connector value + * \vipl_id + * \return \hid_t{VOL connector} + * + * \details H5VLregister_connector_by_value() registers a new VOL connector + * with value connector_value as a member of the virtual object layer + * class. This VOL connector identifier is good until the library is + * closed or the connector is unregistered. + * + * \p connector_value has a type of H5VL_class_value_t, which is + * defined in H5VLpublic.h as follows: + * \snippet this H5VL_class_value_t_snip + * + * Valid VOL connector identifiers can have values from 0 through 255 + * for connectors defined by the HDF5 library. Values 256 through 511 + * are available for testing new connectors. Subsequent values should + * be obtained by contacting the The HDF Help Desk. + * + * \p vipl_id is either #H5P_DEFAULT or the identifier of a VOL + * initialization property list of class #H5P_VOL_INITIALIZE created + * with H5Pcreate(). When created, this property list contains no + * library properties. If a VOL connector author decides that + * initialization-specific data are needed, they can be added to the + * empty list and retrieved by the connector in the VOL connector's + * initialize callback. Use of the VOL initialization property list is + * 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. + * + * \since 1.12.0 + */ +H5_DLL hid_t H5VLregister_connector_by_value(H5VL_class_value_t connector_value, hid_t vipl_id); +/** + * \ingroup H5VL + * \brief Tests whether a VOL class has been registered under a certain name + * + * \param[in] name Alleged name of connector + * \return \htri_t + * + * \details H5VLis_connector_registered_by_name() tests whether a VOL class has + * been registered or not, according to the supplied connector name + * \p name. + * + * \since 1.12.0 + */ +H5_DLL htri_t H5VLis_connector_registered_by_name(const char *name); +/** + * \ingroup H5VL + * \brief Tests whether a VOL class has been registered for a given value + * + * \param[in] connector_value Connector value + * \return \htri_t + * + * \details H5VLis_connector_registered_by_value() tests whether a VOL class + * has been registered, according to the supplied connector value \p + * connector_value. + * + * \p connector_value has a type of H5VL_class_value_t, which is + * defined in H5VLpublic.h as follows: + * \snippet this H5VL_class_value_t_snip + * + * Valid VOL connector identifiers can have values from 0 through 255 + * for connectors defined by the HDF5 library. Values 256 through 511 + * are available for testing new connectors. Subsequent values should + * be obtained by contacting the The HDF Help Desk. + * + * \since 1.12.0 + */ +H5_DLL htri_t H5VLis_connector_registered_by_value(H5VL_class_value_t connector_value); +/** + * \ingroup H5VL + * \brief Retrieves the VOL connector identifier for a given object identifier + * + * \obj_id + * \return \hid_t{VOL connector} + * + * \details H5VLget_connector_id() retrieves the registered VOL connector + * identifier for the specified object identifier \p obj_id. The VOL + * connector identifier must be closed with H5VLclose() when no longer + * in use. + * + * \since 1.12.0 + */ +H5_DLL hid_t H5VLget_connector_id(hid_t obj_id); +/** + * \ingroup H5VL + * \brief Retrieves the identifier for a registered VOL connector name + * + * \param[in] name Connector name + * \return \hid_t{VOL connector} + * + * \details H5VLget_connector_id_by_name() retrieves the identifier for a + * registered VOL connector with the name \p name. The identifier must + * be closed with H5VLclose() when no longer in use. + * + * \since 1.12.0 + */ +H5_DLL hid_t H5VLget_connector_id_by_name(const char *name); +/** + * \ingroup H5VL + * \brief Retrieves the identifier for a registered VOL connector value + * + * \param[in] connector_value Connector value + * \return \hid_t{VOL connector} + * + * \details H5VLget_connector_id_by_value() retrieves the identifier for a + * registered VOL connector with the value \p connector_value. The + * identifier will need to be closed by H5VLclose(). + * + * \p connector_value has a type of H5VL_class_value_t, which is + * defined in H5VLpublic.h as follows: + * \snippet this H5VL_class_value_t_snip + * + * Valid VOL connector identifiers can have values from 0 through 255 + * for connectors defined by the HDF5 library. Values 256 through 511 + * are available for testing new connectors. Subsequent values should + * be obtained by contacting the The HDF Help Desk. + * + * \since 1.12.0 + */ +H5_DLL hid_t H5VLget_connector_id_by_value(H5VL_class_value_t connector_value); +/** + * \ingroup H5VL + * \brief Retrieves a connector name for a VOL + * + * \obj_id{id} or file identifier + * \param[out] name Connector name + * \param[in] size Maximum length of the name to retrieve + * \return Returns the length of the connector name on success, and a negative value on failure. + * + * \details H5VLget_connector_name() retrieves up to \p size elements of the + * VOL name \p name associated with the object or file identifier \p + * id. + * + * Passing in a NULL pointer for size will return the size of the + * connector name. This can be used to determine the size of the + * buffer to allocate for the name. + * + * \since 1.12.0 + */ H5_DLL ssize_t H5VLget_connector_name(hid_t id, char *name /*out*/, size_t size); -H5_DLL herr_t H5VLclose(hid_t connector_id); -H5_DLL herr_t H5VLunregister_connector(hid_t connector_id); -H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, hbool_t *supported); +/** + * \ingroup H5VL + * \brief Closes a VOL connector identifier + * + * \param[in] connector_id Connector identifier + * \return \herr_t + * + * \details H5VLclose() closes a VOL connector identifier. This does not affect + * the file access property lists which have been defined to use this + * VOL connector or files which are already opened under this + * connector. + * + * \since 1.12.0 + */ +H5_DLL herr_t H5VLclose(hid_t connector_id); +/** + * \ingroup H5VL + * \brief Removes a VOL connector identifier from the library + * + * \param[in] connector_id Connector identifier + * \return \herr_t + * + * \details H5VLunregister_connector() removes a VOL connector identifier from + * the library. This does not affect the file access property lists + * which have been defined to use the VOL connector or any files which + * are already opened with this connector. + * + * \attention H5VLunregister_connector() will fail if attempting to unregister + * the native VOL connector. + * + * \since 1.12.0 + */ +H5_DLL herr_t H5VLunregister_connector(hid_t connector_id); +/** + * \ingroup H5VL + * \brief Determine if a VOL connector supports a particular + * optional callback operation. + * + * \obj_id + * \param[in] subcls VOL subclass + * \param[in] opt_type Option type + * \param[out] supported Flag + * \return \herr_t + * + * \since 1.12.0 + */ +H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, hbool_t *supported); #ifdef __cplusplus } @@ -447,13 +447,8 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, con *------------------------------------------------------------------------- */ herr_t -H5VM_hyper_copy(unsigned n, const hsize_t *_size, - - /*destination*/ - const hsize_t *dst_size, const hsize_t *dst_offset, void *_dst, - - /*source*/ - const hsize_t *src_size, const hsize_t *src_offset, const void *_src) +H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const hsize_t *dst_offset, + void *_dst, const hsize_t *src_size, const hsize_t *src_offset, const void *_src) { const uint8_t *src = (const uint8_t *)_src; /*cast for ptr arithmtc */ uint8_t * dst = (uint8_t *)_dst; /*cast for ptr arithmtc */ @@ -491,7 +486,7 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, #ifdef NO_INLINED_CODE dst_start = H5VM_hyper_stride(n, size, dst_size, dst_offset, dst_stride); src_start = H5VM_hyper_stride(n, size, src_size, src_offset, src_stride); -#else /* NO_INLINED_CODE */ +#else /* NO_INLINED_CODE */ /* in-line version of two calls to H5VM_hyper_stride() */ { hsize_t dst_acc; /*accumulator */ @@ -795,13 +790,9 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss *------------------------------------------------------------------------- */ static void -H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, - - /* destination */ - unsigned dst_n, const hsize_t *dst_size, const hsize_t *dst_stride, void *_dst, - - /* source */ - unsigned src_n, const hsize_t *src_size, const hsize_t *src_stride, const void *_src) +H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size, + const hsize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size, + const hsize_t *src_stride, const void *_src) { uint8_t * dst = (uint8_t *)_dst; const uint8_t *src = (const uint8_t *)_src; @@ -47,7 +47,7 @@ typedef struct H5Z_object_t { #ifdef H5_HAVE_PARALLEL hbool_t sanity_checked; /* Whether the sanity check for collectively calling H5Zunregister has been done */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ } H5Z_object_t; /* Enumerated type for dataset creation prelude callbacks */ @@ -175,13 +175,13 @@ H5Z_term_package(void) H5Z_stat_table_g[i].stats[dir].errors, timestrs.user, timestrs.system, timestrs.elapsed, bandwidth); next: - free(timestrs.user); - free(timestrs.system); - free(timestrs.elapsed); + HDfree(timestrs.user); + HDfree(timestrs.system); + HDfree(timestrs.elapsed); } /* end for */ } /* end for */ } /* end if */ -#endif /* H5Z_DEBUG */ +#endif /* H5Z_DEBUG */ /* Free the table of filters */ if (H5Z_table_g) { @@ -255,11 +255,11 @@ H5Zregister(const void *cls) /* Set cls_real to point to the translated structure */ cls_real = &cls_new; -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ - } /* end if */ + } /* end if */ if (cls_real->id < 0 || cls_real->id > H5Z_FILTER_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") @@ -327,7 +327,7 @@ H5Z_register(const H5Z_class2_t *cls) #ifdef H5Z_DEBUG HDmemset(H5Z_stat_table_g + i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ - } /* end if */ + } /* end if */ /* Filter already registered */ else { /* Replace old contents */ @@ -582,12 +582,12 @@ done: *------------------------------------------------------------------------- */ static int -H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key H5_ATTR_PARALLEL_USED) +H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_PARALLEL_USED *key) { H5F_t *f = (H5F_t *)obj_ptr; /* File object for operations */ #ifdef H5_HAVE_PARALLEL H5Z_object_t *object = (H5Z_object_t *)key; -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC @@ -632,7 +632,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key H5_ATTR if (H5P_USER_TRUE == coll_md_read) H5CX_set_coll_metadata_read(TRUE); } /* end if */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ /* Call the flush routine for mounted file hierarchies */ if (H5F_flush_mounts((H5F_t *)obj_ptr) < 0) @@ -1665,12 +1665,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) +H5Zget_filter_info(H5Z_filter_t filter, unsigned *filter_config_flags /*out*/) { herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); + H5TRACE2("e", "Zfx", filter, filter_config_flags); /* Get the filter info */ if (H5Z_get_filter_info(filter, filter_config_flags) < 0) diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h index d83f338..3be2629 100644 --- a/src/H5Zmodule.h +++ b/src/H5Zmodule.h @@ -29,4 +29,71 @@ #define H5_MY_PKG_ERR H5E_PLINE #define H5_MY_PKG_INIT YES +/** + * \defgroup H5Z H5Z + * + * + * \brief Filter and Compression Interface + * + * \details The functions in this module let you configure filters that process + * data during I/O operation. + * + * 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. + * + * 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. + * + * 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 \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. + * + * \todo Fix the reference. + * + * \defgroup H5ZPRE Predefined Filters + * \ingroup H5Z + * \defgroup FLETCHER32 Checksum Filter + * \ingroup H5ZPRE + * \defgroup SCALEOFFSET Scale-Offset Filter + * \ingroup H5ZPRE + * \defgroup SHUFFLE Shuffle Filter + * \ingroup H5ZPRE + * \defgroup SZIP Szip Filter + * \ingroup H5ZPRE + * + */ + #endif /* _H5Zmodule_H */ diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index 97da13c..56047ae 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -21,111 +21,229 @@ /* Public headers needed by this file */ #include "H5public.h" -/* - * Filter identifiers. Values 0 through 255 are for filters defined by the - * HDF5 library. Values 256 through 511 are available for testing new - * filters. Subsequent values should be obtained from the HDF5 development - * team at help@hdfgroup.org. These values will never change because they - * appear in the HDF5 files. +/** + * \brief Filter identifiers + * + * \details Values 0 through 255 are for filters defined by the HDF5 library. + * Values 256 through 511 are available for testing new filters. + * Subsequent values should be obtained from the HDF5 development team + * at mailto:help@hdfgroup.org. These values will never change because + * they appear in the HDF5 files. */ typedef int H5Z_filter_t; /* Filter IDs */ -#define H5Z_FILTER_ERROR (-1) /*no filter */ -#define H5Z_FILTER_NONE 0 /*reserved indefinitely */ -#define H5Z_FILTER_DEFLATE 1 /*deflation like gzip */ -#define H5Z_FILTER_SHUFFLE 2 /*shuffle the data */ -#define H5Z_FILTER_FLETCHER32 3 /*fletcher32 checksum of EDC */ -#define H5Z_FILTER_SZIP 4 /*szip compression */ -#define H5Z_FILTER_NBIT 5 /*nbit compression */ -#define H5Z_FILTER_SCALEOFFSET 6 /*scale+offset compression */ -#define H5Z_FILTER_RESERVED 256 /*filter ids below this value are reserved for library use */ - -#define H5Z_FILTER_MAX 65535 /*maximum filter id */ +/** + * no filter + */ +#define H5Z_FILTER_ERROR (-1) +/** + * reserved indefinitely + */ +#define H5Z_FILTER_NONE 0 +/** + * deflation like gzip + */ +#define H5Z_FILTER_DEFLATE 1 +/** + * shuffle the data + */ +#define H5Z_FILTER_SHUFFLE 2 +/** + * fletcher32 checksum of EDC + */ +#define H5Z_FILTER_FLETCHER32 3 +/** + * szip compression + */ +#define H5Z_FILTER_SZIP 4 +/** + * nbit compression + */ +#define H5Z_FILTER_NBIT 5 +/** + * scale+offset compression + */ +#define H5Z_FILTER_SCALEOFFSET 6 +/** + * filter ids below this value are reserved for library use + */ +#define H5Z_FILTER_RESERVED 256 +/** + * maximum filter id + */ +#define H5Z_FILTER_MAX 65535 /* General macros */ -#define H5Z_FILTER_ALL 0 /* Symbol to remove all filters in H5Premove_filter */ -#define H5Z_MAX_NFILTERS 32 /* Maximum number of filters allowed in a pipeline */ - /* (should probably be allowed to be an - * unlimited amount, but currently each - * filter uses a bit in a 32-bit field, - * so the format would have to be - * changed to accommodate that) - */ +/** + * Symbol to remove all filters in H5Premove_filter() + */ +#define H5Z_FILTER_ALL 0 +/** + * Maximum number of filters allowed in a pipeline + * + * \internal (should probably be allowed to be an unlimited amount, but + * currently each filter uses a bit in a 32-bit field, so the format + * would have to be changed to accommodate that) + */ +#define H5Z_MAX_NFILTERS 32 /* Flags for filter definition (stored) */ -#define H5Z_FLAG_DEFMASK 0x00ff /*definition flag mask */ -#define H5Z_FLAG_MANDATORY 0x0000 /*filter is mandatory */ -#define H5Z_FLAG_OPTIONAL 0x0001 /*filter is optional */ +/** + * definition flag mask + */ +#define H5Z_FLAG_DEFMASK 0x00ff +/** + * filter is mandatory + */ +#define H5Z_FLAG_MANDATORY 0x0000 +/** + * filter is optional + */ +#define H5Z_FLAG_OPTIONAL 0x0001 /* Additional flags for filter invocation (not stored) */ -#define H5Z_FLAG_INVMASK 0xff00 /*invocation flag mask */ -#define H5Z_FLAG_REVERSE 0x0100 /*reverse direction; read */ -#define H5Z_FLAG_SKIP_EDC 0x0200 /*skip EDC filters for read */ +/** + * invocation flag mask + */ +#define H5Z_FLAG_INVMASK 0xff00 +/** + * reverse direction; read + */ +#define H5Z_FLAG_REVERSE 0x0100 +/** + * skip EDC filters for read + */ +#define H5Z_FLAG_SKIP_EDC 0x0200 /* Special parameters for szip compression */ /* [These are aliases for the similar definitions in szlib.h, which we can't * include directly due to the duplication of various symbols with the zlib.h * header file] */ +/** + * \ingroup SZIP */ #define H5_SZIP_ALLOW_K13_OPTION_MASK 1 -#define H5_SZIP_CHIP_OPTION_MASK 2 -#define H5_SZIP_EC_OPTION_MASK 4 -#define H5_SZIP_NN_OPTION_MASK 32 -#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 +/** + * \ingroup SZIP */ +#define H5_SZIP_CHIP_OPTION_MASK 2 +/** + * \ingroup SZIP */ +#define H5_SZIP_EC_OPTION_MASK 4 +/** + * \ingroup SZIP */ +#define H5_SZIP_NN_OPTION_MASK 32 +/** + * \ingroup SZIP */ +#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 /* Macros for the shuffle filter */ -#define H5Z_SHUFFLE_USER_NPARMS 0 /* Number of parameters that users can set */ -#define H5Z_SHUFFLE_TOTAL_NPARMS 1 /* Total number of parameters for filter */ +/** + * \ingroup SHUFFLE + * Number of parameters that users can set for the shuffle filter + */ +#define H5Z_SHUFFLE_USER_NPARMS 0 +/** + * \ingroup SHUFFLE + * Total number of parameters for the shuffle filter + */ +#define H5Z_SHUFFLE_TOTAL_NPARMS 1 /* Macros for the szip filter */ -#define H5Z_SZIP_USER_NPARMS 2 /* Number of parameters that users can set */ -#define H5Z_SZIP_TOTAL_NPARMS 4 /* Total number of parameters for filter */ -#define H5Z_SZIP_PARM_MASK 0 /* "User" parameter for option mask */ -#define H5Z_SZIP_PARM_PPB 1 /* "User" parameter for pixels-per-block */ -#define H5Z_SZIP_PARM_BPP 2 /* "Local" parameter for bits-per-pixel */ -#define H5Z_SZIP_PARM_PPS 3 /* "Local" parameter for pixels-per-scanline */ +/** + * \ingroup SZIP + * Number of parameters that users can set for SZIP + */ +#define H5Z_SZIP_USER_NPARMS 2 +/** + * \ingroup SZIP + * Total number of parameters for SZIP filter + */ +#define H5Z_SZIP_TOTAL_NPARMS 4 +/** + * \ingroup SZIP + * "User" parameter for option mask + */ +#define H5Z_SZIP_PARM_MASK 0 +/** + * \ingroup SZIP + * "User" parameter for pixels-per-block + */ +#define H5Z_SZIP_PARM_PPB 1 +/** + * \ingroup SZIP + * "Local" parameter for bits-per-pixel + */ +#define H5Z_SZIP_PARM_BPP 2 +/** + * \ingroup SZIP + * "Local" parameter for pixels-per-scanline + */ +#define H5Z_SZIP_PARM_PPS 3 /* Macros for the nbit filter */ +/** + * \ingroup NBIT + * Number of parameters that users can set for the N-bit filter + */ #define H5Z_NBIT_USER_NPARMS 0 /* Number of parameters that users can set */ /* Macros for the scale offset filter */ -#define H5Z_SCALEOFFSET_USER_NPARMS 2 /* Number of parameters that users can set */ +/** + * \ingroup SCALEOFFSET + * Number of parameters that users can set for the scale-offset filter + */ +#define H5Z_SCALEOFFSET_USER_NPARMS 2 /* Special parameters for ScaleOffset filter*/ +/** + * \ingroup SCALEOFFSET */ #define H5Z_SO_INT_MINBITS_DEFAULT 0 +/** + * \ingroup SCALEOFFSET */ typedef enum H5Z_SO_scale_type_t { H5Z_SO_FLOAT_DSCALE = 0, H5Z_SO_FLOAT_ESCALE = 1, H5Z_SO_INT = 2 } H5Z_SO_scale_type_t; -/* Current version of the H5Z_class_t struct */ +/** + * Current version of the H5Z_class_t struct + */ #define H5Z_CLASS_T_VERS (1) -/* Values to decide if EDC is enabled for reading data */ +/** + * \ingroup FLETCHER32 + * Values to decide if EDC is enabled for reading data + */ typedef enum H5Z_EDC_t { - H5Z_ERROR_EDC = -1, /* error value */ - H5Z_DISABLE_EDC = 0, - H5Z_ENABLE_EDC = 1, - H5Z_NO_EDC = 2 /* must be the last */ + H5Z_ERROR_EDC = -1, /**< error value */ + H5Z_DISABLE_EDC = 0, + H5Z_ENABLE_EDC = 1, + H5Z_NO_EDC = 2 /**< sentinel */ } H5Z_EDC_t; /* Bit flags for H5Zget_filter_info */ #define H5Z_FILTER_CONFIG_ENCODE_ENABLED (0x0001) #define H5Z_FILTER_CONFIG_DECODE_ENABLED (0x0002) -/* Return values for filter callback function */ +/** + * 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, + 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_return_t; -/* Filter callback function definition */ +/** + * 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 */ +/** + * Structure for filter callback property + */ typedef struct H5Z_cb_t { H5Z_filter_func_t func; void * op_data; @@ -135,87 +253,376 @@ typedef struct H5Z_cb_t { extern "C" { #endif -/* - * Before a dataset gets created, the "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). +/** + * \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 "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 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 "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 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 "can_apply" callback returns positive a valid combination, zero for an - * invalid combination and negative for an error. + * 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); - -/* - * After the "can_apply" callbacks are checked for new datasets, the "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). +//! [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 "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 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 "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 can be the NULL pointer, in which case, + * the library will assume that there are no dataset-specific settings + * for this filter. * - * The "set_local" callback must return non-negative on success and negative - * for an error. + * 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); - -/* - * 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. +//! [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 BUF_SIZE - * pointer and the new buffer through the BUF pointer. + * 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. + * 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 */ + 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 + * + * \param[in] id Filter identifier + * \return \htri_t + * + * \details H5Zfilter_avail() determines whether the filter specified in \p id + * is available to the application. + * + * \since 1.6.0 + */ H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id); +/** + * \ingroup H5Z + * + * \brief Retrieves information about a filter + * + * \param[in] filter Filter identifier + * \param[out] filter_config_flags A bit field encoding the returned filter + * information + * \return \herr_t + * + * \details H5Zget_filter_info() retrieves information about a filter. At + * present, this means that the function retrieves a filter's + * configuration flags, indicating whether the filter is configured to + * decode data, to encode data, neither, or both. + * + * If \p filter_config_flags is not set to NULL prior to the function + * call, the returned parameter contains a bit field specifying the + * available filter configuration. The configuration flag values can + * then be determined through a series of bitwise AND operations, as + * described below. + * + * Valid filter configuration flags include the following: + * <table> + * <tr><td>#H5Z_FILTER_CONFIG_ENCODE_ENABLED</td> + * <td>Encoding is enabled for this filter</td></tr> + * <tr><td>#H5Z_FILTER_CONFIG_DECODE_ENABLED</td> + * <td>Decoding is enabled for this filter</td></tr> + * </table> + * + * A bitwise AND of the returned \p filter_config_flags and a valid + * filter configuration flag will reveal whether the related + * configuration option is available. For example, if the value of + * \code + * H5Z_FILTER_CONFIG_ENCODE_ENABLED & filter_config_flags + * \endcode + * is true, i.e., greater than 0 (zero), the queried filter + * is configured to encode data; if the value is \c FALSE, i.e., equal to + * 0 (zero), the filter is not so configured. + * + * If a filter is not encode-enabled, the corresponding \c H5Pset_* + * function will return an error if the filter is added to a dataset + * creation property list (which is required if the filter is to be + * used to encode that dataset). For example, if the + * #H5Z_FILTER_CONFIG_ENCODE_ENABLED flag is not returned for the SZIP + * filter, #H5Z_FILTER_SZIP, a call to H5Pset_szip() will fail. + * + * If a filter is not decode-enabled, the application will not be able + * to read an existing file encoded with that filter. + * + * This function should be called, and the returned \p + * filter_config_flags analyzed, before calling any other function, + * such as H5Pset_szip() , that might require a particular filter + * configuration. + * + * \since 1.6.3 + */ 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. @@ -224,17 +631,19 @@ H5_DLL herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_confi */ #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_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 */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index bd28f84..354d4df 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -123,7 +123,7 @@ H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] size_t i; /* Local index variables */ #ifdef NO_DUFFS_DEVICE size_t j; /* Local index variable */ -#endif /* NO_DUFFS_DEVICE */ +#endif /* NO_DUFFS_DEVICE */ size_t leftover; /* Extra bytes at end of buffer */ size_t ret_value = 0; /* Return value */ @@ -165,7 +165,7 @@ H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] j--; } /* end for */ -#else /* NO_DUFFS_DEVICE */ +#else /* NO_DUFFS_DEVICE */ { size_t duffs_index; /* Counting index for Duff's device */ @@ -177,31 +177,38 @@ H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] case 0: do { DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 7: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 6: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 5: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 4: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 3: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 2: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 1: DUFF_GUTS } while (--duffs_index > 0); } /* end switch */ } -#endif /* NO_DUFFS_DEVICE */ +#endif /* NO_DUFFS_DEVICE */ #undef DUFF_GUTS } /* end for */ @@ -229,7 +236,7 @@ H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] j--; } /* end for */ -#else /* NO_DUFFS_DEVICE */ +#else /* NO_DUFFS_DEVICE */ { size_t duffs_index; /* Counting index for Duff's device */ @@ -241,31 +248,38 @@ H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] case 0: do { DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 7: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 6: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 5: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 4: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 3: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 2: DUFF_GUTS + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 1: DUFF_GUTS } while (--duffs_index > 0); } /* end switch */ } -#endif /* NO_DUFFS_DEVICE */ +#endif /* NO_DUFFS_DEVICE */ #undef DUFF_GUTS } /* end for */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index a61a52d..cde1862 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -1033,7 +1033,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void *array, size_t array_size #if CHAR_MIN >= 0 else if (array_type == H5T_NATIVE_SCHAR) H5Z_XFORM_DO_OP5(signed char, array_size) -#else /* CHAR_MIN >= 0 */ +#else /* CHAR_MIN >= 0 */ else if (array_type == H5T_NATIVE_UCHAR) H5Z_XFORM_DO_OP5(unsigned char, array_size) #endif /* CHAR_MIN >= 0 */ diff --git a/src/H5checksum.c b/src/H5checksum.c index 7ae588e..82964d9 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -379,7 +380,7 @@ uint32_t H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) { const uint8_t *k = (const uint8_t *)key; - uint32_t a, b, c; /* internal state */ + uint32_t a, b, c = 0; /* internal state */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -414,36 +415,47 @@ H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) { case 12: c += ((uint32_t)k[11]) << 24; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 11: c += ((uint32_t)k[10]) << 16; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 10: c += ((uint32_t)k[9]) << 8; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 9: c += k[8]; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 8: b += ((uint32_t)k[7]) << 24; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 7: b += ((uint32_t)k[6]) << 16; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 6: b += ((uint32_t)k[5]) << 8; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 5: b += k[4]; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 4: a += ((uint32_t)k[3]) << 24; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 3: a += ((uint32_t)k[2]) << 16; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 2: a += ((uint32_t)k[1]) << 8; + /* FALLTHROUGH */ H5_ATTR_FALLTHROUGH case 1: a += k[0]; diff --git a/src/H5dbg.c b/src/H5dbg.c index 1b64d2c..5d38efc 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ diff --git a/src/H5detect.c b/src/H5detect.c index 973cd97..e383d9b 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -1140,7 +1140,7 @@ print_header(void) #ifdef H5_HAVE_GETPWUID struct passwd *pwd = NULL; #else - int pwd = 1; + int pwd = 1; #endif static const char *month_name[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; diff --git a/src/H5err.txt b/src/H5err.txt index 24ac2ac..05476e5 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -46,6 +46,7 @@ MAJOR, H5E_ARGS, Invalid arguments to routine MAJOR, H5E_RESOURCE, Resource unavailable MAJOR, H5E_INTERNAL, Internal error (too specific to document in detail) +MAJOR, H5E_LIB, General library infrastructure MAJOR, H5E_FILE, File accessibility MAJOR, H5E_IO, Low-level I/O MAJOR, H5E_FUNC, Function entry/exit diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c index 617d1f5..2afa531 100644 --- a/src/H5make_libsettings.c +++ b/src/H5make_libsettings.c @@ -144,7 +144,7 @@ print_header(void) #ifdef H5_HAVE_GETPWUID struct passwd *pwd = NULL; #else - int pwd = 1; + int pwd = 1; #endif static const char *month_name[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; diff --git a/src/H5module.h b/src/H5module.h new file mode 100644 index 0000000..2b7d858 --- /dev/null +++ b/src/H5module.h @@ -0,0 +1,34 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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: This file contains declarations which define macros for the + * H5 package. Including this header means that the source file + * is part of the H5 package. + */ +#ifndef _H5module_H +#define _H5module_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5_MODULE +#define H5_MY_PKG H5 +#define H5_MY_PKG_ERR H5E_LIB +#define H5_MY_PKG_INIT YES + +/**\defgroup H5 H5 + * \brief General Library Functions + * \todo Describe concisely what the functions in this module are about. + */ + +#endif /* _H5module_H */ diff --git a/src/H5mpi.c b/src/H5mpi.c index c1f9132..613a4bf 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -25,7 +25,7 @@ /****************/ /* Local Macros */ /****************/ -#define TWO_GIG_LIMIT (1 << 31) +#define TWO_GIG_LIMIT INT32_MAX #ifndef H5_MAX_MPI_COUNT #define H5_MAX_MPI_COUNT (1 << 30) #endif @@ -33,7 +33,7 @@ /*******************/ /* Local Variables */ /*******************/ -static hsize_t bigio_count = H5_MAX_MPI_COUNT; +static hsize_t bigio_count_g = H5_MAX_MPI_COUNT; /*------------------------------------------------------------------------- * Function: H5_mpi_set_bigio_count @@ -42,7 +42,7 @@ static hsize_t bigio_count = H5_MAX_MPI_COUNT; * when we utilize derived datatypes. This is of * particular interest for allowing nightly testing * - * Return: The current/previous value of bigio_count. + * Return: The current/previous value of bigio_count_g. * * Programmer: Richard Warren, March 10, 2017 * @@ -51,10 +51,10 @@ static hsize_t bigio_count = H5_MAX_MPI_COUNT; hsize_t H5_mpi_set_bigio_count(hsize_t new_count) { - hsize_t orig_count = bigio_count; + hsize_t orig_count = bigio_count_g; if ((new_count > 0) && (new_count < (hsize_t)TWO_GIG_LIMIT)) { - bigio_count = new_count; + bigio_count_g = new_count; } return orig_count; } /* end H5_mpi_set_bigio_count() */ @@ -63,9 +63,9 @@ H5_mpi_set_bigio_count(hsize_t new_count) * Function: H5_mpi_get_bigio_count * * Purpose: Allow other HDF5 library functions to access - * the current value for bigio_count. + * the current value for bigio_count_g. * - * Return: The current/previous value of bigio_count. + * Return: The current/previous value of bigio_count_g. * * Programmer: Richard Warren, October 7, 2019 * @@ -74,7 +74,7 @@ H5_mpi_set_bigio_count(hsize_t new_count) hsize_t H5_mpi_get_bigio_count(void) { - return bigio_count; + return bigio_count_g; } /*------------------------------------------------------------------------- @@ -471,8 +471,8 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat FUNC_ENTER_NOAPI(FAIL) /* Calculate how many Big MPI datatypes are needed to represent the buffer */ - num_big_types = (int)(num_elements / bigio_count); - leftover = (hsize_t)num_elements - (hsize_t)num_big_types * bigio_count; + num_big_types = (int)(num_elements / bigio_count_g); + leftover = (hsize_t)num_elements - (hsize_t)num_big_types * bigio_count_g; H5_CHECKED_ASSIGN(remaining_bytes, int, leftover, hsize_t); /* Create a contiguous datatype of size equal to the largest @@ -481,11 +481,11 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat * use type_hvector to create the type with the displacement provided */ if (0 == stride_bytes) { - if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)bigio_count, old_type, &inner_type))) + if (MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)bigio_count_g, old_type, &inner_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) } /* end if */ else if (MPI_SUCCESS != - (mpi_code = MPI_Type_create_hvector((int)bigio_count, 1, stride_bytes, old_type, &inner_type))) + (mpi_code = MPI_Type_create_hvector((int)bigio_count_g, 1, stride_bytes, old_type, &inner_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) /* Create a contiguous datatype of the buffer (minus the remaining < 2GB part) @@ -510,7 +510,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) } /* end if */ else if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector( - (int)(num_elements - (hsize_t)num_big_types * bigio_count), 1, + (int)(num_elements - (hsize_t)num_big_types * bigio_count_g), 1, stride_bytes, old_type, &leftover_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) @@ -529,7 +529,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, MPI_Datat block_len[0] = 1; block_len[1] = 1; disp[0] = 0; - disp[1] = (old_extent + stride_bytes) * num_big_types * (MPI_Aint)bigio_count; + disp[1] = (old_extent + stride_bytes) * num_big_types * (MPI_Aint)bigio_count_g; if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct(2, block_len, disp, type, new_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct failed", mpi_code) diff --git a/src/H5private.h b/src/H5private.h index ca005f6..2d90766 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -298,6 +298,10 @@ * Note that Solaris Studio supports attribute, but does not support the * attributes we use. * + * When using H5_ATTR_FALLTHROUGH, you should also include a comment that + * says FALLTHROUGH to reduce warnings on compilers that don't use + * attributes but do respect fall-through comments. + * * H5_ATTR_CONST is redefined in tools/h5repack/dynlib_rpk.c to quiet * gcc warnings (it has to use the public API and can't include this * file). Be sure to update that file if the #ifdefs change here. @@ -476,11 +480,11 @@ typedef unsigned char uint8_t; #if H5_SIZEOF_INT16_T >= 2 #elif H5_SIZEOF_SHORT >= 2 -typedef short int16_t; +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; +typedef int int16_t; #undef H5_SIZEOF_INT16_T #define H5_SIZEOF_INT16_T H5_SIZEOF_INT #else @@ -502,11 +506,11 @@ typedef unsigned uint16_t; #if H5_SIZEOF_INT32_T >= 4 #elif H5_SIZEOF_SHORT >= 4 -typedef short int32_t; +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; +typedef int int32_t; #undef H5_SIZEOF_INT32_T #define H5_SIZEOF_INT32_T H5_SIZEOF_INT #elif H5_SIZEOF_LONG >= 4 @@ -678,7 +682,7 @@ typedef struct { #endif /* HDabs */ #ifndef HDaccept #define HDaccept(A, B, C) accept((A), (B), (C)) /* mirror VFD */ -#endif /* HDaccept */ +#endif /* HDaccept */ #ifndef HDaccess #define HDaccess(F, M) access(F, M) #endif /* HDaccess */ @@ -705,7 +709,7 @@ typedef struct { #endif /* HDasin */ #ifndef HDasprintf #define HDasprintf asprintf /*varargs*/ -#endif /* HDasprintf */ +#endif /* HDasprintf */ #ifndef HDassert #define HDassert(X) assert(X) #endif /* HDassert */ @@ -732,7 +736,7 @@ typedef struct { #endif /* HDatol */ #ifndef HDbind #define HDbind(A, B, C) bind((A), (B), (C)) /* mirror VFD */ -#endif /* HDbind */ +#endif /* HDbind */ #ifndef HDbsearch #define HDbsearch(K, B, N, Z, F) bsearch(K, B, N, Z, F) #endif /* HDbsearch */ @@ -780,7 +784,7 @@ typedef struct { #endif /* HDclosedir */ #ifndef HDconnect #define HDconnect(A, B, C) connect((A), (B), (C)) /* mirror VFD */ -#endif /* HDconnect */ +#endif /* HDconnect */ #ifndef HDcos #define HDcos(X) cos(X) #endif /* HDcos */ @@ -1029,7 +1033,7 @@ typedef off_t h5_stat_size_t; #endif /* HDgetgroups */ #ifndef HDgethostbyaddr #define HDgethostbyaddr(A, B, C) gethostbyaddr((A), (B), (C)) /* mirror VFD */ -#endif /* HDgethostbyaddr */ +#endif /* HDgethostbyaddr */ #ifndef HDgethostname #define HDgethostname(N, L) gethostname(N, L) #endif /* HDgethostname */ @@ -1071,55 +1075,55 @@ typedef off_t h5_stat_size_t; #endif /* HDgmtime */ #ifndef HDhtonl #define HDhtonl(X) htonl((X)) /* mirror VFD */ -#endif /* HDhtonl */ +#endif /* HDhtonl */ #ifndef HDhtons #define HDhtons(X) htons((X)) /* mirror VFD */ -#endif /* HDhtons */ +#endif /* HDhtons */ #ifndef HDinet_addr #define HDinet_addr(C) inet_addr((C)) /* mirror VFD */ -#endif /* HDinet_addr */ +#endif /* HDinet_addr */ #ifndef HDinet_ntoa #define HDinet_ntoa(C) inet_ntoa((C)) /* mirror VFD */ -#endif /* HDinet_ntoa */ +#endif /* HDinet_ntoa */ #ifndef HDisalnum #define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/ -#endif /* HDisalnum */ +#endif /* HDisalnum */ #ifndef HDisalpha #define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/ -#endif /* HDisalpha */ +#endif /* HDisalpha */ #ifndef HDisatty #define HDisatty(F) isatty(F) #endif /* HDisatty */ #ifndef HDiscntrl #define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ -#endif /* HDiscntrl */ +#endif /* HDiscntrl */ #ifndef HDisdigit #define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ -#endif /* HDisdigit */ +#endif /* HDisdigit */ #ifndef HDisgraph #define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ -#endif /* HDisgraph */ +#endif /* HDisgraph */ #ifndef HDislower #define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ -#endif /* HDislower */ +#endif /* HDislower */ #ifndef HDisnan #define HDisnan(X) isnan(X) #endif /* HDisnan */ #ifndef HDisprint #define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ -#endif /* HDisprint */ +#endif /* HDisprint */ #ifndef HDispunct #define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ -#endif /* HDispunct */ +#endif /* HDispunct */ #ifndef HDisspace #define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ -#endif /* HDisspace */ +#endif /* HDisspace */ #ifndef HDisupper #define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ -#endif /* HDisupper */ +#endif /* HDisupper */ #ifndef HDisxdigit #define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/ -#endif /* HDisxdigit */ +#endif /* HDisxdigit */ #ifndef HDkill #define HDkill(P, S) kill(P, S) #endif /* HDkill */ @@ -1137,7 +1141,7 @@ typedef off_t h5_stat_size_t; #endif /* HDlink */ #ifndef HDlisten #define HDlisten(A, B) listen((A), (B)) /* mirror VFD */ -#endif /* HDlisten */ +#endif /* HDlisten */ #ifndef HDllround #define HDllround(V) llround(V) #endif /* HDround */ @@ -1221,10 +1225,10 @@ typedef off_t h5_stat_size_t; #endif /* HDnanosleep */ #ifndef HDntohl #define HDntohl(A) ntohl((A)) /* mirror VFD */ -#endif /* HDntohl */ +#endif /* HDntohl */ #ifndef HDntohs #define HDntohs(A) ntohs((A)) /* mirror VFD */ -#endif /* HDntohs */ +#endif /* HDntohs */ #ifndef HDopen #define HDopen(F, ...) open(F, __VA_ARGS__) #endif /* HDopen */ @@ -1255,6 +1259,57 @@ typedef off_t h5_stat_size_t; #ifndef HDprintf #define HDprintf printf #endif /* HDprintf */ +#ifndef HDpthread_attr_destroy +#define HDpthread_attr_destroy(A) pthread_attr_destroy(A) +#endif /* HDpthread_attr_destroy */ +#ifndef HDpthread_attr_init +#define HDpthread_attr_init(A) pthread_attr_init(A) +#endif /* HDpthread_attr_init */ +#ifndef HDpthread_attr_setscope +#define HDpthread_attr_setscope(A, S) pthread_attr_setscope(A, S) +#endif /* HDpthread_attr_setscope */ +#ifndef HDpthread_cond_init +#define HDpthread_cond_init(C, A) pthread_cond_init(C, A) +#endif /* HDpthread_cond_init */ +#ifndef HDpthread_cond_signal +#define HDpthread_cond_signal(C) pthread_cond_signal(C) +#endif /* HDpthread_cond_signal */ +#ifndef HDpthread_cond_wait +#define HDpthread_cond_wait(C, M) pthread_cond_wait(C, M) +#endif /* HDpthread_cond_wait */ +#ifndef HDpthread_create +#define HDpthread_create(R, A, F, U) pthread_create(R, A, F, U) +#endif /* HDpthread_create */ +#ifndef HDpthread_equal +#define HDpthread_equal(T1, T2) pthread_equal(T1, T2) +#endif /* HDpthread_equal */ +#ifndef HDpthread_getspecific +#define HDpthread_getspecific(K) pthread_getspecific(K) +#endif /* HDpthread_getspecific */ +#ifndef HDpthread_join +#define HDpthread_join(T, V) pthread_join(T, V) +#endif /* HDpthread_join */ +#ifndef HDpthread_key_create +#define HDpthread_key_create(K, D) pthread_key_create(K, D) +#endif /* HDpthread_key_create */ +#ifndef HDpthread_mutex_init +#define HDpthread_mutex_init(M, A) pthread_mutex_init(M, A) +#endif /* HDpthread_mutex_init */ +#ifndef HDpthread_mutex_lock +#define HDpthread_mutex_lock(M) pthread_mutex_lock(M) +#endif /* HDpthread_mutex_lock */ +#ifndef HDpthread_mutex_unlock +#define HDpthread_mutex_unlock(M) pthread_mutex_unlock(M) +#endif /* HDpthread_mutex_unlock */ +#ifndef HDpthread_self +#define HDpthread_self() pthread_self() +#endif /* HDpthread_self */ +#ifndef HDpthread_setcancelstate +#define HDpthread_setcancelstate(N, O) pthread_setcancelstate(N, O) +#endif /* HDpthread_setcancelstate */ +#ifndef HDpthread_setspecific +#define HDpthread_setspecific(K, V) pthread_setspecific(K, V) +#endif /* HDpthread_setspecific */ #ifndef HDputc #define HDputc(C, F) putc(C, F) #endif /* HDputc*/ @@ -1296,7 +1351,7 @@ H5_DLL void HDsrand(unsigned int seed); #ifndef HDsrandom #define HDsrandom(S) srandom(S) #endif /* HDsrandom */ -#else /* H5_HAVE_RANDOM */ +#else /* H5_HAVE_RANDOM */ #ifndef HDrand #define HDrand() rand() #endif /* HDrand */ @@ -1374,7 +1429,7 @@ H5_DLL void HDsrand(unsigned int seed); #endif /* HDsetsid */ #ifndef HDsetsockopt #define HDsetsockopt(A, B, C, D, E) setsockopt((A), (B), (C), (D), (E)) /* mirror VFD */ -#endif /* HDsetsockopt */ +#endif /* HDsetsockopt */ #ifndef HDsetuid #define HDsetuid(U) setuid(U) #endif /* HDsetuid */ @@ -1383,7 +1438,7 @@ H5_DLL void HDsrand(unsigned int seed); #endif /* HDsetvbuf */ #ifndef HDshutdown #define HDshutdown(A, B) shutdown((A), (B)) /* mirror VFD */ -#endif /* HDshutdown */ +#endif /* HDshutdown */ #ifndef HDsigaction #define HDsigaction(S, A, O) sigaction((S), (A), (O)) #endif /* HDsigaction */ @@ -1431,13 +1486,13 @@ H5_DLL void HDsrand(unsigned int seed); #endif /* HDsleep */ #ifndef HDsnprintf #define HDsnprintf snprintf /*varargs*/ -#endif /* HDsnprintf */ +#endif /* HDsnprintf */ #ifndef HDsocket #define HDsocket(A, B, C) socket((A), (B), (C)) /* mirror VFD */ -#endif /* HDsocket */ +#endif /* HDsocket */ #ifndef HDsprintf #define HDsprintf sprintf /*varargs*/ -#endif /* HDsprintf */ +#endif /* HDsprintf */ #ifndef HDsqrt #define HDsqrt(X) sqrt(X) #endif /* HDsqrt */ @@ -1651,7 +1706,7 @@ H5_DLL int64_t HDstrtoll(const char *s, const char **rest, int base); * define these in terms of macros. */ #if !defined strdup && !defined H5_HAVE_STRDUP -extern char * strdup(const char *s); +extern char *strdup(const char *s); #endif #ifndef HDstrdup @@ -1937,9 +1992,33 @@ extern char H5libhdf5_settings[]; /* embedded library information */ #define H5TRACE11(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) /*void*/ #define H5TRACE12(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) /*void*/ #define H5TRACE_RETURN(V) /*void*/ -#endif /* H5_DEBUG_API */ +#endif /* H5_DEBUG_API */ +/* Argument tracing macros (defined all the time) */ +#define H5ARG_TRACE0(C, T) C, T +#define H5ARG_TRACE1(C, T, A0) C, T, #A0, A0 +#define H5ARG_TRACE2(C, T, A0, A1) C, T, #A0, A0, #A1, A1 +#define H5ARG_TRACE3(C, T, A0, A1, A2) C, T, #A0, A0, #A1, A1, #A2, A2 +#define H5ARG_TRACE4(C, T, A0, A1, A2, A3) C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3 +#define H5ARG_TRACE5(C, T, A0, A1, A2, A3, A4) C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4 +#define H5ARG_TRACE6(C, T, A0, A1, A2, A3, A4, A5) C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5 +#define H5ARG_TRACE7(C, T, A0, A1, A2, A3, A4, A5, A6) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6 +#define H5ARG_TRACE8(C, T, A0, A1, A2, A3, A4, A5, A6, A7) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7 +#define H5ARG_TRACE9(C, T, A0, A1, A2, A3, A4, A5, A6, A7, A8) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7, #A8, A8 +#define H5ARG_TRACE10(C, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7, #A8, A8, #A9, A9 +#define H5ARG_TRACE11(C, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) \ + C, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7, #A8, A8, #A9, A9, #A10, A10 +#define H5ARG_TRACE12(C, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) \ + C, 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 + +struct H5RS_str_t; H5_DLL double H5_trace(const double *calltime, const char *func, const char *type, ...); +H5_DLL herr_t H5_trace_args(struct H5RS_str_t *rs, const char *type, va_list ap); /*------------------------------------------------------------------------- * Purpose: Register function entry for library initialization and code @@ -2067,10 +2146,10 @@ extern hbool_t H5_libterm_g; /* Is the library being shutdown? */ #define H5_PUSH_FUNC H5CS_push(FUNC); #define H5_POP_FUNC H5CS_pop(); -#else /* H5_HAVE_CODESTACK */ +#else /* H5_HAVE_CODESTACK */ #define H5_PUSH_FUNC /* void */ #define H5_POP_FUNC /* void */ -#endif /* H5_HAVE_CODESTACK */ +#endif /* H5_HAVE_CODESTACK */ #ifdef H5_HAVE_MPE extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ @@ -2123,7 +2202,7 @@ H5_DLL herr_t H5CX_pop(void); func_check = TRUE; \ } /* end if */ \ } /* end scope */ -#else /* NDEBUG */ +#else /* NDEBUG */ #define FUNC_ENTER_CHECK_NAME(asrt) #endif /* NDEBUG */ @@ -2156,7 +2235,6 @@ H5_DLL herr_t H5CX_pop(void); #define FUNC_ENTER_API_INIT(err) \ /* Initialize the library */ \ if (!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { \ - H5_INIT_GLOBAL = TRUE; \ if (H5_init_library() < 0) \ HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, "library initialization failed") \ } /* end if */ \ @@ -2248,6 +2326,23 @@ H5_DLL herr_t H5CX_pop(void); FUNC_ENTER_API_INIT(err); \ { +/* + * 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, + * + */ +#define FUNC_ENTER_API_NAMECHECK_ONLY \ + { \ + { \ + { \ + { \ + { \ + { \ + FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \ + { + /* Note: this macro only works when there's _no_ interface initialization routine for the module */ #define FUNC_ENTER_NOAPI_INIT(err) \ /* Initialize the package, if appropriate */ \ @@ -2327,6 +2422,17 @@ H5_DLL herr_t H5CX_pop(void); 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. + * + */ +#define FUNC_ENTER_NOAPI_NAMECHECK_ONLY \ + { \ + 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 * up a metadata tag. */ @@ -2394,6 +2500,17 @@ H5_DLL herr_t H5CX_pop(void); 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. + * + */ +#define FUNC_ENTER_STATIC_NAMECHECK_ONLY \ + { \ + 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. */ #define FUNC_ENTER_STATIC_TAG(tag) \ @@ -2471,6 +2588,18 @@ H5_DLL herr_t H5CX_pop(void); } \ } /*end scope from beginning of FUNC_ENTER*/ +/* Use this macro to match the FUNC_ENTER_API_NAMECHECK_ONLY macro */ +#define FUNC_LEAVE_API_NAMECHECK_ONLY(ret_value) \ + ; \ + } /*end scope from end of FUNC_ENTER*/ \ + return (ret_value); \ + } \ + } \ + } \ + } \ + } \ + } /*end scope from beginning of FUNC_ENTER*/ + #define FUNC_LEAVE_NOAPI(ret_value) \ ; \ } /*end scope from end of FUNC_ENTER*/ \ @@ -2496,6 +2625,14 @@ H5_DLL herr_t H5CX_pop(void); return (ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ +/* Use these macros to match the FUNC_ENTER_NOAPI_NAMECHECK_ONLY macro */ +#define FUNC_LEAVE_NOAPI_NAMECHECK_ONLY(ret_value) \ + return (ret_value); \ + } /*end scope from beginning of FUNC_ENTER*/ +#define FUNC_LEAVE_NOAPI_VOID_NAMECHECK_ONLY \ + return; \ + } /*end scope from beginning of FUNC_ENTER*/ + /* Use this macro when exiting a function that set up a metadata tag */ #define FUNC_LEAVE_NOAPI_TAG(ret_value) \ ; \ @@ -2599,7 +2736,6 @@ extern hbool_t H5_api_entered_g; /* Has library already been entered through API \ /* Initialize the library or bust */ \ if (!H5_INIT_GLOBAL && !H5_TERM_GLOBAL) { \ - H5_INIT_GLOBAL = TRUE; \ if (H5_init_library() < 0) { \ /* (Can't use H5E_THROW here) */ \ H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ diff --git a/src/H5public.h b/src/H5public.h index 5b9a5fe..20a7dc1 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -176,15 +176,15 @@ typedef long long ssize_t; */ #if H5_SIZEOF_INT64_T >= 8 #elif H5_SIZEOF_INT >= 8 -typedef int int64_t; +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; +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; +typedef long long int64_t; #undef H5_SIZEOF_INT64_T #define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG #else @@ -199,12 +199,12 @@ typedef long long int64_t; #define UINT64_MAX ((uint64_t)-1) #endif #elif H5_SIZEOF_INT >= 8 -typedef unsigned uint64_t; +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; +typedef unsigned long uint64_t; #define UINT64_MAX ULONG_MAX #undef H5_SIZEOF_UINT64_T #define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG @@ -289,30 +289,36 @@ typedef unsigned long long haddr_t; */ #if H5_SIZEOF_UINT32_T >= 4 #elif H5_SIZEOF_SHORT >= 4 -typedef short uint32_t; +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; +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; +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" #endif -/* Common iteration orders */ +//! [H5_iter_order_t_snip] + +/** + * Common iteration orders + */ typedef enum { - H5_ITER_UNKNOWN = -1, /* Unknown order */ - H5_ITER_INC, /* Increasing order */ - H5_ITER_DEC, /* Decreasing order */ - H5_ITER_NATIVE, /* No particular order, whatever is fastest */ - H5_ITER_N /* Number of iteration orders */ + H5_ITER_UNKNOWN = -1, /**< Unknown order */ + H5_ITER_INC, /**< Increasing order */ + H5_ITER_DEC, /**< Decreasing order */ + 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] + /* 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) @@ -321,66 +327,473 @@ typedef enum { #define H5_ITER_CONT (0) #define H5_ITER_STOP (1) -/* +//! [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 * links in groups/attributes on objects. */ typedef enum H5_index_t { - H5_INDEX_UNKNOWN = -1, /* Unknown index type */ - H5_INDEX_NAME, /* Index on names */ - H5_INDEX_CRT_ORDER, /* Index on creation order */ - H5_INDEX_N /* Number of indices defined */ + H5_INDEX_UNKNOWN = -1, /**< Unknown index type */ + H5_INDEX_NAME, /**< Index on names */ + H5_INDEX_CRT_ORDER, /**< Index on creation order */ + H5_INDEX_N /**< Number of indices defined */ } H5_index_t; -/* +//! [H5_index_t_snip] + +/** * Storage info struct used by H5O_info_t and H5F_info_t */ +//! [H5_ih_info_t_snip] typedef struct H5_ih_info_t { - hsize_t index_size; /* btree and/or list */ + hsize_t index_size; /**< btree and/or list */ hsize_t heap_size; } H5_ih_info_t; +//! [H5_ih_info_t_snip] -/* Tokens are unique and permanent identifiers that are - * used to reference HDF5 objects in a container. */ +/** + * The maximum size allowed for tokens + * \details Tokens are unique and permanent identifiers that are + * used to reference HDF5 objects in a container. This allows + * for 128-bit tokens + */ +#define H5O_MAX_TOKEN_SIZE (16) -/* The maximum size allowed for tokens */ -#define H5O_MAX_TOKEN_SIZE (16) /* Allows for 128-bit tokens */ +//! [H5O_token_t_snip] +/** + * \internal (Hoisted here, since it's used by both the + * H5Lpublic.h and H5Opublic.h headers) */ /* Type for object tokens */ -/* (Hoisted here, since it's used by both the 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] + +/** * Allocation statistics info struct */ typedef struct H5_alloc_stats_t { - unsigned long long total_alloc_bytes; /* Running count of total # of bytes allocated */ - size_t curr_alloc_bytes; /* Current # of bytes allocated */ - size_t peak_alloc_bytes; /* Peak # of bytes allocated */ - size_t max_block_size; /* Largest block allocated */ - size_t total_alloc_blocks_count; /* Running count of total # of blocks allocated */ - size_t curr_alloc_blocks_count; /* Current # of blocks allocated */ - size_t peak_alloc_blocks_count; /* Peak # of blocks allocated */ + unsigned long long total_alloc_bytes; /**< Running count of total # of bytes allocated */ + size_t curr_alloc_bytes; /**< Current # of bytes allocated */ + size_t peak_alloc_bytes; /**< Peak # of bytes allocated */ + size_t max_block_size; /**< Largest block allocated */ + size_t total_alloc_blocks_count; /**< Running count of total # of blocks allocated */ + size_t curr_alloc_blocks_count; /**< Current # of blocks allocated */ + size_t peak_alloc_blocks_count; /**< Peak # of blocks allocated */ } H5_alloc_stats_t; /* Functions in H5.c */ +/** + * \ingroup H5 + * \brief Initializes the HDF5 library + * \return \herr_t + * + * \details H5open() initializes the HDF5 library. + * + * \details When the HDF5 library is used in a C application, the library is + * automatically initialized when the first HDf5 function call is + * issued. If one finds that an HDF5 library function is failing + * inexplicably, H5open() can be called first. It is safe to call + * H5open() before an application issues any other function calls to + * the HDF5 library as there are no damaging side effects in calling + * it more than once. + */ H5_DLL herr_t H5open(void); +/** + * \ingroup H5 + * \brief Flushes all data to disk, closes all open objects, and releases memory + * \return \herr_t + * + * \details H5close() flushes all data to disk, closes all open HDF5 objects, + * and cleans up all memory used by the HDF5 library. This function is + * generally called when the application calls exit(), but may be + * called earlier in the event of an emergency shutdown or out of a + * desire to free all resources used by the HDF5 library. + */ H5_DLL herr_t H5close(void); +/** + * \ingroup H5 + * \brief Instructs library not to install atexit() cleanup routine + * \return \herr_t + * + * \details H5dont_atexit() indicates to the library that an atexit() cleanup + * routine should not be installed. The major purpose for using this + * function is in situations where the library is dynamically linked + * into an application and is un-linked from the application before + * exit() gets called. In those situations, a routine installed with + * atexit() would jump to a routine which was no longer in memory, + * causing errors. + * + * \attention In order to be effective, this routine \Emph{must} be called + * before any other HDF5 function calls, and must be called each + * time the library is loaded/linked into the application (the first + * time and after it's been un-loaded). + */ H5_DLL herr_t H5dont_atexit(void); +/** + * \ingroup H5 + * \brief Garbage collects on all free-lists of all types + * \return \herr_t + * + * \details H5garbage_collect() walks through all garbage collection routines + * of the library, freeing any unused memory. + * + * It is not required that H5garbage_collect() be called at any + * particular time; it is only necessary in certain situations where + * the application has performed actions that cause the library to + * allocate many objects. The application should call + * H5garbage_collect() if it eventually releases those objects and + * wants to reduce the memory used by the library from the peak usage + * required. + * + * \note The library automatically garbage collects all the free lists when the + * application ends. + */ H5_DLL herr_t H5garbage_collect(void); +/** + * \ingroup H5 + * \brief Sets free-list size limits + * + * \param[in] reg_global_lim The cumulative limit, in bytes, on memory used for + * all regular free lists (Default: 1MB) + * \param[in] reg_list_lim The limit, in bytes, on memory used for each regular + * free list (Default: 64KB) + * \param[in] arr_global_lim The cumulative limit, in bytes, on memory used for + * all array free lists (Default: 4MB) + * \param[in] arr_list_lim The limit, in bytes, on memory used for each array + * free list (Default: 256KB) + * \param[in] blk_global_lim The cumulative limit, in bytes, on memory used for + * all block free lists and, separately, for all + * factory free lists (Default: 16MB) + * \param[in] blk_list_lim The limit, in bytes, on memory used for each block + * or factory free list (Default: 1MB) + * \return \herr_t + * + * \details H5set_free_list_limits() sets size limits on all types of free + * lists. The HDF5 library uses free lists internally to manage + * memory. The types of free lists used are as follows: + * \li Regular free lists manage memory for single internal data + * structures. + * \li Array free lists manage memory for arrays of internal + * data structures. + * \li Block free lists manage memory for arbitrarily-sized blocks + * of bytes. + * \li Factory free lists manage memory for fixed-size blocks of + * bytes. + * + * The parameters specify global and per-list limits; for example, \p + * reg_global_limit and \p reg_list_limit limit the accumulated size + * of all regular free lists and the size of each individual regular + * free list, respectively. Therefore, if an application sets a 1Mb + * limit on each of the global lists, up to 4Mb of total storage might + * be allocated, 1Mb for each of the regular, array, block, and + * factory type lists. + * + * The settings specified for block free lists are duplicated for + * factory free lists. Therefore, increasing the global limit on block + * free lists by x bytes will increase the potential free list memory + * usage by 2x bytes. + * + * Using a value of -1 for a limit means that no limit is set for the + * specified type of free list. + * + * \version 1.8.3 Function changed in this release to set factory free list + * memory limits. + * + * \since 1.6.0 + */ H5_DLL herr_t H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); +/** + * \ingroup H5 + * \brief Gets the current size of the free lists used to manage memory + * + * \param[out] reg_size The current size of all "regular" free list memory used + * \param[out] arr_size The current size of all "array" free list memory used + * \param[out] blk_size The current size of all "block" free list memory used + * \param[out] fac_size The current size of all "factory" free list memory used + * \return \herr_t + * + * \details H5get_free_list_sizes() obtains 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. + * + * \since 1.12.1 + */ H5_DLL herr_t H5get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, size_t *fac_size); +/** + * \ingroup H5 + * \brief Gets the memory allocation statistics for the library + * + * \param[out] stats Memory allocation statistics + * \return \herr_t + * + * \details H5get_alloc_stats() gets the memory allocation statistics for the + * library, if the \c --enable-memory-alloc-sanity-check option was + * given when building the library. Applications can check whether + * this option was enabled detecting if the + * \c 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 do not include allocations from chunked dataset + * I/O filters or non-native VOL connectors. + * + * \since 1.12.1 + */ H5_DLL herr_t H5get_alloc_stats(H5_alloc_stats_t *stats); +/** + * \ingroup H5 + * \brief Returns the HDF library release number + * + * \param[out] majnum The major version number of the library + * \param[out] minnum The minor version number of the library + * \param[out] relnum The release version number of the library + * \return \herr_t + * + * \details H5get_libversion() retrieves the major, minor, and release numbers + * of the version of the HDF5 library which is linked to the + * application. + * + */ H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum); +/** + * \ingroup H5 + * \brief Verifies that HDF5 library versions are consistent + * + * \param[in] majnum HDF5 library major version number + * \param[in] minnum HDF5 library minor version number + * \param[in] relnum HDF5 library release number + * \return \herr_t + * + * \details H5check_version() verifies that the version of the HDF5 library + * with which an application was compiled, as indicated by the passed + * parameters, matches the version of the HDF5 library against which + * the application is currently linked. + * + * \p majnum is the major version number of the HDF library with which + * the application was compiled, \p minnum is the minor version + * number, and \p relnum is the release number. Consider the following + * example: + * + * An official HDF5 release is labelled as follows: + * HDF5 Release \Code{\<majnum\>.\<minnum\>.\<relnum\>}\n + * For example, in HDF5 Release 1.8.5: + * \li 1 is the major version number, \p majnum. + * \li 8 is the minor version number, \p minnum. + * \li 5 is the release number, \p relnum. + * + * As stated above, H5check_version() first verifies that the version + * of the HDF5 library with which an application was compiled matches + * the version of the HDF5 library against which the application is + * currently linked. If this check fails, H5check_version() causes the + * application to abort (by means of a standard C abort() call) and + * prints information that is usually useful for debugging. This + * precaution is is taken to avoid the risks of data corruption or + * segmentation faults. + * + * The most common cause of this failure is that an application was + * compiled with one version of HDF5 and is dynamically linked with a + * different version different version. + * + * If the above test passes, H5check_version() proceeds to verify the + * consistency of additional library version information. This is + * designed to catch source code inconsistencies that do not normally + * cause failures; if this check reveals an inconsistency, an + * informational warning is printed but the application is allowed to + * run. + * + */ H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum); +/** + * \ingroup H5 + * \brief Determines whether the HDF5 library was built with the thread-safety + * feature enabled + * + * \param[out] is_ts Boolean value indicating whether the library was built + * with thread-safety enabled + * \return \herr_t + * + * \details The HDF5 library, although not internally multi-threaded, can be + * built with a thread-safety feature enabled that protects internal + * data structures with a mutex. In certain circumstances, it may be + * useful to determine, at run-time, whether the linked HDF5 library + * was built with the thread-safety feature enabled. + */ H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); +/** + * \ingroup H5 + * \brief Frees memory allocated by the HDF5 library + * + * \param[in] mem Buffer to be freed. Can be NULL + * \return \herr_t + * + * \details H5free_memory() frees memory that has been allocated by the caller + * with H5allocate_memory() or by the HDF5 library on behalf of the + * caller. + * + * H5Tget_member_name() provides an example of memory allocation on + * behalf of the caller: The function returns a buffer containing the + * name of a compound datatype member. It is the caller’s + * responsibility to eventually free that buffer with H5free_memory(). + * + * \attention It is especially important to use this function to free memory + * allocated by the library on Windows. The C standard library is + * implemented in dynamic link libraries (DLLs) known as the C + * run-time (CRT). Each version of Visual Studio comes with two CRT + * DLLs (debug and release) and allocating and freeing across DLL + * boundaries can cause resource leaks and subtle bugs due to heap + * corruption.\n + * Only use this function to free memory allocated by the HDF5 + * Library. It will generally not be safe to use this function to + * free memory allocated by any other means.\n + * Even when using this function, it is still best to ensure that + * all components of a C application are built with the same version + * of Visual Studio and build (debug or release) and thus linked + * against the same CRT. + * + * \see H5allocate_memory(), H5resize_memory() + * + * \since 1.8.13 + * + */ H5_DLL herr_t H5free_memory(void *mem); -H5_DLL void * H5allocate_memory(size_t size, hbool_t clear); -H5_DLL void * H5resize_memory(void *mem, size_t size); +/** + * \ingroup H5 + * \brief Frees memory allocated by the HDF5 library + * + * \param[in] size The size in bytes of the buffer to be allocated + * \param[in] clear Flag whether the new buffer is to be initialized with 0 + * + * \return On success, returns pointer to newly allocated buffer or returns + * NULL if size is 0 (zero).\n + * Returns NULL on failure. + * + * \details H5allocate_memory() allocates a memory buffer of size bytes that + * will later be freed internally by the HDF5 library. + * + * The boolean \p clear parameter specifies whether the buffer should + * be initialized. If clear is \c TRUE, all bits in the buffer are to be + * set to 0 (zero); if clear is \c FALSE, the buffer will not be + * initialized. + * + * This function is intended to have the semantics of malloc() and + * calloc(). However, unlike malloc() and calloc() which allow for a + * "special" pointer to be returned instead of NULL, this function + * always returns NULL on failure or when size is set to 0 (zero). + * + * \note At this time, the only intended use for this function is to allocate + * memory that will be returned to the library as a data buffer from a + * third-party filter. + * + * \attention To avoid heap corruption, allocated memory should be freed using + * the same library that initially allocated it. In most cases, the + * HDF5 API uses resources that are allocated and freed either + * entirely by the user or entirely by the library, so this is not a + * problem. In rare cases, however, HDF5 API calls will free memory + * that the user allocated. This function allows the user to safely + * allocate this memory.\n + * It is particularly important to use this function to allocate + * memory in Microsoft Windows environments. In Windows, the C + * standard library is implemented in dynamic link libraries (DLLs) + * known as the C run-time (CRT). Each version of Visual Studio + * comes with multiple versions of the CRT DLLs (debug, release, et + * cetera) and allocating and freeing memory across DLL boundaries + * can cause resource leaks and subtle bugs due to heap corruption.\n + * Even when using this function, it is best where possible to + * ensure that all components of a C application are built with the + * same version of Visual Studio and configuration (Debug or + * Release), and thus linked against the same CRT.\n + * Use this function only to allocate memory inside third-party HDF5 + * filters. It will generally not be safe to use this function to + * allocate memory for any other purpose. + * + * \see H5free_memory(), H5resize_memory() + * + * \since 1.8.15 + * + */ +H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); +/** + * \ingroup H5 + * \brief Resizes and, if required, re-allocates memory that will later be + * freed internally by the HDF5 library + * + * \param[in] mem Pointer to a buffer to be resized. May be NULL + * \param[in] size New size of the buffer, in bytes + + * + * \return On success, returns pointer to resized or reallocated buffer + * or returns NULL if size is 0 (zero).\n + * Returns NULL on failure. + * + * \details H5resize_memory() takes a pointer to an existing buffer and resizes + * the buffer to match the value in \p size. If necessary, the buffer + * is reallocated. If \p size is 0, the buffer is released. + * + * The input buffer must either be NULL or have been allocated by + * H5allocate_memory() since the input buffer may be freed by the + * library. + * + * For certain behaviors, the pointer \p mem may be passed in as NULL. + * + * This function is intended to have the semantics of realloc(): + * + * <table> + * <tr><td>\Code{H5resize_memory(buffer, size)}</td> + * <td>Resizes buffer. Returns pointer to resized buffer.</td></tr> + * <tr><td>\Code{H5resize_memory(NULL, size)}</td> + * <td>Allocates memory using HDF5 Library allocator. + * Returns pointer to new buffer</td></tr> + * <tr><td>\Code{H5resize_memory(buffer, 0)}</td> + * <td>Frees memory using HDF5 Library allocator. + * Returns NULL.</td></tr> + * <tr><td>\Code{H5resize_memory(NULL, 0)}</td> + * <td>Returns NULL (undefined in C standard).</td></tr> + * </table> + * + * Unlike realloc(), which allows for a "special pointer to be + * returned instead of NULL, this function always returns NULL on + * failure or when size is 0 (zero). + * + * \note At this time, the only intended use for this function is to resize or + * reallocate memory that will be returned to the library (and eventually + * to the user) as a data buffer from a third-party HDF5 filter. + * + * \attention To avoid heap corruption, allocated memory should be freed using + * the same library that initially allocated it. In most cases, the + * HDF5 API uses resources that are allocated and freed either + * entirely by the user or entirely by the library, so this is not a + * problem. In rare cases, however, HDF5 API calls will free memory + * that the user allocated. This function allows the user to safely + * allocate this memory.\n + * It is particularly important to use this function to resize + * memory on Microsoft Windows systems. In Windows, the C standard + * library is implemented in dynamic link libraries (DLLs) known as + * the C run-time (CRT). Each version of Visual Studio comes with + * multiple versions of the CRT DLLs (debug, release, et cetera) and + * allocating and freeing memory across DLL boundaries can cause + * resource leaks and subtle bugs due to heap corruption.\n + * Even when using this function, it is still best to ensure that + * all components of a C application are built with the same version + * of Visual Studio and the same configuration (Debug or Release), + * and thus linked against the same CRT.\n + * Only use this function to resize memory inside third-party HDF5 + * filters. It will generally not be safe to use this function to + * resize memory for any other purpose. + * + * \see H5allocate_memory(), H5free_memory() + * + * \since 1.8.15 + * + */ +H5_DLL void *H5resize_memory(void *mem, size_t size); #ifdef __cplusplus } diff --git a/src/H5system.c b/src/H5system.c index b2a2668..fdc6c22 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -25,6 +25,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -346,8 +347,8 @@ H5_make_time(struct tm *tm) * VS 2015 is removed, with _get_timezone replacing it. */ long timezone = 0; -#endif /* defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) */ - time_t ret_value; /* Return value */ +#endif /* defined(H5_HAVE_VISUAL_STUDIO) && (_MSC_VER >= 1900) */ + time_t ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5timer.c b/src/H5timer.c index 1df2d8d..b637a16 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -24,6 +24,7 @@ /****************/ /* Module Setup */ /****************/ +#include "H5module.h" /* This source code file is part of the H5 module */ /***********/ /* Headers */ @@ -163,7 +164,7 @@ H5_now(void) HDgettimeofday(&now_tv, NULL); now = now_tv.tv_sec; } -#else /* H5_HAVE_GETTIMEOFDAY */ +#else /* H5_HAVE_GETTIMEOFDAY */ now = HDtime(NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ @@ -201,8 +202,8 @@ H5_now_usec(void) HDgettimeofday(&now_tv, NULL); now = (uint64_t)(now_tv.tv_sec * (1000 * 1000)) + (uint64_t)now_tv.tv_usec; } -#else /* H5_HAVE_GETTIMEOFDAY */ - now = (uint64_t)(HDtime(NULL) * (1000 * 1000)); +#else /* H5_HAVE_GETTIMEOFDAY */ + now = (uint64_t)(HDtime(NULL) * (1000 * 1000)); #endif /* H5_HAVE_GETTIMEOFDAY */ return (now); diff --git a/src/H5trace.c b/src/H5trace.c index 9f23d0a..4beecc3 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -25,7 +25,8 @@ /****************/ /* Module Setup */ /****************/ -#define H5I_FRIEND /*suppress error about including H5Ipkg */ +#include "H5module.h" /* This source code file is part of the H5 module */ +#define H5I_FRIEND /*suppress error about including H5Ipkg */ /***********/ /* Headers */ @@ -36,7 +37,9 @@ #include "H5FDprivate.h" /* File drivers */ #include "H5Rprivate.h" /* References */ #include "H5Ipkg.h" /* IDs */ +#include "H5Mpublic.h" /* Maps */ #include "H5MMprivate.h" /* Memory management */ +#include "H5RSprivate.h" /* Reference-counted strings */ #include "H5VLprivate.h" /* Virtual Object Layer */ #ifdef H5_HAVE_PARALLEL @@ -59,6 +62,9 @@ /********************/ /* Local Prototypes */ /********************/ +static herr_t H5_trace_args_bool(H5RS_str_t *rs, hbool_t val); +static herr_t H5_trace_args_cset(H5RS_str_t *rs, H5T_cset_t cset); +static herr_t H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degree); /*********************/ /* Package Variables */ @@ -73,134 +79,170 @@ /*******************/ /*------------------------------------------------------------------------- - * Function: H5_trace + * Function: H5_trace_args_bool * - * Purpose: This function is called whenever an API function is called - * and tracing is turned on. If RETURNING is non-zero then - * the caller is about to return and RETURNING points to the - * time for the corresponding function call event. Otherwise - * we print the function name and the arguments. + * Purpose: This routine formats an hbool_t and adds the output to + * the refcounted string (RS) argument. * - * The TYPE argument is a string which gives the type of each of - * the following argument pairs. Each type is zero or more - * asterisks (one for each level of indirection, although some - * types have one level of indirection already implied) followed - * by either one letter (lower case) or two letters (first one - * uppercase). + * Return: SUCCEED / FAIL * - * The variable argument list consists of pairs of values. Each - * pair is a string which is the formal argument name in the - * calling function, followed by the argument value. The type - * of the argument value is given by the TYPE string. + * Programmer: Quincey Koziol + * Monday, September 21, 2020 * - * Note: The TYPE string is meant to be terse and is generated by a - * separate perl script. + *------------------------------------------------------------------------- + */ +static herr_t +H5_trace_args_bool(H5RS_str_t *rs, hbool_t val) +{ + /* FUNC_ENTER() should not be called */ + + if (TRUE == val) + H5RS_acat(rs, "TRUE"); + else if (!val) + H5RS_acat(rs, "FALSE"); + else + H5RS_asprintf_cat(rs, "TRUE(%u)", (unsigned)val); + + return SUCCEED; +} /* end H5_trace_args_bool() */ + +/*------------------------------------------------------------------------- + * Function: H5_trace_args_cset * - * WARNING: DO NOT CALL ANY HDF5 FUNCTION THAT CALLS FUNC_ENTER(). DOING - * SO MAY CAUSE H5_trace() TO BE INVOKED RECURSIVELY OR MAY - * CAUSE LIBRARY INITIALIZATIONS THAT ARE NOT DESIRED. + * Purpose: This routine formats an H5T_cset_t and adds the output to + * the refcounted string (RS) argument. * - * Return: Execution time for an API call + * Return: SUCCEED / FAIL * - * Programmer: Robb Matzke - * Tuesday, June 16, 1998 + * Programmer: Quincey Koziol + * Sunday, September 20, 2020 * *------------------------------------------------------------------------- */ -double -H5_trace(const double *returning, const char *func, const char *type, ...) +static herr_t +H5_trace_args_cset(H5RS_str_t *rs, H5T_cset_t cset) { - va_list ap; - char buf[64], *rest; - const char * argname; - int argno = 0, ptr, asize_idx; - hssize_t asize[16]; - hssize_t i; - void * vp = NULL; - FILE * out = H5_debug_g.trace; - static hbool_t is_first_invocation = TRUE; - H5_timer_t function_timer; - H5_timevals_t function_times; - static H5_timer_t running_timer; - H5_timevals_t running_times; - static int current_depth = 0; - static int last_call_depth = 0; + /* FUNC_ENTER() should not be called */ + switch (cset) { + case H5T_CSET_ERROR: + H5RS_acat(rs, "H5T_CSET_ERROR"); + break; + + case H5T_CSET_ASCII: + H5RS_acat(rs, "H5T_CSET_ASCII"); + break; + + case H5T_CSET_UTF8: + H5RS_acat(rs, "H5T_CSET_UTF8"); + break; + + case H5T_CSET_RESERVED_2: + case H5T_CSET_RESERVED_3: + case H5T_CSET_RESERVED_4: + case H5T_CSET_RESERVED_5: + case H5T_CSET_RESERVED_6: + case H5T_CSET_RESERVED_7: + case H5T_CSET_RESERVED_8: + case H5T_CSET_RESERVED_9: + case H5T_CSET_RESERVED_10: + case H5T_CSET_RESERVED_11: + case H5T_CSET_RESERVED_12: + case H5T_CSET_RESERVED_13: + case H5T_CSET_RESERVED_14: + case H5T_CSET_RESERVED_15: + H5RS_asprintf_cat(rs, "H5T_CSET_RESERVED_%ld", (long)cset); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)cset); + break; + } /* end switch */ + + return SUCCEED; +} /* end H5_trace_args_cset() */ + +/*------------------------------------------------------------------------- + * Function: H5_trace_args_close_degree + * + * Purpose: This routine formats an H5F_close_degree_t and adds the output to + * the refcounted string (RS) argument. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Monday, September 21, 2020 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5_trace_args_close_degree(H5RS_str_t *rs, H5F_close_degree_t degree) +{ /* FUNC_ENTER() should not be called */ - if (!out) - return 0.0F; /*tracing is off*/ - HDva_start(ap, type); + switch (degree) { + case H5F_CLOSE_DEFAULT: + H5RS_acat(rs, "H5F_CLOSE_DEFAULT"); + break; - if (H5_debug_g.ttop) { - if (returning) { - if (current_depth > 1) { - --current_depth; - return 0.0F; - } /* end if */ - } /* end if */ - else { - if (current_depth > 0) { - /*do not update last_call_depth*/ - current_depth++; - return 0.0F; - } /* end if */ - } /* end else */ - } /* end if */ + case H5F_CLOSE_WEAK: + H5RS_acat(rs, "H5F_CLOSE_WEAK"); + break; - /* Get time for event if the trace times flag is set */ - if (is_first_invocation && H5_debug_g.ttimes) { - /* 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); - H5_timer_start(&function_timer); - } /* end if */ + case H5F_CLOSE_SEMI: + H5RS_acat(rs, "H5F_CLOSE_SEMI"); + break; - /* Print the first part of the line. This is the indication of the - * nesting depth followed by the function name and either start of - * argument list or start of return value. If this call is for a - * function return and no other calls have been made to H5_trace() - * since the one for the function call, then we're continuing - * the same line. */ - if (returning) { - HDassert(current_depth > 0); - --current_depth; - if (current_depth < last_call_depth) { - /* We are at the beginning of a line */ - if (H5_debug_g.ttimes) { - char tmp[320]; + case H5F_CLOSE_STRONG: + H5RS_acat(rs, "H5F_CLOSE_STRONG"); + break; - H5_timer_get_times(function_timer, &function_times); - H5_timer_get_times(running_timer, &running_times); - HDsprintf(tmp, "%.6f", (function_times.elapsed - running_times.elapsed)); - HDfprintf(out, " %*s ", (int)HDstrlen(tmp), ""); - } /* end if */ - for (i = 0; i < current_depth; i++) - HDfputc('+', out); - HDfprintf(out, "%*s%s = ", 2 * current_depth, "", func); - } /* end if */ - else { - /* Continue current line with return value */ - HDfprintf(out, " = "); - } /* end else */ - } /* end if */ - else { - if (current_depth > last_call_depth) - HDfputs(" = <delayed>\n", out); - if (H5_debug_g.ttimes) { - H5_timer_get_times(function_timer, &function_times); - H5_timer_get_times(running_timer, &running_times); - HDfprintf(out, "@%.6f ", (function_times.elapsed - running_times.elapsed)); - } /* end if */ - for (i = 0; i < current_depth; i++) - HDfputc('+', out); - HDfprintf(out, "%*s%s(", 2 * current_depth, "", func); - } /* end else */ + default: + H5RS_asprintf_cat(rs, "%ld", (long)degree); + break; + } /* end switch */ + + return SUCCEED; +} /* end H5_trace_args_cset() */ + +/*------------------------------------------------------------------------- + * Function: H5_trace_args + * + * Purpose: This routine formats a set of function arguments, placing the + * resulting string in the refcounted string (RS) argument. + * + * The TYPE argument is a string which gives the type of each of + * the following argument pairs. Each type begins with zero or + * more asterisks (one for each level of indirection, although + * some types have one level of indirection already implied) + * followed by either one letter (lower case) or two letters + * (first one uppercase). + * + * The variable argument list consists of pairs of values. Each + * pair is a string which is the formal argument name in the + * calling function, followed by the argument value. The type + * of the argument value is given by the TYPE string. + * + * Note: The TYPE string is meant to be terse and is generated by a + * separate perl script. + * + * Return: SUCCEED / FAIL + * + * Programmer: Quincey Koziol + * Saturday, September 19, 2020 + * + *------------------------------------------------------------------------- + */ +herr_t +H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap) +{ + const char *argname; + int argno = 0, ptr, asize_idx; + hssize_t asize[16]; + hssize_t i; + void * vp = NULL; + + /* FUNC_ENTER() should not be called */ /* Clear array sizes */ for (i = 0; i < (hssize_t)NELMTS(asize); i++) @@ -211,7 +253,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* Count levels of indirection */ for (ptr = 0; '*' == *type; type++) ptr++; + + /* Array parameter, possibly with another argument as the array size */ if ('[' == *type) { + char *rest; + if ('a' == type[1]) { asize_idx = (int)HDstrtol(type + 2, &rest, 10); HDassert(0 <= asize_idx && asize_idx < (int)NELMTS(asize)); @@ -229,1136 +275,1338 @@ H5_trace(const double *returning, const char *func, const char *type, ...) asize_idx = -1; /* - * The argument name. Leave off the `_id' part. If the argument - * name is the null pointer then don't print the argument or the - * following `='. This is used for return values. + * The argument name. If the argument name is the null pointer then + * don't print the argument or the following `=' (this is used for + * return values). */ argname = HDva_arg(ap, char *); - if (argname) { - unsigned n = (unsigned)MAX(0, (int)HDstrlen(argname) - 3); - - if (!HDstrcmp(argname + n, "_id")) { - HDstrncpy(buf, argname, (size_t)MIN((int)sizeof(buf) - 1, n)); - buf[MIN((int)sizeof(buf) - 1, n)] = '\0'; - argname = buf; - } /* end if */ - HDfprintf(out, "%s%s=", argno ? ", " : "", argname); - } /* end if */ + if (argname) + H5RS_asprintf_cat(rs, "%s%s=", argno ? ", " : "", argname); else argname = ""; - /* The value */ - if (ptr) + /* A pointer/array */ + if (ptr) { vp = HDva_arg(ap, void *); - switch (type[0]) { - case 'a': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + if (vp) { + switch (type[0]) { + case 'h': /* hsize_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + hsize_t *p = (hsize_t *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) { + if (H5S_UNLIMITED == p[i]) + H5RS_asprintf_cat(rs, "%sH5S_UNLIMITED", (i ? ", " : "")); + else + H5RS_asprintf_cat(rs, "%s%" PRIuHSIZE, (i ? ", " : ""), p[i]); + } /* end for */ + H5RS_acat(rs, "}"); + } /* end if */ + break; + + case 'H': + if ('s' == type[1]) { /* hssize_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + hssize_t *p = (hssize_t *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%" PRIdHSIZE, (i ? ", " : ""), p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end if */ + else + H5RS_asprintf_cat(rs, "%p", vp); + break; + + case 'I': + if ('s' == type[1]) { /* int / int32_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + int *p = (int *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%d", (i ? ", " : ""), p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end if */ + else if ('u' == type[1]) { /* unsigned / uint32_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned *p = (unsigned *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%u", i ? ", " : "", p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end else-if */ + else + H5RS_asprintf_cat(rs, "%p", vp); + break; + + case 's': /* char* */ + /* Strings have one level of indirection by default, pointers + * to strings have 2 or more. + */ + if (ptr > 1) + H5RS_asprintf_cat(rs, "%p", vp); + else + H5RS_asprintf_cat(rs, "\"%s\"", (const char *)vp); + break; + + case 'U': + if ('l' == type[1]) { /* unsigned long */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned long *p = (unsigned long *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%lu", i ? ", " : "", p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end if */ + else if ('L' == type[1]) { /* unsigned long long / uint64_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned long long *p = (unsigned long long *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%llu", i ? ", " : "", p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end else-if */ + else + H5RS_asprintf_cat(rs, "%p", vp); + break; + + case 'x': /* void */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + void **p = (void **)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) { + if (p[i]) + H5RS_asprintf_cat(rs, "%s%p", (i ? ", " : ""), p[i]); + else + H5RS_asprintf_cat(rs, "%sNULL", (i ? ", " : "")); + } /* end for */ + H5RS_acat(rs, "}"); + } /* end if */ + break; + + case 'z': /* size_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + size_t *p = (size_t *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%zu", (i ? ", " : ""), p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + break; + + case 'Z': + if ('s' == type[1]) { /* ssize_t */ + H5RS_asprintf_cat(rs, "%p", vp); + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + ssize_t *p = (ssize_t *)vp; + + H5RS_acat(rs, " {"); + for (i = 0; i < asize[asize_idx]; i++) + H5RS_asprintf_cat(rs, "%s%zd", (i ? ", " : ""), p[i]); + H5RS_acat(rs, "}"); + } /* end if */ + } /* end if */ + else + H5RS_asprintf_cat(rs, "%p", vp); + break; + + default: + H5RS_asprintf_cat(rs, "%p", vp); + } /* end switch */ + } /* end if */ + else + H5RS_acat(rs, "NULL"); + } /* end if */ + /* A value */ + else { + switch (type[0]) { + case 'a': /* haddr_t */ + { haddr_t addr = HDva_arg(ap, haddr_t); - HDfprintf(out, "%" PRIuHADDR, addr); - } /* end else */ + if (H5F_addr_defined(addr)) + H5RS_asprintf_cat(rs, "%" PRIuHADDR, addr); + else + H5RS_acat(rs, "UNDEF"); + } /* end block */ break; - case 'b': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'A': + switch (type[1]) { + case 'i': /* H5A_info_t */ + { + H5A_info_t ainfo = HDva_arg(ap, H5A_info_t); + + H5RS_acat(rs, "{"); + H5_trace_args_bool(rs, ainfo.corder_valid); + H5RS_asprintf_cat(rs, ", %u, ", ainfo.corder); + H5_trace_args_cset(rs, ainfo.cset); + H5RS_asprintf_cat(rs, "%" PRIuHSIZE "}", ainfo.data_size); + } /* end block */ + break; + +#ifndef H5_NO_DEPRECATED_SYMBOLS + case 'o': /* H5A_operator1_t */ + { + H5A_operator1_t aop1 = (H5A_operator1_t)HDva_arg(ap, H5A_operator1_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)aop1); + } /* end block */ + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case 'O': /* H5A_operator2_t */ + { + H5A_operator2_t aop2 = (H5A_operator2_t)HDva_arg(ap, H5A_operator2_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)aop2); + } /* end block */ + break; + + default: + H5RS_asprintf_cat(rs, "BADTYPE(A%c)", type[1]); + goto error; + } /* end switch */ + break; + + case 'b': /* hbool_t */ + { /* Can't pass hbool_t to HDva_arg() */ hbool_t bool_var = (hbool_t)HDva_arg(ap, int); - if (TRUE == bool_var) - HDfprintf(out, "TRUE"); - else if (!bool_var) - HDfprintf(out, "FALSE"); - else - HDfprintf(out, "TRUE(%u)", (unsigned)bool_var); - } + + H5_trace_args_bool(rs, bool_var); + } /* end block */ break; - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'C': + switch (type[1]) { + case 'c': /* H5AC_cache_config_t */ + { + H5AC_cache_config_t cc = HDva_arg(ap, H5AC_cache_config_t); + + H5RS_asprintf_cat(rs, "{%d, ", cc.version); + H5_trace_args_bool(rs, cc.rpt_fcn_enabled); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cc.open_trace_file); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cc.close_trace_file); + H5RS_asprintf_cat(rs, ", '%s', ", cc.trace_file_name); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cc.evictions_enabled); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cc.set_initial_size); + H5RS_asprintf_cat(rs, ", %zu, ", cc.initial_size); + H5RS_asprintf_cat(rs, "%f, ", cc.min_clean_fraction); + H5RS_asprintf_cat(rs, "%zu, ", cc.max_size); + H5RS_asprintf_cat(rs, "%zu, ", cc.min_size); + H5RS_asprintf_cat(rs, "%ld, ", cc.epoch_length); + switch (cc.incr_mode) { + case H5C_incr__off: + H5RS_acat(rs, "H5C_incr__off"); + break; + + case H5C_incr__threshold: + H5RS_acat(rs, "H5C_incr__threshold"); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)cc.incr_mode); + break; + } /* end switch */ + H5RS_asprintf_cat(rs, ", %f, ", cc.lower_hr_threshold); + H5RS_asprintf_cat(rs, "%f, ", cc.increment); + H5_trace_args_bool(rs, cc.apply_max_increment); + H5RS_asprintf_cat(rs, ", %zu, ", cc.max_increment); + switch (cc.flash_incr_mode) { + case H5C_flash_incr__off: + H5RS_acat(rs, "H5C_flash_incr__off"); + break; + + case H5C_flash_incr__add_space: + H5RS_acat(rs, "H5C_flash_incr__add_space"); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)cc.flash_incr_mode); + break; + } /* end switch */ + H5RS_asprintf_cat(rs, ", %f, ", cc.flash_multiple); + H5RS_asprintf_cat(rs, "%f, ", cc.flash_threshold); + switch (cc.decr_mode) { + case H5C_decr__off: + H5RS_acat(rs, "H5C_decr__off"); + break; + + case H5C_decr__threshold: + H5RS_acat(rs, "H5C_decr__threshold"); + break; + + case H5C_decr__age_out: + H5RS_acat(rs, "H5C_decr__age_out"); + break; + + case H5C_decr__age_out_with_threshold: + H5RS_acat(rs, "H5C_decr__age_out_with_threshold"); + break; + + default: + H5RS_asprintf_cat(rs, "%ld", (long)cc.decr_mode); + break; + } /* end switch */ + H5RS_asprintf_cat(rs, ", %f, ", cc.upper_hr_threshold); + H5RS_asprintf_cat(rs, "%f, ", cc.decrement); + H5_trace_args_bool(rs, cc.apply_max_decrement); + H5RS_asprintf_cat(rs, ", %zu, ", cc.max_decrement); + H5RS_asprintf_cat(rs, "%d, ", cc.epochs_before_eviction); + H5_trace_args_bool(rs, cc.apply_empty_reserve); + H5RS_asprintf_cat(rs, ", %f, ", cc.empty_reserve); + H5RS_asprintf_cat(rs, "%zu, ", cc.dirty_bytes_threshold); + H5RS_asprintf_cat(rs, "%d}", cc.metadata_write_strategy); + } /* end block */ + break; + + case 'C': /* H5AC_cache_image_config_t */ + { + H5AC_cache_image_config_t cic = HDva_arg(ap, H5AC_cache_image_config_t); + + H5RS_asprintf_cat(rs, "{%d, ", cic.version); + H5_trace_args_bool(rs, cic.generate_image); + H5RS_acat(rs, ", "); + H5_trace_args_bool(rs, cic.save_resize_status); + H5RS_acat(rs, ", "); + H5RS_asprintf_cat(rs, "%d}", cic.entry_ageout); + } /* end block */ + break; + + default: + H5RS_asprintf_cat(rs, "BADTYPE(C%c)", type[1]); + goto error; + } /* end switch */ + break; + + case 'd': /* double */ + { double dbl = HDva_arg(ap, double); - HDfprintf(out, "%g", dbl); - } /* end else */ + H5RS_asprintf_cat(rs, "%g", dbl); + } /* end block */ break; - case 'D': - switch (type[1]) { - case 'a': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'D': + switch (type[1]) { + case 'a': /* H5D_alloc_time_t */ + { H5D_alloc_time_t alloc_time = (H5D_alloc_time_t)HDva_arg(ap, int); switch (alloc_time) { case H5D_ALLOC_TIME_ERROR: - HDfprintf(out, "H5D_ALLOC_TIME_ERROR"); + H5RS_acat(rs, "H5D_ALLOC_TIME_ERROR"); break; case H5D_ALLOC_TIME_DEFAULT: - HDfprintf(out, "H5D_ALLOC_TIME_DEFAULT"); + H5RS_acat(rs, "H5D_ALLOC_TIME_DEFAULT"); break; case H5D_ALLOC_TIME_EARLY: - HDfprintf(out, "H5D_ALLOC_TIME_EARLY"); + H5RS_acat(rs, "H5D_ALLOC_TIME_EARLY"); break; case H5D_ALLOC_TIME_LATE: - HDfprintf(out, "H5D_ALLOC_TIME_LATE"); + H5RS_acat(rs, "H5D_ALLOC_TIME_LATE"); break; case H5D_ALLOC_TIME_INCR: - HDfprintf(out, "H5D_ALLOC_TIME_INCR"); + H5RS_acat(rs, "H5D_ALLOC_TIME_INCR"); break; default: - HDfprintf(out, "%ld", (long)alloc_time); + H5RS_asprintf_cat(rs, "%ld", (long)alloc_time); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'A': /* H5D_append_cb_t */ + { + H5D_append_cb_t dapp = (H5D_append_cb_t)HDva_arg(ap, H5D_append_cb_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)dapp); + } /* end block */ + break; + + case 'c': /* H5FD_mpio_collective_opt_t */ + { H5FD_mpio_collective_opt_t opt = (H5FD_mpio_collective_opt_t)HDva_arg(ap, int); switch (opt) { case H5FD_MPIO_COLLECTIVE_IO: - HDfprintf(out, "H5FD_MPIO_COLLECTIVE_IO"); + H5RS_acat(rs, "H5FD_MPIO_COLLECTIVE_IO"); break; case H5FD_MPIO_INDIVIDUAL_IO: - HDfprintf(out, "H5FD_MPIO_INDIVIDUAL_IO"); + H5RS_acat(rs, "H5FD_MPIO_INDIVIDUAL_IO"); break; default: - HDfprintf(out, "%ld", (long)opt); + H5RS_asprintf_cat(rs, "%ld", (long)opt); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'f': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'f': /* H5D_fill_time_t */ + { H5D_fill_time_t fill_time = (H5D_fill_time_t)HDva_arg(ap, int); switch (fill_time) { case H5D_FILL_TIME_ERROR: - HDfprintf(out, "H5D_FILL_TIME_ERROR"); + H5RS_acat(rs, "H5D_FILL_TIME_ERROR"); break; case H5D_FILL_TIME_ALLOC: - HDfprintf(out, "H5D_FILL_TIME_ALLOC"); + H5RS_acat(rs, "H5D_FILL_TIME_ALLOC"); break; case H5D_FILL_TIME_NEVER: - HDfprintf(out, "H5D_FILL_TIME_NEVER"); + H5RS_acat(rs, "H5D_FILL_TIME_NEVER"); break; case H5D_FILL_TIME_IFSET: - HDfprintf(out, "H5D_FILL_TIME_IFSET"); + H5RS_acat(rs, "H5D_FILL_TIME_IFSET"); break; default: - HDfprintf(out, "%ld", (long)fill_time); + H5RS_asprintf_cat(rs, "%ld", (long)fill_time); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'F': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'F': /* H5D_fill_value_t */ + { H5D_fill_value_t fill_value = (H5D_fill_value_t)HDva_arg(ap, int); switch (fill_value) { case H5D_FILL_VALUE_ERROR: - HDfprintf(out, "H5D_FILL_VALUE_ERROR"); + H5RS_acat(rs, "H5D_FILL_VALUE_ERROR"); break; case H5D_FILL_VALUE_UNDEFINED: - HDfprintf(out, "H5D_FILL_VALUE_UNDEFINED"); + H5RS_acat(rs, "H5D_FILL_VALUE_UNDEFINED"); break; case H5D_FILL_VALUE_DEFAULT: - HDfprintf(out, "H5D_FILL_VALUE_DEFAULT"); + H5RS_acat(rs, "H5D_FILL_VALUE_DEFAULT"); break; case H5D_FILL_VALUE_USER_DEFINED: - HDfprintf(out, "H5D_FILL_VALUE_USER_DEFINED"); + H5RS_acat(rs, "H5D_FILL_VALUE_USER_DEFINED"); break; default: - HDfprintf(out, "%ld", (long)fill_value); + H5RS_asprintf_cat(rs, "%ld", (long)fill_value); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'h': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'g': /* H5D_gather_func_t */ + { + H5D_gather_func_t gop = (H5D_gather_func_t)HDva_arg(ap, H5D_gather_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)gop); + } /* end block */ + break; + + case 'h': /* H5FD_mpio_chunk_opt_t */ + { H5FD_mpio_chunk_opt_t opt = (H5FD_mpio_chunk_opt_t)HDva_arg(ap, int); switch (opt) { case H5FD_MPIO_CHUNK_DEFAULT: - HDfprintf(out, "H5FD_MPIO_CHUNK_DEFAULT"); + H5RS_acat(rs, "H5FD_MPIO_CHUNK_DEFAULT"); break; case H5FD_MPIO_CHUNK_ONE_IO: - HDfprintf(out, "H5FD_MPIO_CHUNK_ONE_IO"); + H5RS_acat(rs, "H5FD_MPIO_CHUNK_ONE_IO"); break; case H5FD_MPIO_CHUNK_MULTI_IO: - HDfprintf(out, "H5FD_MPIO_CHUNK_MULTI_IO"); + H5RS_acat(rs, "H5FD_MPIO_CHUNK_MULTI_IO"); break; default: - HDfprintf(out, "%ld", (long)opt); + H5RS_asprintf_cat(rs, "%ld", (long)opt); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'i': /* H5D_mpio_actual_io_mode_t */ + { H5D_mpio_actual_io_mode_t actual_io_mode = (H5D_mpio_actual_io_mode_t)HDva_arg(ap, int); switch (actual_io_mode) { case H5D_MPIO_NO_COLLECTIVE: - HDfprintf(out, "H5D_MPIO_NO_COLLECTIVE"); + H5RS_acat(rs, "H5D_MPIO_NO_COLLECTIVE"); break; case H5D_MPIO_CHUNK_INDEPENDENT: - HDfprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT"); + H5RS_acat(rs, "H5D_MPIO_CHUNK_INDEPENDENT"); break; case H5D_MPIO_CHUNK_COLLECTIVE: - HDfprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE"); + H5RS_acat(rs, "H5D_MPIO_CHUNK_COLLECTIVE"); break; case H5D_MPIO_CHUNK_MIXED: - HDfprintf(out, "H5D_MPIO_CHUNK_MIXED"); + H5RS_acat(rs, "H5D_MPIO_CHUNK_MIXED"); break; case H5D_MPIO_CONTIGUOUS_COLLECTIVE: - HDfprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); + H5RS_acat(rs, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); break; default: - HDfprintf(out, "%ld", (long)actual_io_mode); + H5RS_asprintf_cat(rs, "%ld", (long)actual_io_mode); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'k': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'I': /* H5FD_file_image_callbacks_t */ + { + H5FD_file_image_callbacks_t ficb = HDva_arg(ap, H5FD_file_image_callbacks_t); + + H5RS_asprintf_cat(rs, "{%p, ", (void *)(uintptr_t)ficb.image_malloc); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.image_memcpy); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.image_realloc); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.image_free); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.udata_copy); + H5RS_asprintf_cat(rs, "%p, ", (void *)(uintptr_t)ficb.udata_free); + H5RS_asprintf_cat(rs, "%p}", ficb.udata); + } /* end block */ + break; + + case 'k': /* H5D_chunk_index_t */ + { H5D_chunk_index_t idx = (H5D_chunk_index_t)HDva_arg(ap, int); switch (idx) { case H5D_CHUNK_IDX_BTREE: - HDfprintf(out, "H5D_CHUNK_IDX_BTREE"); + H5RS_acat(rs, "H5D_CHUNK_IDX_BTREE"); break; case H5D_CHUNK_IDX_NONE: - HDfprintf(out, "H5D_CHUNK_IDX_NONE"); + H5RS_acat(rs, "H5D_CHUNK_IDX_NONE"); break; case H5D_CHUNK_IDX_FARRAY: - HDfprintf(out, "H5D_CHUNK_IDX_FARRAY"); + H5RS_acat(rs, "H5D_CHUNK_IDX_FARRAY"); break; case H5D_CHUNK_IDX_EARRAY: - HDfprintf(out, "H5D_CHUNK_IDX_EARRAY"); + H5RS_acat(rs, "H5D_CHUNK_IDX_EARRAY"); break; case H5D_CHUNK_IDX_BT2: - HDfprintf(out, "H5D_CHUNK_IDX_BT2"); + H5RS_acat(rs, "H5D_CHUNK_IDX_BT2"); break; case H5D_CHUNK_IDX_SINGLE: - HDfprintf(out, "H5D_CHUNK_IDX_SINGLE"); + H5RS_acat(rs, "H5D_CHUNK_IDX_SINGLE"); break; case H5D_CHUNK_IDX_NTYPES: - HDfprintf(out, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)"); + H5RS_acat(rs, "ERROR: H5D_CHUNK_IDX_NTYPES (invalid value)"); break; default: - HDfprintf(out, "UNKNOWN VALUE: %ld", (long)idx); + H5RS_asprintf_cat(rs, "UNKNOWN VALUE: %ld", (long)idx); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'l': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'l': /* H5D_layout_t */ + { H5D_layout_t layout = (H5D_layout_t)HDva_arg(ap, int); switch (layout) { case H5D_LAYOUT_ERROR: - HDfprintf(out, "H5D_LAYOUT_ERROR"); + H5RS_acat(rs, "H5D_LAYOUT_ERROR"); break; case H5D_COMPACT: - HDfprintf(out, "H5D_COMPACT"); + H5RS_acat(rs, "H5D_COMPACT"); break; case H5D_CONTIGUOUS: - HDfprintf(out, "H5D_CONTIGUOUS"); + H5RS_acat(rs, "H5D_CONTIGUOUS"); break; case H5D_CHUNKED: - HDfprintf(out, "H5D_CHUNKED"); + H5RS_acat(rs, "H5D_CHUNKED"); break; case H5D_VIRTUAL: - HDfprintf(out, "H5D_VIRTUAL"); + H5RS_acat(rs, "H5D_VIRTUAL"); break; case H5D_NLAYOUTS: - HDfprintf(out, "H5D_NLAYOUTS"); + H5RS_acat(rs, "H5D_NLAYOUTS"); break; default: - HDfprintf(out, "%ld", (long)layout); + H5RS_asprintf_cat(rs, "%ld", (long)layout); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'n': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'n': /* H5D_mpio_no_collective_cause_t */ + { H5D_mpio_no_collective_cause_t nocol_cause_mode = (H5D_mpio_no_collective_cause_t)HDva_arg(ap, int); hbool_t flag_already_displayed = FALSE; /* Check for all bit-flags which might be set */ if (nocol_cause_mode & H5D_MPIO_COLLECTIVE) { - HDfprintf(out, "H5D_MPIO_COLLECTIVE"); + H5RS_acat(rs, "H5D_MPIO_COLLECTIVE"); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_SET_INDEPENDENT) { - HDfprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_SET_INDEPENDENT", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_DATATYPE_CONVERSION) { - HDfprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_DATATYPE_CONVERSION", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_DATA_TRANSFORMS) { - HDfprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_DATA_TRANSFORMS", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED) { - HDfprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES) { - HDfprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ if (nocol_cause_mode & H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) { - HDfprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", - flag_already_displayed ? " | " : ""); + H5RS_asprintf_cat(rs, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ /* Display '<none>' if there's no flags set */ if (!flag_already_displayed) - HDfprintf(out, "<none>"); - } /* end else */ + H5RS_acat(rs, "<none>"); + } /* end block */ break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'o': /* H5D_mpio_actual_chunk_opt_mode_t */ + { H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode = (H5D_mpio_actual_chunk_opt_mode_t)HDva_arg(ap, int); switch (chunk_opt_mode) { case H5D_MPIO_NO_CHUNK_OPTIMIZATION: - HDfprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); + H5RS_acat(rs, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); break; case H5D_MPIO_LINK_CHUNK: - HDfprintf(out, "H5D_MPIO_LINK_CHUNK"); + H5RS_acat(rs, "H5D_MPIO_LINK_CHUNK"); break; case H5D_MPIO_MULTI_CHUNK: - HDfprintf(out, "H5D_MPIO_MULTI_CHUNK"); + H5RS_acat(rs, "H5D_MPIO_MULTI_CHUNK"); break; default: - HDfprintf(out, "%ld", (long)chunk_opt_mode); + H5RS_asprintf_cat(rs, "%ld", (long)chunk_opt_mode); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'O': /* H5D_operator_t */ + { + H5D_operator_t dop = (H5D_operator_t)HDva_arg(ap, H5D_operator_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)dop); + } /* end block */ + break; + + case 's': /* H5D_space_status_t */ + { H5D_space_status_t space_status = (H5D_space_status_t)HDva_arg(ap, int); switch (space_status) { case H5D_SPACE_STATUS_NOT_ALLOCATED: - HDfprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED"); + H5RS_acat(rs, "H5D_SPACE_STATUS_NOT_ALLOCATED"); break; case H5D_SPACE_STATUS_PART_ALLOCATED: - HDfprintf(out, "H5D_SPACE_STATUS_PART_ALLOCATED"); + H5RS_acat(rs, "H5D_SPACE_STATUS_PART_ALLOCATED"); break; case H5D_SPACE_STATUS_ALLOCATED: - HDfprintf(out, "H5D_SPACE_STATUS_ALLOCATED"); + H5RS_acat(rs, "H5D_SPACE_STATUS_ALLOCATED"); break; case H5D_SPACE_STATUS_ERROR: - HDfprintf(out, "H5D_SPACE_STATUS_ERROR"); + H5RS_acat(rs, "H5D_SPACE_STATUS_ERROR"); break; default: - HDfprintf(out, "%ld", (long)space_status); + H5RS_asprintf_cat(rs, "%ld", (long)space_status); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'S': /* H5D_scatter_func_t */ + { + H5D_scatter_func_t sop = (H5D_scatter_func_t)HDva_arg(ap, H5D_scatter_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)sop); + } /* end block */ + break; + + case 't': /* H5FD_mpio_xfer_t */ + { H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)HDva_arg(ap, int); switch (transfer) { case H5FD_MPIO_INDEPENDENT: - HDfprintf(out, "H5FD_MPIO_INDEPENDENT"); + H5RS_acat(rs, "H5FD_MPIO_INDEPENDENT"); break; case H5FD_MPIO_COLLECTIVE: - HDfprintf(out, "H5FD_MPIO_COLLECTIVE"); + H5RS_acat(rs, "H5FD_MPIO_COLLECTIVE"); break; default: - HDfprintf(out, "%ld", (long)transfer); + H5RS_asprintf_cat(rs, "%ld", (long)transfer); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'v': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'v': /* H5D_vds_view_t */ + { H5D_vds_view_t view = (H5D_vds_view_t)HDva_arg(ap, int); switch (view) { case H5D_VDS_ERROR: - HDfprintf(out, "H5D_VDS_ERROR"); + H5RS_acat(rs, "H5D_VDS_ERROR"); break; case H5D_VDS_FIRST_MISSING: - HDfprintf(out, "H5D_VDS_FIRST_MISSING"); + H5RS_acat(rs, "H5D_VDS_FIRST_MISSING"); break; case H5D_VDS_LAST_AVAILABLE: - HDfprintf(out, "H5D_VDS_LAST_AVAILABLE"); + H5RS_acat(rs, "H5D_VDS_LAST_AVAILABLE"); break; default: - HDfprintf(out, "%ld", (long)view); + H5RS_asprintf_cat(rs, "%ld", (long)view); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(D%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(D%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* herr_t */ + { herr_t status = HDva_arg(ap, herr_t); if (status >= 0) - HDfprintf(out, "SUCCEED"); + H5RS_acat(rs, "SUCCEED"); else - HDfprintf(out, "FAIL"); - } /* end else */ + H5RS_acat(rs, "FAIL"); + } /* end block */ break; - case 'E': - switch (type[1]) { - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'E': + switch (type[1]) { +#ifndef H5_NO_DEPRECATED_SYMBOLS + case 'a': /* H5E_auto1_t */ + { + H5E_auto1_t eauto1 = (H5E_auto1_t)HDva_arg(ap, H5E_auto1_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)eauto1); + } /* end block */ + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case 'A': /* H5E_auto2_t */ + { + H5E_auto2_t eauto2 = (H5E_auto2_t)HDva_arg(ap, H5E_auto2_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)eauto2); + } /* end block */ + break; + + case 'd': /* H5E_direction_t */ + { H5E_direction_t direction = (H5E_direction_t)HDva_arg(ap, int); switch (direction) { case H5E_WALK_UPWARD: - HDfprintf(out, "H5E_WALK_UPWARD"); + H5RS_acat(rs, "H5E_WALK_UPWARD"); break; case H5E_WALK_DOWNWARD: - HDfprintf(out, "H5E_WALK_DOWNWARD"); + H5RS_acat(rs, "H5E_WALK_DOWNWARD"); break; default: - HDfprintf(out, "%ld", (long)direction); + H5RS_asprintf_cat(rs, "%ld", (long)direction); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* H5E_error_t */ + { H5E_error2_t *error = HDva_arg(ap, H5E_error2_t *); - HDfprintf(out, "0x%p", (void *)error); - } /* end else */ + H5RS_asprintf_cat(rs, "%p", (void *)error); + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5ES_status_t */ + { H5ES_status_t status = (H5ES_status_t)HDva_arg(ap, int); switch (status) { case H5ES_STATUS_IN_PROGRESS: - HDfprintf(out, "H5ES_STATUS_IN_PROGRESS"); + H5RS_acat(rs, "H5ES_STATUS_IN_PROGRESS"); break; + case H5ES_STATUS_SUCCEED: - HDfprintf(out, "H5ES_STATUS_SUCCEED"); + H5RS_acat(rs, "H5ES_STATUS_SUCCEED"); break; + case H5ES_STATUS_FAIL: - HDfprintf(out, "H5ES_STATUS_FAIL"); + H5RS_acat(rs, "H5ES_STATUS_FAIL"); break; + case H5ES_STATUS_CANCELED: - HDfprintf(out, "H5ES_STATUS_CANCELED"); + H5RS_acat(rs, "H5ES_STATUS_CANCELED"); break; default: - HDfprintf(out, "%ld", (long)status); + H5RS_asprintf_cat(rs, "%ld", (long)status); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5E_type_t */ + { H5E_type_t etype = (H5E_type_t)HDva_arg(ap, int); switch (etype) { case H5E_MAJOR: - HDfprintf(out, "H5E_MAJOR"); + H5RS_acat(rs, "H5E_MAJOR"); break; case H5E_MINOR: - HDfprintf(out, "H5E_MINOR"); + H5RS_acat(rs, "H5E_MINOR"); break; default: - HDfprintf(out, "%ld", (long)etype); + H5RS_asprintf_cat(rs, "%ld", (long)etype); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(E%c)", type[1]); - goto error; - } /* end switch */ - break; - - case 'F': - switch (type[1]) { - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - H5F_close_degree_t degree = (H5F_close_degree_t)HDva_arg(ap, int); - - switch (degree) { - case H5F_CLOSE_DEFAULT: - HDfprintf(out, "H5F_CLOSE_DEFAULT"); - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(E%c)", type[1]); + goto error; + } /* end switch */ + break; - case H5F_CLOSE_WEAK: - HDfprintf(out, "H5F_CLOSE_WEAK"); - break; + case 'F': + switch (type[1]) { + case 'C': /* H5FD_class_t */ + { + H5FD_class_t cls = HDva_arg(ap, H5FD_class_t); - case H5F_CLOSE_SEMI: - HDfprintf(out, "H5F_CLOSE_SEMI"); - break; + H5RS_asprintf_cat(rs, "{'%s', " H5_PRINTF_HADDR_FMT ", ", cls.name, cls.maxaddr); + H5_trace_args_close_degree(rs, cls.fc_degree); + H5RS_acat(rs, ", ...}"); + } /* end block */ + break; - case H5F_CLOSE_STRONG: - HDfprintf(out, "H5F_CLOSE_STRONG"); - break; + case 'd': /* H5F_close_degree_t */ + { + H5F_close_degree_t degree = (H5F_close_degree_t)HDva_arg(ap, int); - default: - HDfprintf(out, "%ld", (long)degree); - break; - } /* end switch */ - } /* end else */ + H5_trace_args_close_degree(rs, degree); + } /* end block */ break; - case 'f': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'f': /* H5F_fspace_strategy_t */ + { H5F_fspace_strategy_t fs_strategy = (H5F_fspace_strategy_t)HDva_arg(ap, int); switch (fs_strategy) { case H5F_FSPACE_STRATEGY_FSM_AGGR: - HDfprintf(out, "H5F_FSPACE_STRATEGY_FSM_AGGR"); + H5RS_acat(rs, "H5F_FSPACE_STRATEGY_FSM_AGGR"); break; case H5F_FSPACE_STRATEGY_PAGE: - HDfprintf(out, "H5F_FSPACE_STRATEGY_PAGE"); + H5RS_acat(rs, "H5F_FSPACE_STRATEGY_PAGE"); break; case H5F_FSPACE_STRATEGY_AGGR: - HDfprintf(out, "H5F_FSPACE_STRATEGY_AGGR"); + H5RS_acat(rs, "H5F_FSPACE_STRATEGY_AGGR"); break; case H5F_FSPACE_STRATEGY_NONE: - HDfprintf(out, "H5F_FSPACE_STRATEGY_NONE"); + H5RS_acat(rs, "H5F_FSPACE_STRATEGY_NONE"); break; case H5F_FSPACE_STRATEGY_NTYPES: default: - HDfprintf(out, "%ld", (long)fs_strategy); + H5RS_asprintf_cat(rs, "%ld", (long)fs_strategy); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'm': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'F': /* H5F_flush_cb_t */ + { + H5F_flush_cb_t fflsh = (H5F_flush_cb_t)HDva_arg(ap, H5F_flush_cb_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)fflsh); + } /* end block */ + break; + + case 'I': /* H5F_info2_t */ + { + H5F_info2_t fi2 = HDva_arg(ap, H5F_info2_t); + + H5RS_asprintf_cat(rs, "{{%u, %" PRIuHSIZE ", %" PRIuHSIZE "}, ", + fi2.super.version, fi2.super.super_size, + fi2.super.super_ext_size); + H5RS_asprintf_cat(rs, "{%u, %" PRIuHSIZE ", %" PRIuHSIZE "}, ", fi2.free.version, + fi2.free.meta_size, fi2.free.tot_space); + H5RS_asprintf_cat(rs, "{%u, %" PRIuHSIZE ", {%" PRIuHSIZE ", %" PRIuHSIZE "}}}", + fi2.sohm.version, fi2.sohm.hdr_size, + fi2.sohm.msgs_info.index_size, fi2.sohm.msgs_info.heap_size); + } /* end block */ + break; + + case 'm': /* H5F_mem_t */ + { H5F_mem_t mem_type = (H5F_mem_t)HDva_arg(ap, int); switch (mem_type) { case H5FD_MEM_NOLIST: - HDfprintf(out, "H5FD_MEM_NOLIST"); + H5RS_acat(rs, "H5FD_MEM_NOLIST"); break; case H5FD_MEM_DEFAULT: - HDfprintf(out, "H5FD_MEM_DEFAULT"); + H5RS_acat(rs, "H5FD_MEM_DEFAULT"); break; case H5FD_MEM_SUPER: - HDfprintf(out, "H5FD_MEM_SUPER"); + H5RS_acat(rs, "H5FD_MEM_SUPER"); break; case H5FD_MEM_BTREE: - HDfprintf(out, "H5FD_MEM_BTREE"); + H5RS_acat(rs, "H5FD_MEM_BTREE"); break; case H5FD_MEM_DRAW: - HDfprintf(out, "H5FD_MEM_DRAW"); + H5RS_acat(rs, "H5FD_MEM_DRAW"); break; case H5FD_MEM_GHEAP: - HDfprintf(out, "H5FD_MEM_GHEAP"); + H5RS_acat(rs, "H5FD_MEM_GHEAP"); break; case H5FD_MEM_LHEAP: - HDfprintf(out, "H5FD_MEM_LHEAP"); + H5RS_acat(rs, "H5FD_MEM_LHEAP"); break; case H5FD_MEM_OHDR: - HDfprintf(out, "H5FD_MEM_OHDR"); + H5RS_acat(rs, "H5FD_MEM_OHDR"); break; case H5FD_MEM_NTYPES: default: - HDfprintf(out, "%ld", (long)mem_type); + H5RS_asprintf_cat(rs, "%ld", (long)mem_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5F_scope_t */ + { H5F_scope_t scope = (H5F_scope_t)HDva_arg(ap, int); switch (scope) { case H5F_SCOPE_LOCAL: - HDfprintf(out, "H5F_SCOPE_LOCAL"); + H5RS_acat(rs, "H5F_SCOPE_LOCAL"); break; case H5F_SCOPE_GLOBAL: - HDfprintf(out, "H5F_SCOPE_GLOBAL"); + H5RS_acat(rs, "H5F_SCOPE_GLOBAL"); break; default: - HDfprintf(out, "%ld", (long)scope); + H5RS_asprintf_cat(rs, "%ld", (long)scope); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ + case 't': /* H5F_file_space_type_t */ + { + H5F_file_space_type_t fspace_type = (H5F_file_space_type_t)HDva_arg(ap, int); + + switch (fspace_type) { + case H5F_FILE_SPACE_DEFAULT: + H5RS_acat(rs, "H5F_FILE_SPACE_DEFAULT"); + break; + + case H5F_FILE_SPACE_ALL_PERSIST: + H5RS_acat(rs, "H5F_FILE_SPACE_ALL_PERSIST"); + break; + + case H5F_FILE_SPACE_ALL: + H5RS_acat(rs, "H5F_FILE_SPACE_ALL"); + break; + + case H5F_FILE_SPACE_AGGR_VFD: + H5RS_acat(rs, "H5F_FILE_SPACE_AGGR_VFD"); + break; + + case H5F_FILE_SPACE_VFD: + H5RS_acat(rs, "H5F_FILE_SPACE_VFD"); + break; + + case H5F_FILE_SPACE_NTYPES: + default: + H5RS_asprintf_cat(rs, "%ld", (long)fspace_type); + break; + } /* end switch */ + } /* end block */ break; - case 'v': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'v': /* H5F_libver_t */ + { H5F_libver_t libver_vers = (H5F_libver_t)HDva_arg(ap, int); switch (libver_vers) { case H5F_LIBVER_EARLIEST: - HDfprintf(out, "H5F_LIBVER_EARLIEST"); + H5RS_acat(rs, "H5F_LIBVER_EARLIEST"); break; case H5F_LIBVER_V18: - HDfprintf(out, "H5F_LIBVER_V18"); + H5RS_acat(rs, "H5F_LIBVER_V18"); break; case H5F_LIBVER_V110: - HDfprintf(out, "H5F_LIBVER_V110"); + H5RS_acat(rs, "H5F_LIBVER_V110"); break; case H5F_LIBVER_V112: - HDfprintf(out, "H5F_LIBVER_V112"); + H5RS_acat(rs, "H5F_LIBVER_V112"); break; case H5F_LIBVER_V114: HDcompile_assert(H5F_LIBVER_LATEST == H5F_LIBVER_V114); - HDfprintf(out, "H5F_LIBVER_LATEST"); + H5RS_acat(rs, "H5F_LIBVER_LATEST"); break; case H5F_LIBVER_ERROR: case H5F_LIBVER_NBOUNDS: default: - HDfprintf(out, "%ld", (long)libver_vers); + H5RS_asprintf_cat(rs, "%ld", (long)libver_vers); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(F%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(F%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'G': - switch (type[1]) { + case 'G': + switch (type[1]) { #ifndef H5_NO_DEPRECATED_SYMBOLS - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'i': /* H5G_iterate_t */ + { + H5G_iterate_t git = (H5G_iterate_t)HDva_arg(ap, H5G_iterate_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)git); + } /* end block */ + break; + + case 'o': /* H5G_obj_t */ + { H5G_obj_t obj_type = (H5G_obj_t)HDva_arg(ap, int); switch (obj_type) { case H5G_UNKNOWN: - HDfprintf(out, "H5G_UNKNOWN"); + H5RS_acat(rs, "H5G_UNKNOWN"); break; case H5G_GROUP: - HDfprintf(out, "H5G_GROUP"); + H5RS_acat(rs, "H5G_GROUP"); break; case H5G_DATASET: - HDfprintf(out, "H5G_DATASET"); + H5RS_acat(rs, "H5G_DATASET"); break; case H5G_TYPE: - HDfprintf(out, "H5G_TYPE"); + H5RS_acat(rs, "H5G_TYPE"); break; case H5G_LINK: - HDfprintf(out, "H5G_LINK"); + H5RS_acat(rs, "H5G_LINK"); break; case H5G_UDLINK: - HDfprintf(out, "H5G_UDLINK"); + H5RS_acat(rs, "H5G_UDLINK"); break; case H5G_RESERVED_5: case H5G_RESERVED_6: case H5G_RESERVED_7: - HDfprintf(out, "H5G_RESERVED(%ld)", (long)obj_type); + H5RS_asprintf_cat(rs, "H5G_RESERVED(%ld)", (long)obj_type); break; default: - HDfprintf(out, "%ld", (long)obj_type); + H5RS_asprintf_cat(rs, "%ld", (long)obj_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5G_stat_t */ + { H5G_stat_t *statbuf = HDva_arg(ap, H5G_stat_t *); - HDfprintf(out, "0x%p", (void *)statbuf); - } + H5RS_asprintf_cat(rs, "%p", (void *)statbuf); + } /* end block */ break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ - default: - HDfprintf(out, "BADTYPE(G%c)", type[1]); - goto error; - } - break; - - case 'h': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - hsize_t *p = (hsize_t *)vp; + default: + H5RS_asprintf_cat(rs, "BADTYPE(G%c)", type[1]); + goto error; + } /* end switch */ + break; - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) { - if (H5S_UNLIMITED == p[i]) - HDfprintf(out, "%sH5S_UNLIMITED", (i ? ", " : "")); - else - HDfprintf(out, "%s%" PRIuHSIZE, (i ? ", " : ""), p[i]); - } /* end for */ - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'h': /* hsize_t */ + { hsize_t hsize = HDva_arg(ap, hsize_t); if (H5S_UNLIMITED == hsize) - HDfprintf(out, "H5S_UNLIMITED"); + H5RS_acat(rs, "H5S_UNLIMITED"); else { - HDfprintf(out, "%" PRIuHSIZE, hsize); + H5RS_asprintf_cat(rs, "%" PRIuHSIZE, hsize); asize[argno] = (hssize_t)hsize; } /* end else */ - } /* end else */ + } /* end block */ break; - case 'H': - switch (type[1]) { - case 's': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - hssize_t *p = (hssize_t *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%" PRIdHSIZE, (i ? ", " : ""), p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'H': + switch (type[1]) { + case 'a': /* H5_alloc_stats_t */ + { + H5_alloc_stats_t stats = HDva_arg(ap, H5_alloc_stats_t); + + H5RS_asprintf_cat(rs, "{%llu, %zu, %zu, %zu, %zu, %zu, %zu}", + stats.total_alloc_bytes, stats.curr_alloc_bytes, + stats.peak_alloc_bytes, stats.max_block_size, + stats.total_alloc_blocks_count, stats.curr_alloc_blocks_count, + stats.peak_alloc_blocks_count); + } /* end block */ + break; + + case 's': /* hssize_t */ + { hssize_t hssize = HDva_arg(ap, hssize_t); - HDfprintf(out, "%" PRIdHSIZE, hssize); + H5RS_asprintf_cat(rs, "%" PRIdHSIZE, hssize); asize[argno] = (hssize_t)hssize; - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(H%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(H%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'i': /* hid_t (and H5E_major_t / H5E_minor_t) */ + { hid_t obj = HDva_arg(ap, hid_t); if (H5P_DEFAULT == obj) - HDfprintf(out, "H5P_DEFAULT"); + H5RS_acat(rs, "H5P_DEFAULT"); else if (obj < 0) - HDfprintf(out, "FAIL"); + H5RS_acat(rs, "FAIL"); else { switch (H5I_TYPE(obj)) { /* Use internal H5I macro instead of function call */ case H5I_UNINIT: - HDfprintf(out, "%ld (uninit - error)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (uninit - error)", (unsigned long long)obj); break; case H5I_BADID: - HDfprintf(out, "%ld (error)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (badid - error)", (unsigned long long)obj); break; case H5I_FILE: - HDfprintf(out, "%ld (file)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (file)", (unsigned long long)obj); break; case H5I_GROUP: - HDfprintf(out, "%ld (group)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (group)", (unsigned long long)obj); break; case H5I_DATATYPE: if (obj == H5T_NATIVE_SCHAR_g) - HDfprintf(out, "H5T_NATIVE_SCHAR"); + H5RS_acat(rs, "H5T_NATIVE_SCHAR"); else if (obj == H5T_NATIVE_UCHAR_g) - HDfprintf(out, "H5T_NATIVE_UCHAR"); + H5RS_acat(rs, "H5T_NATIVE_UCHAR"); else if (obj == H5T_NATIVE_SHORT_g) - HDfprintf(out, "H5T_NATIVE_SHORT"); + H5RS_acat(rs, "H5T_NATIVE_SHORT"); else if (obj == H5T_NATIVE_USHORT_g) - HDfprintf(out, "H5T_NATIVE_USHORT"); + H5RS_acat(rs, "H5T_NATIVE_USHORT"); else if (obj == H5T_NATIVE_INT_g) - HDfprintf(out, "H5T_NATIVE_INT"); + H5RS_acat(rs, "H5T_NATIVE_INT"); else if (obj == H5T_NATIVE_UINT_g) - HDfprintf(out, "H5T_NATIVE_UINT"); + H5RS_acat(rs, "H5T_NATIVE_UINT"); else if (obj == H5T_NATIVE_LONG_g) - HDfprintf(out, "H5T_NATIVE_LONG"); + H5RS_acat(rs, "H5T_NATIVE_LONG"); else if (obj == H5T_NATIVE_ULONG_g) - HDfprintf(out, "H5T_NATIVE_ULONG"); + H5RS_acat(rs, "H5T_NATIVE_ULONG"); else if (obj == H5T_NATIVE_LLONG_g) - HDfprintf(out, "H5T_NATIVE_LLONG"); + H5RS_acat(rs, "H5T_NATIVE_LLONG"); else if (obj == H5T_NATIVE_ULLONG_g) - HDfprintf(out, "H5T_NATIVE_ULLONG"); + H5RS_acat(rs, "H5T_NATIVE_ULLONG"); else if (obj == H5T_NATIVE_FLOAT_g) - HDfprintf(out, "H5T_NATIVE_FLOAT"); + H5RS_acat(rs, "H5T_NATIVE_FLOAT"); else if (obj == H5T_NATIVE_DOUBLE_g) - HDfprintf(out, "H5T_NATIVE_DOUBLE"); + H5RS_acat(rs, "H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE != 0 else if (obj == H5T_NATIVE_LDOUBLE_g) - HDfprintf(out, "H5T_NATIVE_LDOUBLE"); + H5RS_acat(rs, "H5T_NATIVE_LDOUBLE"); #endif else if (obj == H5T_IEEE_F32BE_g) - HDfprintf(out, "H5T_IEEE_F32BE"); + H5RS_acat(rs, "H5T_IEEE_F32BE"); else if (obj == H5T_IEEE_F32LE_g) - HDfprintf(out, "H5T_IEEE_F32LE"); + H5RS_acat(rs, "H5T_IEEE_F32LE"); else if (obj == H5T_IEEE_F64BE_g) - HDfprintf(out, "H5T_IEEE_F64BE"); + H5RS_acat(rs, "H5T_IEEE_F64BE"); else if (obj == H5T_IEEE_F64LE_g) - HDfprintf(out, "H5T_IEEE_F64LE"); + H5RS_acat(rs, "H5T_IEEE_F64LE"); else if (obj == H5T_STD_I8BE_g) - HDfprintf(out, "H5T_STD_I8BE"); + H5RS_acat(rs, "H5T_STD_I8BE"); else if (obj == H5T_STD_I8LE_g) - HDfprintf(out, "H5T_STD_I8LE"); + H5RS_acat(rs, "H5T_STD_I8LE"); else if (obj == H5T_STD_I16BE_g) - HDfprintf(out, "H5T_STD_I16BE"); + H5RS_acat(rs, "H5T_STD_I16BE"); else if (obj == H5T_STD_I16LE_g) - HDfprintf(out, "H5T_STD_I16LE"); + H5RS_acat(rs, "H5T_STD_I16LE"); else if (obj == H5T_STD_I32BE_g) - HDfprintf(out, "H5T_STD_I32BE"); + H5RS_acat(rs, "H5T_STD_I32BE"); else if (obj == H5T_STD_I32LE_g) - HDfprintf(out, "H5T_STD_I32LE"); + H5RS_acat(rs, "H5T_STD_I32LE"); else if (obj == H5T_STD_I64BE_g) - HDfprintf(out, "H5T_STD_I64BE"); + H5RS_acat(rs, "H5T_STD_I64BE"); else if (obj == H5T_STD_I64LE_g) - HDfprintf(out, "H5T_STD_I64LE"); + H5RS_acat(rs, "H5T_STD_I64LE"); else if (obj == H5T_STD_U8BE_g) - HDfprintf(out, "H5T_STD_U8BE"); + H5RS_acat(rs, "H5T_STD_U8BE"); else if (obj == H5T_STD_U8LE_g) - HDfprintf(out, "H5T_STD_U8LE"); + H5RS_acat(rs, "H5T_STD_U8LE"); else if (obj == H5T_STD_U16BE_g) - HDfprintf(out, "H5T_STD_U16BE"); + H5RS_acat(rs, "H5T_STD_U16BE"); else if (obj == H5T_STD_U16LE_g) - HDfprintf(out, "H5T_STD_U16LE"); + H5RS_acat(rs, "H5T_STD_U16LE"); else if (obj == H5T_STD_U32BE_g) - HDfprintf(out, "H5T_STD_U32BE"); + H5RS_acat(rs, "H5T_STD_U32BE"); else if (obj == H5T_STD_U32LE_g) - HDfprintf(out, "H5T_STD_U32LE"); + H5RS_acat(rs, "H5T_STD_U32LE"); else if (obj == H5T_STD_U64BE_g) - HDfprintf(out, "H5T_STD_U64BE"); + H5RS_acat(rs, "H5T_STD_U64BE"); else if (obj == H5T_STD_U64LE_g) - HDfprintf(out, "H5T_STD_U64LE"); + H5RS_acat(rs, "H5T_STD_U64LE"); else if (obj == H5T_STD_B8BE_g) - HDfprintf(out, "H5T_STD_B8BE"); + H5RS_acat(rs, "H5T_STD_B8BE"); else if (obj == H5T_STD_B8LE_g) - HDfprintf(out, "H5T_STD_B8LE"); + H5RS_acat(rs, "H5T_STD_B8LE"); else if (obj == H5T_STD_B16BE_g) - HDfprintf(out, "H5T_STD_B16BE"); + H5RS_acat(rs, "H5T_STD_B16BE"); else if (obj == H5T_STD_B16LE_g) - HDfprintf(out, "H5T_STD_B16LE"); + H5RS_acat(rs, "H5T_STD_B16LE"); else if (obj == H5T_STD_B32BE_g) - HDfprintf(out, "H5T_STD_B32BE"); + H5RS_acat(rs, "H5T_STD_B32BE"); else if (obj == H5T_STD_B32LE_g) - HDfprintf(out, "H5T_STD_B32LE"); + H5RS_acat(rs, "H5T_STD_B32LE"); else if (obj == H5T_STD_B64BE_g) - HDfprintf(out, "H5T_STD_B64BE"); + H5RS_acat(rs, "H5T_STD_B64BE"); else if (obj == H5T_STD_B64LE_g) - HDfprintf(out, "H5T_STD_B64LE"); + H5RS_acat(rs, "H5T_STD_B64LE"); else if (obj == H5T_C_S1_g) - HDfprintf(out, "H5T_C_S1"); + H5RS_acat(rs, "H5T_C_S1"); else if (obj == H5T_FORTRAN_S1_g) - HDfprintf(out, "H5T_FORTRAN_S1"); + H5RS_acat(rs, "H5T_FORTRAN_S1"); else - HDfprintf(out, "%ld (dtype)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (dtype)", (unsigned long long)obj); break; case H5I_DATASPACE: - HDfprintf(out, "%ld (dspace)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (dspace)", (unsigned long long)obj); /* Save the rank of simple dataspaces for arrays */ /* This may generate recursive call to the library... -QAK */ { @@ -1371,506 +1619,515 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5I_DATASET: - HDfprintf(out, "%ld (dset)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (dset)", (unsigned long long)obj); break; case H5I_ATTR: - HDfprintf(out, "%ld (attr)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (attr)", (unsigned long long)obj); break; case H5I_MAP: - HDfprintf(out, "%ld (map)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (map)", (unsigned long long)obj); break; case H5I_VFL: - HDfprintf(out, "%ld (file driver)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (file driver)", (unsigned long long)obj); break; case H5I_VOL: - HDfprintf(out, "%ld (VOL plugin)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (VOL plugin)", (unsigned long long)obj); break; case H5I_GENPROP_CLS: - HDfprintf(out, "%ld (genprop class)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (genprop class)", (unsigned long long)obj); break; case H5I_GENPROP_LST: - HDfprintf(out, "%ld (genprop list)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (genprop list)", (unsigned long long)obj); break; case H5I_ERROR_CLASS: - HDfprintf(out, "%ld (err class)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (err class)", (unsigned long long)obj); break; case H5I_ERROR_MSG: - HDfprintf(out, "%ld (err msg)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (err msg)", (unsigned long long)obj); break; case H5I_ERROR_STACK: - HDfprintf(out, "%ld (err stack)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (err stack)", (unsigned long long)obj); break; case H5I_SPACE_SEL_ITER: - HDfprintf(out, "%ld (dataspace selection iterator)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (dataspace selection iterator)", + (unsigned long long)obj); break; case H5I_NTYPES: - HDfprintf(out, "%ld (ntypes - error)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (ntypes - error)", (unsigned long long)obj); break; default: - HDfprintf(out, "%ld (unknown class)", (long)obj); + H5RS_asprintf_cat(rs, "0x%0llx (unknown class)", (unsigned long long)obj); break; } /* end switch */ } /* end else */ - } /* end else */ + } /* end block */ break; - case 'I': - switch (type[1]) { - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'I': + switch (type[1]) { + case 'f': /* H5I_free_t */ + { + H5I_free_t ifree = (H5I_free_t)HDva_arg(ap, H5I_free_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ifree); + } /* end block */ + break; + + case 'i': /* H5_index_t */ + { H5_index_t idx_type = (H5_index_t)HDva_arg(ap, int); switch (idx_type) { case H5_INDEX_UNKNOWN: - HDfprintf(out, "H5_INDEX_UNKNOWN"); + H5RS_acat(rs, "H5_INDEX_UNKNOWN"); break; case H5_INDEX_NAME: - HDfprintf(out, "H5_INDEX_NAME"); + H5RS_acat(rs, "H5_INDEX_NAME"); break; case H5_INDEX_CRT_ORDER: - HDfprintf(out, "H5_INDEX_CRT_ORDER"); + H5RS_acat(rs, "H5_INDEX_CRT_ORDER"); break; case H5_INDEX_N: - HDfprintf(out, "H5_INDEX_N"); + H5RS_acat(rs, "H5_INDEX_N"); break; default: - HDfprintf(out, "%ld", (long)idx_type); + H5RS_asprintf_cat(rs, "%ld", (long)idx_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'I': /* H5I_iterate_func_t */ + { + H5I_iterate_func_t iiter = (H5I_iterate_func_t)HDva_arg(ap, H5I_iterate_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)iiter); + } /* end block */ + break; + + case 'o': /* H5_iter_order_t */ + { H5_iter_order_t order = (H5_iter_order_t)HDva_arg(ap, int); switch (order) { case H5_ITER_UNKNOWN: - HDfprintf(out, "H5_ITER_UNKNOWN"); + H5RS_acat(rs, "H5_ITER_UNKNOWN"); break; case H5_ITER_INC: - HDfprintf(out, "H5_ITER_INC"); + H5RS_acat(rs, "H5_ITER_INC"); break; case H5_ITER_DEC: - HDfprintf(out, "H5_ITER_DEC"); + H5RS_acat(rs, "H5_ITER_DEC"); break; case H5_ITER_NATIVE: - HDfprintf(out, "H5_ITER_NATIVE"); + H5RS_acat(rs, "H5_ITER_NATIVE"); break; case H5_ITER_N: - HDfprintf(out, "H5_ITER_N"); + H5RS_acat(rs, "H5_ITER_N"); break; default: - HDfprintf(out, "%ld", (long)order); + H5RS_asprintf_cat(rs, "%ld", (long)order); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - int *p = (int *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%d", (i ? ", " : ""), p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* int / int32_t */ + { int is = HDva_arg(ap, int); - HDfprintf(out, "%d", is); + H5RS_asprintf_cat(rs, "%d", is); asize[argno] = is; - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'S': /* H5I_search_func_t */ + { + H5I_search_func_t isearch = (H5I_search_func_t)HDva_arg(ap, H5I_search_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)isearch); + } /* end block */ + break; + + case 't': /* H5I_type_t */ + { H5I_type_t id_type = (H5I_type_t)HDva_arg(ap, int); switch (id_type) { case H5I_UNINIT: - HDfprintf(out, "H5I_UNINIT"); + H5RS_acat(rs, "H5I_UNINIT"); break; case H5I_BADID: - HDfprintf(out, "H5I_BADID"); + H5RS_acat(rs, "H5I_BADID"); break; case H5I_FILE: - HDfprintf(out, "H5I_FILE"); + H5RS_acat(rs, "H5I_FILE"); break; case H5I_GROUP: - HDfprintf(out, "H5I_GROUP"); + H5RS_acat(rs, "H5I_GROUP"); break; case H5I_DATATYPE: - HDfprintf(out, "H5I_DATATYPE"); + H5RS_acat(rs, "H5I_DATATYPE"); break; case H5I_DATASPACE: - HDfprintf(out, "H5I_DATASPACE"); + H5RS_acat(rs, "H5I_DATASPACE"); break; case H5I_DATASET: - HDfprintf(out, "H5I_DATASET"); + H5RS_acat(rs, "H5I_DATASET"); break; case H5I_ATTR: - HDfprintf(out, "H5I_ATTR"); + H5RS_acat(rs, "H5I_ATTR"); break; case H5I_MAP: - HDfprintf(out, "H5I_MAP"); + H5RS_acat(rs, "H5I_MAP"); break; case H5I_VFL: - HDfprintf(out, "H5I_VFL"); + H5RS_acat(rs, "H5I_VFL"); break; case H5I_VOL: - HDfprintf(out, "H5I_VOL"); + H5RS_acat(rs, "H5I_VOL"); break; case H5I_GENPROP_CLS: - HDfprintf(out, "H5I_GENPROP_CLS"); + H5RS_acat(rs, "H5I_GENPROP_CLS"); break; case H5I_GENPROP_LST: - HDfprintf(out, "H5I_GENPROP_LST"); + H5RS_acat(rs, "H5I_GENPROP_LST"); break; case H5I_ERROR_CLASS: - HDfprintf(out, "H5I_ERROR_CLASS"); + H5RS_acat(rs, "H5I_ERROR_CLASS"); break; case H5I_ERROR_MSG: - HDfprintf(out, "H5I_ERROR_MSG"); + H5RS_acat(rs, "H5I_ERROR_MSG"); break; case H5I_ERROR_STACK: - HDfprintf(out, "H5I_ERROR_STACK"); + H5RS_acat(rs, "H5I_ERROR_STACK"); break; case H5I_SPACE_SEL_ITER: - HDfprintf(out, "H5I_SPACE_SEL_ITER"); + H5RS_acat(rs, "H5I_SPACE_SEL_ITER"); break; case H5I_NTYPES: - HDfprintf(out, "H5I_NTYPES"); + H5RS_acat(rs, "H5I_NTYPES"); break; default: - HDfprintf(out, "%ld", (long)id_type); + H5RS_asprintf_cat(rs, "%ld", (long)id_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'u': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - unsigned *p = (unsigned *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%u", i ? ", " : "", p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'u': /* unsigned / uint32_t */ + { unsigned iu = HDva_arg(ap, unsigned); - HDfprintf(out, "%u", iu); + H5RS_asprintf_cat(rs, "%u", iu); asize[argno] = iu; - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(I%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(I%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'k': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'k': /* H5O_token_t */ + { H5O_token_t token = HDva_arg(ap, H5O_token_t); int j; for (j = 0; j < H5O_MAX_TOKEN_SIZE; j++) - HDfprintf(out, "%02x", token.__data[j]); - } /* end else */ + H5RS_asprintf_cat(rs, "%02x", token.__data[j]); + } /* end block */ break; - case 'L': - switch (type[1]) { - case 'l': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'L': + switch (type[1]) { +#ifndef H5_NO_DEPRECATED_SYMBOLS + case 'i': /* H5L_iterate1_t */ + { + H5L_iterate1_t liter = (H5L_iterate1_t)HDva_arg(ap, H5L_iterate1_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)liter); + } /* end block */ + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case 'I': /* H5L_iterate2_t */ + { + H5L_iterate2_t liter = (H5L_iterate2_t)HDva_arg(ap, H5L_iterate2_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)liter); + } /* end block */ + break; + + case 'l': /* H5L_type_t (or H5G_link_t) */ + { H5L_type_t link_type = (H5L_type_t)HDva_arg(ap, int); switch (link_type) { case H5L_TYPE_ERROR: - HDfprintf(out, "H5L_TYPE_ERROR"); + H5RS_acat(rs, "H5L_TYPE_ERROR"); break; case H5L_TYPE_HARD: - HDfprintf(out, "H5L_TYPE_HARD"); + H5RS_acat(rs, "H5L_TYPE_HARD"); break; case H5L_TYPE_SOFT: - HDfprintf(out, "H5L_TYPE_SOFT"); + H5RS_acat(rs, "H5L_TYPE_SOFT"); break; case H5L_TYPE_EXTERNAL: - HDfprintf(out, "H5L_TYPE_EXTERNAL"); + H5RS_acat(rs, "H5L_TYPE_EXTERNAL"); break; case H5L_TYPE_MAX: - HDfprintf(out, "H5L_TYPE_MAX"); + H5RS_acat(rs, "H5L_TYPE_MAX"); break; default: - HDfprintf(out, "%ld", (long)link_type); + H5RS_asprintf_cat(rs, "%ld", (long)link_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(G%c)", type[1]); - goto error; - } /* end switch */ - break; + case 't': /* H5L_elink_traverse_t */ + { + H5L_elink_traverse_t elt = + (H5L_elink_traverse_t)HDva_arg(ap, H5L_elink_traverse_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)elt); + } /* end block */ + break; + + default: + H5RS_asprintf_cat(rs, "BADTYPE(G%c)", type[1]); + goto error; + } /* end switch */ + break; + + case 'M': + switch (type[1]) { + case 'a': /* H5MM_allocate_t */ + { + H5MM_allocate_t afunc = (H5MM_allocate_t)HDva_arg(ap, H5MM_allocate_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)afunc); + } /* end block */ + break; - case 'M': - switch (type[1]) { - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ #ifdef H5_HAVE_PARALLEL - else { + case 'c': /* MPI_Comm */ + { MPI_Comm comm = HDva_arg(ap, MPI_Comm); - HDfprintf(out, "%ld", (long)comm); - } /* end else */ -#endif /* H5_HAVE_PARALLEL */ + H5RS_asprintf_cat(rs, "%ld", (long)comm); + } /* end block */ + break; +#endif /* H5_HAVE_PARALLEL */ + + case 'f': /* H5MM_free_t */ + { + H5MM_free_t ffunc = (H5MM_free_t)HDva_arg(ap, H5MM_free_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ffunc); + } /* end block */ break; - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ #ifdef H5_HAVE_PARALLEL - else { + case 'i': /* MPI_Info */ + { MPI_Info info = HDva_arg(ap, MPI_Info); - HDfprintf(out, "%ld", (long)info); - } /* end else */ -#endif /* H5_HAVE_PARALLEL */ + H5RS_asprintf_cat(rs, "%ld", (long)info); + } /* end block */ break; +#endif /* H5_HAVE_PARALLEL */ - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { +#ifdef H5_HAVE_MAP_API + case 'I': /* H5M_iterate_t */ + { + H5M_iterate_t miter = (H5M_iterate_t)HDva_arg(ap, H5M_iterate_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)miter); + } /* end block */ + break; +#endif /* H5_HAVE_MAP_API */ + + case 't': /* H5FD_mem_t */ + { H5FD_mem_t mt = (H5FD_mem_t)HDva_arg(ap, int); switch (mt) { case H5FD_MEM_NOLIST: - HDfprintf(out, "H5FD_MEM_NOLIST"); + H5RS_acat(rs, "H5FD_MEM_NOLIST"); break; case H5FD_MEM_DEFAULT: - HDfprintf(out, "H5FD_MEM_DEFAULT"); + H5RS_acat(rs, "H5FD_MEM_DEFAULT"); break; case H5FD_MEM_SUPER: - HDfprintf(out, "H5FD_MEM_SUPER"); + H5RS_acat(rs, "H5FD_MEM_SUPER"); break; case H5FD_MEM_BTREE: - HDfprintf(out, "H5FD_MEM_BTREE"); + H5RS_acat(rs, "H5FD_MEM_BTREE"); break; case H5FD_MEM_DRAW: - HDfprintf(out, "H5FD_MEM_DRAW"); + H5RS_acat(rs, "H5FD_MEM_DRAW"); break; case H5FD_MEM_GHEAP: - HDfprintf(out, "H5FD_MEM_GHEAP"); + H5RS_acat(rs, "H5FD_MEM_GHEAP"); break; case H5FD_MEM_LHEAP: - HDfprintf(out, "H5FD_MEM_LHEAP"); + H5RS_acat(rs, "H5FD_MEM_LHEAP"); break; case H5FD_MEM_OHDR: - HDfprintf(out, "H5FD_MEM_OHDR"); + H5RS_acat(rs, "H5FD_MEM_OHDR"); break; case H5FD_MEM_NTYPES: - HDfprintf(out, "H5FD_MEM_NTYPES"); + H5RS_acat(rs, "H5FD_MEM_NTYPES"); break; default: - HDfprintf(out, "%ld", (long)mt); + H5RS_asprintf_cat(rs, "%ld", (long)mt); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - goto error; - } /* end switch */ - break; + default: + goto error; + } /* end switch */ + break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'o': /* off_t */ + { off_t offset = HDva_arg(ap, off_t); - HDfprintf(out, "%ld", (long)offset); - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)offset); + } /* end block */ break; - case 'O': - switch (type[1]) { - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'O': + switch (type[1]) { +#ifndef H5_NO_DEPRECATED_SYMBOLS + case 'i': /* H5O_iterate1_t */ + { + H5O_iterate1_t oiter = (H5O_iterate1_t)HDva_arg(ap, H5O_iterate1_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)oiter); + } /* end block */ + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case 'I': /* H5O_iterate2_t */ + { + H5O_iterate2_t oiter2 = (H5O_iterate2_t)HDva_arg(ap, H5O_iterate2_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)oiter2); + } /* end block */ + break; + + case 's': /* H5O_mcdt_search_cb_t */ + { + H5O_mcdt_search_cb_t osrch = + (H5O_mcdt_search_cb_t)HDva_arg(ap, H5O_mcdt_search_cb_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)osrch); + } /* end block */ + break; + + case 't': /* H5O_type_t */ + { H5O_type_t objtype = (H5O_type_t)HDva_arg(ap, int); switch (objtype) { case H5O_TYPE_UNKNOWN: - HDfprintf(out, "H5O_TYPE_UNKNOWN"); + H5RS_acat(rs, "H5O_TYPE_UNKNOWN"); break; case H5O_TYPE_GROUP: - HDfprintf(out, "H5O_TYPE_GROUP"); + H5RS_acat(rs, "H5O_TYPE_GROUP"); break; case H5O_TYPE_DATASET: - HDfprintf(out, "H5O_TYPE_DATASET"); + H5RS_acat(rs, "H5O_TYPE_DATASET"); break; case H5O_TYPE_NAMED_DATATYPE: - HDfprintf(out, "H5O_TYPE_NAMED_DATATYPE"); + H5RS_acat(rs, "H5O_TYPE_NAMED_DATATYPE"); break; case H5O_TYPE_MAP: - HDfprintf(out, "H5O_TYPE_MAP"); + H5RS_acat(rs, "H5O_TYPE_MAP"); break; case H5O_TYPE_NTYPES: - HDfprintf(out, "H5O_TYPE_NTYPES"); + H5RS_acat(rs, "H5O_TYPE_NTYPES"); break; default: - HDfprintf(out, "BADTYPE(%ld)", (long)objtype); + H5RS_asprintf_cat(rs, "BADTYPE(%ld)", (long)objtype); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(S%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(S%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'p': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'p': /* H5P_class_t */ + { hid_t pclass_id = HDva_arg(ap, hid_t); char * class_name = NULL; H5P_genclass_t *pclass; @@ -1879,619 +2136,609 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* (This may generate recursive call to the library... -QAK) */ if (NULL != (pclass = (H5P_genclass_t *)H5I_object(pclass_id)) && NULL != (class_name = H5P_get_class_name(pclass))) { - HDfprintf(out, "%s", class_name); + H5RS_asprintf_cat(rs, "%s", class_name); H5MM_xfree(class_name); } /* end if */ else - HDfprintf(out, "%ld", (long)pclass_id); - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)pclass_id); + } /* end block */ break; - case 'R': - switch (type[1]) { + case 'P': + switch (type[1]) { + case 'c': /* H5P_cls_create_func_t */ + { + H5P_cls_create_func_t pcls_crt = + (H5P_cls_create_func_t)HDva_arg(ap, H5P_cls_create_func_t); - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - hobj_ref_t ref = HDva_arg(ap, hobj_ref_t); + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)pcls_crt); + } /* end block */ + break; + + case 'C': /* H5P_prp_create_func_t */ + { + H5P_prp_create_func_t prp_crt = + (H5P_prp_create_func_t)HDva_arg(ap, H5P_prp_create_func_t); - HDfprintf(out, "Reference Object=%" PRIuHADDR, ref); - } /* end else */ + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_crt); + } /* end block */ break; - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'D': /* H5P_prp_delete_func_t */ + { + H5P_prp_delete_func_t prp_del = + (H5P_prp_delete_func_t)HDva_arg(ap, H5P_prp_delete_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_del); + } /* end block */ + break; + + case 'G': /* H5P_prp_get_func_t */ + { + H5P_prp_get_func_t prp_get = (H5P_prp_get_func_t)HDva_arg(ap, H5P_prp_get_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_get); + } /* end block */ + break; + + case 'i': /* H5P_iterate_t */ + { + H5P_iterate_t piter = (H5P_iterate_t)HDva_arg(ap, H5P_iterate_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)piter); + } /* end block */ + break; + + case 'l': /* H5P_cls_close_func_t */ + { + H5P_cls_close_func_t pcls_cls = + (H5P_cls_close_func_t)HDva_arg(ap, H5P_cls_close_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)pcls_cls); + } /* end block */ + break; + + case 'L': /* H5P_prp_close_func_t */ + { + H5P_prp_close_func_t prp_cls = + (H5P_prp_close_func_t)HDva_arg(ap, H5P_prp_close_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_cls); + } /* end block */ + break; + + case 'M': /* H5P_prp_compare_func_t */ + { + H5P_prp_compare_func_t prp_cmp = + (H5P_prp_compare_func_t)HDva_arg(ap, H5P_prp_compare_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_cmp); + } /* end block */ + break; + + case 'o': /* H5P_cls_copy_func_t */ + { + H5P_cls_copy_func_t pcls_cpy = + (H5P_cls_copy_func_t)HDva_arg(ap, H5P_cls_copy_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)pcls_cpy); + } /* end block */ + break; + + case 'O': /* H5P_prp_copy_func_t */ + { + H5P_prp_copy_func_t prp_cpy = + (H5P_prp_copy_func_t)HDva_arg(ap, H5P_prp_copy_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_cpy); + } /* end block */ + break; + + case 'S': /* H5P_prp_set_func_t */ + { + H5P_prp_set_func_t prp_set = (H5P_prp_set_func_t)HDva_arg(ap, H5P_prp_set_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)prp_set); + } /* end block */ + break; + + default: + H5RS_asprintf_cat(rs, "BADTYPE(P%c)", type[1]); + goto error; + } /* end switch */ + break; + + case 'R': + switch (type[1]) { + case 'd': /* hdset_reg_ref_t */ + { /* Note! region references are array types */ - HDfprintf(out, "Reference Region"); + H5RS_acat(rs, "Reference Region"); goto error; - } /* end else */ + } /* end block */ break; - case 'r': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'o': /* hobj_ref_t */ + { + hobj_ref_t ref = HDva_arg(ap, hobj_ref_t); + + H5RS_asprintf_cat(rs, "Reference Object=%" PRIuHADDR, ref); + } /* end block */ + break; + + case 'r': /* H5R_ref_t */ + { /* Note! reference types are opaque types */ - HDfprintf(out, "Reference Opaque"); + H5RS_acat(rs, "Reference Opaque"); goto error; - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5R_type_t */ + { H5R_type_t reftype = (H5R_type_t)HDva_arg(ap, int); switch (reftype) { case H5R_BADTYPE: - HDfprintf(out, "H5R_BADTYPE"); + H5RS_acat(rs, "H5R_BADTYPE"); break; case H5R_OBJECT1: - HDfprintf(out, "H5R_OBJECT1"); + H5RS_acat(rs, "H5R_OBJECT1"); break; case H5R_DATASET_REGION1: - HDfprintf(out, "H5R_DATASET_REGION1"); + H5RS_acat(rs, "H5R_DATASET_REGION1"); break; case H5R_OBJECT2: - HDfprintf(out, "H5R_OBJECT2"); + H5RS_acat(rs, "H5R_OBJECT2"); break; case H5R_DATASET_REGION2: - HDfprintf(out, "H5R_DATASET_REGION2"); + H5RS_acat(rs, "H5R_DATASET_REGION2"); break; case H5R_ATTR: - HDfprintf(out, "H5R_ATTR"); + H5RS_acat(rs, "H5R_ATTR"); break; case H5R_MAXTYPE: - HDfprintf(out, "H5R_MAXTYPE"); + H5RS_acat(rs, "H5R_MAXTYPE"); break; default: - HDfprintf(out, "BADTYPE(%ld)", (long)reftype); + H5RS_asprintf_cat(rs, "BADTYPE(%ld)", (long)reftype); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(S%c)", type[1]); - goto error; - } - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(S%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'S': - switch (type[1]) { - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'S': + switch (type[1]) { + case 'c': /* H5S_class_t */ + { H5S_class_t cls = (H5S_class_t)HDva_arg(ap, int); switch (cls) { case H5S_NO_CLASS: - HDfprintf(out, "H5S_NO_CLASS"); + H5RS_acat(rs, "H5S_NO_CLASS"); break; case H5S_SCALAR: - HDfprintf(out, "H5S_SCALAR"); + H5RS_acat(rs, "H5S_SCALAR"); break; case H5S_SIMPLE: - HDfprintf(out, "H5S_SIMPLE"); + H5RS_acat(rs, "H5S_SIMPLE"); break; case H5S_NULL: - HDfprintf(out, "H5S_NULL"); + H5RS_acat(rs, "H5S_NULL"); break; default: - HDfprintf(out, "%ld", (long)cls); + H5RS_asprintf_cat(rs, "%ld", (long)cls); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5S_seloper_t */ + { H5S_seloper_t so = (H5S_seloper_t)HDva_arg(ap, int); switch (so) { case H5S_SELECT_NOOP: - HDfprintf(out, "H5S_NOOP"); + H5RS_acat(rs, "H5S_NOOP"); break; case H5S_SELECT_SET: - HDfprintf(out, "H5S_SELECT_SET"); + H5RS_acat(rs, "H5S_SELECT_SET"); break; case H5S_SELECT_OR: - HDfprintf(out, "H5S_SELECT_OR"); + H5RS_acat(rs, "H5S_SELECT_OR"); break; case H5S_SELECT_AND: - HDfprintf(out, "H5S_SELECT_AND"); + H5RS_acat(rs, "H5S_SELECT_AND"); break; case H5S_SELECT_XOR: - HDfprintf(out, "H5S_SELECT_XOR"); + H5RS_acat(rs, "H5S_SELECT_XOR"); break; case H5S_SELECT_NOTB: - HDfprintf(out, "H5S_SELECT_NOTB"); + H5RS_acat(rs, "H5S_SELECT_NOTB"); break; case H5S_SELECT_NOTA: - HDfprintf(out, "H5S_SELECT_NOTA"); + H5RS_acat(rs, "H5S_SELECT_NOTA"); break; case H5S_SELECT_APPEND: - HDfprintf(out, "H5S_SELECT_APPEND"); + H5RS_acat(rs, "H5S_SELECT_APPEND"); break; case H5S_SELECT_PREPEND: - HDfprintf(out, "H5S_SELECT_PREPEND"); + H5RS_acat(rs, "H5S_SELECT_PREPEND"); break; case H5S_SELECT_INVALID: - HDfprintf(out, "H5S_SELECT_INVALID"); + H5RS_acat(rs, "H5S_SELECT_INVALID"); break; default: - HDfprintf(out, "%ld", (long)so); + H5RS_asprintf_cat(rs, "%ld", (long)so); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5S_sel_type */ + { H5S_sel_type st = (H5S_sel_type)HDva_arg(ap, int); switch (st) { case H5S_SEL_ERROR: - HDfprintf(out, "H5S_SEL_ERROR"); + H5RS_acat(rs, "H5S_SEL_ERROR"); break; case H5S_SEL_NONE: - HDfprintf(out, "H5S_SEL_NONE"); + H5RS_acat(rs, "H5S_SEL_NONE"); break; case H5S_SEL_POINTS: - HDfprintf(out, "H5S_SEL_POINTS"); + H5RS_acat(rs, "H5S_SEL_POINTS"); break; case H5S_SEL_HYPERSLABS: - HDfprintf(out, "H5S_SEL_HYPERSLABS"); + H5RS_acat(rs, "H5S_SEL_HYPERSLABS"); break; case H5S_SEL_ALL: - HDfprintf(out, "H5S_SEL_ALL"); + H5RS_acat(rs, "H5S_SEL_ALL"); break; case H5S_SEL_N: - HDfprintf(out, "H5S_SEL_N"); + H5RS_acat(rs, "H5S_SEL_N"); break; default: - HDfprintf(out, "%ld", (long)st); + H5RS_asprintf_cat(rs, "%ld", (long)st); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(S%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(S%c)", type[1]); + goto error; + } /* end switch */ + break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - const char *str = HDva_arg(ap, const char *); + case 't': /* htri_t */ + { + htri_t tri_var = HDva_arg(ap, htri_t); - HDfprintf(out, "\"%s\"", str); - } /* end else */ + if (tri_var > 0) + H5RS_acat(rs, "TRUE"); + else if (!tri_var) + H5RS_acat(rs, "FALSE"); + else + H5RS_asprintf_cat(rs, "FAIL(%d)", (int)tri_var); + } /* end block */ break; - case 'T': - switch (type[1]) { - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'T': + switch (type[1]) { + case 'c': /* H5T_cset_t */ + { H5T_cset_t cset = (H5T_cset_t)HDva_arg(ap, int); - switch (cset) { - case H5T_CSET_ERROR: - HDfprintf(out, "H5T_CSET_ERROR"); - break; - - case H5T_CSET_ASCII: - HDfprintf(out, "H5T_CSET_ASCII"); - break; - - case H5T_CSET_UTF8: - HDfprintf(out, "H5T_CSET_UTF8"); - break; + H5_trace_args_cset(rs, cset); + } /* end block */ + break; - case H5T_CSET_RESERVED_2: - case H5T_CSET_RESERVED_3: - case H5T_CSET_RESERVED_4: - case H5T_CSET_RESERVED_5: - case H5T_CSET_RESERVED_6: - case H5T_CSET_RESERVED_7: - case H5T_CSET_RESERVED_8: - case H5T_CSET_RESERVED_9: - case H5T_CSET_RESERVED_10: - case H5T_CSET_RESERVED_11: - case H5T_CSET_RESERVED_12: - case H5T_CSET_RESERVED_13: - case H5T_CSET_RESERVED_14: - case H5T_CSET_RESERVED_15: - HDfprintf(out, "H5T_CSET_RESERVED_%ld", (long)cset); - break; + case 'C': /* H5T_conv_t */ + { + H5T_conv_t tconv = (H5T_conv_t)HDva_arg(ap, H5T_conv_t); - default: - HDfprintf(out, "%ld", (long)cset); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)tconv); + } /* end block */ break; - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'd': /* H5T_direction_t */ + { H5T_direction_t direct = (H5T_direction_t)HDva_arg(ap, int); switch (direct) { case H5T_DIR_DEFAULT: - HDfprintf(out, "H5T_DIR_DEFAULT"); + H5RS_acat(rs, "H5T_DIR_DEFAULT"); break; case H5T_DIR_ASCEND: - HDfprintf(out, "H5T_DIR_ASCEND"); + H5RS_acat(rs, "H5T_DIR_ASCEND"); break; case H5T_DIR_DESCEND: - HDfprintf(out, "H5T_DIR_DESCEND"); + H5RS_acat(rs, "H5T_DIR_DESCEND"); break; default: - HDfprintf(out, "%ld", (long)direct); + H5RS_asprintf_cat(rs, "%ld", (long)direct); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* H5T_pers_t */ + { H5T_pers_t pers = (H5T_pers_t)HDva_arg(ap, int); switch (pers) { case H5T_PERS_DONTCARE: - HDfprintf(out, "H5T_PERS_DONTCARE"); + H5RS_acat(rs, "H5T_PERS_DONTCARE"); break; case H5T_PERS_SOFT: - HDfprintf(out, "H5T_PERS_SOFT"); + H5RS_acat(rs, "H5T_PERS_SOFT"); break; case H5T_PERS_HARD: - HDfprintf(out, "H5T_PERS_HARD"); + H5RS_acat(rs, "H5T_PERS_HARD"); break; default: - HDfprintf(out, "%ld", (long)pers); + H5RS_asprintf_cat(rs, "%ld", (long)pers); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'n': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'E': /* H5T_conv_except_func_t */ + { + H5T_conv_except_func_t conv_ex = + (H5T_conv_except_func_t)HDva_arg(ap, H5T_conv_except_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)conv_ex); + } /* end block */ + break; + + case 'n': /* H5T_norm_t */ + { H5T_norm_t norm = (H5T_norm_t)HDva_arg(ap, int); switch (norm) { case H5T_NORM_ERROR: - HDfprintf(out, "H5T_NORM_ERROR"); + H5RS_acat(rs, "H5T_NORM_ERROR"); break; case H5T_NORM_IMPLIED: - HDfprintf(out, "H5T_NORM_IMPLIED"); + H5RS_acat(rs, "H5T_NORM_IMPLIED"); break; case H5T_NORM_MSBSET: - HDfprintf(out, "H5T_NORM_MSBSET"); + H5RS_acat(rs, "H5T_NORM_MSBSET"); break; case H5T_NORM_NONE: - HDfprintf(out, "H5T_NORM_NONE"); + H5RS_acat(rs, "H5T_NORM_NONE"); break; default: - HDfprintf(out, "%ld", (long)norm); + H5RS_asprintf_cat(rs, "%ld", (long)norm); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'o': /* H5T_order_t */ + { H5T_order_t order = (H5T_order_t)HDva_arg(ap, int); switch (order) { case H5T_ORDER_ERROR: - HDfprintf(out, "H5T_ORDER_ERROR"); + H5RS_acat(rs, "H5T_ORDER_ERROR"); break; case H5T_ORDER_LE: - HDfprintf(out, "H5T_ORDER_LE"); + H5RS_acat(rs, "H5T_ORDER_LE"); break; case H5T_ORDER_BE: - HDfprintf(out, "H5T_ORDER_BE"); + H5RS_acat(rs, "H5T_ORDER_BE"); break; case H5T_ORDER_VAX: - HDfprintf(out, "H5T_ORDER_VAX"); + H5RS_acat(rs, "H5T_ORDER_VAX"); break; case H5T_ORDER_MIXED: - HDfprintf(out, "H5T_ORDER_MIXED"); + H5RS_acat(rs, "H5T_ORDER_MIXED"); break; case H5T_ORDER_NONE: - HDfprintf(out, "H5T_ORDER_NONE"); + H5RS_acat(rs, "H5T_ORDER_NONE"); break; default: - HDfprintf(out, "%ld", (long)order); + H5RS_asprintf_cat(rs, "%ld", (long)order); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'p': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'p': /* H5T_pad_t */ + { H5T_pad_t pad = (H5T_pad_t)HDva_arg(ap, int); switch (pad) { case H5T_PAD_ERROR: - HDfprintf(out, "H5T_PAD_ERROR"); + H5RS_acat(rs, "H5T_PAD_ERROR"); break; case H5T_PAD_ZERO: - HDfprintf(out, "H5T_PAD_ZERO"); + H5RS_acat(rs, "H5T_PAD_ZERO"); break; case H5T_PAD_ONE: - HDfprintf(out, "H5T_PAD_ONE"); + H5RS_acat(rs, "H5T_PAD_ONE"); break; case H5T_PAD_BACKGROUND: - HDfprintf(out, "H5T_PAD_BACKGROUND"); + H5RS_acat(rs, "H5T_PAD_BACKGROUND"); break; case H5T_NPAD: - HDfprintf(out, "H5T_NPAD"); + H5RS_acat(rs, "H5T_NPAD"); break; default: - HDfprintf(out, "%ld", (long)pad); + H5RS_asprintf_cat(rs, "%ld", (long)pad); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5T_sign_t */ + { H5T_sign_t sign = (H5T_sign_t)HDva_arg(ap, int); switch (sign) { case H5T_SGN_ERROR: - HDfprintf(out, "H5T_SGN_ERROR"); + H5RS_acat(rs, "H5T_SGN_ERROR"); break; case H5T_SGN_NONE: - HDfprintf(out, "H5T_SGN_NONE"); + H5RS_acat(rs, "H5T_SGN_NONE"); break; case H5T_SGN_2: - HDfprintf(out, "H5T_SGN_2"); + H5RS_acat(rs, "H5T_SGN_2"); break; case H5T_NSGN: - HDfprintf(out, "H5T_NSGN"); + H5RS_acat(rs, "H5T_NSGN"); break; default: - HDfprintf(out, "%ld", (long)sign); + H5RS_asprintf_cat(rs, "%ld", (long)sign); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5T_class_t */ + { H5T_class_t type_class = (H5T_class_t)HDva_arg(ap, int); switch (type_class) { case H5T_NO_CLASS: - HDfprintf(out, "H5T_NO_CLASS"); + H5RS_acat(rs, "H5T_NO_CLASS"); break; case H5T_INTEGER: - HDfprintf(out, "H5T_INTEGER"); + H5RS_acat(rs, "H5T_INTEGER"); break; case H5T_FLOAT: - HDfprintf(out, "H5T_FLOAT"); + H5RS_acat(rs, "H5T_FLOAT"); break; case H5T_TIME: - HDfprintf(out, "H5T_TIME"); + H5RS_acat(rs, "H5T_TIME"); break; case H5T_STRING: - HDfprintf(out, "H5T_STRING"); + H5RS_acat(rs, "H5T_STRING"); break; case H5T_BITFIELD: - HDfprintf(out, "H5T_BITFIELD"); + H5RS_acat(rs, "H5T_BITFIELD"); break; case H5T_OPAQUE: - HDfprintf(out, "H5T_OPAQUE"); + H5RS_acat(rs, "H5T_OPAQUE"); break; case H5T_COMPOUND: - HDfprintf(out, "H5T_COMPOUND"); + H5RS_acat(rs, "H5T_COMPOUND"); break; case H5T_REFERENCE: - HDfprintf(out, "H5T_REFERENCE"); + H5RS_acat(rs, "H5T_REFERENCE"); break; case H5T_ENUM: - HDfprintf(out, "H5T_ENUM"); + H5RS_acat(rs, "H5T_ENUM"); break; case H5T_VLEN: - HDfprintf(out, "H5T_VLEN"); + H5RS_acat(rs, "H5T_VLEN"); break; case H5T_ARRAY: - HDfprintf(out, "H5T_ARRAY"); + H5RS_acat(rs, "H5T_ARRAY"); break; case H5T_NCLASSES: - HDfprintf(out, "H5T_NCLASSES"); + H5RS_acat(rs, "H5T_NCLASSES"); break; default: - HDfprintf(out, "%ld", (long)type_class); + H5RS_asprintf_cat(rs, "%ld", (long)type_class); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'z': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'z': /* H5T_str_t */ + { H5T_str_t str = (H5T_str_t)HDva_arg(ap, int); switch (str) { case H5T_STR_ERROR: - HDfprintf(out, "H5T_STR_ERROR"); + H5RS_acat(rs, "H5T_STR_ERROR"); break; case H5T_STR_NULLTERM: - HDfprintf(out, "H5T_STR_NULLTERM"); + H5RS_acat(rs, "H5T_STR_NULLTERM"); break; case H5T_STR_NULLPAD: - HDfprintf(out, "H5T_STR_NULLPAD"); + H5RS_acat(rs, "H5T_STR_NULLPAD"); break; case H5T_STR_SPACEPAD: - HDfprintf(out, "H5T_STR_SPACEPAD"); + H5RS_acat(rs, "H5T_STR_SPACEPAD"); break; case H5T_STR_RESERVED_3: @@ -2507,1219 +2754,1211 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5T_STR_RESERVED_13: case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: - HDfprintf(out, "H5T_STR_RESERVED(%ld)", (long)str); + H5RS_asprintf_cat(rs, "H5T_STR_RESERVED(%ld)", (long)str); break; default: - HDfprintf(out, "%ld", (long)str); + H5RS_asprintf_cat(rs, "%ld", (long)str); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(T%c)", type[1]); - goto error; - } /* end switch */ - break; - - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - htri_t tri_var = HDva_arg(ap, htri_t); - - if (tri_var > 0) - HDfprintf(out, "TRUE"); - else if (!tri_var) - HDfprintf(out, "FALSE"); - else - HDfprintf(out, "FAIL(%d)", (int)tri_var); - } /* end else */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(T%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'U': - switch (type[1]) { - case 'l': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - unsigned long *p = (unsigned long *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%lu", i ? ", " : "", p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'U': + switch (type[1]) { + case 'l': /* unsigned long */ + { unsigned long iul = HDva_arg(ap, unsigned long); - HDfprintf(out, "%lu", iul); + H5RS_asprintf_cat(rs, "%lu", iul); asize[argno] = (hssize_t)iul; - } /* end else */ - break; - - case 'L': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - unsigned long long *p = (unsigned long long *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%llu", i ? ", " : "", p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + } /* end block */ + break; + + case 'L': /* unsigned long long / uint64_t */ + { unsigned long long iull = HDva_arg(ap, unsigned long long); - HDfprintf(out, "%llu", iull); + H5RS_asprintf_cat(rs, "%llu", iull); asize[argno] = (hssize_t)iull; - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(U%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(U%c)", type[1]); + goto error; + } /* end switch */ + break; - case 'V': - switch (type[1]) { - case 'a': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'V': + switch (type[1]) { + case 'a': /* H5VL_attr_get_t */ + { H5VL_attr_get_t get = (H5VL_attr_get_t)HDva_arg(ap, int); switch (get) { case H5VL_ATTR_GET_SPACE: - HDfprintf(out, "H5VL_ATTR_GET_SPACE"); + H5RS_acat(rs, "H5VL_ATTR_GET_SPACE"); break; + case H5VL_ATTR_GET_TYPE: - HDfprintf(out, "H5VL_ATTR_GET_TYPE"); + H5RS_acat(rs, "H5VL_ATTR_GET_TYPE"); break; + case H5VL_ATTR_GET_ACPL: - HDfprintf(out, "H5VL_ATTR_GET_ACPL"); + H5RS_acat(rs, "H5VL_ATTR_GET_ACPL"); break; + case H5VL_ATTR_GET_NAME: - HDfprintf(out, "H5VL_ATTR_GET_NAME"); + H5RS_acat(rs, "H5VL_ATTR_GET_NAME"); break; + case H5VL_ATTR_GET_STORAGE_SIZE: - HDfprintf(out, "H5VL_ATTR_GET_STORAGE_SIZE"); + H5RS_acat(rs, "H5VL_ATTR_GET_STORAGE_SIZE"); break; + case H5VL_ATTR_GET_INFO: - HDfprintf(out, "H5VL_ATTR_GET_INFO"); + H5RS_acat(rs, "H5VL_ATTR_GET_INFO"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'A': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'A': /* H5VL_blob_optional_t */ + { H5VL_blob_optional_t optional = (H5VL_blob_optional_t)HDva_arg(ap, int); - switch (optional) { - default: - HDfprintf(out, "%ld", (long)optional); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)optional); + } /* end block */ break; - case 'b': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'b': /* H5VL_attr_specific_t */ + { H5VL_attr_specific_t specific = (H5VL_attr_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_ATTR_DELETE: - HDfprintf(out, "H5VL_ATTR_DELETE"); + H5RS_acat(rs, "H5VL_ATTR_DELETE"); break; + case H5VL_ATTR_EXISTS: - HDfprintf(out, "H5VL_ATTR_EXISTS"); + H5RS_acat(rs, "H5VL_ATTR_EXISTS"); break; + case H5VL_ATTR_ITER: - HDfprintf(out, "H5VL_ATTR_ITER"); + H5RS_acat(rs, "H5VL_ATTR_ITER"); break; + case H5VL_ATTR_RENAME: - HDfprintf(out, "H5VL_ATTR_RENAME"); + H5RS_acat(rs, "H5VL_ATTR_RENAME"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'B': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'B': /* H5VL_blob_specific_t */ + { H5VL_blob_specific_t specific = (H5VL_blob_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_BLOB_DELETE: - HDfprintf(out, "H5VL_BLOB_DELETE"); + H5RS_acat(rs, "H5VL_BLOB_DELETE"); break; + case H5VL_BLOB_GETSIZE: - HDfprintf(out, "H5VL_BLOB_GETSIZE"); + H5RS_acat(rs, "H5VL_BLOB_GETSIZE"); break; + case H5VL_BLOB_ISNULL: - HDfprintf(out, "H5VL_BLOB_ISNULL"); + H5RS_acat(rs, "H5VL_BLOB_ISNULL"); break; + case H5VL_BLOB_SETNULL: - HDfprintf(out, "H5VL_BLOB_SETNULL"); + H5RS_acat(rs, "H5VL_BLOB_SETNULL"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ - break; - - case 'C': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { - H5VL_class_value_t class_val = - (H5VL_class_value_t)HDva_arg(ap, H5VL_class_value_t); - - if (H5_VOL_NATIVE == class_val) - HDfprintf(out, "H5_VOL_NATIVE"); - else - HDfprintf(out, "%ld", (long)class_val); - } /* end else */ + } /* end block */ break; - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'c': /* H5VL_dataset_get_t */ + { H5VL_dataset_get_t get = (H5VL_dataset_get_t)HDva_arg(ap, int); switch (get) { case H5VL_DATASET_GET_SPACE: - HDfprintf(out, "H5VL_DATASET_GET_SPACE"); + H5RS_acat(rs, "H5VL_DATASET_GET_SPACE"); break; + case H5VL_DATASET_GET_SPACE_STATUS: - HDfprintf(out, "H5VL_DATASET_GET_SPACE_STATUS"); + H5RS_acat(rs, "H5VL_DATASET_GET_SPACE_STATUS"); break; + case H5VL_DATASET_GET_TYPE: - HDfprintf(out, "H5VL_DATASET_GET_TYPE"); + H5RS_acat(rs, "H5VL_DATASET_GET_TYPE"); break; + case H5VL_DATASET_GET_DCPL: - HDfprintf(out, "H5VL_DATASET_GET_DCPL"); + H5RS_acat(rs, "H5VL_DATASET_GET_DCPL"); break; + case H5VL_DATASET_GET_DAPL: - HDfprintf(out, "H5VL_DATASET_GET_DAPL"); + H5RS_acat(rs, "H5VL_DATASET_GET_DAPL"); break; + case H5VL_DATASET_GET_STORAGE_SIZE: - HDfprintf(out, "H5VL_DATASET_GET_STORAGE_SIZE"); + H5RS_acat(rs, "H5VL_DATASET_GET_STORAGE_SIZE"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'd': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); + case 'C': /* H5VL_class_value_t */ + { + H5VL_class_value_t class_val = + (H5VL_class_value_t)HDva_arg(ap, H5VL_class_value_t); + + if (H5_VOL_NATIVE == class_val) + H5RS_acat(rs, "H5_VOL_NATIVE"); else - HDfprintf(out, "NULL"); - } /* end if */ - else { + H5RS_asprintf_cat(rs, "%ld", (long)class_val); + } /* end block */ + break; + + case 'd': /* H5VL_dataset_specific_t */ + { H5VL_dataset_specific_t specific = (H5VL_dataset_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_DATASET_SET_EXTENT: - HDfprintf(out, "H5VL_DATASET_SET_EXTENT"); + H5RS_acat(rs, "H5VL_DATASET_SET_EXTENT"); break; + case H5VL_DATASET_FLUSH: - HDfprintf(out, "H5VL_DATASET_FLUSH"); + H5RS_acat(rs, "H5VL_DATASET_FLUSH"); break; + case H5VL_DATASET_REFRESH: - HDfprintf(out, "H5VL_DATASET_REFRESH"); + H5RS_acat(rs, "H5VL_DATASET_REFRESH"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* H5VL_datatype_get_t */ + { H5VL_datatype_get_t get = (H5VL_datatype_get_t)HDva_arg(ap, int); switch (get) { case H5VL_DATATYPE_GET_BINARY: - HDfprintf(out, "H5VL_DATATYPE_GET_BINARY"); + H5RS_acat(rs, "H5VL_DATATYPE_GET_BINARY"); break; + case H5VL_DATATYPE_GET_TCPL: - HDfprintf(out, "H5VL_DATATYPE_GET_TCPL"); + H5RS_acat(rs, "H5VL_DATATYPE_GET_TCPL"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'f': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'f': /* H5VL_datatype_specific_t */ + { H5VL_datatype_specific_t specific = (H5VL_datatype_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_DATATYPE_FLUSH: - HDfprintf(out, "H5VL_DATATYPE_FLUSH"); + H5RS_acat(rs, "H5VL_DATATYPE_FLUSH"); break; + case H5VL_DATATYPE_REFRESH: - HDfprintf(out, "H5VL_DATATYPE_REFRESH"); + H5RS_acat(rs, "H5VL_DATATYPE_REFRESH"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'g': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'g': /* H5VL_file_get_t */ + { H5VL_file_get_t get = (H5VL_file_get_t)HDva_arg(ap, int); switch (get) { case H5VL_FILE_GET_CONT_INFO: - HDfprintf(out, "H5VL_FILE_GET_CONT_INFO"); + H5RS_acat(rs, "H5VL_FILE_GET_CONT_INFO"); break; + case H5VL_FILE_GET_FAPL: - HDfprintf(out, "H5VL_FILE_GET_FAPL"); + H5RS_acat(rs, "H5VL_FILE_GET_FAPL"); break; + case H5VL_FILE_GET_FCPL: - HDfprintf(out, "H5VL_FILE_GET_FCPL"); + H5RS_acat(rs, "H5VL_FILE_GET_FCPL"); break; + case H5VL_FILE_GET_FILENO: - HDfprintf(out, "H5VL_FILE_GET_FILENO"); + H5RS_acat(rs, "H5VL_FILE_GET_FILENO"); break; + case H5VL_FILE_GET_INTENT: - HDfprintf(out, "H5VL_FILE_GET_INTENT"); + H5RS_acat(rs, "H5VL_FILE_GET_INTENT"); break; + case H5VL_FILE_GET_NAME: - HDfprintf(out, "H5VL_FILE_GET_NAME"); + H5RS_acat(rs, "H5VL_FILE_GET_NAME"); break; + case H5VL_FILE_GET_OBJ_COUNT: - HDfprintf(out, "H5VL_FILE_GET_OBJ_COUNT"); + H5RS_acat(rs, "H5VL_FILE_GET_OBJ_COUNT"); break; + case H5VL_FILE_GET_OBJ_IDS: - HDfprintf(out, "H5VL_FILE_GET_OBJ_IDS"); + H5RS_acat(rs, "H5VL_FILE_GET_OBJ_IDS"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'h': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'h': /* H5VL_file_specific_t */ + { H5VL_file_specific_t specific = (H5VL_file_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_FILE_FLUSH: - HDfprintf(out, "H5VL_FILE_FLUSH"); + H5RS_acat(rs, "H5VL_FILE_FLUSH"); break; + case H5VL_FILE_REOPEN: - HDfprintf(out, "H5VL_FILE_REOPEN"); + H5RS_acat(rs, "H5VL_FILE_REOPEN"); break; + case H5VL_FILE_MOUNT: - HDfprintf(out, "H5VL_FILE_MOUNT"); + H5RS_acat(rs, "H5VL_FILE_MOUNT"); break; + case H5VL_FILE_UNMOUNT: - HDfprintf(out, "H5VL_FILE_UNMOUNT"); + H5RS_acat(rs, "H5VL_FILE_UNMOUNT"); break; + case H5VL_FILE_IS_ACCESSIBLE: - HDfprintf(out, "H5VL_FILE_IS_ACCESSIBLE"); + H5RS_acat(rs, "H5VL_FILE_IS_ACCESSIBLE"); break; + case H5VL_FILE_DELETE: - HDfprintf(out, "H5VL_FILE_DELETE"); + H5RS_acat(rs, "H5VL_FILE_DELETE"); break; + case H5VL_FILE_IS_EQUAL: - HDfprintf(out, "H5VL_FILE_IS_EQUAL"); + H5RS_acat(rs, "H5VL_FILE_IS_EQUAL"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'i': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'i': /* H5VL_group_get_t */ + { H5VL_group_get_t get = (H5VL_group_get_t)HDva_arg(ap, int); switch (get) { case H5VL_GROUP_GET_GCPL: - HDfprintf(out, "H5VL_GROUP_GET_GCPL"); + H5RS_acat(rs, "H5VL_GROUP_GET_GCPL"); break; + case H5VL_GROUP_GET_INFO: - HDfprintf(out, "H5VL_GROUP_GET_INFO"); + H5RS_acat(rs, "H5VL_GROUP_GET_INFO"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'j': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'j': /* H5VL_group_specific_t */ + { H5VL_group_specific_t specific = (H5VL_group_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_GROUP_FLUSH: - HDfprintf(out, "H5VL_GROUP_FLUSH"); + H5RS_acat(rs, "H5VL_GROUP_FLUSH"); break; + case H5VL_GROUP_REFRESH: - HDfprintf(out, "H5VL_GROUP_REFRESH"); + H5RS_acat(rs, "H5VL_GROUP_REFRESH"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'k': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'k': /* H5VL_link_create_type_t */ + { H5VL_link_create_type_t create = (H5VL_link_create_type_t)HDva_arg(ap, int); switch (create) { case H5VL_LINK_CREATE_HARD: - HDfprintf(out, "H5VL_LINK_CREATE_HARD"); + H5RS_acat(rs, "H5VL_LINK_CREATE_HARD"); break; + case H5VL_LINK_CREATE_SOFT: - HDfprintf(out, "H5VL_LINK_CREATE_SOFT"); + H5RS_acat(rs, "H5VL_LINK_CREATE_SOFT"); break; + case H5VL_LINK_CREATE_UD: - HDfprintf(out, "H5VL_LINK_CREATE_UD"); + H5RS_acat(rs, "H5VL_LINK_CREATE_UD"); break; + default: - HDfprintf(out, "%ld", (long)create); + H5RS_asprintf_cat(rs, "%ld", (long)create); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'l': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'l': /* H5VL_link_get_t */ + { H5VL_link_get_t get = (H5VL_link_get_t)HDva_arg(ap, int); switch (get) { case H5VL_LINK_GET_INFO: - HDfprintf(out, "H5VL_LINK_GET_INFO"); + H5RS_acat(rs, "H5VL_LINK_GET_INFO"); break; + case H5VL_LINK_GET_NAME: - HDfprintf(out, "H5VL_LINK_GET_NAME"); + H5RS_acat(rs, "H5VL_LINK_GET_NAME"); break; + case H5VL_LINK_GET_VAL: - HDfprintf(out, "H5VL_LINK_GET_VAL"); + H5RS_acat(rs, "H5VL_LINK_GET_VAL"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'L': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'L': /* H5VL_get_conn_lvl_t */ + { H5VL_get_conn_lvl_t get = (H5VL_get_conn_lvl_t)HDva_arg(ap, int); switch (get) { case H5VL_GET_CONN_LVL_CURR: - HDfprintf(out, "H5VL_GET_CONN_LVL_CURR"); + H5RS_acat(rs, "H5VL_GET_CONN_LVL_CURR"); break; + case H5VL_GET_CONN_LVL_TERM: - HDfprintf(out, "H5VL_GET_CONN_LVL_TERM"); + H5RS_acat(rs, "H5VL_GET_CONN_LVL_TERM"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'm': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'm': /* H5VL_link_specific_t */ + { H5VL_link_specific_t specific = (H5VL_link_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_LINK_DELETE: - HDfprintf(out, "H5VL_LINK_DELETE"); + H5RS_acat(rs, "H5VL_LINK_DELETE"); break; + case H5VL_LINK_EXISTS: - HDfprintf(out, "H5VL_LINK_EXISTS"); + H5RS_acat(rs, "H5VL_LINK_EXISTS"); break; + case H5VL_LINK_ITER: - HDfprintf(out, "H5VL_LINK_ITER"); + H5RS_acat(rs, "H5VL_LINK_ITER"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'n': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'n': /* H5VL_object_get_t */ + { H5VL_object_get_t get = (H5VL_object_get_t)HDva_arg(ap, int); switch (get) { case H5VL_OBJECT_GET_FILE: - HDfprintf(out, "H5VL_OBJECT_GET_FILE"); + H5RS_acat(rs, "H5VL_OBJECT_GET_FILE"); break; + case H5VL_OBJECT_GET_NAME: - HDfprintf(out, "H5VL_OBJECT_GET_NAME"); + H5RS_acat(rs, "H5VL_OBJECT_GET_NAME"); break; + case H5VL_OBJECT_GET_TYPE: - HDfprintf(out, "H5VL_OBJECT_GET_TYPE"); + H5RS_acat(rs, "H5VL_OBJECT_GET_TYPE"); break; + case H5VL_OBJECT_GET_INFO: - HDfprintf(out, "H5VL_OBJECT_GET_INFO"); + H5RS_acat(rs, "H5VL_OBJECT_GET_INFO"); break; + default: - HDfprintf(out, "%ld", (long)get); + H5RS_asprintf_cat(rs, "%ld", (long)get); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'o': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'N': /* H5VL_request_notify_t */ + { + H5VL_request_notify_t vlrnot = + (H5VL_request_notify_t)HDva_arg(ap, H5VL_request_notify_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)vlrnot); + } /* end block */ + break; + + case 'o': /* H5VL_object_specific_t */ + { H5VL_object_specific_t specific = (H5VL_object_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_OBJECT_CHANGE_REF_COUNT: - HDfprintf(out, "H5VL_OBJECT_CHANGE_REF_COUNT"); + H5RS_acat(rs, "H5VL_OBJECT_CHANGE_REF_COUNT"); break; + case H5VL_OBJECT_EXISTS: - HDfprintf(out, "H5VL_OBJECT_EXISTS"); + H5RS_acat(rs, "H5VL_OBJECT_EXISTS"); break; + case H5VL_OBJECT_LOOKUP: - HDfprintf(out, "H5VL_OBJECT_LOOKUP"); + H5RS_acat(rs, "H5VL_OBJECT_LOOKUP"); break; + case H5VL_OBJECT_VISIT: - HDfprintf(out, "H5VL_OBJECT_VISIT"); + H5RS_acat(rs, "H5VL_OBJECT_VISIT"); break; + case H5VL_OBJECT_FLUSH: - HDfprintf(out, "H5VL_OBJECT_FLUSH"); + H5RS_acat(rs, "H5VL_OBJECT_FLUSH"); break; + case H5VL_OBJECT_REFRESH: - HDfprintf(out, "H5VL_OBJECT_REFRESH"); + H5RS_acat(rs, "H5VL_OBJECT_REFRESH"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'r': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'r': /* H5VL_request_specific_t */ + { H5VL_request_specific_t specific = (H5VL_request_specific_t)HDva_arg(ap, int); switch (specific) { case H5VL_REQUEST_WAITANY: - HDfprintf(out, "H5VL_REQUEST_WAITANY"); + H5RS_acat(rs, "H5VL_REQUEST_WAITANY"); break; + case H5VL_REQUEST_WAITSOME: - HDfprintf(out, "H5VL_REQUEST_WAITSOME"); + H5RS_acat(rs, "H5VL_REQUEST_WAITSOME"); break; + case H5VL_REQUEST_WAITALL: - HDfprintf(out, "H5VL_REQUEST_WAITALL"); + H5RS_acat(rs, "H5VL_REQUEST_WAITALL"); break; + default: - HDfprintf(out, "%ld", (long)specific); + H5RS_asprintf_cat(rs, "%ld", (long)specific); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 's': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 's': /* H5VL_attr_optional_t */ + { H5VL_attr_optional_t optional = (H5VL_attr_optional_t)HDva_arg(ap, int); switch (optional) { #ifndef H5_NO_DEPRECATED_SYMBOLS case H5VL_NATIVE_ATTR_ITERATE_OLD: - HDfprintf(out, "H5VL_NATIVE_ATTR_ITERATE_OLD"); + H5RS_acat(rs, "H5VL_NATIVE_ATTR_ITERATE_OLD"); break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'S': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'S': /* H5VL_subclass_t */ + { H5VL_subclass_t subclass = (H5VL_subclass_t)HDva_arg(ap, int); switch (subclass) { case H5VL_SUBCLS_NONE: - HDfprintf(out, "H5VL_SUBCLS_NONE"); + H5RS_acat(rs, "H5VL_SUBCLS_NONE"); break; + case H5VL_SUBCLS_INFO: - HDfprintf(out, "H5VL_SUBCLS_INFO"); + H5RS_acat(rs, "H5VL_SUBCLS_INFO"); break; + case H5VL_SUBCLS_WRAP: - HDfprintf(out, "H5VL_SUBCLS_WRAP"); + H5RS_acat(rs, "H5VL_SUBCLS_WRAP"); break; + case H5VL_SUBCLS_ATTR: - HDfprintf(out, "H5VL_SUBCLS_ATTR"); + H5RS_acat(rs, "H5VL_SUBCLS_ATTR"); break; + case H5VL_SUBCLS_DATASET: - HDfprintf(out, "H5VL_SUBCLS_DATASET"); + H5RS_acat(rs, "H5VL_SUBCLS_DATASET"); break; + case H5VL_SUBCLS_DATATYPE: - HDfprintf(out, "H5VL_SUBCLS_DATATYPE"); + H5RS_acat(rs, "H5VL_SUBCLS_DATATYPE"); break; + case H5VL_SUBCLS_FILE: - HDfprintf(out, "H5VL_SUBCLS_FILE"); + H5RS_acat(rs, "H5VL_SUBCLS_FILE"); break; + case H5VL_SUBCLS_GROUP: - HDfprintf(out, "H5VL_SUBCLS_GROUP"); + H5RS_acat(rs, "H5VL_SUBCLS_GROUP"); break; + case H5VL_SUBCLS_LINK: - HDfprintf(out, "H5VL_SUBCLS_LINK"); + H5RS_acat(rs, "H5VL_SUBCLS_LINK"); break; + case H5VL_SUBCLS_OBJECT: - HDfprintf(out, "H5VL_SUBCLS_OBJECT"); + H5RS_acat(rs, "H5VL_SUBCLS_OBJECT"); break; + case H5VL_SUBCLS_REQUEST: - HDfprintf(out, "H5VL_SUBCLS_REQUEST"); + H5RS_acat(rs, "H5VL_SUBCLS_REQUEST"); break; + case H5VL_SUBCLS_BLOB: - HDfprintf(out, "H5VL_SUBCLS_BLOB"); + H5RS_acat(rs, "H5VL_SUBCLS_BLOB"); break; + case H5VL_SUBCLS_TOKEN: - HDfprintf(out, "H5VL_SUBCLS_TOKEN"); + H5RS_acat(rs, "H5VL_SUBCLS_TOKEN"); break; + default: - HDfprintf(out, "%ld", (long)subclass); + H5RS_asprintf_cat(rs, "%ld", (long)subclass); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 't': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 't': /* H5VL_dataset_optional_t */ + { H5VL_dataset_optional_t optional = (H5VL_dataset_optional_t)HDva_arg(ap, int); switch (optional) { case H5VL_NATIVE_DATASET_FORMAT_CONVERT: - HDfprintf(out, "H5VL_NATIVE_DATASET_FORMAT_CONVERT"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_FORMAT_CONVERT"); break; + case H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_CHUNK_INDEX_TYPE"); break; + case H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_CHUNK_STORAGE_SIZE"); break; + case H5VL_NATIVE_DATASET_GET_NUM_CHUNKS: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_NUM_CHUNKS"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_NUM_CHUNKS"); break; + case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_IDX"); break; + case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD"); break; + case H5VL_NATIVE_DATASET_CHUNK_READ: - HDfprintf(out, "H5VL_NATIVE_DATASET_CHUNK_READ"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_CHUNK_READ"); break; + case H5VL_NATIVE_DATASET_CHUNK_WRITE: - HDfprintf(out, "H5VL_NATIVE_DATASET_CHUNK_WRITE"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_CHUNK_WRITE"); break; + case H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE"); break; + case H5VL_NATIVE_DATASET_GET_OFFSET: - HDfprintf(out, "H5VL_NATIVE_DATASET_GET_OFFSET"); + H5RS_acat(rs, "H5VL_NATIVE_DATASET_GET_OFFSET"); break; + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'u': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'u': /* H5VL_datatype_optional_t */ + { H5VL_datatype_optional_t optional = (H5VL_datatype_optional_t)HDva_arg(ap, int); - switch (optional) { - default: - HDfprintf(out, "%ld", (long)optional); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)optional); + } /* end block */ break; - case 'v': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'v': /* H5VL_file_optional_t */ + { H5VL_file_optional_t optional = (H5VL_file_optional_t)HDva_arg(ap, int); switch (optional) { case H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE: - HDfprintf(out, "H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_CLEAR_ELINK_CACHE"); break; + case H5VL_NATIVE_FILE_GET_FILE_IMAGE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_FILE_IMAGE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_FILE_IMAGE"); break; + case H5VL_NATIVE_FILE_GET_FREE_SECTIONS: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_FREE_SECTIONS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_FREE_SECTIONS"); break; + case H5VL_NATIVE_FILE_GET_FREE_SPACE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_FREE_SPACE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_FREE_SPACE"); break; + case H5VL_NATIVE_FILE_GET_INFO: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_INFO"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_INFO"); break; + case H5VL_NATIVE_FILE_GET_MDC_CONF: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_CONF"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_CONF"); break; + case H5VL_NATIVE_FILE_GET_MDC_HR: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_HR"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_HR"); break; + case H5VL_NATIVE_FILE_GET_MDC_SIZE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_SIZE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_SIZE"); break; + case H5VL_NATIVE_FILE_GET_SIZE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_SIZE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_SIZE"); break; + case H5VL_NATIVE_FILE_GET_VFD_HANDLE: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_VFD_HANDLE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_VFD_HANDLE"); break; + case H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE: - HDfprintf(out, "H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_RESET_MDC_HIT_RATE"); break; + case H5VL_NATIVE_FILE_SET_MDC_CONFIG: - HDfprintf(out, "H5VL_NATIVE_FILE_SET_MDC_CONFIG"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_MDC_CONFIG"); break; + case H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_METADATA_READ_RETRY_INFO"); break; + case H5VL_NATIVE_FILE_START_SWMR_WRITE: - HDfprintf(out, "H5VL_NATIVE_FILE_START_SWMR_WRITE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_START_SWMR_WRITE"); break; + case H5VL_NATIVE_FILE_START_MDC_LOGGING: - HDfprintf(out, "H5VL_NATIVE_FILE_START_MDC_LOGGING"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_START_MDC_LOGGING"); break; + case H5VL_NATIVE_FILE_STOP_MDC_LOGGING: - HDfprintf(out, "H5VL_NATIVE_FILE_STOP_MDC_LOGGING"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_STOP_MDC_LOGGING"); break; + case H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_LOGGING_STATUS"); break; + case H5VL_NATIVE_FILE_FORMAT_CONVERT: - HDfprintf(out, "H5VL_NATIVE_FILE_FORMAT_CONVERT"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_FORMAT_CONVERT"); break; + case H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS: - HDfprintf(out, "H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_RESET_PAGE_BUFFERING_STATS"); break; + case H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_PAGE_BUFFERING_STATS"); break; + case H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MDC_IMAGE_INFO"); break; + case H5VL_NATIVE_FILE_GET_EOA: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_EOA"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_EOA"); break; + case H5VL_NATIVE_FILE_INCR_FILESIZE: - HDfprintf(out, "H5VL_NATIVE_FILE_INCR_FILESIZE"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_INCR_FILESIZE"); break; + case H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS: - HDfprintf(out, "H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_LIBVER_BOUNDS"); break; + case H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG"); break; + case H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG: - HDfprintf(out, "H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG"); break; + case H5VL_NATIVE_FILE_GET_MPI_ATOMICITY: - HDfprintf(out, "H5VL_NATIVE_FILE_GET_MPI_ATOMICITY"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_GET_MPI_ATOMICITY"); break; + case H5VL_NATIVE_FILE_SET_MPI_ATOMICITY: - HDfprintf(out, "H5VL_NATIVE_FILE_SET_MPI_ATOMICITY"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_SET_MPI_ATOMICITY"); break; + case H5VL_NATIVE_FILE_POST_OPEN: - HDfprintf(out, "H5VL_NATIVE_FILE_POST_OPEN"); + H5RS_acat(rs, "H5VL_NATIVE_FILE_POST_OPEN"); break; + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'w': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'w': /* H5VL_group_optional_t */ + { H5VL_group_optional_t optional = (H5VL_group_optional_t)HDva_arg(ap, int); switch (optional) { #ifndef H5_NO_DEPRECATED_SYMBOLS case H5VL_NATIVE_GROUP_ITERATE_OLD: - HDfprintf(out, "H5VL_NATIVE_GROUP_ITERATE_OLD"); + H5RS_acat(rs, "H5VL_NATIVE_GROUP_ITERATE_OLD"); break; + case H5VL_NATIVE_GROUP_GET_OBJINFO: - HDfprintf(out, "H5VL_NATIVE_GROUP_GET_OBJINFO"); + H5RS_acat(rs, "H5VL_NATIVE_GROUP_GET_OBJINFO"); break; #endif /* H5_NO_DEPRECATED_SYMBOLS */ + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'x': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'x': /* H5VL_link_optional_t */ + { H5VL_link_optional_t optional = (H5VL_link_optional_t)HDva_arg(ap, int); - switch (optional) { - default: - HDfprintf(out, "%ld", (long)optional); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)optional); + } /* end block */ break; - case 'y': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'y': /* H5VL_object_optional_t */ + { H5VL_object_optional_t optional = (H5VL_object_optional_t)HDva_arg(ap, int); switch (optional) { case H5VL_NATIVE_OBJECT_GET_COMMENT: - HDfprintf(out, "H5VL_NATIVE_OBJECT_GET_COMMENT"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_GET_COMMENT"); break; + case H5VL_NATIVE_OBJECT_SET_COMMENT: - HDfprintf(out, "H5VL_NATIVE_OBJECT_SET_COMMENT"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_SET_COMMENT"); break; + case H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES: - HDfprintf(out, "H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_DISABLE_MDC_FLUSHES"); break; + case H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES: - HDfprintf(out, "H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_ENABLE_MDC_FLUSHES"); break; + case H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED: - HDfprintf(out, "H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_ARE_MDC_FLUSHES_DISABLED"); break; + case H5VL_NATIVE_OBJECT_GET_NATIVE_INFO: - HDfprintf(out, "H5VL_NATIVE_OBJECT_GET_NATIVE_INFO"); + H5RS_acat(rs, "H5VL_NATIVE_OBJECT_GET_NATIVE_INFO"); break; + default: - HDfprintf(out, "%ld", (long)optional); + H5RS_asprintf_cat(rs, "%ld", (long)optional); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'z': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'z': /* H5VL_request_optional_t */ + { H5VL_request_optional_t optional = (H5VL_request_optional_t)HDva_arg(ap, int); - switch (optional) { - default: - HDfprintf(out, "%ld", (long)optional); - break; - } /* end switch */ - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)optional); + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(Z%c)", type[1]); - goto error; - } /* end switch */ - break; - - case 'x': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - void **p = (void **)vp; + default: + H5RS_asprintf_cat(rs, "BADTYPE(Z%c)", type[1]); + goto error; + } /* end switch */ + break; - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) { - if (p[i]) - HDfprintf(out, "%s0x%p", (i ? ", " : ""), p[i]); - else - HDfprintf(out, "%sNULL", (i ? ", " : "")); - } /* end for */ - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'x': { /* void / va_list */ vp = HDva_arg(ap, void *); if (vp) - HDfprintf(out, "0x%p", vp); + H5RS_asprintf_cat(rs, "%p", vp); else - HDfprintf(out, "NULL"); - } /* end else */ + H5RS_acat(rs, "NULL"); + } /* end block */ break; - case 'z': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - size_t *p = (size_t *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%zu", (i ? ", " : ""), p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'z': { size_t size = HDva_arg(ap, size_t); - HDfprintf(out, "%zu", size); + H5RS_asprintf_cat(rs, "%zu", size); asize[argno] = (hssize_t)size; - } /* end else */ + } /* end block */ break; - case 'Z': - switch (type[1]) { - case 'a': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'Z': + switch (type[1]) { + case 'a': /* H5Z_SO_scale_type_t */ + { H5Z_SO_scale_type_t scale_type = (H5Z_SO_scale_type_t)HDva_arg(ap, int); switch (scale_type) { case H5Z_SO_FLOAT_DSCALE: - HDfprintf(out, "H5Z_SO_FLOAT_DSCALE"); + H5RS_acat(rs, "H5Z_SO_FLOAT_DSCALE"); break; case H5Z_SO_FLOAT_ESCALE: - HDfprintf(out, "H5Z_SO_FLOAT_ESCALE"); + H5RS_acat(rs, "H5Z_SO_FLOAT_ESCALE"); break; case H5Z_SO_INT: - HDfprintf(out, "H5Z_SO_INT"); + H5RS_acat(rs, "H5Z_SO_INT"); break; default: - HDfprintf(out, "%ld", (long)scale_type); + H5RS_asprintf_cat(rs, "%ld", (long)scale_type); break; } /* end switch */ - } /* end else */ + } /* end block */ break; - case 'c': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'c': /* H5Z_class2_t */ + { H5Z_class2_t *filter = HDva_arg(ap, H5Z_class2_t *); - HDfprintf(out, "0x%p", (void *)filter); - } /* end else */ + H5RS_asprintf_cat(rs, "%p", (void *)filter); + } /* end block */ break; - case 'e': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'e': /* H5Z_EDC_t */ + { H5Z_EDC_t edc = (H5Z_EDC_t)HDva_arg(ap, int); if (H5Z_DISABLE_EDC == edc) - HDfprintf(out, "H5Z_DISABLE_EDC"); + H5RS_acat(rs, "H5Z_DISABLE_EDC"); else if (H5Z_ENABLE_EDC == edc) - HDfprintf(out, "H5Z_ENABLE_EDC"); + H5RS_acat(rs, "H5Z_ENABLE_EDC"); else - HDfprintf(out, "%ld", (long)edc); - } /* end else */ + H5RS_asprintf_cat(rs, "%ld", (long)edc); + } /* end block */ break; - case 'f': - if (ptr) { - if (vp) - HDfprintf(out, "0x%p", vp); - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + case 'f': /* H5Z_filter_t */ + { H5Z_filter_t id = HDva_arg(ap, H5Z_filter_t); - if (H5Z_FILTER_DEFLATE == id) - HDfprintf(out, "H5Z_FILTER_DEFLATE"); + if (H5Z_FILTER_NONE == id) + H5RS_acat(rs, "H5Z_FILTER_NONE"); + else if (H5Z_FILTER_DEFLATE == id) + H5RS_acat(rs, "H5Z_FILTER_DEFLATE"); + else if (H5Z_FILTER_SHUFFLE == id) + H5RS_acat(rs, "H5Z_FILTER_SHUFFLE"); + else if (H5Z_FILTER_FLETCHER32 == id) + H5RS_acat(rs, "H5Z_FILTER_FLETCHER32"); + else if (H5Z_FILTER_SZIP == id) + H5RS_acat(rs, "H5Z_FILTER_SZIP"); + else if (H5Z_FILTER_NBIT == id) + H5RS_acat(rs, "H5Z_FILTER_NBIT"); + else if (H5Z_FILTER_SCALEOFFSET == id) + H5RS_acat(rs, "H5Z_FILTER_SCALEOFFSET"); else - HDfprintf(out, "%ld", (long)id); - } /* end else */ - break; - - case 's': - if (ptr) { - if (vp) { - HDfprintf(out, "0x%p", vp); - if (asize_idx >= 0 && asize[asize_idx] >= 0) { - ssize_t *p = (ssize_t *)vp; - - HDfprintf(out, " {"); - for (i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%zd", (i ? ", " : ""), p[i]); - HDfprintf(out, "}"); - } /* end if */ - } /* end if */ - else - HDfprintf(out, "NULL"); - } /* end if */ - else { + H5RS_asprintf_cat(rs, "%ld", (long)id); + } /* end block */ + break; + + case 'F': /* H5Z_filter_func_t */ + { + H5Z_filter_func_t ffunc = (H5Z_filter_func_t)HDva_arg(ap, H5Z_filter_func_t); + + H5RS_asprintf_cat(rs, "%p", (void *)(uintptr_t)ffunc); + } /* end block */ + break; + + case 's': { ssize_t ssize = HDva_arg(ap, ssize_t); - HDfprintf(out, "%zd", ssize); + H5RS_asprintf_cat(rs, "%zd", ssize); asize[argno] = (hssize_t)ssize; - } /* end else */ + } /* end block */ break; - default: - HDfprintf(out, "BADTYPE(Z%c)", type[1]); - goto error; - } /* end switch */ - break; + default: + H5RS_asprintf_cat(rs, "BADTYPE(Z%c)", type[1]); + goto error; + } /* end switch */ + break; + + case '#': + H5RS_acat(rs, "Unsupported type slipped through!"); + break; - default: - if (HDisupper(type[0])) - HDfprintf(out, "BADTYPE(%c%c)", type[0], type[1]); - else - HDfprintf(out, "BADTYPE(%c)", type[0]); - goto error; - } /* end switch */ - } /* end for */ + case '!': + H5RS_acat(rs, "Unknown type slipped through!"); + break; + + default: + if (HDisupper(type[0])) + H5RS_asprintf_cat(rs, "BADTYPE(%c%c)", type[0], type[1]); + else + H5RS_asprintf_cat(rs, "BADTYPE(%c)", type[0]); + goto error; + } /* end switch */ + } /* end else */ + } /* end for */ + + return SUCCEED; +error: + return FAIL; +} /* end H5_trace_args() */ + +/*------------------------------------------------------------------------- + * Function: H5_trace + * + * Purpose: This function is called whenever an API function is called + * and tracing is turned on. If RETURNING is non-zero then + * the caller is about to return and RETURNING points to the + * time for the corresponding function call event. Otherwise + * we print the function name and the arguments. + * + * The TYPE argument is a string which gives the type of each of + * the following argument pairs. Each type is zero or more + * asterisks (one for each level of indirection, although some + * types have one level of indirection already implied) followed + * by either one letter (lower case) or two letters (first one + * uppercase). + * + * The variable argument list consists of pairs of values. Each + * pair is a string which is the formal argument name in the + * calling function, followed by the argument value. The type + * of the argument value is given by the TYPE string. + * + * Note: The TYPE string is meant to be terse and is generated by a + * separate perl script. + * + * WARNING: DO NOT CALL ANY HDF5 FUNCTION THAT CALLS FUNC_ENTER(). DOING + * SO MAY CAUSE H5_trace() TO BE INVOKED RECURSIVELY OR MAY + * CAUSE LIBRARY INITIALIZATIONS THAT ARE NOT DESIRED. + * + * Return: Execution time for an API call + * + * Programmer: Robb Matzke + * Tuesday, June 16, 1998 + * + *------------------------------------------------------------------------- + */ +double +H5_trace(const double *returning, const char *func, const char *type, ...) +{ + va_list ap; + H5RS_str_t * rs = NULL; + hssize_t i; + FILE * out = H5_debug_g.trace; + static hbool_t is_first_invocation = TRUE; + H5_timer_t function_timer; + H5_timevals_t function_times; + static H5_timer_t running_timer; + H5_timevals_t running_times; + static int current_depth = 0; + static int last_call_depth = 0; + + /* FUNC_ENTER() should not be called */ + + if (!out) + return (double)0.0F; /*tracing is off*/ + + if (H5_debug_g.ttop) { + if (returning) { + if (current_depth > 1) { + --current_depth; + return (double)0.0F; + } /* end if */ + } /* end if */ + else { + if (current_depth > 0) { + /*do not update last_call_depth*/ + current_depth++; + return (double)0.0F; + } /* end if */ + } /* end else */ + } /* end if */ + + /* Get time for event if the trace times flag is set */ + if (is_first_invocation && H5_debug_g.ttimes) { + /* 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); + H5_timer_start(&function_timer); + } /* end if */ + + /* Create the ref-counted string */ + rs = H5RS_create(NULL); + + /* Print the first part of the line. This is the indication of the + * nesting depth followed by the function name and either start of + * argument list or start of return value. If this call is for a + * function return and no other calls have been made to H5_trace() + * since the one for the function call, then we're continuing + * the same line. */ + if (returning) { + HDassert(current_depth > 0); + --current_depth; + if (current_depth < last_call_depth) { + /* We are at the beginning of a line */ + if (H5_debug_g.ttimes) { + char tmp[320]; + + H5_timer_get_times(function_timer, &function_times); + 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"); + if (H5_debug_g.ttimes) { + 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); + H5_trace_args(rs, type, ap); + HDva_end(ap); /* Display event time for return */ if (returning && H5_debug_g.ttimes) { H5_timer_get_times(function_timer, &function_times); H5_timer_get_times(running_timer, &running_times); - HDfprintf(out, " @%.6f [dt=%.6f]", (function_times.elapsed - running_times.elapsed), - (function_times.elapsed - *returning)); + H5RS_asprintf_cat(rs, " @%.6f [dt=%.6f]", (function_times.elapsed - running_times.elapsed), + (function_times.elapsed - *returning)); } /* end if */ -error: - HDva_end(ap); + /* Display generated string */ if (returning) - HDfprintf(out, ";\n"); + H5RS_acat(rs, ";\n"); else { last_call_depth = current_depth++; - HDfprintf(out, ")"); + H5RS_acat(rs, ")"); } /* end else */ + HDfputs(H5RS_get_str(rs), out); HDfflush(out); + H5RS_decr(rs); if (H5_debug_g.ttimes) return function_times.elapsed; else - return 0.0F; + return (double)0.0F; } /* end H5_trace() */ diff --git a/src/Makefile.am b/src/Makefile.am index cbecccd..e18b0ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,6 +19,8 @@ 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 @@ -33,13 +35,13 @@ lib_LTLIBRARIES=libhdf5.la libhdf5_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS) # H5Tinit.c and H5lib_settings.c are generated files and should be cleaned. -MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.c +MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.c $(DX_CLEANFILES) # H5pubconf.h is generated by configure, and should be cleaned. DISTCLEANFILES=H5pubconf.h # library sources libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \ - H5timer.c H5trace.c \ + H5timer.c H5trace.c \ H5A.c H5Abtree2.c H5Adense.c H5Adeprec.c H5Aint.c H5Atest.c \ H5AC.c H5ACdbg.c H5ACproxy_entry.c \ H5B.c H5Bcache.c H5Bdbg.c \ @@ -61,7 +63,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \ H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ H5FAint.c H5FAstat.c H5FAtest.c \ - H5FD.c H5FDcore.c H5FDfamily.c H5FDhdfs.c H5FDint.c H5FDlog.c \ + H5FD.c H5FDcore.c H5FDfamily.c H5FDint.c H5FDlog.c \ H5FDmulti.c H5FDsec2.c H5FDspace.c \ H5FDsplitter.c H5FDstdio.c H5FDtest.c \ H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSint.c H5FSsection.c \ @@ -75,7 +77,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \ H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c \ H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c H5HLprfx.c H5HLdblk.c \ H5HP.c \ - H5I.c H5Itest.c \ + H5I.c H5Idbg.c H5Iint.c H5Itest.c \ H5L.c H5Ldeprec.c H5Lexternal.c \ H5M.c \ H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \ @@ -126,6 +128,11 @@ if DIRECT_VFD_CONDITIONAL libhdf5_la_SOURCES += H5FDdirect.c endif +# Only compile the read-only HDFS VFD if necessary +if HDFS_VFD_CONDITIONAL + libhdf5_la_SOURCES += H5FDhdfs.c +endif + # Only compile the mirror VFD if necessary if MIRROR_VFD_CONDITIONAL libhdf5_la_SOURCES += H5FDmirror.c @@ -196,12 +203,16 @@ $(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 # tracing information is inserted. trace should have no effect on files # without HDF5 macros. -.PHONY: trace trace: $(libhdf5_la_SOURCES) @for dep in $? dummy; do \ diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index 98390b8..4fddbc8 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -39,7 +39,7 @@ Languages: H5_CPPFLAGS: @H5_CPPFLAGS@ AM_CPPFLAGS: @AM_CPPFLAGS@ C Flags: @CFLAGS@ - H5 C Flags: @H5_CFLAGS@ @H5_ECFLAGS@ + H5 C Flags: @H5_CFLAGS@ AM C Flags: @AM_CFLAGS@ Shared C Library: @enable_shared@ Static C Library: @enable_static@ diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 462e9d5..013189c 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -844,7 +844,7 @@ endif () ### F I L T E R P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - if (WIN32 OR MINGW) + if (WIN32) set (CMAKE_SEP "\;") set (BIN_REL_PATH "../../") else () @@ -940,7 +940,7 @@ endif () ### V O L P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - if (WIN32 OR MINGW) + if (WIN32) set (CMAKE_SEP "\;") set (BIN_REL_PATH "../../") else () diff --git a/test/Makefile.am b/test/Makefile.am index 7ebeae7..7f4edd4 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -61,7 +61,8 @@ TEST_PROG= testhdf5 \ stab gheap evict_on_close farray earray btree2 fheap \ pool accum hyperslab istore bittests dt_arith page_buffer \ dtypes dsets chunk_info cmpd_dset filter_fail extend direct_chunk \ - external efc objcopy objcopy_ref links unlink twriteorder big mtime fillval mount \ + external efc objcopy objcopy_ref links unlink twriteorder big mtime \ + fillval mount \ flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \ enc_dec_plist_cross_platform getname vfd ros3 s3comms hdfs ntypes \ dangle dtransform reserved cross_read freespace mf vds file_image \ diff --git a/test/accum.c b/test/accum.c index 183f955..46015c9 100644 --- a/test/accum.c +++ b/test/accum.c @@ -2101,7 +2101,7 @@ test_swmr_write_big(hbool_t newest_format) unsigned u; /* Local index variable */ #ifdef H5_HAVE_UNISTD_H pid_t pid; /* Process ID */ -#endif /* H5_HAVE_UNISTD_H */ +#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 */ @@ -2243,7 +2243,7 @@ test_swmr_write_big(hbool_t newest_format) char *const new_argv[] = {swmr_reader, NULL}; /* Run the reader */ status = HDexecv(SWMR_READER, new_argv); - HDprintf("errno from execv = %s\n", strerror(errno)); + HDprintf("errno from execv = %s\n", HDstrerror(errno)); FAIL_STACK_ERROR; } /* end if */ diff --git a/test/btree2.c b/test/btree2.c index 4391a3b..919a6ee 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -2690,7 +2690,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, record = 2862; /* Record to left of insertion point in right internal node (now) */ if (check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR -#endif /* NONE */ +#endif /* NONE */ record = 3137; /* Record to right of insertion point in right internal node (now) */ if (check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR @@ -2871,7 +2871,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, cons record = 3049; /* Record to left of insertion point in middle internal node */ if (check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR -#endif /* NONE */ +#endif /* NONE */ record = 2822; /* Record to right of insertion point in middle internal node */ if (check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR @@ -10023,14 +10023,14 @@ main(void) if (nerrors) goto error; - puts("All v2 B-tree tests passed."); + HDputs("All v2 B-tree tests passed."); h5_cleanup(FILENAME, fapl); return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Pclose(fapl); } H5E_END_TRY; diff --git a/test/cache.c b/test/cache.c index b7269ba..0e923fd 100644 --- a/test/cache.c +++ b/test/cache.c @@ -4449,7 +4449,7 @@ check_flush_cache__multi_entry_test(H5F_t *file_ptr, int test_num, unsigned int test_entry_t *base_addr; test_entry_t *entry_ptr; -#if 0 /* JRM */ +#if 0 /* JRM */ /* This gets used a lot, so lets leave it in. */ HDfprintf(stdout, "check_flush_cache__multi_entry_test: test %d\n", @@ -4637,7 +4637,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t *file_ptr, int test_num, unsigned i test_entry_t *base_addr; test_entry_t *entry_ptr; -#if 0 /* JRM */ +#if 0 /* JRM */ /* This is useful debugging code. Leave it in for now. */ HDfprintf(stdout, "check_flush_cache__pe_multi_entry_test: test %d\n", @@ -33871,7 +33871,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t *file_ptr) pass = FALSE; failure_mssg = "unexpected scan restart stats in cedds__expunge_dirty_entry_in_flush_test()."; } /* end if */ -#endif /* H5C_COLLECT_CACHE_STATS */ +#endif /* H5C_COLLECT_CACHE_STATS */ if (pass) reset_entries(); @@ -35232,7 +35232,7 @@ check_stats__smoke_check_1(H5F_t *file_ptr) pass = FALSE; failure_mssg = "Unexpected monster entry level stats in check_stats__smoke_check_1(1)."; } /* end if */ -#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ if (pass) /* protect and unprotect each entry once. Note @@ -35306,7 +35306,7 @@ check_stats__smoke_check_1(H5F_t *file_ptr) pass = FALSE; failure_mssg = "Unexpected monster entry level stats in check_stats__smoke_check_1(2)."; } /* end if */ -#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ +#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ if (pass) { /* protect and unprotect an entry that is not currently diff --git a/test/cache_api.c b/test/cache_api.c index acdb4ba..143cc71 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1216,9 +1216,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) /* do random reads on all datasets */ n = 0; while ((pass) && (n < NUM_RANDOM_ACCESSES)) { - m = rand() % NUM_DSETS; - i = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; - j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; + m = HDrand() % NUM_DSETS; + i = (HDrand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; + j = (HDrand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; /* select on disk hyperslab */ offset[0] = (hsize_t)i; /*offset of hyperslab in file*/ @@ -1328,8 +1328,8 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) m = 0; n = 0; while ((pass) && (n < NUM_RANDOM_ACCESSES)) { - i = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; - j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; + i = (HDrand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; + j = (HDrand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE; /* select on disk hyperslab */ offset[0] = (hsize_t)i; /*offset of hyperslab in file*/ diff --git a/test/cache_common.h b/test/cache_common.h index aa32858..87fab72 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -392,8 +392,7 @@ typedef struct test_entry_t { int flush_dep_par_idx[MAX_FLUSH_DEP_PARS]; /* Indices of flush dependency parents */ unsigned flush_dep_npar; /* Number of flush dependency parents */ unsigned flush_dep_nchd; /* Number of flush dependency children */ - unsigned - flush_dep_ndirty_chd; /* Number of dirty flush dependency children (including granchildren, etc.) */ + unsigned flush_dep_ndirty_chd; /* Number of dirty flush dependency children (including granchildren, etc.) */ hbool_t pinned_from_client; /* entry was pinned by client call */ hbool_t pinned_from_cache; /* entry was pinned by cache internally */ unsigned flush_order; /* Order that entry was flushed in */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index b2975d1..9d0aa3e 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -444,7 +444,7 @@ check_file_creation_tags(hid_t fcpl_id, int type) hid_t fid = -1; /* File Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose test outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; haddr_t sbe_tag = 0; @@ -548,7 +548,7 @@ check_file_open_tags(hid_t fcpl, int type) hid_t fid = -1; /* File Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag; /* Root Group Tag */ haddr_t sbe_tag; /* Sblock Extension Tag */ @@ -678,7 +678,7 @@ check_group_creation_tags(void) hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */ haddr_t g_tag; /* Group Tag */ @@ -801,7 +801,7 @@ check_multi_group_creation_tags(void) hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ char gname[16]; /* group name buffer */ int i = 0; /* iterator */ hid_t fapl = -1; /* File access prop list */ @@ -953,7 +953,7 @@ check_link_iteration_tags(void) hid_t did = -1; /* Group Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ int i = 0; /* iterator */ haddr_t root_tag = 0; /* Root Group Tag Value */ char dsetname[500]; /* Name of dataset */ @@ -1095,7 +1095,7 @@ check_dense_attribute_tags(void) hid_t dcpl = -1; /* Group Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ int i = 0; /* iterator */ hid_t fapl = -1; /* File access property list */ haddr_t d_tag = 0; /* Dataset tag value */ @@ -1325,7 +1325,7 @@ check_group_open_tags(void) hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file output */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; @@ -1456,7 +1456,7 @@ check_attribute_creation_tags(hid_t fcpl, int type) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; /* Root group tag */ haddr_t g_tag = 0; @@ -1621,7 +1621,7 @@ check_attribute_open_tags(hid_t fcpl, int type) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; haddr_t g_tag = 0; @@ -1788,7 +1788,7 @@ check_attribute_rename_tags(hid_t fcpl, int type) hid_t sid = -1; /* Dataset Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ int * data = NULL; /* data buffer */ int i, j, k = 0; /* iterators */ hid_t fapl = -1; /* File access prop list */ @@ -2001,7 +2001,7 @@ check_attribute_delete_tags(hid_t fcpl, int type) hid_t sid = -1; /* Dataset Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ int * data = NULL; /* data buffer */ int i, j, k = 0; /* iterators */ hid_t fapl = -1; /* File access prop list */ @@ -2192,7 +2192,7 @@ check_dataset_creation_tags(hid_t fcpl, int type) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -2352,7 +2352,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -2518,7 +2518,7 @@ check_dataset_open_tags(void) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -2670,7 +2670,7 @@ check_dataset_write_tags(void) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -2837,7 +2837,7 @@ check_attribute_write_tags(hid_t fcpl, int type) hid_t sid = -1; /* Dataset Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ int * data = NULL; /* data buffer */ int i, j, k = 0; /* iterators */ hid_t fapl = -1; /* File access prop list */ @@ -3023,7 +3023,7 @@ check_dataset_read_tags(void) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -3185,7 +3185,7 @@ check_dataset_size_retrieval(void) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -3349,7 +3349,7 @@ check_dataset_extend_tags(void) hid_t sid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -3511,7 +3511,7 @@ check_object_info_tags(void) hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file output */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; @@ -3646,7 +3646,7 @@ check_object_copy_tags(void) hid_t gid = -1; /* Group Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file output */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = HADDR_UNDEF; haddr_t g_tag; @@ -3796,7 +3796,7 @@ check_link_removal_tags(hid_t fcpl, int type) hid_t gid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -3985,7 +3985,7 @@ check_link_getname_tags(void) hid_t gid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t dcpl = -1; /* dataset creation pl */ hsize_t cdims[2] = {1, 1}; /* chunk dimensions */ int fillval = 0; @@ -4162,7 +4162,7 @@ check_external_link_creation_tags(void) hid_t gid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; @@ -4289,7 +4289,7 @@ check_external_link_open_tags(void) hid_t xid = -1; /* Dataspace Identifier */ #ifndef NDEBUG int verbose = FALSE; /* verbose file outout */ -#endif /* NDEBUG */ /* end debugging functions */ +#endif /* NDEBUG */ H5O_native_info_t ninfo; /* Native object info struct */ hid_t fapl = -1; /* File access prop list */ haddr_t root_tag = 0; @@ -4462,7 +4462,7 @@ check_invalid_tag_application(void) H5HL_t *lheap = NULL; hid_t fapl = -1; /* File access prop list */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ -#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ TESTING("failure on invalid tag application"); diff --git a/test/chunk_info.c b/test/chunk_info.c index 99b5b1e..37fbe60 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -421,7 +421,7 @@ verify_idx_nchunks(hid_t dset, hid_t dspace, H5D_chunk_index_t exp_idx_type, hsi /* Ensure the correct chunk indexing scheme is used */ if (idx_type != exp_idx_type) { char msg[256]; - sprintf(msg, "Should be using %s.\n", index_type_str(idx_type)); + HDsprintf(msg, "Should be using %s.\n", index_type_str(idx_type)); FAIL_PUTS_ERROR(msg); } @@ -489,7 +489,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) 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 /* end H5_HAVE_FILTER_DEFLATE */ 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 */ @@ -542,7 +542,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) #ifdef H5_HAVE_FILTER_DEFLATE /* Allocate input (compressed) buffer */ - inbuf = malloc(z_dst_nbytes); + inbuf = HDcalloc(1, z_dst_nbytes); /* Set chunk size to the compressed chunk size and the chunk point to the compressed data chunk */ @@ -554,20 +554,20 @@ test_get_chunk_info_highest_v18(hid_t fapl) /* Check for various zlib errors */ if (Z_BUF_ERROR == ret) { - fprintf(stderr, "overflow"); + HDfprintf(stderr, "overflow"); TEST_ERROR } else if (Z_MEM_ERROR == ret) { - fprintf(stderr, "deflate memory error"); + HDfprintf(stderr, "deflate memory error"); TEST_ERROR } else if (Z_OK != ret) { - fprintf(stderr, "other deflate error"); + HDfprintf(stderr, "other deflate error"); TEST_ERROR } #else /* Allocate input (non-compressed) buffer */ - inbuf = malloc(CHK_SIZE); + inbuf = HDcalloc(1, CHK_SIZE); HDmemcpy(inbuf, direct_buf, CHK_SIZE); #endif /* end H5_HAVE_FILTER_DEFLATE */ @@ -1638,7 +1638,7 @@ test_basic_query(hid_t fapl) TEST_ERROR /* Remove the test file */ - remove(filename); + HDremove(filename); PASSED(); return SUCCEED; @@ -2040,7 +2040,7 @@ test_flt_msk_with_skip_compress(hid_t fapl) TEST_ERROR /* Remove the test file */ - remove(filename); + HDremove(filename); PASSED(); return SUCCEED; diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 6e5dd07..37217e7 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -302,7 +302,7 @@ test_compound(char *filename, hid_t fapl) s1[i].c[1] != s2[i].c[1] || s1[i].c[2] != s2[i].c[2] || s1[i].c[3] != s2[i].c[3] || s1[i].d != s2[i].d || s1[i].e != s2[i].e) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -339,7 +339,7 @@ test_compound(char *filename, hid_t fapl) s1[i].c[1] != s3[i].c[1] || s1[i].c[2] != s3[i].c[2] || s1[i].c[3] != s3[i].c[3] || s1[i].d != s3[i].d || s1[i].e != s3[i].e) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -369,7 +369,7 @@ test_compound(char *filename, hid_t fapl) for (i = 0; i < NX * NY; i++) { if (s1[i].b != s4[i].b || s1[i].d != s4[i].d) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -413,7 +413,7 @@ test_compound(char *filename, hid_t fapl) s1[i].c[1] != s5[i].c[1] || s1[i].c[2] != s5[i].c[2] || s1[i].c[3] != s5[i].c[3] || s1[i].d != s5[i].d || s1[i].e != s5[i].e) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -423,7 +423,7 @@ test_compound(char *filename, hid_t fapl) if (s5[i].pre != 1000 + 4 * i || s5[i].mid1 != 1001 + 4 * i || s5[i].mid2 != 1002 + 4 * i || s5[i].post != 1003 + 4 * i) { H5_FAILED(); - puts(" Memory values were clobbered"); + HDputs(" Memory values were clobbered"); goto error; } } @@ -482,7 +482,7 @@ test_compound(char *filename, hid_t fapl) s1[i].c[1] != s6[i].c[1] || s1[i].c[2] != s6[i].c[2] || s1[i].c[3] != s6[i].c[3] || s1[i].d != s6[i].d || s1[i].e != s6[i].e) { H5_FAILED(); - puts(" Incorrect values read from the file"); + HDputs(" Incorrect values read from the file"); goto error; } } @@ -492,7 +492,7 @@ test_compound(char *filename, hid_t fapl) if (s6[i].pre != 1000 + 4 * i || s6[i].mid1 != 1001 + 4 * i || s6[i].mid2 != 1002 + 4 * i || s6[i].post != 1003 + 4 * i) { H5_FAILED(); - puts(" Memory values were clobbered"); + HDputs(" Memory values were clobbered"); goto error; } } @@ -561,7 +561,7 @@ test_compound(char *filename, hid_t fapl) s2[i].c[1] != s1[i].c[1] || s2[i].c[2] != s1[i].c[2] || s2[i].c[3] != s1[i].c[3] || s2[i].d != s1[i].d || s2[i].e != s1[i].e) { H5_FAILED(); - puts(" Incorrect values read from file"); + HDputs(" Incorrect values read from file"); goto error; } } @@ -590,7 +590,7 @@ test_compound(char *filename, hid_t fapl) /* Read the dataset */ s8 = (s1_t *)HDcalloc((size_t)(h_size[0] * h_size[1]), sizeof(s1_t)); - assert(s8); + HDassert(s8); if (H5Dread(dataset, s1_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s8) < 0) { goto error; } @@ -604,7 +604,7 @@ test_compound(char *filename, hid_t fapl) if (ps8->a != ps1->a || ps8->b != ps1->b || ps8->c[0] != ps1->c[0] || ps8->c[1] != ps1->c[1] || ps8->c[2] != ps1->c[2] || ps8->c[3] != ps1->c[3] || ps8->d != ps1->d || ps8->e != ps1->e) { H5_FAILED(); - puts(" Incorrect values read from file"); + HDputs(" Incorrect values read from file"); goto error; } } @@ -643,7 +643,7 @@ test_compound(char *filename, hid_t fapl) ps2->c[1] != ps1->c[1] || ps2->c[2] != ps1->c[2] || ps2->c[3] != ps1->c[3] || ps2->d != ps1->d || ps2->e != ps1->e) { H5_FAILED(); - puts(" Memory values clobbered"); + HDputs(" Memory values clobbered"); goto error; } } @@ -652,7 +652,7 @@ test_compound(char *filename, hid_t fapl) ps2->c[1] != (unsigned)(-1) || ps2->c[2] != (unsigned)(-1) || ps2->c[3] != (unsigned)(-1) || ps2->d != (unsigned)(-1) || ps2->e != (unsigned)(-1)) { H5_FAILED(); - puts(" Incorrect values read from file"); + HDputs(" Incorrect values read from file"); goto error; } } @@ -691,7 +691,7 @@ test_compound(char *filename, hid_t fapl) ps5->c[2] != ps1->c[2] || ps5->c[3] != ps1->c[3] || ps5->mid2 != (unsigned)(-1) || ps5->d != ps1->d || ps5->e != ps1->e || ps5->post != (unsigned)(-1)) { H5_FAILED(); - puts(" Memory values clobbered"); + HDputs(" Memory values clobbered"); goto error; } } @@ -702,7 +702,7 @@ test_compound(char *filename, hid_t fapl) ps5->c[3] != (unsigned)(-1) || ps5->mid2 != (unsigned)(-1) || ps5->d != (unsigned)(-1) || ps5->e != (unsigned)(-1) || ps5->post != (unsigned)(-1)) { H5_FAILED(); - puts(" Incorrect values read from file"); + HDputs(" Incorrect values read from file"); goto error; } } @@ -723,7 +723,7 @@ test_compound(char *filename, hid_t fapl) h_size[0] = 2 * NX / 3 - f_offset[0]; h_size[1] = 2 * NY / 3 - f_offset[1]; s11 = (s4_t *)HDmalloc((size_t)h_size[0] * (size_t)h_size[1] * sizeof(s4_t)); - assert(s11); + HDassert(s11); /* Initialize */ for (i = 0; i < h_size[0] * h_size[1]; i++) { @@ -751,7 +751,7 @@ test_compound(char *filename, hid_t fapl) ps1->c[1] != 8 * (i * NY + j) + 3 || ps1->c[2] != 8 * (i * NY + j) + 4 || ps1->c[3] != 8 * (i * NY + j) + 5 || ps1->e != 8 * (i * NY + j) + 7) { H5_FAILED(); - puts(" Write clobbered values"); + HDputs(" Write clobbered values"); goto error; } @@ -759,14 +759,14 @@ test_compound(char *filename, hid_t fapl) j < f_offset[1] + h_size[1]) { if (ps1->b != (unsigned)(-1) || ps1->d != (unsigned)(-1)) { H5_FAILED(); - puts(" Wrong values written or read"); + HDputs(" Wrong values written or read"); goto error; } } else { if (ps1->b != 8 * (i * NY + j) + 1 || ps1->d != 8 * (i * NY + j) + 6) { H5_FAILED(); - puts(" Write clobbered values"); + HDputs(" Write clobbered values"); goto error; } } @@ -792,7 +792,7 @@ test_compound(char *filename, hid_t fapl) return 0; error: - puts("*** DATASET TESTS FAILED ***"); + HDputs("*** DATASET TESTS FAILED ***"); /* Release resources */ if (s1) @@ -1669,7 +1669,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) return 0; error: - puts("*** DATASET TESTS FAILED ***"); + HDputs("*** DATASET TESTS FAILED ***"); return 1; } @@ -1684,7 +1684,7 @@ error: for (_i = 0; _i < PACK_NMEMBS; _i++) \ HDprintf(" %d", order[_i]); \ HDprintf("\n Inner compound order = %d, location = %d\n", sub_cmpd_order, order[sub_cmpd_order]); \ - fflush(stdout); \ + HDfflush(stdout); \ goto error; \ } @@ -1719,7 +1719,7 @@ test_pack_ooo(void) * the compound */ unsigned i, j; /* Indices */ - HDsrand((unsigned)time(NULL)); + HDsrand((unsigned)HDtime(NULL)); /* Initialize "free_order" array to indicate that all slots in order are * free */ @@ -2233,7 +2233,7 @@ main(int argc, char *argv[]) /* Turn off optimized compound converter? */ if (argc > 1) { - if (argc > 2 || strcmp("--noopt", argv[1])) { + if (argc > 2 || HDstrcmp("--noopt", argv[1])) { HDfprintf(stderr, "usage: %s [--noopt]\n", argv[0]); HDexit(EXIT_FAILURE); } diff --git a/test/cross_read.c b/test/cross_read.c index 22c6828..7455752 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -275,7 +275,7 @@ check_file(char *filename) TESTING("dataset of LE FLOAT with Deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE nerrors += check_data_f(DATASETNAME16, fid); -#else /*H5_HAVE_FILTER_DEFLATE*/ +#else /*H5_HAVE_FILTER_DEFLATE*/ SKIPPED(); HDputs(not_supported); #endif /*H5_HAVE_FILTER_DEFLATE*/ @@ -283,7 +283,7 @@ check_file(char *filename) TESTING("dataset of BE FLOAT with Deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE nerrors += check_data_f(DATASETNAME17, fid); -#else /*H5_HAVE_FILTER_DEFLATE*/ +#else /*H5_HAVE_FILTER_DEFLATE*/ SKIPPED(); HDputs(not_supported); #endif /*H5_HAVE_FILTER_DEFLATE*/ @@ -291,7 +291,7 @@ check_file(char *filename) TESTING("dataset of LE FLOAT with Szip filter"); #ifdef H5_HAVE_FILTER_SZIP nerrors += check_data_f(DATASETNAME18, fid); -#else /*H5_HAVE_FILTER_SZIP*/ +#else /*H5_HAVE_FILTER_SZIP*/ SKIPPED(); HDputs(not_supported); #endif /*H5_HAVE_FILTER_SZIP*/ @@ -299,7 +299,7 @@ check_file(char *filename) TESTING("dataset of BE FLOAT with Szip filter"); #ifdef H5_HAVE_FILTER_SZIP nerrors += check_data_f(DATASETNAME19, fid); -#else /*H5_HAVE_FILTER_SZIP*/ +#else /*H5_HAVE_FILTER_SZIP*/ SKIPPED(); HDputs(not_supported); #endif /*H5_HAVE_FILTER_SZIP*/ diff --git a/test/dangle.c b/test/dangle.c index 4728923..d7c7dfc 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -660,7 +660,7 @@ main(void) int nerrors = 0; /* Run tests w/weak file close */ - puts("Testing dangling objects with weak file close:"); + HDputs("Testing dangling objects with weak file close:"); nerrors += test_dangle_dataset(H5F_CLOSE_WEAK); nerrors += test_dangle_group(H5F_CLOSE_WEAK); nerrors += test_dangle_datatype1(H5F_CLOSE_WEAK); @@ -668,7 +668,7 @@ main(void) nerrors += test_dangle_attribute(H5F_CLOSE_WEAK); /* Run tests w/semi file close */ - puts("Testing dangling objects with semi file close:"); + HDputs("Testing dangling objects with semi file close:"); nerrors += test_dangle_dataset(H5F_CLOSE_SEMI); nerrors += test_dangle_group(H5F_CLOSE_SEMI); nerrors += test_dangle_datatype1(H5F_CLOSE_SEMI); @@ -676,7 +676,7 @@ main(void) nerrors += test_dangle_attribute(H5F_CLOSE_SEMI); /* Run tests w/strong file close */ - puts("Testing dangling objects with strong file close:"); + HDputs("Testing dangling objects with strong file close:"); nerrors += test_dangle_dataset(H5F_CLOSE_STRONG); nerrors += test_dangle_group(H5F_CLOSE_STRONG); nerrors += test_dangle_datatype1(H5F_CLOSE_STRONG); @@ -689,11 +689,11 @@ main(void) /* Check for errors */ if (nerrors) goto error; - puts("All dangling ID tests passed."); + HDputs("All dangling ID tests passed."); return 0; error: - puts("***** DANGLING ID TESTS FAILED *****"); + HDputs("***** DANGLING ID TESTS FAILED *****"); return 1; } diff --git a/test/direct_chunk.c b/test/direct_chunk.c index 388f2cc..00fc06f 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -2320,7 +2320,7 @@ main(void) need_comma = TRUE; } /* end if */ HDprintf(":\n"); - fflush(stdout); + HDfflush(stdout); nerrors += test_single_chunk(config); } /* end for */ diff --git a/test/dsets.c b/test/dsets.c index 8a4332d..2e9e3db 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -375,13 +375,13 @@ test_create(hid_t file) dims[0] = 256; dims[1] = 512; space = H5Screate_simple(2, dims, NULL); - assert(space >= 0); + HDassert(space >= 0); /* Create a small data space for compact dataset */ small_dims[0] = 16; small_dims[1] = 8; small_space = H5Screate_simple(2, small_dims, NULL); - assert(space >= 0); + HDassert(space >= 0); /* * Create a dataset using the default dataset creation properties. We're @@ -447,13 +447,13 @@ test_create(hid_t file) * layout. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - assert(create_parms >= 0); + HDassert(create_parms >= 0); /* Attempt to create a dataset with invalid chunk sizes */ csize[0] = dims[0] * 2; csize[1] = dims[1] * 2; status = H5Pset_chunk(create_parms, 2, csize); - assert(status >= 0); + HDassert(status >= 0); H5E_BEGIN_TRY { dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, create_parms, @@ -469,7 +469,7 @@ test_create(hid_t file) csize[0] = 5; csize[1] = 100; status = H5Pset_chunk(create_parms, 2, csize); - assert(status >= 0); + HDassert(status >= 0); dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, create_parms, H5P_DEFAULT); @@ -491,11 +491,11 @@ test_create(hid_t file) * Create a compact dataset, then close it. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - assert(create_parms >= 0); + HDassert(create_parms >= 0); status = H5Pset_layout(create_parms, H5D_COMPACT); - assert(status >= 0); + HDassert(status >= 0); status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); - assert(status >= 0); + HDassert(status >= 0); dataset = H5Dcreate2(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, create_parms, H5P_DEFAULT); @@ -567,7 +567,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) /* Create a small conversion buffer to test strip mining */ tconv_buf = HDmalloc((size_t)1000); xfer = H5Pcreate(H5P_DATASET_XFER); - assert(xfer >= 0); + HDassert(xfer >= 0); if (H5Pset_buffer(xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error; @@ -2412,7 +2412,7 @@ test_get_filter_info(void) if (((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) != 0) || ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) TEST_ERROR - } /* end else */ + } /* end else */ #endif /* H5_HAVE_FILTER_SZIP */ /* Verify that get_filter_info throws an error when given a bad filter */ @@ -2454,7 +2454,7 @@ test_filters(hid_t file, hid_t #ifdef H5_HAVE_FILTER_DEFLATE hsize_t deflate_size; /* Size of dataset with deflate filter */ -#endif /* H5_HAVE_FILTER_DEFLATE */ +#endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP hsize_t szip_size; /* Size of dataset with szip filter */ @@ -2466,7 +2466,7 @@ test_filters(hid_t file, hid_t #if defined(H5_HAVE_FILTER_DEFLATE) || defined(H5_HAVE_FILTER_SZIP) hsize_t combo_size; /* Size of dataset with multiple filters */ -#endif /* defined(H5_HAVE_FILTER_DEFLATE) || defined(H5_HAVE_FILTER_SZIP) */ +#endif /* defined(H5_HAVE_FILTER_DEFLATE) || defined(H5_HAVE_FILTER_SZIP) */ /* test the H5Zget_filter_info function */ if (test_get_filter_info() < 0) @@ -2569,7 +2569,7 @@ test_filters(hid_t file, hid_t /* Clean up objects used for this test */ if (H5Pclose(dc) < 0) goto error; -#else /* H5_HAVE_FILTER_DEFLATE */ +#else /* H5_HAVE_FILTER_DEFLATE */ TESTING("deflate filter"); SKIPPED(); HDputs(" Deflate filter not enabled"); @@ -2611,7 +2611,7 @@ test_filters(hid_t file, hid_t SKIPPED(); } -#else /* H5_HAVE_FILTER_SZIP */ +#else /* H5_HAVE_FILTER_SZIP */ TESTING("szip filter"); SKIPPED(); HDputs(" Szip filter not enabled"); @@ -2686,7 +2686,7 @@ test_filters(hid_t file, hid_t /* Clean up objects used for this test */ if (H5Pclose(dc) < 0) goto error; -#else /* H5_HAVE_FILTER_DEFLATE */ +#else /* H5_HAVE_FILTER_DEFLATE */ TESTING("shuffle+deflate+fletcher32 filters"); SKIPPED(); HDputs(" Deflate filter not enabled"); @@ -2764,7 +2764,7 @@ test_filters(hid_t file, hid_t SKIPPED(); } -#else /* H5_HAVE_FILTER_SZIP */ +#else /* H5_HAVE_FILTER_SZIP */ TESTING("shuffle+szip+fletcher32 filters"); SKIPPED(); HDputs(" szip filter not enabled"); @@ -2820,7 +2820,7 @@ test_missing_filter(hid_t file) H5_FAILED(); HDprintf(" Line %d: Can't unregister deflate filter\n", __LINE__); goto error; - } /* end if */ + } /* end if */ #endif /* H5_HAVE_FILTER_DEFLATE */ /* Verify deflate filter is not registered currently */ if (H5Zfilter_avail(H5Z_FILTER_DEFLATE) != FALSE) { @@ -3006,7 +3006,7 @@ test_missing_filter(hid_t file) H5_FAILED(); HDprintf(" Line %d: Deflate filter not available\n", __LINE__); goto error; - } /* end if */ + } /* end if */ #endif /* H5_HAVE_FILTER_DEFLATE */ /* Pop API context */ @@ -4336,9 +4336,9 @@ test_nbit_compound_3(hid_t file) /* Check that the values read are the same as the values written */ for (i = 0; i < (size_t)size[0]; i++) { - if (new_data[i].i != orig_data[i].i || strcmp(new_data[i].str, orig_data[i].str) != 0 || - strcmp(new_data[i].vl_str, orig_data[i].vl_str) != 0 || new_data[i].v.len != orig_data[i].v.len || - new_data[i].r != orig_data[i].r) { + if (new_data[i].i != orig_data[i].i || HDstrcmp(new_data[i].str, orig_data[i].str) != 0 || + HDstrcmp(new_data[i].vl_str, orig_data[i].vl_str) != 0 || + new_data[i].v.len != orig_data[i].v.len || new_data[i].r != orig_data[i].r) { H5_FAILED(); HDprintf(" Read different values than written.\n"); HDprintf(" At index %lu\n", (unsigned long)i); @@ -6257,7 +6257,7 @@ test_can_apply_szip(hid_t const hsize_t chunk_dims[2] = {250, 2048}; /* Chunk dimensions */ const hsize_t chunk_dims2[2] = {2, 1}; /* Chunk dimensions */ herr_t ret; /* Status value */ -#endif /* H5_HAVE_FILTER_SZIP */ +#endif /* H5_HAVE_FILTER_SZIP */ TESTING("dataset szip filter 'can apply' callback"); @@ -6409,7 +6409,7 @@ test_can_apply_szip(hid_t SKIPPED(); HDputs(" Szip encoding is not enabled."); } -#else /* H5_HAVE_FILTER_SZIP */ +#else /* H5_HAVE_FILTER_SZIP */ SKIPPED(); HDputs(" Szip filter is not enabled."); #endif /* H5_HAVE_FILTER_SZIP */ @@ -7832,7 +7832,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) TESTING(testname); - assert(NPOINTS < 100); + HDassert(NPOINTS < 100); h5_fixname(FILENAME[6], fapl, filename, sizeof filename); @@ -8354,13 +8354,13 @@ test_deprec(hid_t file) dims[0] = 256; dims[1] = 512; space = H5Screate_simple(2, dims, NULL); - assert(space >= 0); + HDassert(space >= 0); /* Create a small data space for compact dataset */ small_dims[0] = 16; small_dims[1] = 8; small_space = H5Screate_simple(2, small_dims, NULL); - assert(space >= 0); + HDassert(space >= 0); /* * Create a dataset using the default dataset creation properties. We're @@ -8413,7 +8413,7 @@ test_deprec(hid_t file) * layout. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - assert(create_parms >= 0); + HDassert(create_parms >= 0); /* Add the deflate filter, if available */ #if defined H5_HAVE_FILTER_DEFLATE @@ -8449,7 +8449,7 @@ test_deprec(hid_t file) csize[0] = dims[0] * 2; csize[1] = dims[1] * 2; status = H5Pset_chunk(create_parms, 2, csize); - assert(status >= 0); + HDassert(status >= 0); H5E_BEGIN_TRY { dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms); @@ -8464,7 +8464,7 @@ test_deprec(hid_t file) csize[0] = 5; csize[1] = 100; status = H5Pset_chunk(create_parms, 2, csize); - assert(status >= 0); + HDassert(status >= 0); if ((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error; @@ -8489,11 +8489,11 @@ test_deprec(hid_t file) * Create a compact dataset, then close it. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - assert(create_parms >= 0); + HDassert(create_parms >= 0); status = H5Pset_layout(create_parms, H5D_COMPACT); - assert(status >= 0); + HDassert(status >= 0); status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); - assert(status >= 0); + HDassert(status >= 0); if ((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) @@ -10668,7 +10668,7 @@ test_fixed_array(hid_t fapl) #ifdef H5_HAVE_FILTER_DEFLATE unsigned compress; /* Whether chunks should be compressed */ -#endif /* H5_HAVE_FILTER_DEFLATE */ +#endif /* H5_HAVE_FILTER_DEFLATE */ h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ @@ -11087,7 +11087,7 @@ test_fixed_array(hid_t fapl) } /* end for */ #ifdef H5_HAVE_FILTER_DEFLATE - } /* end for */ + } /* end for */ #endif /* H5_HAVE_FILTER_DEFLATE */ /* Release buffers */ @@ -11179,7 +11179,7 @@ test_single_chunk(hid_t fapl) #ifdef H5_HAVE_FILTER_DEFLATE unsigned compress; /* Whether chunks should be compressed */ -#endif /* H5_HAVE_FILTER_DEFLATE */ +#endif /* H5_HAVE_FILTER_DEFLATE */ size_t n, i; /* local index variables */ herr_t ret; /* Generic return value */ @@ -11391,7 +11391,7 @@ test_single_chunk(hid_t fapl) } /* end for */ #ifdef H5_HAVE_FILTER_DEFLATE - } /* end for */ + } /* end for */ #endif /* H5_HAVE_FILTER_DEFLATE */ /* Release buffers */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 466554c..49c1e8c 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -359,7 +359,7 @@ static int without_hardware_g = 0; \ for (n = 0; n < 2; n++) { \ if (n == 1) { \ - memset(value, 0, SRC_SIZE * sizeof(unsigned char)); \ + HDmemset(value, 0, SRC_SIZE * sizeof(unsigned char)); \ /* -0 */ \ H5T__bit_set(value, (size_t)(SRC_PREC - 1), (size_t)1, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ @@ -566,7 +566,7 @@ generates_sigfpe(void) HDfflush(stdout); HDfflush(stderr); - if ((pid = fork()) < 0) { + if ((pid = HDfork()) < 0) { HDperror("fork"); HDexit(EXIT_FAILURE); } @@ -580,7 +580,7 @@ generates_sigfpe(void) HDexit(EXIT_SUCCESS); } - while (pid != waitpid(pid, &status, 0)) + while (pid != HDwaitpid(pid, &status, 0)) /*void*/; if (WIFEXITED(status) && 0 == WEXITSTATUS(status)) { HDputs("Floating-point overflow cases will be tested."); @@ -2388,7 +2388,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) } /* Make certain that there isn't some weird number of destination bits */ - assert(dst_nbits % 8 == 0); + HDassert(dst_nbits % 8 == 0); /* Are the two results the same? */ for (k = (dst_size - (dst_nbits / 8)); k < dst_size; k++) @@ -2945,12 +2945,12 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) */ HDfflush(stdout); HDfflush(stderr); - if ((child_pid = fork()) < 0) { + if ((child_pid = HDfork()) < 0) { HDperror("fork"); return 1; } else if (child_pid > 0) { - while (child_pid != waitpid(child_pid, &status, 0)) /*void*/ + while (child_pid != HDwaitpid(child_pid, &status, 0)) /*void*/ ; if (WIFEXITED(status) && 255 == WEXITSTATUS(status)) { return 0; /*child exit after catching SIGFPE*/ @@ -3019,7 +3019,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) if (sizeof(float) == sizeof(double)) HDputs("Sizeof(float)==sizeof(double) - some tests may not be sensible."); if (OTHER == src_type || OTHER == dst_type) { - if (!strcmp(name, "noop")) + if (!HDstrcmp(name, "noop")) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); else if (run_test == TEST_SPECIAL) @@ -3038,7 +3038,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) goto error; } else { - if (!strcmp(name, "noop")) + if (!HDstrcmp(name, "noop")) HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); else if (run_test == TEST_SPECIAL) @@ -4347,7 +4347,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) } /* Make certain that there isn't some weird number of destination bits */ - assert(dst_nbits % 8 == 0); + HDassert(dst_nbits % 8 == 0); /* For Intel machines, the size of "long double" is 12 bytes, precision * is 80 bits; for AMD processors, the size of "long double" is 16 bytes, @@ -5006,7 +5006,7 @@ run_fp_tests(const char *name) { int nerrors = 0; - if (!strcmp(name, "noop")) { + if (!HDstrcmp(name, "noop")) { nerrors += test_conv_flt_1("noop", TEST_NOOP, H5T_NATIVE_FLOAT, H5T_NATIVE_FLOAT); nerrors += test_conv_flt_1("noop", TEST_NOOP, H5T_NATIVE_DOUBLE, H5T_NATIVE_DOUBLE); #if H5_SIZEOF_LONG_DOUBLE != 0 @@ -5165,7 +5165,7 @@ run_int_fp_conv(const char *name) #if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG #if H5_LLONG_TO_LDOUBLE_CORRECT nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_LDOUBLE); -#else /* H5_LLONG_TO_LDOUBLE_CORRECT */ +#else /* H5_LLONG_TO_LDOUBLE_CORRECT */ { char str[256]; /*hello string */ @@ -5177,7 +5177,7 @@ run_int_fp_conv(const char *name) #endif /* H5_LLONG_TO_LDOUBLE_CORRECT */ #if H5_LLONG_TO_LDOUBLE_CORRECT nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_LDOUBLE); -#else /* H5_LLONG_TO_LDOUBLE_CORRECT */ +#else /* H5_LLONG_TO_LDOUBLE_CORRECT */ { char str[256]; /*hello string */ @@ -5243,7 +5243,7 @@ run_fp_int_conv(const char *name) #endif #if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG - if (!strcmp(name, "hw")) { /* Hardware conversion */ + if (!HDstrcmp(name, "hw")) { /* Hardware conversion */ nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG); } diff --git a/test/dtypes.c b/test/dtypes.c index bb9bb2e..8ff49b9 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1891,7 +1891,7 @@ test_compound_9(void) goto error; } /* end if */ - if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || strcmp(rdata.str, wdata.str)) { + if (rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); @@ -2097,7 +2097,7 @@ test_compound_10(void) t1 = rdata[i].text.p; t2 = wdata[i].text.p; - if (strcmp((char *)t1, (char *)t2)) { + if (HDstrcmp((char *)t1, (char *)t2)) { H5_FAILED(); AT(); HDprintf("incorrect VL read data\n"); @@ -2502,7 +2502,7 @@ test_compound_12(void) H5E_END_TRY; if (ret >= 0) { H5_FAILED(); - puts(" Tries to cut off the last member. Should have failed."); + HDputs(" Tries to cut off the last member. Should have failed."); goto error; } @@ -3054,7 +3054,7 @@ test_compound_14(void) goto error; } /* end if */ - if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || strcmp(rdata1.str, wdata1.str)) { + if (rdata1.c1 != wdata1.c1 || rdata1.c2 != wdata1.c2 || HDstrcmp(rdata1.str, wdata1.str)) { H5_FAILED(); AT(); HDprintf("incorrect read data\n"); @@ -3885,7 +3885,7 @@ test_query(void) HDprintf("Can't get name for enum member\n"); goto error; } /* end if */ - if (strcmp("YELLOW", enum_name)) { + if (HDstrcmp("YELLOW", enum_name)) { H5_FAILED(); HDprintf("Incorrect name for enum member\n"); goto error; @@ -6486,7 +6486,7 @@ test_int_float_except(void) hid_t dxpl; /* Dataset transfer property list */ except_info_t e; /* Exception information */ unsigned u; /* Local index variables */ -#endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */ +#endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */ TESTING("exceptions for int <-> float conversions"); @@ -6602,7 +6602,7 @@ test_int_float_except(void) TEST_ERROR PASSED(); -#else /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */ +#else /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */ SKIPPED(); HDputs(" Test skipped due to int or float not 4 bytes."); #endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */ diff --git a/test/earray.c b/test/earray.c index 79bf0f1..21db0d8 100644 --- a/test/earray.c +++ b/test/earray.c @@ -375,7 +375,7 @@ check_stats(const H5EA_t *ea, const earray_state_t *state) "\n", earray_stats.stored.data_blk_size, state->data_blk_size); TEST_ERROR - } /* end if */ + } /* end if */ #endif /* NOT_YET */ if (earray_stats.stored.nsuper_blks != state->nsuper_blks) { HDfprintf(stdout, @@ -391,7 +391,7 @@ check_stats(const H5EA_t *ea, const earray_state_t *state) "\n", earray_stats.stored.super_blk_size, state->super_blk_size); TEST_ERROR - } /* end if */ + } /* end if */ #endif /* NOT_YET */ /* All tests passed */ @@ -757,9 +757,9 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE PASSED(); } -#else /* NDEBUG */ +#else /* NDEBUG */ SKIPPED(); - puts(" Not tested when assertions are disabled"); + HDputs(" Not tested when assertions are disabled"); #endif /* NDEBUG */ /* @@ -2427,12 +2427,12 @@ main(void) switch (curr_test) { /* "Normal" testing parameters */ case EARRAY_TEST_NORMAL: - puts("Testing with normal parameters"); + HDputs("Testing with normal parameters"); break; /* "Re-open array" testing parameters */ case EARRAY_TEST_REOPEN: - puts("Testing with reopen array flag set"); + HDputs("Testing with reopen array flag set"); tparam.reopen_array = EARRAY_TEST_REOPEN; break; @@ -2461,31 +2461,31 @@ main(void) switch (curr_iter) { /* "Forward" testing parameters */ case EARRAY_ITER_FW: - puts("Testing with forward iteration"); + HDputs("Testing with forward iteration"); tparam.eiter = &ea_iter_fw; break; /* "Reverse" testing parameters */ case EARRAY_ITER_RV: - puts("Testing with reverse iteration"); + HDputs("Testing with reverse iteration"); tparam.eiter = &ea_iter_rv; break; /* "Random" testing parameters */ case EARRAY_ITER_RND: - puts("Testing with random iteration"); + HDputs("Testing with random iteration"); tparam.eiter = &ea_iter_rnd; break; /* "Random #2" testing parameters */ case EARRAY_ITER_RND2: - puts("Testing with random #2 iteration"); + HDputs("Testing with random #2 iteration"); tparam.eiter = &ea_iter_rnd2; break; /* "Cyclic" testing parameters */ case EARRAY_ITER_CYC: - puts("Testing with cyclic iteration"); + HDputs("Testing with cyclic iteration"); tparam.eiter = &ea_iter_cyc; break; diff --git a/test/enum.c b/test/enum.c index eafce72..4a13358 100644 --- a/test/enum.c +++ b/test/enum.c @@ -768,11 +768,11 @@ main(void) if (nerrors) goto error; - puts("All enum tests passed."); + HDputs("All enum tests passed."); h5_cleanup(FILENAME, fapl); return 0; error: - puts("*** ENUM TESTS FAILED ***"); + HDputs("*** ENUM TESTS FAILED ***"); return 1; } diff --git a/test/error_test.c b/test/error_test.c index bcb2ec4..a47fa85 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -132,7 +132,7 @@ test_error(hid_t file) #ifdef H5_USE_16_API if (old_func != (H5E_auto_t)H5Eprint) TEST_ERROR; -#else /* H5_USE_16_API */ +#else /* H5_USE_16_API */ if (old_func != (H5E_auto2_t)H5Eprint2) TEST_ERROR; #endif /* H5_USE_16_API */ @@ -511,7 +511,7 @@ error: /*------------------------------------------------------------------------- * Function: test_copy * - * Purpose: Test copyinging an error stack + * Purpose: Test copying an error stack * * Return: Success: 0 * Failure: -1 diff --git a/test/external.c b/test/external.c index 376204a..d106555 100644 --- a/test/external.c +++ b/test/external.c @@ -476,12 +476,12 @@ __add_external_files(hid_t dcpl_id, unsigned int n_external_files, off_t offset, for (i = 0; i < n_external_files; i++) { if (HDsnprintf(exname, AEF_EXNAME_MAX_LEN, "ext%d.data", i + 1) > AEF_EXNAME_MAX_LEN) { HDfprintf(stderr, "External file %d overflows name buffer\n", i + 1); - fflush(stderr); + HDfflush(stderr); return -1; } if (H5Pset_external(dcpl_id, exname, offset, max_ext_size) < 0) { HDfprintf(stderr, "Problem adding external file %s\n", exname); - fflush(stderr); + HDfflush(stderr); return -1; } } diff --git a/test/farray.c b/test/farray.c index b6a6c31..5758a3f 100644 --- a/test/farray.c +++ b/test/farray.c @@ -481,9 +481,9 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE PASSED(); } -#else /* NDEBUG */ +#else /* NDEBUG */ SKIPPED(); - puts(" Not tested when assertions are disabled"); + HDputs(" Not tested when assertions are disabled"); #endif /* NDEBUG */ /* diff --git a/test/fheap.c b/test/fheap.c index 9a73cd0..f8f9d16 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -9423,9 +9423,8 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ - unsigned row; /* Current row in indirect block */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned row; /* Current row in indirect block */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -9555,8 +9554,7 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -9701,9 +9699,8 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ - unsigned row; /* Current row in indirect block */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned row; /* Current row in indirect block */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -9864,8 +9861,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ unsigned max_dblock_rows; /* Max. # of rows (of direct blocks) in the root indirect block */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ @@ -10020,8 +10016,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ unsigned max_dblock_rows; /* Max. # of rows (of direct blocks) in the root indirect block */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ @@ -10477,8 +10472,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -10630,8 +10624,7 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -10787,8 +10780,7 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -10951,8 +10943,7 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -11119,8 +11110,7 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -11282,8 +11272,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -11465,8 +11454,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -11685,8 +11673,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -11885,8 +11872,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -12416,8 +12402,7 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * H5HF_t * fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - unsigned - num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ + unsigned num_first_indirect_rows; /* Number of rows (of direct blocks) in each of the first indirect blocks */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ @@ -13827,7 +13812,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam if (reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR -/* QAK */ #ifdef QAK /* Close the fractal heap */ if (H5HF_close(fh) < 0) @@ -13854,7 +13838,6 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam if (NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR #endif /* QAK */ - /* QAK */ /* Check up on heap... */ state.huge_size = obj_size; @@ -14954,7 +14937,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para h5_stat_size_t empty_size; /* Size of a file with an empty heap */ #ifdef NOT_YET h5_stat_size_t file_size; /* Size of file currently */ -#endif /* NOT_YET */ +#endif /* NOT_YET */ unsigned char heap_id[HEAP_ID_LEN]; /* Heap ID for object */ size_t obj_size; /* Size of object */ size_t robj_size; /* Size of object read */ @@ -15127,7 +15110,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa h5_stat_size_t empty_size; /* Size of a file with an empty heap */ #ifdef NOT_YET h5_stat_size_t file_size; /* Size of file currently */ -#endif /* NOT_YET */ +#endif /* NOT_YET */ unsigned char heap_id1[HEAP_ID_LEN]; /* Heap ID for object #1 */ unsigned char heap_id2[HEAP_ID_LEN]; /* Heap ID for object #2 */ size_t obj_size; /* Size of object */ diff --git a/test/filenotclosed.c b/test/filenotclosed.c index 13ce9fd..330224d 100644 --- a/test/filenotclosed.c +++ b/test/filenotclosed.c @@ -80,7 +80,7 @@ main(void) contig_addr_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")); if (!contig_addr_vfd) { SKIPPED(); - puts(" Temporary skipped for a spilt/multi driver"); + HDputs(" Temporary skipped for a spilt/multi driver"); HDexit(EXIT_SUCCESS); } diff --git a/test/fillval.c b/test/fillval.c index 05570f0..2decbfa 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -201,7 +201,7 @@ test_getset(void) H5E_END_TRY; if (fill_i != 0) { H5_FAILED(); - puts(" H5Pget_fill_value() should return default 0"); + HDputs(" H5Pget_fill_value() should return default 0"); goto error; } @@ -220,8 +220,8 @@ test_getset(void) goto error; if (fill_ss.v1 != fill_ss_rd.v1 || fill_ss.v2 != fill_ss_rd.v2) { H5_FAILED(); - puts(" Failed to get fill value using same data type that was "); - puts(" used to set the fill value."); + HDputs(" Failed to get fill value using same data type that was "); + HDputs(" used to set the fill value."); goto error; } @@ -232,8 +232,8 @@ test_getset(void) goto error; if (fill_ss.v1 != fill_si.v1 || fill_ss.v2 != fill_si.v2) { H5_FAILED(); - puts(" Failed to get fill value using a data type other than what"); - puts(" was used to set the fill value."); + HDputs(" Failed to get fill value using a data type other than what"); + HDputs(" was used to set the fill value."); goto error; } @@ -246,7 +246,7 @@ test_getset(void) goto error; if (fill_si.v1 != fill_ss.v1 || fill_si.v2 != fill_ss.v2) { H5_FAILED(); - puts(" Resetting the fill value was unsuccessful."); + HDputs(" Resetting the fill value was unsuccessful."); goto error; } @@ -662,12 +662,12 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (alloc_time != H5D_ALLOC_TIME_LATE) { H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); + HDputs(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); HDprintf(" Got %d\n", alloc_time); } if (fill_time != H5D_FILL_TIME_ALLOC) { H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); + HDputs(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); HDprintf(" Got %d\n", fill_time); } if (H5Dclose(dset3) < 0) @@ -682,7 +682,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) { H5_FAILED(); - puts(" Got allocated space instead of unallocated."); + HDputs(" Got allocated space instead of unallocated."); HDprintf(" Got %d\n", allocation); goto error; } @@ -694,12 +694,12 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (alloc_time != H5D_ALLOC_TIME_LATE) { H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); + HDputs(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); HDprintf(" Got %d\n", alloc_time); } if (fill_time != H5D_FILL_TIME_NEVER) { H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_NEVER fill value write time."); + HDputs(" Got non-H5D_FILL_TIME_NEVER fill value write time."); HDprintf(" Got %d\n", fill_time); } if (H5Dclose(dset4) < 0) @@ -717,7 +717,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if (!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 || rd_c.z != '\0') { H5_FAILED(); - puts(" Got wrong fill value"); + HDputs(" Got wrong fill value"); HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); } @@ -746,14 +746,14 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); + HDputs(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); HDprintf(" Got %d\n", alloc_time); } if (H5Pget_fill_time(dcpl, &fill_time) < 0) goto error; if (fill_time != H5D_FILL_TIME_NEVER) { H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_NEVER fill value write time."); + HDputs(" Got non-H5D_FILL_TIME_NEVER fill value write time."); HDprintf(" Got %d\n", fill_time); } if (H5Dclose(dset5) < 0) @@ -786,14 +786,14 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; if (alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); - puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); + HDputs(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); HDprintf(" Got %d\n", alloc_time); } if (H5Pget_fill_time(dcpl, &fill_time) < 0) goto error; if (fill_time != H5D_FILL_TIME_ALLOC) { H5_FAILED(); - puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); + HDputs(" Got non-H5D_FILL_TIME_ALLOC fill value write time."); HDprintf(" Got %d\n", fill_time); } if (H5Dclose(dset6) < 0) @@ -811,7 +811,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if (!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 || rd_c.z != '\0') { H5_FAILED(); - puts(" Got wrong fill value"); + HDputs(" Got wrong fill value"); HDprintf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y, rd_c.x, rd_c.z); } @@ -1649,7 +1649,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, hsize_t *ch_si } /* end if */ else { /* Sanity check */ - assert(dtype_class == H5T_COMPOUND); + HDassert(dtype_class == H5T_COMPOUND); /* Initialize specific values for this datatype */ val_size = sizeof(comp_vl_datatype); @@ -1701,7 +1701,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, hsize_t *ch_si } /* end for */ /* Check for overflow */ - assert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size))); + HDassert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size))); /* Allocate & initialize buffer */ buf = HDmalloc((size_t)(nelmts * val_size)); @@ -2141,7 +2141,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) */ if (H5D_CONTIGUOUS == layout) { SKIPPED(); - puts(" Not implemented yet -- needs H5S_SELECT_DIFF operator"); + HDputs(" Not implemented yet -- needs H5S_SELECT_DIFF operator"); goto skip; } #endif @@ -2259,7 +2259,7 @@ test_compatible(void) goto error; if (dims[0] != 8 || dims[1] != 8) { H5_FAILED(); - puts(" Got a different dimension size than what was set."); + HDputs(" Got a different dimension size than what was set."); HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]); goto error; } @@ -2271,7 +2271,7 @@ test_compatible(void) goto error; if (val_rd != 0) { H5_FAILED(); - puts(" Got a different value than what was set."); + HDputs(" Got a different value than what was set."); HDprintf(" Got %ld, set 0\n", (long)val_rd); goto error; } @@ -2312,7 +2312,7 @@ test_compatible(void) goto error; if (dims[0] != 8 || dims[1] != 8) { H5_FAILED(); - puts(" Got a different dimension size than what was set."); + HDputs(" Got a different dimension size than what was set."); HDprintf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]); goto error; } @@ -2324,7 +2324,7 @@ test_compatible(void) goto error; if (val_rd != fill_val) { H5_FAILED(); - puts(" Got a different value than what was set."); + HDputs(" Got a different value than what was set."); HDprintf(" Got %ld, set %ld\n", (long)val_rd, (long)fill_val); goto error; } @@ -2659,11 +2659,11 @@ main(int argc, char *argv[]) if (argc >= 2) { test_contig = test_chunk = test_compact = 0; for (argno = 1; argno < argc; argno++) { - if (!strcmp(argv[argno], "contiguous")) + if (!HDstrcmp(argv[argno], "contiguous")) test_contig = 1; - else if (!strcmp(argv[argno], "chunked")) + else if (!HDstrcmp(argv[argno], "chunked")) test_chunk = 1; - else if (!strcmp(argv[argno], "compact")) + else if (!HDstrcmp(argv[argno], "compact")) test_compact = 1; else { HDfprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]); @@ -2693,11 +2693,11 @@ main(int argc, char *argv[]) /* Set the FAPL for the type of format */ if (new_format) { - puts("\nTesting with new file format:"); + HDputs("\nTesting with new file format:"); my_fapl = fapl2; } /* end if */ else { - puts("Testing with old file format:"); + HDputs("Testing with old file format:"); my_fapl = fapl; } /* end else */ diff --git a/test/filter_fail.c b/test/filter_fail.c index dca9a20..d7f784c 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -171,7 +171,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) H5E_END_TRY; if (ret >= 0) { H5_FAILED(); - puts(" Data writing is supposed to fail because the chunk can't be written to file."); + HDputs(" Data writing is supposed to fail because the chunk can't be written to file."); TEST_ERROR } } @@ -189,7 +189,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled) H5E_END_TRY; if (ret >= 0) { H5_FAILED(); - puts(" Dataset is supposed to fail because the chunk can't be flushed to file."); + HDputs(" Dataset is supposed to fail because the chunk can't be flushed to file."); TEST_ERROR } } diff --git a/test/filter_plugin.c b/test/filter_plugin.c index 7956ab3..cf2272c 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -463,7 +463,7 @@ test_dataset_write_with_filters(hid_t fid) /* Clean up objects used for this test */ if (H5Pclose(dcpl_id) < 0) TEST_ERROR; -#else /* H5_HAVE_FILTER_DEFLATE */ +#else /* H5_HAVE_FILTER_DEFLATE */ SKIPPED(); HDputs(" Deflate filter not enabled"); #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -649,7 +649,7 @@ test_dataset_read_with_filters(hid_t fid) if (H5Dclose(did) < 0) TEST_ERROR; -#else /* H5_HAVE_FILTER_DEFLATE */ +#else /* H5_HAVE_FILTER_DEFLATE */ SKIPPED(); HDputs(" Deflate filter not enabled"); #endif /* H5_HAVE_FILTER_DEFLATE */ diff --git a/test/flushrefreshTest.cmake b/test/flushrefreshTest.cmake index 6faf37b..e280b8b 100644 --- a/test/flushrefreshTest.cmake +++ b/test/flushrefreshTest.cmake @@ -41,7 +41,7 @@ endif () message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") if (TEST_LIBRARY_DIRECTORY) - if (WIN32 OR MINGW) + if (WIN32) set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") else () set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") diff --git a/test/gen_bad_ohdr.c b/test/gen_bad_ohdr.c index ca635a1..641beac 100644 --- a/test/gen_bad_ohdr.c +++ b/test/gen_bad_ohdr.c @@ -112,7 +112,7 @@ error: H5Fclose(fid); } H5E_END_TRY; -#else /* H5O_ENABLE_BAD_MESG_COUNT */ +#else /* H5O_ENABLE_BAD_MESG_COUNT */ HDputs("H5O_BAD_MESG_COUNT compiler macro not defined!"); #endif /* H5O_ENABLE_BAD_MESG_COUNT */ return 1; diff --git a/test/gen_bogus.c b/test/gen_bogus.c index b21adeb..ad85898 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -179,7 +179,7 @@ error: H5Fclose(fid); } H5E_END_TRY; -#else /* H5O_ENABLE_BOGUS */ +#else /* H5O_ENABLE_BOGUS */ HDputs("H5O_ENABLE_BOGUS compiler macro not defined!"); #endif /* H5O_ENABLE_BOGUS */ return 1; diff --git a/test/gen_cross.c b/test/gen_cross.c index 37c6dcf..28ddf54 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -925,10 +925,10 @@ create_deflate_dsets_float(hid_t fid, hid_t fsid, hid_t msid) if (H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_DEFLATE */ +#else /* H5_HAVE_FILTER_DEFLATE */ const char *not_supported = "Deflate filter is not enabled. Can't create the dataset."; - puts(not_supported); + HDputs(not_supported); #endif /* H5_HAVE_FILTER_DEFLATE */ return 0; @@ -1328,7 +1328,7 @@ main(void) /* Create a dataset of FLOAT with szip filter */ if (create_szip_dsets_float(file, filespace, memspace) < 0) TEST_ERROR; -#else /* H5_HAVE_FILTER_SZIP */ +#else /* H5_HAVE_FILTER_SZIP */ HDputs("Szip filter is not enabled. Can't create the dataset."); #endif /* H5_HAVE_FILTER_SZIP */ diff --git a/test/gen_filters.c b/test/gen_filters.c index 502e041..0d107a9 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -243,12 +243,12 @@ main(void) if (nerrors) goto error; - printf("All tests passed.\n"); + HDprintf("All tests passed.\n"); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d GEN_FILTERS FAILURES *****\n", nerrors); + HDprintf("***** %d GEN_FILTERS FAILURES *****\n", nerrors); return 1; } diff --git a/test/getname.c b/test/getname.c index 61feee6..0cf9768 100644 --- a/test/getname.c +++ b/test/getname.c @@ -3787,7 +3787,7 @@ main(void) if (nerrors) goto error; - puts("All getname tests passed."); + HDputs("All getname tests passed."); h5_cleanup(FILENAME, fapl); @@ -3797,7 +3797,7 @@ error: H5E_BEGIN_TRY { H5Fclose(file_id); } H5E_END_TRY; - puts("***** GET NAME TESTS FAILED *****"); + HDputs("***** GET NAME TESTS FAILED *****"); return 1; } diff --git a/test/gheap.c b/test/gheap.c index 51e1dd2..1a8a4c0 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -42,9 +42,9 @@ nerrors++; \ if (nerrors <= GHEAP_REPEATED_ERR_LIM) { \ H5_FAILED(); \ - puts(MSG); \ + HDputs(MSG); \ if (nerrors == GHEAP_REPEATED_ERR_LIM) \ - puts(" Suppressing further errors..."); \ + HDputs(" Suppressing further errors..."); \ } /* end if */ \ } /* end GHEAP_REPEATED_ERR */ @@ -226,7 +226,7 @@ test_2(hid_t fapl) HDputs(" Unable to read object"); nerrors++; } - else if (memcmp(in, out, size)) { + else if (HDmemcmp(in, out, size)) { H5_FAILED(); HDputs(" Value read doesn't match value written"); nerrors++; diff --git a/test/hdfs.c b/test/hdfs.c index ee66314..a59cdb6 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -303,7 +303,7 @@ *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(expected, actual, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -348,7 +348,7 @@ *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(actual, expected, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -414,8 +414,8 @@ test_fapl_config_validation(void) #ifndef H5_HAVE_LIBHDFS TESTING("HDFS fapl configuration validation"); SKIPPED(); - puts(" HDFS VFD is not enabled"); - fflush(stdout); + HDputs(" HDFS VFD is not enabled"); + HDfflush(stdout); return 0; #else @@ -564,9 +564,9 @@ test_fapl_config_validation(void) JSVERIFY(config.version, fa_fetch.version, "version number mismatch") JSVERIFY(config.namenode_port, fa_fetch.namenode_port, "namenode port mismatch") JSVERIFY(config.stream_buffer_size, fa_fetch.stream_buffer_size, "streambuffer size mismatch") - JSVERIFY_STR(config.namenode_name, fa_fetch.namenode_name, NULL) - JSVERIFY_STR(config.user_name, fa_fetch.user_name, NULL) - JSVERIFY_STR(config.kerberos_ticket_cache, fa_fetch.kerberos_ticket_cache, NULL) + JSVERIFY_STR(config.namenode_name, fa_fetch.namenode_name, "node name mismatch") + JSVERIFY_STR(config.user_name, fa_fetch.user_name, "user name mismatch") + JSVERIFY_STR(config.kerberos_ticket_cache, fa_fetch.kerberos_ticket_cache, "kerberos ticket cache mismatch") } /*----------------------------- @@ -620,8 +620,8 @@ test_hdfs_fapl(void) #ifndef H5_HAVE_LIBHDFS TESTING("HDFS fapl "); SKIPPED(); - puts(" HDFS VFD is not enabled"); - fflush(stdout); + HDputs(" HDFS VFD is not enabled"); + HDfflush(stdout); return 0; #else @@ -703,8 +703,8 @@ test_vfd_open(void) #ifndef H5_HAVE_LIBHDFS TESTING("HDFS VFD-level open"); SKIPPED(); - puts(" HDFS VFD is not enabled"); - fflush(stdout); + HDputs(" HDFS VFD is not enabled"); + HDfflush(stdout); return 0; #else @@ -956,8 +956,8 @@ test_eof_eoa(void) #ifndef H5_HAVE_LIBHDFS TESTING("HDFS eof/eoa gets and sets"); SKIPPED(); - puts(" HDFS VFD is not enabled"); - fflush(stdout); + HDputs(" HDFS VFD is not enabled"); + HDfflush(stdout); return 0; #else @@ -996,7 +996,7 @@ test_eof_eoa(void) /* verify as found */ - JSVERIFY(5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), NULL) + JSVERIFY(5458199, H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), "EOF mismatch") JSVERIFY(H5FDget_eof(fd_shakespeare, H5FD_MEM_DEFAULT), H5FDget_eof(fd_shakespeare, H5FD_MEM_DRAW), "mismatch between DEFAULT and RAW memory types") JSVERIFY(0, H5FDget_eoa(fd_shakespeare, H5FD_MEM_DEFAULT), "EoA should be unset by H5FDopen") @@ -1066,8 +1066,8 @@ test_H5FDread_without_eoa_set_fails(void) #ifndef H5_HAVE_LIBHDFS TESTING("HDFS VFD read-eoa temporal coupling library limitation"); SKIPPED(); - puts(" HDFS VFD is not enabled"); - fflush(stdout); + HDputs(" HDFS VFD is not enabled"); + HDfflush(stdout); return 0; #else @@ -1165,8 +1165,8 @@ test_read(void) #ifndef H5_HAVE_LIBHDFS TESTING("HDFS VFD read/range-gets"); SKIPPED(); - puts(" HDFS VFD is not enabled"); - fflush(stdout); + HDputs(" HDFS VFD is not enabled"); + HDfflush(stdout); return 0; #else @@ -1272,7 +1272,7 @@ test_read(void) HADDR_UNDEF); /* Demonstrate success with "automatic" value */ FAIL_IF(NULL == file_raven) - JSVERIFY(6464, H5FDget_eof(file_raven, H5FD_MEM_DEFAULT), NULL) + JSVERIFY(6464, H5FDget_eof(file_raven, H5FD_MEM_DEFAULT), "EOF mismatch") /********* * TESTS * @@ -1376,8 +1376,8 @@ test_noops_and_autofails(void) #ifndef H5_HAVE_LIBHDFS TESTING("HDFS VFD always-fail and no-op routines"); SKIPPED(); - puts(" HDFS VFD is not enabled"); - fflush(stdout); + HDputs(" HDFS VFD is not enabled"); + HDfflush(stdout); return 0; #else @@ -1432,8 +1432,8 @@ test_noops_and_autofails(void) /* no-op calls to `lock()` and `unlock()` */ JSVERIFY(SUCCEED, H5FDlock(file, TRUE), "lock always succeeds; has no effect") - JSVERIFY(SUCCEED, H5FDlock(file, FALSE), NULL) - JSVERIFY(SUCCEED, H5FDunlock(file), NULL) + JSVERIFY(SUCCEED, H5FDlock(file, FALSE), "lock issue") + JSVERIFY(SUCCEED, H5FDunlock(file), "unlock issue") /* Lock/unlock with null file or similar error crashes tests. * HDassert in calling heirarchy, `H5FD[un]lock()` and `H5FD_[un]lock()` */ @@ -1528,8 +1528,8 @@ test_H5F_integration(void) #ifndef H5_HAVE_LIBHDFS TESTING("HDFS file access through HD5F library (H5F API)"); SKIPPED(); - puts(" HDFS VFD is not enabled"); - fflush(stdout); + HDputs(" HDFS VFD is not enabled"); + HDfflush(stdout); return 0; #else @@ -1597,7 +1597,7 @@ error: #if HDFS_TEST_DEBUG HDprintf("\nerror!"); - fflush(stdout); + HDfflush(stdout); #endif /* HDFS_TEST_DEBUG */ if (fapl_id >= 0) { diff --git a/test/hyperslab.c b/test/hyperslab.c index 43992de..5c7b78f 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -177,7 +177,7 @@ test_fill(size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_t dk, size } /* end else */ HDsprintf(s, "Testing hyperslab fill %-11s variable hyperslab", dim); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* Allocate array */ if (NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz))) @@ -366,7 +366,7 @@ test_copy(int mode, size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_ HDsprintf(s, "Testing hyperslab copy %-11s %s", dim, sub); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* * Allocate arrays @@ -575,7 +575,7 @@ test_multifill(size_t nx) hsize_t i, j; HDprintf("%-70s", "Testing multi-byte fill value"); - fflush(stdout); + HDfflush(stdout); /* Initialize the source and destination */ if (NULL == (src = (struct a_struct *)HDmalloc(nx * sizeof(*src)))) @@ -687,7 +687,7 @@ test_endian(size_t nx) hsize_t i, j; HDprintf("%-70s", "Testing endian conversion by stride"); - fflush(stdout); + HDfflush(stdout); /* Initialize arrays */ if (NULL == (src = (uint8_t *)HDmalloc(nx * 4))) @@ -773,7 +773,7 @@ test_transpose(size_t nx, size_t ny) HDsprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, (unsigned long)ny); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* Initialize */ if (NULL == (src = (int *)HDmalloc(nx * ny * sizeof(*src)))) @@ -872,7 +872,7 @@ test_sub_super(size_t nx, size_t ny) HDsprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx), (unsigned long)(2 * ny), (unsigned long)nx, (unsigned long)ny); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* Initialize */ if (NULL == (full = (uint8_t *)HDmalloc(4 * nx * ny))) @@ -922,7 +922,7 @@ test_sub_super(size_t nx, size_t ny) HDsprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)nx, (unsigned long)ny, (unsigned long)(2 * nx), (unsigned long)(2 * ny)); HDprintf("%-70s", s); - fflush(stdout); + HDfflush(stdout); /* Setup stride */ size[0] = nx; diff --git a/test/istore.c b/test/istore.c index a724359..c600c31 100644 --- a/test/istore.c +++ b/test/istore.c @@ -619,13 +619,13 @@ main(int argc, char *argv[]) else { int i; for (i = 1, size_of_test = 0; i < argc; i++) { - if (!strcmp(argv[i], "small")) { + if (!HDstrcmp(argv[i], "small")) { size_of_test |= TEST_SMALL; } - else if (!strcmp(argv[i], "medium")) { + else if (!HDstrcmp(argv[i], "medium")) { size_of_test |= TEST_MEDIUM; } - else if (!strcmp(argv[i], "large")) { + else if (!HDstrcmp(argv[i], "large")) { size_of_test |= TEST_LARGE; } else { diff --git a/test/lheap.c b/test/lheap.c index 17e3082..27e025e 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, strlen(buf) + 1, buf))) { + if (UFAIL == (obj[i] = H5HL_insert(f, heap, HDstrlen(buf) + 1, buf))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -155,7 +155,7 @@ main(void) goto error; } - if (strcmp(s, buf)) { + if (HDstrcmp(s, buf)) { H5_FAILED(); HDprintf(" i=%d, heap offset=%lu\n", i, (unsigned long)(obj[i])); HDprintf(" got: \"%s\"\n", s); diff --git a/test/links.c b/test/links.c index 43cd83d..055e1dc 100644 --- a/test/links.c +++ b/test/links.c @@ -12316,7 +12316,7 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) char * tmpname = NULL; char * cwdpath = NULL; hbool_t have_posix_compat_vfd; /* Whether VFD used is compatible w/POSIX I/O calls */ -#endif /* H5_HAVE_SYMLINK */ +#endif /* H5_HAVE_SYMLINK */ if (new_format) TESTING("external links w/symlink files (w/new group format)") @@ -12570,7 +12570,7 @@ error: return FAIL; -#else /* H5_HAVE_SYMLINK */ +#else /* H5_HAVE_SYMLINK */ SKIPPED(); HDputs(" Current file system or operating system doesn't support symbolic links"); @@ -14138,7 +14138,7 @@ 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) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR if (HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR @@ -14165,7 +14165,7 @@ 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) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) + if (HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR if (HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR @@ -14537,7 +14537,7 @@ lapl_udata(hid_t fapl, hbool_t new_format) TEST_ERROR /* Now use the same ud link to access group_b */ - strcpy(group_b_name, "group_b"); + HDstrcpy(group_b_name, "group_b"); if (H5Pset(plist_id, DEST_PROP_NAME, group_b_name) < 0) TEST_ERROR @@ -14851,7 +14851,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) H5E_END_TRY; /* Create a user-defined link to the group. */ - strcpy(group_name, "/group"); + HDstrcpy(group_name, "/group"); if (H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, &group_name, HDstrlen(group_name) + 1, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -19183,7 +19183,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u hsize_t skip; /* # of links to skip in group */ #ifndef H5_NO_DEPRECATED_SYMBOLS int gskip; /* # of links to skip in group, with H5Giterate */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ herr_t ret; /* Generic return value */ /* Iterate over links in group */ @@ -19291,7 +19291,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u if (nvisit != (max_links / 2)) TEST_ERROR - } /* end else */ + } /* end else */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Iterate over links in group, stopping in the middle */ @@ -19671,7 +19671,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links hsize_t skip; /* # of links to skip in group */ #ifndef H5_NO_DEPRECATED_SYMBOLS int gskip; /* # of links to skip in group, with H5Giterate */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ herr_t ret; /* Generic return value */ /* Iterate over links in group */ @@ -19779,7 +19779,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links if (nvisit != (max_links / 2)) TEST_ERROR - } /* end else */ + } /* end else */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Iterate over links in group, stopping in the middle */ @@ -22502,12 +22502,12 @@ main(void) nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */ #ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += ud_hard_links_deprec(fapl2) < 0 ? 1 : 0; /* requires new format groups */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */ #ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += ud_link_reregister_deprec(fapl2) < 0 ? 1 : 0; /* requires new format groups */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - } /* end if */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + } /* end if */ nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0; #ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += ud_callbacks_deprec(my_fapl, new_format) < 0 ? 1 : 0; diff --git a/test/links_env.c b/test/links_env.c index 0e5d1c0..2cfa3fa 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -112,7 +112,7 @@ external_link_env(hid_t fapl, hbool_t new_format) /* Should be able to find the target file from pathnames set via HDF5_EXT_PREFIX */ if (gid < 0) { H5_FAILED(); - puts(" Should have found the file in tmp_links_env directory."); + HDputs(" Should have found the file in tmp_links_env directory."); goto error; } @@ -6112,7 +6112,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - free(memb_name[mt]); + HDfree(memb_name[mt]); } /* end else */ /* Close memb_fapl */ @@ -7685,7 +7685,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - free(memb_name[mt]); + HDfree(memb_name[mt]); return 0; @@ -8841,7 +8841,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - free(memb_name[mt]); + HDfree(memb_name[mt]); /* Close memb_fapl */ if (H5Pclose(memb_fapl) < 0) diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 325999b..43141e0 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -63,8 +63,8 @@ static unsigned int g_verbosity = DEFAULT_VERBOSITY; #define LOGPRINT(lvl, ...) \ do { \ if ((lvl) <= g_verbosity) { \ - fprintf(g_log_stream, __VA_ARGS__); \ - fflush(g_log_stream); \ + HDfprintf(g_log_stream, __VA_ARGS__); \ + HDfflush(g_log_stream); \ } \ } while (0) @@ -150,7 +150,7 @@ _populate_filepath(const char *dirname, const char *_basename, hid_t fapl_id, ch } if (HDsnprintf(_path, H5FD_SPLITTER_PATH_MAX, "%s%s%s", dirname, - (dirname[strlen(dirname)] == '/') ? "" : "/", /* slash iff needed */ + (dirname[HDstrlen(dirname)] == '/') ? "" : "/", /* slash iff needed */ _basename) > H5FD_SPLITTER_PATH_MAX) { TEST_ERROR; } diff --git a/test/mount.c b/test/mount.c index 395a19a..5d345a8 100644 --- a/test/mount.c +++ b/test/mount.c @@ -1194,7 +1194,7 @@ test_interlink(hid_t fapl) FAIL_STACK_ERROR if (H5Tclose(type) < 0) FAIL_STACK_ERROR -#else /* NOT_NOW */ +#else /* NOT_NOW */ SKIPPED(); HDputs(" Test skipped due file pointer sharing issue (Jira 7638)."); #endif /* NOT_NOW */ diff --git a/test/mtime.c b/test/mtime.c index c28b81a..a8ad6ae 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -147,7 +147,7 @@ main(void) H5_FAILED(); /* If this fails, examine H5Omtime.c. Modification time is very * system dependent (e.g., on Windows DST must be hardcoded). */ - puts(" Old modification time incorrect"); + HDputs(" Old modification time incorrect"); goto error; } if (H5Fclose(file) < 0) diff --git a/test/objcopy.c b/test/objcopy.c index 383bd05..31744af 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -4494,8 +4494,8 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid #ifndef H5_HAVE_FILTER_DEFLATE SKIPPED(); - puts(" Deflation filter not available"); -#else /* H5_HAVE_FILTER_DEFLATE */ + HDputs(" Deflation filter not available"); +#else /* H5_HAVE_FILTER_DEFLATE */ /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) for (j = 0; j < DIM_SIZE_2; j++) @@ -4919,8 +4919,8 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h #ifndef H5_HAVE_FILTER_DEFLATE SKIPPED(); - puts(" Deflation filter not available"); -#else /* H5_HAVE_FILTER_DEFLATE */ + HDputs(" Deflation filter not available"); +#else /* H5_HAVE_FILTER_DEFLATE */ /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) for (j = 0; j < DIM_SIZE_2; j++) @@ -7273,8 +7273,8 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, #ifndef H5_HAVE_FILTER_DEFLATE SKIPPED(); - puts(" Deflation filter not available"); -#else /* H5_HAVE_FILTER_DEFLATE */ + HDputs(" Deflation filter not available"); +#else /* H5_HAVE_FILTER_DEFLATE */ /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { for (j = 0; j < DIM_SIZE_2; j++) { diff --git a/test/page_buffer.c b/test/page_buffer.c index ca33872..abbae32 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -349,7 +349,7 @@ set_multi_split(const char *env_h5_drvr, hid_t fapl, hsize_t pagesize) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - free(memb_name[mt]); + HDfree(memb_name[mt]); } /* end if */ diff --git a/test/pool.c b/test/pool.c index 05304e5..ef2a627 100644 --- a/test/pool.c +++ b/test/pool.c @@ -784,11 +784,11 @@ main(void) if (nerrors) goto error; - puts("All memory pool tests passed."); + HDputs("All memory pool tests passed."); return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); return 1; } diff --git a/test/ros3.c b/test/ros3.c index 7ecba0e..654082b 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -318,7 +318,7 @@ jserr_str(const char *expected, const char *actual, const char *reason) *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(expected, actual, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -363,7 +363,7 @@ jserr_str(const char *expected, const char *actual, const char *reason) *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(actual, expected, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -560,8 +560,8 @@ test_fapl_config_validation(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -835,8 +835,8 @@ test_vfd_open(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -969,15 +969,15 @@ test_eof_eoa(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1077,15 +1077,15 @@ test_H5FDread_without_eoa_set_fails(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1248,15 +1248,15 @@ test_read(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1389,8 +1389,8 @@ test_noops_and_autofails(void) if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1515,15 +1515,15 @@ test_cmp(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1636,15 +1636,15 @@ test_H5F_integration(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1691,7 +1691,7 @@ error: * CLEANUP * ***********/ HDprintf("\nerror!"); - fflush(stdout); + HDfflush(stdout); if (fapl_id >= 0) { H5E_BEGIN_TRY { (void)H5Pclose(fapl_id); } diff --git a/test/s3comms.c b/test/s3comms.c index 862914e..f3e96b5 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -291,7 +291,7 @@ jserr_str(const char *expected, const char *actual, const char *reason) if ((long)(actual) == (long)(expected)) { \ JSERR_LONG((expected), (actual), (reason)) \ goto error; \ - } /* JSVERIFY_NOT */ + } /* JSVERIFY_NOT */ #endif /* JSVERIFY_NOT unused */ /*---------------------------------------------------------------------------- @@ -311,7 +311,7 @@ jserr_str(const char *expected, const char *actual, const char *reason) *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(expected, actual, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -348,7 +348,7 @@ jserr_str(const char *expected, const char *actual, const char *reason) if ((long)(actual) == (long)(expected)) { \ JSERR_LONG((expected), (actual), (reason)) \ goto error; \ - } /* JSVERIFY_NOT */ + } /* JSVERIFY_NOT */ #endif /* JSVERIFY_NOT unused */ /*---------------------------------------------------------------------------- @@ -359,7 +359,7 @@ jserr_str(const char *expected, const char *actual, const char *reason) *---------------------------------------------------------------------------- */ #define JSVERIFY_STR(actual, expected, reason) \ - if (strcmp((actual), (expected)) != 0) { \ + if (HDstrcmp((actual), (expected)) != 0) { \ JSERR_STR((expected), (actual), (reason)); \ goto error; \ } /* JSVERIFY_STR */ @@ -1281,29 +1281,29 @@ test_HMAC_SHA256(void) cases[i].msg); if (cases[i].ret == SUCCEED) { #ifdef VERBOSE - if (0 != strncmp(cases[i].exp, dest, HDstrlen(cases[i].exp))) { + if (0 != HDstrncmp(cases[i].exp, dest, HDstrlen(cases[i].exp))) { /* print out how wrong things are, and then fail */ - dest = (char *)realloc(dest, cases[i].dest_size + 1); + dest = (char *)HDrealloc(dest, cases[i].dest_size + 1); HDassert(dest != NULL); dest[cases[i].dest_size] = 0; HDfprintf(stdout, "ERROR:\n!!! \"%s\"\n != \"%s\"\n", cases[i].exp, dest); TEST_ERROR; } -#else /* VERBOSE not defined */ +#else /* VERBOSE not defined */ /* simple pass/fail test */ - JSVERIFY(0, strncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)), NULL); + JSVERIFY(0, HDstrncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)), NULL); #endif /* VERBOSE */ } - free(dest); + HDfree(dest); } PASSED(); return 0; error: - free(dest); + HDfree(dest); return -1; } /* end test_HMAC_SHA256() */ @@ -1369,9 +1369,9 @@ test_nlowercase(void) JSVERIFY(SUCCEED, H5FD_s3comms_nlowercase(dest, cases[i].in, cases[i].len), cases[i].in) if (cases[i].len > 0) { - JSVERIFY(0, strncmp(dest, cases[i].exp, cases[i].len), NULL) + JSVERIFY(0, HDstrncmp(dest, cases[i].exp, cases[i].len), NULL) } - free(dest); + HDfree(dest); } /* end for each testcase */ JSVERIFY(FAIL, H5FD_s3comms_nlowercase(NULL, cases[0].in, cases[0].len), "null distination should fail") @@ -1380,7 +1380,7 @@ test_nlowercase(void) return 0; error: - free(dest); + HDfree(dest); return -1; } /* end test_nlowercase() */ @@ -1741,7 +1741,7 @@ test_percent_encode_char(void) JSVERIFY(SUCCEED, H5FD_s3comms_percent_encode_char(dest, (const unsigned char)cases[i].c, &dest_len), NULL) JSVERIFY(cases[i].exp_len, dest_len, NULL) - JSVERIFY(0, strncmp(dest, cases[i].exp, dest_len), NULL) + JSVERIFY(0, HDstrncmp(dest, cases[i].exp, dest_len), NULL) JSVERIFY_STR(cases[i].exp, dest, NULL) } @@ -1780,8 +1780,8 @@ test_s3r_get_filesize(void) */ if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1840,14 +1840,14 @@ test_s3r_open(void) if (s3_test_credentials_loaded == 0) { SKIPPED(); - puts(" s3 credentials are not loaded"); - fflush(stdout); + HDputs(" s3 credentials are not loaded"); + HDfflush(stdout); return 0; } if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -1873,7 +1873,7 @@ test_s3r_open(void) FAIL_IF(purl->port == NULL); FAIL_IF(5 < HDsnprintf(purl->port, 5, "9000")) } - else if (strcmp(purl->port, "9000") != 0) { + else if (HDstrcmp(purl->port, "9000") != 0) { FAIL_IF(5 < HDsnprintf(purl->port, 5, "9000")) } else { @@ -2044,8 +2044,8 @@ test_s3r_read(void) */ if (FALSE == s3_test_bucket_defined) { SKIPPED(); - puts(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); - fflush(stdout); + HDputs(" environment variable HDF5_ROS3_TEST_BUCKET_URL not defined"); + HDfflush(stdout); return 0; } @@ -2105,7 +2105,7 @@ test_s3r_read(void) JSVERIFY(SUCCEED, H5FD_s3comms_s3r_read(handle, (haddr_t)6370, (size_t)0, buffer), NULL) JSVERIFY( 0, - strncmp( + HDstrncmp( buffer, "And my soul from out that shadow that lies floating on the floor\nShall be lifted—nevermore!\n", 94), @@ -2122,7 +2122,7 @@ test_s3r_read(void) H5FD_s3comms_s3r_read(handle, (haddr_t)6400, (size_t)100, /* 6400+100 > 6464 */ buffer), NULL) - JSVERIFY(0, strcmp("", buffer), NULL) + JSVERIFY(0, HDstrcmp("", buffer), NULL) /************************ * read starts past eof * @@ -2132,14 +2132,14 @@ test_s3r_read(void) H5FD_s3comms_s3r_read(handle, (haddr_t)1200699, /* 1200699 > 6464 */ (size_t)100, buffer), NULL) - JSVERIFY(0, strcmp("", buffer), NULL) + JSVERIFY(0, HDstrcmp("", buffer), NULL) /********************** * read starts on eof * **********************/ JSVERIFY(FAIL, H5FD_s3comms_s3r_read(handle, (haddr_t)6464, (size_t)0, buffer), NULL) - JSVERIFY(0, strcmp("", buffer), NULL) + JSVERIFY(0, HDstrcmp("", buffer), NULL) /************* * TEAR DOWN * @@ -2229,10 +2229,10 @@ test_signing_key(void) JSVERIFY(SUCCEED, H5FD_s3comms_signing_key(key, cases[i].secret_key, cases[i].region, cases[i].when), NULL) - JSVERIFY(0, strncmp((const char *)cases[i].exp, (const char *)key, SHA256_DIGEST_LENGTH), + JSVERIFY(0, HDstrncmp((const char *)cases[i].exp, (const char *)key, SHA256_DIGEST_LENGTH), (const char *)cases[i].exp) - free(key); + HDfree(key); key = NULL; } @@ -2255,7 +2255,7 @@ test_signing_key(void) JSVERIFY(FAIL, H5FD_s3comms_signing_key(key, cases[0].secret_key, cases[0].region, NULL), "time string cannot be NULL") - free(key); + HDfree(key); key = NULL; PASSED(); @@ -2263,7 +2263,7 @@ test_signing_key(void) error: if (key != NULL) { - free(key); + HDfree(key); } return -1; @@ -2411,9 +2411,9 @@ test_trim(void) JSVERIFY(SUCCEED, H5FD_s3comms_trim(dest, str, cases[i].in_len, &dest_len), NULL) JSVERIFY(cases[i].exp_len, dest_len, cases[i].in) if (dest_len > 0) { - JSVERIFY(0, strncmp(cases[i].exp, dest, dest_len), cases[i].exp) + JSVERIFY(0, HDstrncmp(cases[i].exp, dest, dest_len), cases[i].exp) } - free(str); + HDfree(str); str = NULL; } /* end for each testcase */ @@ -2424,9 +2424,9 @@ test_trim(void) HDassert(str == NULL); str = (char *)HDmalloc(sizeof(char *) * 11); HDassert(str != NULL); - memcpy(str, "some text ", 11); /* string with null terminator */ + HDmemcpy(str, "some text ", 11); /* string with null terminator */ JSVERIFY(FAIL, H5FD_s3comms_trim(NULL, str, 10, &dest_len), "destination for trim cannot be NULL"); - free(str); + HDfree(str); str = NULL; PASSED(); @@ -2434,7 +2434,7 @@ test_trim(void) error: if (str != NULL) { - free(str); + HDfree(str); } return -1; @@ -2525,9 +2525,9 @@ test_uriencode(void) H5FD_s3comms_uriencode(dest, cases[i].str, str_len, cases[i].encode_slash, &dest_written), NULL); JSVERIFY(HDstrlen(cases[i].expected), dest_written, NULL) - JSVERIFY(0, strncmp(dest, cases[i].expected, dest_written), cases[i].expected); + JSVERIFY(0, HDstrncmp(dest, cases[i].expected, dest_written), cases[i].expected); - free(dest); + HDfree(dest); dest = NULL; } /* end for each testcase */ @@ -2543,7 +2543,7 @@ test_uriencode(void) JSVERIFY(FAIL, H5FD_s3comms_uriencode(dest, NULL, 5, false, &dest_written), "source string cannot be NULL"); - free(dest); + HDfree(dest); dest = NULL; PASSED(); @@ -2551,7 +2551,7 @@ test_uriencode(void) error: if (dest != NULL) { - free(dest); + HDfree(dest); } return -1; diff --git a/test/set_extent.c b/test/set_extent.c index 133ba48..672d5ff 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -243,11 +243,11 @@ do_ranks(hid_t fapl, hbool_t new_format) #ifdef H5_HAVE_FILTER_DEFLATE if (H5Pset_deflate(dcpl, 9) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_DEFLATE */ +#else /* H5_HAVE_FILTER_DEFLATE */ if (H5Pclose(dcpl) < 0) TEST_ERROR continue; -#endif /* H5_HAVE_FILTER_DEFLATE */ +#endif /* H5_HAVE_FILTER_DEFLATE */ } /* end if */ if (config & CONFIG_FILL) { @@ -2621,7 +2621,7 @@ test_random_rank4_vl(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disab TEST_ERROR if (H5Treclaim(type, mspace, H5P_DEFAULT, wbuf) < 0) TEST_ERROR - free(fill_value.p); + HDfree(fill_value.p); if (H5Sclose(mspace) < 0) TEST_ERROR if (H5Pclose(my_dcpl) < 0) diff --git a/test/stab.c b/test/stab.c index 739a1ba..e68c000 100644 --- a/test/stab.c +++ b/test/stab.c @@ -1271,7 +1271,7 @@ old_api(hid_t fapl) TEST_ERROR PASSED(); -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ /* Shut compiler up */ fapl = fapl; diff --git a/test/swmr.c b/test/swmr.c index 61d312b..ded0115 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -2351,7 +2351,7 @@ test_start_swmr_write_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t H5_ATTR_UNUSE return 0; } /* test_start_swmr_write_concur() */ -#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */ +#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */ static int test_start_swmr_write_concur(hid_t in_fapl, hbool_t new_format) @@ -6508,7 +6508,7 @@ test_refresh_concur(hid_t H5_ATTR_UNUSED in_fapl, hbool_t H5_ATTR_UNUSED new_for return 0; } /* test_refresh_concur() */ -#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */ +#else /* defined(H5_HAVE_FORK && defined(H5_HAVE_WAITPID) */ static int test_refresh_concur(hid_t in_fapl, hbool_t new_format) diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 9017793..1700ece 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -122,7 +122,7 @@ check_dataset(hid_t fid, unsigned verbose, const char *sym_name, symbol_t *recor * not work with SWMR currently (see note in swmr_generator.c), we * simply initialize rec_id to 0. */ record->rec_id = (uint64_t)ULLONG_MAX - 1; -#else /* FILLVAL_WORKS */ +#else /* FILLVAL_WORKS */ record->rec_id = (uint64_t)0; #endif /* FILLVAL_WORKS */ if (H5Dread(dsid, symbol_tid, rec_sid, file_sid, H5P_DEFAULT, record) < 0) diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index 4706b7a..14eef3d 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -150,7 +150,7 @@ add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long f unsigned long rec_to_flush; /* # of records left to write before flush */ #ifdef OUT volatile int dummy; /* Dummy varialbe for busy sleep */ -#endif /* OUT */ +#endif /* OUT */ hsize_t dim[2] = {1, 0}; /* Dataspace dimensions */ unsigned long u, v; /* Local index variables */ diff --git a/test/tarray.c b/test/tarray.c index ba0982f..d278f51 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -2222,5 +2222,5 @@ test_array(void) void cleanup_array(void) { - remove(FILENAME); + HDremove(FILENAME); } /* end cleanup_array() */ diff --git a/test/tattr.c b/test/tattr.c index 7bc215d..ad669a1 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -5436,7 +5436,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) #ifdef LATER h5_stat_size_t empty_size; /* Size of empty file */ h5_stat_size_t file_size; /* Size of file after operating on it */ -#endif /* LATER */ +#endif /* LATER */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ herr_t ret; /* Generic return value */ @@ -5602,7 +5602,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) CHECK(file_size, FAIL, "h5_get_file_size"); VERIFY(file_size, empty_size, "h5_get_file_size"); #endif /* LATER */ - } /* end for */ + } /* end for */ /* Close property list */ ret = H5Pclose(dcpl); @@ -6862,7 +6862,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx hsize_t skip; /* # of attributes to skip on object */ #ifndef H5_NO_DEPRECATED_SYMBOLS unsigned oskip; /* # of attributes to skip on object, with H5Aiterate1 */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ int old_nerrs; /* Number of errors when entering this check */ herr_t ret; /* Generic return value */ @@ -7054,7 +7054,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx nvisit++; VERIFY(skip, (max_attrs / 2), "H5Aiterate1"); - } /* end else */ + } /* end else */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Iterate over attributes on object, stopping in the middle */ diff --git a/test/tcoords.c b/test/tcoords.c index e92bdde..a52851d 100644 --- a/test/tcoords.c +++ b/test/tcoords.c @@ -87,10 +87,10 @@ test_singleEnd_selElements(hid_t file, hbool_t is_chunked) } /* Construct dataset's name */ - memset(dset_name, 0, (size_t)NAME_LEN); - strcat(dset_name, SINGLE_END_DSET); + HDmemset(dset_name, 0, (size_t)NAME_LEN); + HDstrcat(dset_name, SINGLE_END_DSET); if (is_chunked) - strcat(dset_name, "_chunked"); + HDstrcat(dset_name, "_chunked"); did = H5Dcreate2(file, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT); CHECK(did, FAIL, "H5Dcreate2"); @@ -259,10 +259,10 @@ test_singleEnd_selHyperslab(hid_t file, hbool_t is_chunked) hsize_t mem3_block[4] = {1, 3, 6, 1}; /* Construct dataset's name */ - memset(dset_name, 0, NAME_LEN); - strcat(dset_name, SINGLE_END_DSET); + HDmemset(dset_name, 0, NAME_LEN); + HDstrcat(dset_name, SINGLE_END_DSET); if (is_chunked) - strcat(dset_name, "_chunked"); + HDstrcat(dset_name, "_chunked"); /* Dataspace for the dataset in file */ sid = H5Screate_simple(4, da_dims, da_dims); @@ -436,10 +436,10 @@ test_multiple_ends(hid_t file, hbool_t is_chunked) } /* Construct dataset's name */ - memset(dset_name, 0, NAME_LEN); - strcat(dset_name, MULTI_ENDS_SEL_HYPER_DSET); + HDmemset(dset_name, 0, NAME_LEN); + HDstrcat(dset_name, MULTI_ENDS_SEL_HYPER_DSET); if (is_chunked) - strcat(dset_name, "_chunked"); + HDstrcat(dset_name, "_chunked"); did = H5Dcreate2(file, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, plid, H5P_DEFAULT); CHECK(did, FAIL, "H5Dcreate2"); @@ -687,5 +687,5 @@ test_coords(void) void cleanup_coords(void) { - remove(FILENAME); + HDremove(FILENAME); } diff --git a/test/testframe.c b/test/testframe.c index 22f694e..bf6a0e8 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -442,15 +442,15 @@ GetTestExpress(void) /* set it here for now. Should be done in something like h5test_init(). */ if (TestExpress == -1) { - env_val = getenv("HDF5TestExpress"); + env_val = HDgetenv("HDF5TestExpress"); if (env_val == NULL) SetTestExpress(1); - else if (strcmp(env_val, "0") == 0) + else if (HDstrcmp(env_val, "0") == 0) SetTestExpress(0); - else if (strcmp(env_val, "1") == 0) + else if (HDstrcmp(env_val, "1") == 0) SetTestExpress(1); - else if (strcmp(env_val, "2") == 0) + else if (HDstrcmp(env_val, "2") == 0) SetTestExpress(2); else SetTestExpress(3); @@ -521,7 +521,7 @@ ParseTestVerbosity(char *argv) else if (*argv == 'h') SetTestVerbosity(VERBO_HI); else - SetTestVerbosity(atoi(argv)); + SetTestVerbosity(HDatoi(argv)); } /* diff --git a/test/testhdf5.c b/test/testhdf5.c index 152719a..ab79f28 100644 --- a/test/testhdf5.c +++ b/test/testhdf5.c @@ -82,7 +82,7 @@ main(int argc, char *argv[]) TestSummary(); /* Clean up test files, if allowed */ - if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) + if (GetTestCleanup() && !HDgetenv("HDF5_NOCLEANUP")) TestCleanup(); /* Release test infrastructure */ diff --git a/test/testmeta.c b/test/testmeta.c index fee1954..c3044a6 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -83,7 +83,7 @@ main(void) for (i = 0; i < NEXTARRAYS; i++) { /* Create dataset */ - sprintf(name, "/ExtArray%06d", i); + HDsprintf(name, "/ExtArray%06d", i); dataset_id = H5Dcreate2(file_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT); @@ -103,7 +103,7 @@ main(void) /* Removed print statement as it would lock system resources on Windows */ /* * HDprintf("\rWriting Object #%d of %d", j+1, NDATAOBJECTS); - * fflush(stdout); + * HDfflush(stdout); */ floatval = (float)j; diff --git a/test/tfile.c b/test/tfile.c index 2d42cc5..1b334f2 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -4195,7 +4195,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t split) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - free(memb_name[mt]); + HDfree(memb_name[mt]); return 0; @@ -7847,7 +7847,7 @@ test_file(void) #ifndef H5_NO_DEPRECATED_SYMBOLS test_file_ishdf5(env_h5_drvr); /* Test detecting HDF5 files correctly */ test_deprec(); /* Test deprecated routines */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ ret = H5Pclose(fapl_id); CHECK(ret, FAIL, "H5Pclose"); diff --git a/test/tgenprop.c b/test/tgenprop.c index 910153c..c1d9cac 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -2172,5 +2172,5 @@ test_genprop(void) void cleanup_genprop(void) { - remove(FILENAME); + HDremove(FILENAME); } diff --git a/test/th5o.c b/test/th5o.c index 8885eb4..c2409c1 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -1737,7 +1737,7 @@ test_h5o(void) test_h5o_open(); /* Test generic open function */ #ifndef H5_NO_DEPRECATED_SYMBOLS test_h5o_open_by_addr(); /* Test opening objects by address */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ test_h5o_open_by_token(); /* Test opening objects by token */ test_h5o_close(); /* Test generic close function */ test_h5o_refcount(); /* Test incrementing and decrementing reference count */ @@ -1767,5 +1767,5 @@ test_h5o(void) void cleanup_h5o(void) { - remove(TEST_FILENAME); + HDremove(TEST_FILENAME); } diff --git a/test/th5s.c b/test/th5s.c index 07cb0ab..04ac2e6 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1936,7 +1936,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) break; default: - assert(0); + HDassert(0); break; } @@ -3400,9 +3400,9 @@ test_h5s(void) void cleanup_h5s(void) { - remove(DATAFILE); - remove(NULLFILE); - remove(BASICFILE); - remove(ZEROFILE); - remove(VERBFNAME); + HDremove(DATAFILE); + HDremove(NULLFILE); + HDremove(BASICFILE); + HDremove(ZEROFILE); + HDremove(VERBFNAME); } diff --git a/test/thread_id.c b/test/thread_id.c index ce60893..e39b674 100644 --- a/test/thread_id.c +++ b/test/thread_id.c @@ -73,7 +73,7 @@ pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *at if (attr != NULL) return EINVAL; - memset(barrier, 0, sizeof(*barrier)); + HDmemset(barrier, 0, sizeof(*barrier)); barrier->count = count; @@ -96,7 +96,7 @@ barrier_lock(pthread_barrier_t *barrier) int rc; if ((rc = pthread_mutex_lock(&barrier->mtx)) != 0) { - my_errx(EXIT_FAILURE, "%s: pthread_mutex_lock: %s", __func__, strerror(rc)); + my_errx(EXIT_FAILURE, "%s: pthread_mutex_lock: %s", __func__, HDstrerror(rc)); } } @@ -106,7 +106,7 @@ barrier_unlock(pthread_barrier_t *barrier) int rc; if ((rc = pthread_mutex_unlock(&barrier->mtx)) != 0) { - my_errx(EXIT_FAILURE, "%s: pthread_mutex_unlock: %s", __func__, strerror(rc)); + my_errx(EXIT_FAILURE, "%s: pthread_mutex_unlock: %s", __func__, HDstrerror(rc)); } } @@ -203,16 +203,16 @@ atomic_printf(const char *fmt, ...) va_list ap; ssize_t nprinted, nwritten; - va_start(ap, fmt); - nprinted = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); + HDva_start(ap, fmt); + nprinted = HDvsnprintf(buf, sizeof(buf), fmt, ap); + HDva_end(ap); if (nprinted == -1) my_err(EXIT_FAILURE, "%s.%d: vsnprintf", __func__, __LINE__); else if (nprinted >= (ssize_t)sizeof(buf)) my_errx(EXIT_FAILURE, "%s.%d: vsnprintf overflowed", __func__, __LINE__); - nwritten = write(STDOUT_FILENO, buf, (size_t)nprinted); + nwritten = HDwrite(STDOUT_FILENO, buf, (size_t)nprinted); if (nwritten < nprinted) { my_errx(EXIT_FAILURE, "%s.%d: write error or short write", __func__, __LINE__); } @@ -314,7 +314,7 @@ main(void) return failed ? EXIT_FAILURE : EXIT_SUCCESS; } -#else /*H5_HAVE_THREADSAFE && !H5_HAVE_WIN_THREADS*/ +#else /*H5_HAVE_THREADSAFE && !H5_HAVE_WIN_THREADS*/ int main(void) { @@ -569,197 +569,299 @@ out: /* There was a rare bug where, if an id free callback being called by * H5I_clear_type() removed another id in that type, a segfault could occur. * This test tests for that error (and freeing ids "out of order" within - * H5Iclear_type() in general). */ + * H5Iclear_type() in general). + * + * NB: RCT = "remove clear type" + */ + /* Macro definitions */ -#define TEST_RCT_MAX_NOBJS 25 -#define TEST_RCT_MIN_NOBJS 5 -#define TEST_RCT_NITER 50 +#define RCT_MAX_NOBJS 25 /* Maximum number of objects in the list */ +#define RCT_MIN_NOBJS 5 +#define RCT_NITER 50 /* Number of times we cycle through object creation and deletion */ + +/* Structure to hold the master list of objects */ +typedef struct rct_obj_list_t { + + /* Pointer to the objects */ + struct rct_obj_t *objects; + + /* The number of objects in the list */ + long count; -/* Structure to hold the list of objects */ -typedef struct { - struct test_rct_obj_t *list; /* List of objects */ - long nobjs; /* Number of objects in list */ - long nobjs_rem; /* Number of objects in list that have not been freed */ -} test_rct_list_t; + /* The number of objects in the list that have not been freed */ + long remaining; +} rct_obj_list_t; /* Structure for an object */ -typedef struct test_rct_obj_t { - hid_t id; /* ID for this object */ - int nfrees; /* Number of times this object has been freed */ - hbool_t freeing; /* Whether we are currently freeing this object directly (through H5Idec_ref()) */ - test_rct_list_t *obj_list; /* List of all objects */ -} test_rct_obj_t; - -/* Free callback */ +typedef struct rct_obj_t { + /* The ID for this object */ + hid_t id; + + /* The number of times this object has been freed */ + int nfrees; + + /* Whether we are currently freeing this object directly + * through H5Idec_ref(). + */ + hbool_t freeing; + + /* Pointer to the master list of all objects */ + rct_obj_list_t *list; +} rct_obj_t; + +/* Free callback passed to H5Iclear_type() + * + * When invoked on a closing object, frees a random unfreed ID in the + * master list of objects. + */ static herr_t -test_rct_free(void *_obj) +rct_free_cb(void *_obj) { - test_rct_obj_t *obj = (test_rct_obj_t *)_obj; - long rem_idx, i; - herr_t ret; /* return value */ + rct_obj_t * obj = (rct_obj_t *)_obj; + long remove_nth; + long i; + herr_t ret; /* Mark this object as freed */ obj->nfrees++; - obj->obj_list->nobjs_rem--; - - /* Check freeing and nobjs_rem */ - if (!obj->freeing && (obj->obj_list->nobjs_rem > 0)) { - /* Remove a random object from the list */ - rem_idx = HDrandom() % obj->obj_list->nobjs_rem; - - /* Scan the list, finding the rem_idx'th object that has not been - * freed */ - for (i = 0; i < obj->obj_list->nobjs; i++) - if (obj->obj_list->list[i].nfrees == 0) { - if (rem_idx == 0) + + /* Decrement the number of objects in the list that have not been freed */ + obj->list->remaining--; + + /* If this object isn't already being freed by a callback free call and + * the master object list still contains objects to free, pick another + * object and free it. + */ + if (!obj->freeing && (obj->list->remaining > 0)) { + + /* Pick a random object from the list. This is done by picking a + * random number between 0 and the # of remaining unfreed objects + * and then scanning through the list to find that nth unfreed + * object. + */ + remove_nth = HDrandom() % obj->list->remaining; + for (i = 0; i < obj->list->count; i++) + if (obj->list->objects[i].nfrees == 0) { + if (remove_nth == 0) break; else - rem_idx--; - } /* end if */ - if (i == obj->obj_list->nobjs) { + remove_nth--; + } + + /* Badness if we scanned through the list and didn't manage to + * select one to delete (the list stats were probably updated + * incorrectly). + */ + if (i == obj->list->count) { ERROR("invalid obj_list"); - goto out; - } /* end if */ - else { - /* Remove the object. Mark as "freeing" so its own callback does - * not free another object. */ - obj->obj_list->list[i].freeing = TRUE; - ret = H5Idec_ref(obj->obj_list->list[i].id); - CHECK(ret, FAIL, "H5Idec_ref"); - if (ret == FAIL) - goto out; - obj->obj_list->list[i].freeing = FALSE; - } /* end else */ - } /* end if */ - - /* Verify nobjs_rem is non-negative */ - if (obj->obj_list->nobjs_rem < 0) { - ERROR("invalid nobjs_rem"); - goto out; - } /* end if */ + goto error; + } + + /* Mark the object we're about to free so its own callback does + * not free another object. We don't want to recursively free the + * entire list when we free the first ID. + */ + obj->list->objects[i].freeing = TRUE; + + /* Decrement the reference count on the object */ + ret = H5Idec_ref(obj->list->objects[i].id); + CHECK(ret, FAIL, "H5Idec_ref"); + if (ret == FAIL) + goto error; + + /* Unset the "freeing" flag */ + obj->list->objects[i].freeing = FALSE; + } + + /* Verify the number of objects remaining in the master list is non-negative */ + if (obj->list->remaining < 0) { + ERROR("invalid number of objects remaining"); + goto error; + } return 0; -out: +error: return -1; -} /* end test_rct_free() */ +} /* end rct_free_cb() */ /* Test function */ static int test_remove_clear_type(void) { H5I_type_t obj_type; - test_rct_list_t obj_list; - test_rct_obj_t list[TEST_RCT_MAX_NOBJS]; + rct_obj_list_t obj_list; + rct_obj_t * objects = NULL; /* Convenience pointer to objects stored in master list */ + size_t list_size; long i, j; - long nobjs_found; - hsize_t nmembers; herr_t ret; /* return value */ - /* Register type */ - obj_type = H5Iregister_type((size_t)8, 0, test_rct_free); + /* Register a user-defined type with our custom ID-deleting callback */ + obj_type = H5Iregister_type((size_t)8, 0, rct_free_cb); CHECK(obj_type, H5I_BADID, "H5Iregister_type"); if (obj_type == H5I_BADID) - goto out; + goto error; + + /* 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"); + if (NULL == obj_list.objects) + goto error; + + /* Set a convenience pointer to the object array */ + objects = obj_list.objects; + + for (i = 0; i < RCT_NITER; i++) { + + /* The number of members in the type, according to the HDF5 library */ + hsize_t nmembers = 1234567; + + /* The number of objects found while scanning through the object list */ + unsigned found; + + /********************* + * Build object list * + *********************/ + + HDmemset(obj_list.objects, 0, list_size); - /* Init obj_list.list */ - obj_list.list = list; - - for (i = 0; i < TEST_RCT_NITER; i++) { - /* Build object list */ - obj_list.nobjs = obj_list.nobjs_rem = - TEST_RCT_MIN_NOBJS + (HDrandom() % (long)(TEST_RCT_MAX_NOBJS - TEST_RCT_MIN_NOBJS + 1)); - for (j = 0; j < obj_list.nobjs; j++) { - list[j].nfrees = 0; - list[j].freeing = FALSE; - list[j].obj_list = &obj_list; - list[j].id = H5Iregister(obj_type, &list[j]); - CHECK(list[j].id, FAIL, "H5Iregister"); - if (list[j].id == FAIL) - goto out; + /* The number of objects used is a random number between the min and max */ + obj_list.count = obj_list.remaining = + RCT_MIN_NOBJS + (HDrandom() % (long)(RCT_MAX_NOBJS - RCT_MIN_NOBJS + 1)); + + /* Create the actual objects */ + for (j = 0; j < obj_list.count; j++) { + + /* Object setup */ + objects[j].nfrees = 0; + objects[j].freeing = FALSE; + objects[j].list = &obj_list; + + /* Register an ID for it */ + objects[j].id = H5Iregister(obj_type, &objects[j]); + CHECK(objects[j].id, FAIL, "H5Iregister"); + if (objects[j].id == FAIL) + goto error; + + /* Bump the reference count by 1 (to 2) 50% of the time */ if (HDrandom() % 2) { - ret = H5Iinc_ref(list[j].id); + ret = H5Iinc_ref(objects[j].id); CHECK(ret, FAIL, "H5Iinc_ref"); if (ret == FAIL) - goto out; - } /* end if */ - } /* end for */ + goto error; + } + } - /* Clear the type */ + /****************************************** + * Clear the type with force set to FALSE * + ******************************************/ + + /* Clear the type. Since force is FALSE, only + * IDs with a reference count of 1 will be cleared. + */ ret = H5Iclear_type(obj_type, FALSE); CHECK(ret, FAIL, "H5Iclear_type"); if (ret == FAIL) - goto out; - - /* Verify list */ - nobjs_found = 0; - for (j = 0; j < obj_list.nobjs; j++) { - if (list[j].nfrees == 0) - nobjs_found++; + goto error; + + /* Verify that the object struct fields are sane and count the + * number of unfreed objects + */ + found = 0; + for (j = 0; j < obj_list.count; j++) { + + if (objects[j].nfrees == 0) { + /* Count unfreed objects */ + found++; + } else { - VERIFY(list[j].nfrees, (long)1, "list[j].nfrees"); - if (list[j].nfrees != (long)1) - goto out; - } /* end else */ - VERIFY(list[j].freeing, FALSE, "list[j].freeing"); - if (list[j].freeing != FALSE) - goto out; - } /* end for */ - - /* Verify number of objects */ - VERIFY(obj_list.nobjs_rem, nobjs_found, "obj_list.nobjs_rem"); - if (obj_list.nobjs_rem != nobjs_found) - goto out; + /* Every freed object should have been freed exactly once */ + VERIFY(objects[j].nfrees, 1, "object freed more than once"); + if (objects[j].nfrees != 1) + goto error; + } + + /* No object should still be marked as "freeing" */ + VERIFY(objects[j].freeing, FALSE, "object marked as freeing"); + if (objects[j].freeing != FALSE) + goto error; + } + + /* Verify the number of unfreed objects we found during our scan + * matches the number stored in the list + */ + VERIFY(obj_list.remaining, found, "incorrect number of objects remaining"); + if (obj_list.remaining != found) + goto error; + + /* Make sure the HDF5 library confirms our count */ ret = H5Inmembers(obj_type, &nmembers); CHECK(ret, FAIL, "H5Inmembers"); if (ret == FAIL) - goto out; - VERIFY(nmembers, (size_t)nobjs_found, "H5Inmembers"); - if (nmembers != (size_t)nobjs_found) - goto out; + goto error; + VERIFY(nmembers, found, "The number of members remaining in the type did not match our count"); + if (nmembers != found) + goto error; + + /***************************************** + * Clear the type with force set to TRUE * + *****************************************/ - /* Clear the type with force set to TRUE */ + /* Clear the type. Since force is TRUE, all IDs will be cleared. */ ret = H5Iclear_type(obj_type, TRUE); CHECK(ret, FAIL, "H5Iclear_type"); if (ret == FAIL) - goto out; + goto error; - /* Verify list */ - for (j = 0; j < obj_list.nobjs; j++) { - VERIFY(list[j].nfrees, (long)1, "list[j].nfrees"); - if (list[j].nfrees != (long)1) - goto out; - VERIFY(list[j].freeing, FALSE, "list[j].freeing"); - if (list[j].freeing != FALSE) - goto out; - } /* end for */ - - /* Verify number of objects is 0 */ - VERIFY(obj_list.nobjs_rem, (long)0, "obj_list.nobjs_rem"); - if (obj_list.nobjs_rem != (long)0) - goto out; + /* Verify that the object struct fields are sane */ + for (j = 0; j < obj_list.count; j++) { + + /* Every object should have been freed exactly once */ + VERIFY(objects[j].nfrees, 1, "object freed more than once"); + if (objects[j].nfrees != 1) + goto error; + + /* No object should still be marked as "freeing" */ + VERIFY(objects[j].freeing, FALSE, "object marked as freeing"); + if (objects[j].freeing != FALSE) + goto error; + } + + /* Verify the number of objects is 0 */ + VERIFY(obj_list.remaining, 0, "objects remaining was not zero"); + if (obj_list.remaining != 0) + goto error; + + /* Make sure the HDF5 library confirms zero members in the type */ ret = H5Inmembers(obj_type, &nmembers); CHECK(ret, FAIL, "H5Inmembers"); if (ret == FAIL) - goto out; - VERIFY(nmembers, (size_t)0, "H5Inmembers"); - if (nmembers != (size_t)0) - goto out; - } /* end for */ + goto error; + VERIFY(nmembers, 0, "The number of members remaining in the type was not zero"); + if (nmembers != 0) + goto error; + } - /* Destroy type */ + /* Destroy the type */ ret = H5Idestroy_type(obj_type); CHECK(ret, FAIL, "H5Idestroy_type"); if (ret == FAIL) - goto out; + goto error; + + /* Free the object array */ + HDfree(obj_list.objects); return 0; -out: - /* Cleanup. For simplicity, just destroy the types and ignore errors. */ - H5E_BEGIN_TRY - H5Idestroy_type(obj_type); - H5E_END_TRY +error: + /* Cleanup. For simplicity, just destroy the types and ignore errors. */ + H5E_BEGIN_TRY { + H5Idestroy_type(obj_type); + } H5E_END_TRY + + HDfree(obj_list.objects); + return -1; } /* end test_remove_clear_type() */ diff --git a/test/timer.c b/test/timer.c index e907655..24f3245 100644 --- a/test/timer.c +++ b/test/timer.c @@ -146,7 +146,7 @@ test_timer_system_user(void) */ if (timer.initial.system < (double)0.0f || timer.initial.user < (double)0.0f) { SKIPPED(); - printf("NOTE: No suitable way to get system/user times on this platform.\n"); + HDprintf("NOTE: No suitable way to get system/user times on this platform.\n"); return 0; } @@ -383,7 +383,7 @@ main(void) h5_reset(); - printf("Testing platform-independent timer functionality.\n"); + HDprintf("Testing platform-independent timer functionality.\n"); nerrors += test_time_formatting() < 0 ? 1 : 0; nerrors += test_timer_system_user() < 0 ? 1 : 0; @@ -391,11 +391,12 @@ main(void) nerrors += test_timer_functionality() < 0 ? 1 : 0; if (nerrors) { - printf("***** %d platform-independent timer TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); + HDprintf("***** %d platform-independent timer TEST%s FAILED! *****\n", nerrors, + nerrors > 1 ? "S" : ""); return 1; } else { - printf("All platform-independent timer tests passed.\n"); + HDprintf("All platform-independent timer tests passed.\n"); return 0; } } diff --git a/test/titerate.c b/test/titerate.c index bcf19b9..050dcec 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -966,7 +966,7 @@ find_err_msg_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *_ return H5_ITER_ERROR; /* If the searched error message is found, stop the iteration */ - if (err_desc->desc != NULL && strcmp(err_desc->desc, searched_err->message) == 0) { + if (err_desc->desc != NULL && HDstrcmp(err_desc->desc, searched_err->message) == 0) { searched_err->found = true; status = H5_ITER_STOP; } diff --git a/test/tmisc.c b/test/tmisc.c index a6db198..40a1df5 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -1256,7 +1256,7 @@ test_misc8(void) #ifdef VERIFY_DATA int *rdata; /* Data to read */ int *tdata2; /* Temporary pointer to data to read */ -#endif /* VERIFY_DATA */ +#endif /* VERIFY_DATA */ unsigned u, v; /* Local index variables */ int mdc_nelmts; /* Metadata number of elements */ size_t rdcc_nelmts; /* Raw data number of elements */ @@ -1578,7 +1578,7 @@ test_misc8(void) if (storage_size >= (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n", __LINE__, (unsigned)storage_size); -#else /* Compression is not configured */ +#else /* Compression is not configured */ if (storage_size != (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n", __LINE__, (unsigned)storage_size); @@ -1612,7 +1612,7 @@ test_misc8(void) if (storage_size >= (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n", __LINE__, (unsigned)storage_size); -#else /* Compression is not configured */ +#else /* Compression is not configured */ if (storage_size != (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n", __LINE__, (unsigned)storage_size); @@ -1677,7 +1677,7 @@ test_misc8(void) if (storage_size >= (4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n", __LINE__, (unsigned)storage_size); -#else /* Compression is not configured */ +#else /* Compression is not configured */ if (storage_size != (4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT))) TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n", __LINE__, (unsigned)storage_size); @@ -2837,7 +2837,7 @@ test_misc16(void) if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf( "Line %u: VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", - (unsigned)__LINE__, (int)i, (int)strlen(wdata[i]), (int)i, (int)strlen(rdata[i])); + (unsigned)__LINE__, (int)i, (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); continue; } /* end if */ if (HDstrcmp(wdata[i], rdata[i]) != 0) { @@ -2922,7 +2922,7 @@ test_misc17(void) if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) { TestErrPrintf( "Line %u: VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", - (unsigned)__LINE__, (int)i, (int)strlen(wdata[i]), (int)i, (int)strlen(rdata[i])); + (unsigned)__LINE__, (int)i, (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); continue; } /* end if */ if (HDstrcmp(wdata[i], rdata[i]) != 0) { @@ -2963,7 +2963,7 @@ test_misc18(void) hid_t aid; /* Attribute ID */ #ifndef H5_NO_DEPRECATED_SYMBOLS H5O_info1_t old_oinfo; /* (deprecated) information about object */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ H5O_info2_t oinfo; /* Data model information about object */ H5O_native_info_t ninfo; /* Native file format information about object */ char attr_name[32]; /* Attribute name buffer */ @@ -5082,7 +5082,7 @@ test_misc27(void) H5E_BEGIN_TRY { gid = H5Gopen2(fid, MISC27_GROUP, H5P_DEFAULT); } H5E_END_TRY; VERIFY(gid, FAIL, "H5Gopen2"); -#else /* H5_STRICT_FORMAT_CHECKS */ +#else /* H5_STRICT_FORMAT_CHECKS */ /* Open group with incorrect # of object header messages */ gid = H5Gopen2(fid, MISC27_GROUP, H5P_DEFAULT); CHECK(gid, FAIL, "H5Gopen2"); @@ -5399,7 +5399,7 @@ test_misc31(void) hid_t group_id; /* Group id */ hid_t dtype_id; /* Datatype id */ herr_t ret; /* Generic return value */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Output message about test being performed */ MESSAGE(5, ("Deprecated routines initialize after H5close()\n")); @@ -5474,7 +5474,7 @@ test_misc31(void) ret = H5Tclose(dtype_id); CHECK(ret, FAIL, "H5Tclose"); -#else /* H5_NO_DEPRECATED_SYMBOLS */ +#else /* H5_NO_DEPRECATED_SYMBOLS */ /* Output message about test being skipped */ MESSAGE(5, (" ...Skipped")); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -5523,7 +5523,7 @@ test_misc32(void) CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/ buffer = H5allocate_memory(0, TRUE); CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/ -#endif /* NDEBUG */ +#endif /* NDEBUG */ /* RESIZE */ @@ -5542,7 +5542,7 @@ test_misc32(void) #ifdef NDEBUG resized = H5resize_memory(NULL, 0); CHECK_PTR_NULL(resized, "H5resize_memory"); /*BAD*/ -#endif /* NDEBUG */ +#endif /* NDEBUG */ } /* end test_misc32() */ @@ -5700,7 +5700,7 @@ test_misc35(void) CHECK(arr_size_start, 0, "H5get_free_list_sizes"); CHECK(blk_size_start, 0, "H5get_free_list_sizes"); CHECK(fac_size_start, 0, "H5get_free_list_sizes"); -#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ +#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ /* All the values should be == 0 */ VERIFY(reg_size_start, 0, "H5get_free_list_sizes"); VERIFY(arr_size_start, 0, "H5get_free_list_sizes"); @@ -5739,7 +5739,7 @@ test_misc35(void) CHECK(alloc_stats.total_alloc_blocks_count, 0, "H5get_alloc_stats"); CHECK(alloc_stats.curr_alloc_blocks_count, 0, "H5get_alloc_stats"); CHECK(alloc_stats.peak_alloc_blocks_count, 0, "H5get_alloc_stats"); -#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ +#else /* H5_MEMORY_ALLOC_SANITY_CHECK */ /* All the values should be == 0 */ VERIFY(alloc_stats.total_alloc_bytes, 0, "H5get_alloc_stats"); VERIFY(alloc_stats.curr_alloc_bytes, 0, "H5get_alloc_stats"); @@ -5787,7 +5787,7 @@ test_misc(void) test_misc21(); /* Test that "late" allocation time is treated the same as "incremental", for chunked datasets w/a filters */ test_misc22(); /* check szip bits per pixel */ -#endif /* H5_HAVE_FILTER_SZIP */ +#endif /* H5_HAVE_FILTER_SZIP */ test_misc23(); /* Test intermediate group creation */ test_misc24(); /* Test inappropriate API opens of objects */ test_misc25a(); /* Exercise null object header message merge bug */ diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c index 6191526..d2a403f 100644 --- a/test/trefer_deprec.c +++ b/test/trefer_deprec.c @@ -1406,9 +1406,9 @@ test_reference_group(void) /* Create bottom dataset */ did = H5Dcreate2(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(did > 0); + HDassert(did > 0); ret = H5Dclose(did); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Gclose(gid); CHECK(ret, FAIL, "H5Gclose"); diff --git a/test/trefstr.c b/test/trefstr.c index 18e357e..16aa5cc 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -280,60 +280,225 @@ test_refstr_wrap(void) /**************************************************************** ** -** test_refstr_own(): Test basic H5RS (ref-counted strings) code. -** Tests transferring ownership of dynamically allocated strings -** to ref-counted strings. +** test_refstr_asprintf_cat(): Test basic H5RS (ref-counted strings) code. +** Tests appending printf-formatted output to ref-counted strings. ** ****************************************************************/ static void -test_refstr_own(void) +test_refstr_asprintf_cat(void) { - H5RS_str_t *rs; /* Ref-counted string created */ - char * s; /* Pointer to string to transfer */ - const char *t; /* Temporary pointers to string */ - int cmp; /* Comparison value */ - herr_t ret; /* Generic return value */ + H5RS_str_t *rs; /* Ref-counted string created */ + const char *s; /* Pointer to raw string in ref-counted string */ + char buf[256]; /* Buffer to compare against */ + int cmp; /* Comparison value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ - MESSAGE(5, ("Testing Transferring Ref-Counted Strings\n")); + MESSAGE(5, ("Testing Printf-formatted Output to Ref-Counted Strings\n")); - /* Initialize buffer */ - s = (char *)H5FL_BLK_MALLOC(str_buf, HDstrlen("foo") + 1); - CHECK_PTR(s, "H5FL_BLK_MALLOC"); - HDstrcpy(s, "foo"); + /* Wrap ref-counted string around existing buffer */ + rs = H5RS_create(NULL); + CHECK_PTR(rs, "H5RS_create"); - /* Transfer ownership of dynamically allocated string to ref-counted string */ - rs = H5RS_own(s); - CHECK_PTR(rs, "H5RS_own"); + /* Print initial output to ref-counted string */ + ret = H5RS_asprintf_cat(rs, "%d-%s", (int)10, "foo"); + CHECK(ret, FAIL, "H5RS_asprintf_cat"); /* Get pointer to raw string in ref-counted string */ - t = H5RS_get_str(rs); - CHECK_PTR(t, "H5RS_get_str"); - CHECK_PTR_EQ(t, s, "transferring"); - cmp = HDstrcmp(s, t); + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%d-%s", (int)10, "foo"); + cmp = HDstrcmp(s, buf); VERIFY(cmp, 0, "HDstrcmp"); - /* Increment reference count (should NOT duplicate string) */ - ret = H5RS_incr(rs); - CHECK(ret, FAIL, "H5RS_incr"); + /* Append more output to ref-counted string */ + ret = H5RS_asprintf_cat(rs, "-%f", (double)20.0); + CHECK(ret, FAIL, "H5RS_asprintf_cat"); - /* Change the buffer initially wrapped */ - *s = 'F'; + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%d-%s-%f", (int)10, "foo", (double)20.0); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Decrement reference count for string */ + ret = H5RS_decr(rs); + CHECK(ret, FAIL, "H5RS_decr"); + +} /* end test_refstr_asprintf_cat() */ + +/**************************************************************** +** +** test_refstr_acat(): Test basic H5RS (ref-counted strings) code. +** Tests appending strings to ref-counted strings. +** +****************************************************************/ +static void +test_refstr_acat(void) +{ + H5RS_str_t *rs; /* Ref-counted string created */ + const char *s; /* Pointer to raw string in ref-counted string */ + char buf[256]; /* Buffer to compare against */ + char * large_str, *large_str2; /* Large strings to append */ + int cmp; /* Comparison value */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Appending Strings to Ref-Counted Strings\n")); + + /* Wrap ref-counted string around existing buffer */ + rs = H5RS_create(NULL); + CHECK_PTR(rs, "H5RS_create"); + + /* Append first string to ref-counted string */ + ret = H5RS_acat(rs, "foo"); + CHECK(ret, FAIL, "H5RS_acat"); /* Get pointer to raw string in ref-counted string */ - t = H5RS_get_str(rs); - CHECK_PTR(t, "H5RS_get_str"); - CHECK_PTR_EQ(t, s, "transferring"); - cmp = HDstrcmp(t, s); + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%s", "foo"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Append another string to ref-counted string */ + ret = H5RS_acat(rs, "bar"); + CHECK(ret, FAIL, "H5RS_acat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%s", "foobar"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Append a large string to ref-counted string */ + large_str = HDmalloc(1024); + CHECK(large_str, NULL, "HDmalloc"); + HDmemset(large_str, 'a', 1024); + large_str[1023] = '\0'; + ret = H5RS_acat(rs, large_str); + CHECK(ret, FAIL, "H5RS_acat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDsprintf(buf, "%s", "foobar"); + large_str2 = HDmalloc(1024 + 6); + CHECK(large_str2, NULL, "HDmalloc"); + HDstrcpy(large_str2, "foobar"); + HDmemset(&large_str2[6], 'a', 1024); + large_str2[1029] = '\0'; + cmp = HDstrcmp(s, large_str2); VERIFY(cmp, 0, "HDstrcmp"); /* Decrement reference count for string */ ret = H5RS_decr(rs); CHECK(ret, FAIL, "H5RS_decr"); + + /* Free large strings */ + HDfree(large_str); + HDfree(large_str2); +} /* end test_refstr_acat() */ + +/**************************************************************** +** +** test_refstr_ancat(): Test basic H5RS (ref-counted strings) code. +** Tests appending length-limited strings to ref-counted strings. +** +****************************************************************/ +static void +test_refstr_ancat(void) +{ + H5RS_str_t *rs; /* Ref-counted string created */ + const char *s; /* Pointer to raw string in ref-counted string */ + char buf[256]; /* Buffer to compare against */ + int cmp; /* Comparison value */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Appending Strings to Ref-Counted Strings\n")); + + /* Wrap ref-counted string around existing buffer */ + rs = H5RS_create(NULL); + CHECK_PTR(rs, "H5RS_create"); + + /* Append first string to ref-counted string */ + ret = H5RS_ancat(rs, "foo", 2); + CHECK(ret, FAIL, "H5RS_ancat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDstrcpy(buf, "fo"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Append another string to ref-counted string */ + ret = H5RS_ancat(rs, "bar", 2); + CHECK(ret, FAIL, "H5RS_ancat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDstrcpy(buf, "foba"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Decrement reference count for string */ ret = H5RS_decr(rs); CHECK(ret, FAIL, "H5RS_decr"); +} /* end test_refstr_ancat() */ + +/**************************************************************** +** +** test_refstr_aputc(): Test basic H5RS (ref-counted strings) code. +** Tests appending characters to ref-counted strings. +** +****************************************************************/ +static void +test_refstr_aputc(void) +{ + H5RS_str_t *rs; /* Ref-counted string created */ + const char *s; /* Pointer to raw string in ref-counted string */ + char buf[256]; /* Buffer to compare against */ + int cmp; /* Comparison value */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Appending Strings to Ref-Counted Strings\n")); -} /* end test_refstr_own() */ + /* Wrap ref-counted string around existing buffer */ + rs = H5RS_create(NULL); + CHECK_PTR(rs, "H5RS_create"); + + /* Append first character to ref-counted string */ + ret = H5RS_aputc(rs, 'f'); + CHECK(ret, FAIL, "H5RS_ancat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDstrcpy(buf, "f"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Append another character to ref-counted string */ + ret = H5RS_aputc(rs, 'o'); + CHECK(ret, FAIL, "H5RS_ancat"); + + /* Get pointer to raw string in ref-counted string */ + s = H5RS_get_str(rs); + CHECK_PTR(s, "H5RS_get_str"); + HDstrcpy(buf, "fo"); + cmp = HDstrcmp(s, buf); + VERIFY(cmp, 0, "HDstrcmp"); + + /* Decrement reference count for string */ + ret = H5RS_decr(rs); + CHECK(ret, FAIL, "H5RS_decr"); +} /* end test_refstr_aputc() */ /**************************************************************** ** @@ -361,12 +526,15 @@ test_refstr(void) test_refstr_init(); /* Actual ref-counted strings tests */ - test_refstr_create(); /* Test ref-counted string creation */ - test_refstr_count(); /* Test ref-counted string counting */ - test_refstr_dup(); /* Test ref-counted string duplication */ - test_refstr_cmp(); /* Test ref-counted string comparison */ - test_refstr_wrap(); /* Test ref-counted string wrapping */ - test_refstr_own(); /* Test ref-counted string ownership transfer */ + test_refstr_create(); /* Test ref-counted string creation */ + test_refstr_count(); /* Test ref-counted string counting */ + test_refstr_dup(); /* Test ref-counted string duplication */ + test_refstr_cmp(); /* Test ref-counted string comparison */ + test_refstr_wrap(); /* Test ref-counted string wrapping */ + test_refstr_asprintf_cat(); /* Test ref-counted string printf-formatted output */ + test_refstr_acat(); /* Test ref-counted string appends */ + test_refstr_ancat(); /* Test ref-counted length-limited string appends */ + test_refstr_aputc(); /* Test ref-counted character appends */ /* Finalize ref-counted strings testing data */ test_refstr_finalize(); diff --git a/test/tselect.c b/test/tselect.c index f40b2b9..2aeba77 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -5239,7 +5239,7 @@ test_select_hyper_union_stagger(void) CHECK(error, FAIL, "H5Fclose"); /* Initialize intput buffer */ - memset(data_out, 0, 7 * 7 * sizeof(int)); + HDmemset(data_out, 0, 7 * 7 * sizeof(int)); /* Open file */ file_id = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT); @@ -5537,7 +5537,7 @@ test_select_hyper_valid_combination(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Selection Combination Validity\n")); - assert(SPACE9_DIM2 >= POINT1_NPOINTS); + HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for single point selection */ single_pt_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL); @@ -8377,7 +8377,7 @@ test_shape_same(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Same Shape Comparisons\n")); - assert(SPACE9_DIM2 >= POINT1_NPOINTS); + HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for "all" selection */ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); @@ -14648,7 +14648,7 @@ test_internal_consistency(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Consistency of Internal States\n")); - assert(SPACE9_DIM2 >= POINT1_NPOINTS); + HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for "all" selection */ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); diff --git a/test/tsohm.c b/test/tsohm.c index 71e42e6..872875d 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -819,7 +819,7 @@ test_sohm_size1(void) hsize_t oh_sizes[3]; unsigned oh_size_index = 0; -#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */ +#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */ hsize_t norm_oh_size; #endif /* Jira HDFFV-10646 */ hsize_t sohm_oh_size; @@ -922,7 +922,7 @@ test_sohm_size1(void) norm_empty_filesize = file_sizes[0]; norm_final_filesize = file_sizes[1]; norm_final_filesize2 = file_sizes[2]; -#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */ +#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */ norm_oh_size = oh_sizes[0]; #endif /* Jira HDFFV-10646 */ @@ -941,7 +941,7 @@ test_sohm_size1(void) */ VERIFY(sohm_btree_oh_size, sohm_oh_size, "H5Oget_info_by_name"); -#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */ +#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */ /* Object headers in SOHM files should be smaller than normal object * headers. */ @@ -992,7 +992,7 @@ test_sohm_size1(void) * *--------------------------------------------------------------------------- */ -#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */ +#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */ static void test_sohm_size_consistency_open_create(void) { @@ -3822,7 +3822,7 @@ test_sohm(void) test_sohm_size1(); /* Tests the sizes of files with one SOHM */ #if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */ test_sohm_size_consistency_open_create(); -#endif /* Jira HDFFV-10645 */ +#endif /* Jira HDFFV-10645 */ test_sohm_attrs(); /* Tests shared messages in attributes */ test_sohm_size2(0); /* Tests the sizes of files with multiple SOHMs */ test_sohm_size2(1); /* Tests the sizes of files with multiple diff --git a/test/ttsafe.c b/test/ttsafe.c index d2085b9..6862a0b 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -60,7 +60,7 @@ tts_is_threadsafe(void) #ifdef H5_HAVE_THREADSAFE is_ts = FALSE; should_be = TRUE; -#else /* H5_HAVE_THREADSAFE */ +#else /* H5_HAVE_THREADSAFE */ is_ts = TRUE; should_be = FALSE; #endif /* H5_HAVE_THREADSAFE */ @@ -134,7 +134,7 @@ main(int argc, char *argv[]) TestSummary(); /* Clean up test files, if allowed */ - if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) + if (GetTestCleanup() && !HDgetenv("HDF5_NOCLEANUP")) TestCleanup(); /* Release test infrastructure */ diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 1e40c58..2ec9a20 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -65,46 +65,46 @@ tts_cancel(void) /* make thread scheduling global */ ret = pthread_attr_init(&attribute); - assert(ret == 0); + HDassert(ret == 0); #ifdef H5_HAVE_SYSTEM_SCOPE_THREADS ret = pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); - assert(ret == 0); + HDassert(ret == 0); #endif /* H5_HAVE_SYSTEM_SCOPE_THREADS */ /* Initialize mutex & condition variables */ ret = pthread_mutex_init(&mutex, NULL); - assert(ret == 0); + HDassert(ret == 0); ret = pthread_cond_init(&cond, NULL); - assert(ret == 0); + HDassert(ret == 0); /* * Create a hdf5 file using H5F_ACC_TRUNC access, default file * creation plist and default file access plist */ cancel_file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(cancel_file >= 0); + HDassert(cancel_file >= 0); ret = pthread_create(&childthread, &attribute, tts_cancel_thread, NULL); - assert(ret == 0); + HDassert(ret == 0); tts_cancel_barrier(); ret = pthread_cancel(childthread); - assert(ret == 0); + HDassert(ret == 0); dataset = H5Dopen2(cancel_file, DATASETNAME, H5P_DEFAULT); - assert(dataset >= 0); + HDassert(dataset >= 0); ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buffer); - assert(ret >= 0); + HDassert(ret >= 0); if (buffer != 11) TestErrPrintf("operation unsuccessful with value at %d instead of 11\n", buffer); ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(cancel_file); - assert(ret >= 0); + HDassert(ret >= 0); /* Destroy the thread attribute */ ret = pthread_attr_destroy(&attribute); - assert(ret == 0); + HDassert(ret == 0); } /* end tts_cancel() */ void * diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index cedafd0..a5a22be 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -140,7 +140,7 @@ tts_dcreate_creator(void *_thread_data) hsize_t dimsf[1]; /* dataset dimensions */ struct thread_info thread_data; - memcpy(&thread_data, _thread_data, sizeof(struct thread_info)); + HDmemcpy(&thread_data, _thread_data, sizeof(struct thread_info)); /* define dataspace for dataset */ dimsf[0] = 1; diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index f92c65e..0b44958 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -72,7 +72,7 @@ tts_error(void) /* Must initialize these at runtime */ expected_g[0].maj_num = H5E_DATASET; - expected_g[0].min_num = H5E_CANTINIT; + expected_g[0].min_num = H5E_CANTCREATE; expected_g[1].maj_num = H5E_VOL; expected_g[1].min_num = H5E_CANTCREATE; @@ -134,7 +134,8 @@ tts_error(void) if (error_flag_g) { TestErrPrintf( "At least one thread reported a value that was different from the expected value\n"); - HDprintf("(Update this test if the error stack changed!)\n"); + HDprintf( + "(Update the expected_g[] array in tts_error for this test if the error stack changed!)\n"); } if (error_count_g != NUM_THREAD - 1) @@ -241,7 +242,18 @@ walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void H5_ATTR_UNUSE return SUCCEED; } + /* Unexpected error stack entry, print some info and set flag */ + HDfprintf(stderr, "Unexpected error stack entry!\n"); + HDfprintf(stderr, "Stack entry: %d\n", n); + HDfprintf(stderr, + "Actual: maj_num = %" PRIxHID ", min_num = %" PRIxHID + ", line = %u, func = '%s', file = '%s', desc = '%s'\n", + err_desc->maj_num, err_desc->min_num, err_desc->line, err_desc->func_name, err_desc->file_name, + err_desc->desc); + HDfprintf(stderr, "Expected: maj_num = %" PRIxHID ", min_num = %" PRIxHID "\n", expected_g[n].maj_num, + expected_g[n].min_num); error_flag_g = -1; + return SUCCEED; } diff --git a/test/tunicode.c b/test/tunicode.c index 28f819b..2fed891 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -532,7 +532,7 @@ test_attrname(hid_t fid, const char *string) CHECK(attr_id, FAIL, "H5Acreate2"); size = H5Aget_name(attr_id, (size_t)MAX_STRING_LENGTH, read_buf); CHECK(size, FAIL, "H5Aget_name"); - ret = strcmp(read_buf, string); + ret = HDstrcmp(read_buf, string); VERIFY(ret, 0, "strcmp"); read_buf[0] = '\0'; @@ -541,7 +541,7 @@ test_attrname(hid_t fid, const char *string) CHECK(ret, FAIL, "H5Awrite"); ret = H5Aread(attr_id, dtype_id, read_buf); CHECK(ret, FAIL, "H5Aread"); - ret = strcmp(read_buf, string); + ret = HDstrcmp(read_buf, string); VERIFY(ret, 0, "strcmp"); /* Clean up */ @@ -682,7 +682,7 @@ test_enum(hid_t H5_ATTR_UNUSED fid, const char *string) VERIFY(val, E1_WHITE, "H5Tenum_valueof"); ret = H5Tenum_nameof(type_id, &val, readbuf, (size_t)MAX_STRING_LENGTH); CHECK(ret, FAIL, "H5Tenum_nameof"); - ret = strcmp(readbuf, string); + ret = HDstrcmp(readbuf, string); VERIFY(ret, 0, "strcmp"); /* Close the datatype */ @@ -709,7 +709,7 @@ test_opaque(hid_t H5_ATTR_UNUSED fid, const char *string) /* Read the tag back. */ read_buf = H5Tget_tag(type_id); - ret = strcmp(read_buf, string); + ret = HDstrcmp(read_buf, string); VERIFY(ret, 0, "H5Tget_tag"); H5free_memory(read_buf); diff --git a/test/tvlstr.c b/test/tvlstr.c index c8e65b5..c2d2f2d 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -203,7 +203,7 @@ test_vlstrings_basic(void) for (i = 0; i < SPACE1_DIM1; i++) { if (HDstrlen(wdata[i]) != HDstrlen(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)HDstrlen(rdata[i])); + (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); continue; } /* end if */ if (HDstrcmp(wdata[i], rdata[i]) != 0) { @@ -307,7 +307,7 @@ test_vlstrings_special(void) for (i = 0; i < SPACE1_DIM1; i++) { if (HDstrlen(wdata[i]) != HDstrlen(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)HDstrlen(rdata[i])); + (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); continue; } /* end if */ if ((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) { @@ -536,7 +536,7 @@ test_compact_vlstring(void) for (i = 0; i < SPACE1_DIM1; i++) { if (HDstrlen(wdata[i]) != HDstrlen(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)HDstrlen(rdata[i])); + (int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i])); continue; } /* end if */ if (HDstrcmp(wdata[i], rdata[i]) != 0) { diff --git a/test/tvltypes.c b/test/tvltypes.c index 50cfbd7..47b28d3 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -2676,13 +2676,13 @@ test_vltypes_fill_value(void) } break; case H5D_VIRTUAL: - assert(0 && "Invalid layout type!"); + HDassert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - assert(0 && "Unknown layout type!"); + HDassert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -2784,13 +2784,13 @@ test_vltypes_fill_value(void) break; case H5D_VIRTUAL: - assert(0 && "Invalid layout type!"); + HDassert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - assert(0 && "Unknown layout type!"); + HDassert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -2969,13 +2969,13 @@ test_vltypes_fill_value(void) break; case H5D_VIRTUAL: - assert(0 && "Invalid layout type!"); + HDassert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - assert(0 && "Unknown layout type!"); + HDassert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -3241,5 +3241,5 @@ test_vltypes(void) void cleanup_vltypes(void) { - remove(FILENAME); + HDremove(FILENAME); } diff --git a/test/twriteorder.c b/test/twriteorder.c index 83a615c..9c8a145 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -141,21 +141,21 @@ parse_option(int argc, char *const argv[]) HDexit(EXIT_SUCCESS); break; case 'b': /* number of planes to write/read */ - if ((blocksize_g = atoi(optarg)) <= 0) { + if ((blocksize_g = HDatoi(optarg)) <= 0) { HDfprintf(stderr, "bad blocksize %s, must be a positive integer\n", optarg); usage(progname_g); Hgoto_error(-1); }; break; case 'n': /* number of planes to write/read */ - if ((nlinkedblock_g = atoi(optarg)) < 2) { + if ((nlinkedblock_g = HDatoi(optarg)) < 2) { HDfprintf(stderr, "bad number of linked blocks %s, must be greater than 1.\n", optarg); usage(progname_g); Hgoto_error(-1); }; break; case 'p': /* number of planes to write/read */ - if ((part_size_g = atoi(optarg)) <= 0) { + if ((part_size_g = HDatoi(optarg)) <= 0) { HDfprintf(stderr, "bad partition size %s, must be a positive integer\n", optarg); usage(progname_g); Hgoto_error(-1); @@ -404,7 +404,7 @@ main(int argc, char *argv[]) Hgoto_error(1); }; }; - mypid = getpid(); + mypid = HDgetpid(); /* ============= */ /* launch reader */ @@ -440,7 +440,7 @@ main(int argc, char *argv[]) /* If readwrite, collect exit code of child process */ /* ================================================ */ if (launch_g == UC_READWRITE) { - if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) { + if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) { HDperror("waitpid"); Hgoto_error(1); } diff --git a/test/unlink.c b/test/unlink.c index 8129cc9..2f68a69 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -575,7 +575,7 @@ test_filespace(hid_t fapl) size_t rdcc_nbytes; double rdcc_w0; - puts("Testing file space gets reused:"); + HDputs("Testing file space gets reused:"); /* Open file */ h5_fixname(FILENAME[4], fapl, filename, sizeof filename); diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index 0b2c409..94adfb0 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -165,12 +165,12 @@ main(int argc, char *argv[]) /* Fork process */ /* ============ */ if (UC_opts.launch == UC_READWRITE) { - if ((childpid = fork()) < 0) { - perror("fork"); + if ((childpid = HDfork()) < 0) { + HDperror("fork"); Hgoto_error(1); } } - mypid = getpid(); + mypid = HDgetpid(); /* ============= */ /* launch reader */ @@ -239,8 +239,8 @@ main(int argc, char *argv[]) /* If readwrite, collect exit code of child process */ /* ================================================ */ if (UC_opts.launch == UC_READWRITE) { - if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) { - perror("waitpid"); + if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) { + HDperror("waitpid"); Hgoto_error(1); } diff --git a/test/use_common.c b/test/use_common.c index ccebd0b..7a3c95a 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -68,7 +68,7 @@ parse_option(int argc, char *const argv[], options_t *opts) switch (c) { case 'h': usage(opts->progname); - exit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); break; case 'f': /* usecase data file name */ opts->filename = HDstrdup(optarg); @@ -907,7 +907,7 @@ test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low) TEST_ERROR ex_dcpl = -1; -#else /* VDS_POINT_SELECTIONS */ +#else /* VDS_POINT_SELECTIONS */ /* * Test 3: Verify point selections fail @@ -617,7 +617,7 @@ test_direct(void) #ifndef H5_HAVE_DIRECT SKIPPED(); return 0; -#else /*H5_HAVE_DIRECT*/ +#else /*H5_HAVE_DIRECT*/ /* Set property list and file name for Direct driver. Set memory alignment boundary * and file block size to 512 which is the minimum for Linux 2.6. */ @@ -2168,8 +2168,6 @@ test_ros3(void) hid_t driver_id = -1; /* ID for this VFD */ unsigned long driver_flags = 0; /* VFD feature flags */ char filename[1024]; /* filename */ - void * os_file_handle = NULL; /* OS file handle */ - hsize_t file_size; /* file size */ H5FD_ros3_fapl_t test_ros3_fa; H5FD_ros3_fapl_t ros3_fa_0 = { /* version = */ H5FD_CURR_ROS3_FAPL_T_VERSION, @@ -2185,7 +2183,7 @@ test_ros3(void) #ifndef H5_HAVE_ROS3_VFD SKIPPED(); return 0; -#else /* H5_HAVE_ROS3_VFD */ +#else /* H5_HAVE_ROS3_VFD */ /* Set property list and file name for ROS3 driver. */ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -2201,9 +2199,9 @@ test_ros3(void) /* need a macro to compare instances of H5FD_ros3_fapl_t */ if ((test_ros3_fa.version != ros3_fa_0.version) || (test_ros3_fa.authenticate != ros3_fa_0.authenticate) || - (strcmp(test_ros3_fa.aws_region, ros3_fa_0.aws_region) != 0) || - (strcmp(test_ros3_fa.secret_id, ros3_fa_0.secret_id) != 0) || - (strcmp(test_ros3_fa.secret_key, ros3_fa_0.secret_key) != 0)) + (HDstrcmp(test_ros3_fa.aws_region, ros3_fa_0.aws_region) != 0) || + (HDstrcmp(test_ros3_fa.secret_id, ros3_fa_0.secret_id) != 0) || + (HDstrcmp(test_ros3_fa.secret_key, ros3_fa_0.secret_key) != 0)) TEST_ERROR; h5_fixname(FILENAME[10], fapl_id, filename, sizeof(filename)); @@ -2252,7 +2250,7 @@ error: AT(); \ HDfprintf(stderr, mesg); \ H5Eprint2(H5E_DEFAULT, stderr); \ - fflush(stderr); \ + HDfflush(stderr); \ ret_value = -1; \ goto done; \ } @@ -2464,7 +2462,7 @@ run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_err } /* Verify existence of logfile if appropriate */ - logfile = fopen(vfd_config->log_file_path, "r"); + logfile = HDfopen(vfd_config->log_file_path, "r"); if ((TRUE == provide_logfile_path && NULL == logfile) || (FALSE == provide_logfile_path && NULL != logfile)) { SPLITTER_TEST_FAULT("no logfile when one was expected\n"); @@ -2485,7 +2483,7 @@ done: } if (logfile != NULL) - fclose(logfile); + HDfclose(logfile); HDfree(vfd_config); HDfree(filename_rw); @@ -18,6 +18,7 @@ * other mechanisms. */ +/* Headers needed */ #include "h5test.h" /* Filename */ @@ -90,7 +91,7 @@ static const H5VL_class_t fake_vol_g = { /* datatype_cls */ NULL, /* commit */ NULL, /* open */ - NULL, /* get_size */ + NULL, /* get */ NULL, /* specific */ NULL, /* optional */ NULL /* close */ diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index 3e92f18..536d312 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -4220,7 +4220,7 @@ test_no_collective_cause_mode_filter(int selection_mode) herr_t ret; #ifdef LATER /* fletcher32 */ H5Z_filter_t filter_info; -#endif /* LATER */ +#endif /* LATER */ char message[256]; /* Set up MPI parameters */ @@ -4248,7 +4248,7 @@ test_no_collective_cause_mode_filter(int selection_mode) ret = H5Pset_fletcher32(dcpl); VRFY((ret >= 0),"set filter (flecher32) succeeded"); -#endif /* LATER */ +#endif /* LATER */ } else { VRFY(0, "Unexpected mode, only test for TEST_FILTERS_READ."); @@ -4290,7 +4290,7 @@ test_no_collective_cause_mode_filter(int selection_mode) test_name = "Broken Collective I/O - Filter is required"; no_collective_cause_local_expected = H5D_MPIO_FILTERS; no_collective_cause_global_expected = H5D_MPIO_FILTERS; -#endif /* LATER */ +#endif /* LATER */ /* Get the file dataspace */ file_space = H5Dget_space(dataset); @@ -4421,9 +4421,9 @@ no_collective_cause_tests(void) test_no_collective_cause_mode(TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT); test_no_collective_cause_mode(TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL); #ifdef LATER /* fletcher32 */ - /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and - * H5Dwrite is ready for mpio + filter feature. - */ + /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and + * H5Dwrite is ready for mpio + filter feature. + */ /* test_no_collective_cause_mode (TEST_FILTERS); */ test_no_collective_cause_mode_filter(TEST_FILTERS_READ); #endif /* LATER */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index e0e03f2..3989f2e 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -2465,7 +2465,7 @@ datum_notify(H5C_notify_action_t action, void *thing) 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. */ +#if 0 /* This has been useful debugging code -- keep it for now. */ if ( mssg.req != READ_REQ_REPLY_CODE ) { HDfprintf(stdout, @@ -6880,7 +6880,7 @@ main(int argc, char **argv) H5open(); express_test = do_express_test(); -#if 0 /* JRM */ +#if 0 /* JRM */ express_test = 0; #endif /* JRM */ if (express_test) { diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index 776da2e..cce3932 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -53,9 +53,6 @@ static void verify_data_sets(hid_t file_id, int min_dset, int max_dset); /* local test function declarations */ -static hbool_t parse_flags(int argc, char *argv[], hbool_t *setup_ptr, hbool_t *ici_ptr, int *file_idx_ptr, - int *mpi_size_ptr, hbool_t display); -static void usage(void); static unsigned construct_test_file(int test_file_index); static void par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, int mpi_size); static void par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank); @@ -1743,13 +1740,6 @@ par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank) } /* par_delete_dataset() */ -/* 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. - */ -#ifdef H5_HAVE_FORK - /*------------------------------------------------------------------------- * Function: par_insert_cache_image() * @@ -1781,63 +1771,14 @@ par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank) static void par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size) { - hbool_t show_progress = FALSE; - if (pass) { if (mpi_rank == 0) { /* insert cache image in supplied test file */ - char file_name_idx_str[32]; - char mpi_size_str[32]; - int child_status; - pid_t child_pid; - - HDsprintf(file_name_idx_str, "%d", file_name_idx); - HDsprintf(mpi_size_str, "%d", mpi_size); - - child_pid = fork(); - - if (child_pid == 0) { /* this is the child process */ - - /* fun and games to shutup the compiler */ - char param0[32] = "t_cache_image"; - char param1[32] = "ici"; - char *child_argv[] = {param0, param1, file_name_idx_str, mpi_size_str, NULL}; - - /* we may need to play with the path here */ - if (execv("t_cache_image", child_argv) == -1) { - - HDfprintf(stdout, "execl() of ici process failed. errno = %d(%s)\n", errno, - strerror(errno)); - HDexit(1); - } - } - else if (child_pid != -1) { - /* this is the parent process -- wait until child is done */ - if (-1 == waitpid(child_pid, &child_status, WUNTRACED)) { - - HDfprintf(stdout, "can't wait on ici process.\n"); - pass = FALSE; - } - else if (!WIFEXITED(child_status)) { - - HDfprintf(stdout, "ici process hasn't exitied.\n"); - pass = FALSE; - } - else if (WEXITSTATUS(child_status) != 0) { - - HDfprintf(stdout, "ici process reports failure.\n"); - pass = FALSE; - } - else if (show_progress) { - - HDfprintf(stdout, "cache image insertion complete.\n"); - } - } - else { /* fork failed */ - - HDfprintf(stdout, "can't create process to insert cache image.\n"); - pass = FALSE; + if (!serial_insert_cache_image(file_name_idx, mpi_size)) { + HDfprintf(stderr, "\n\nCache image insertion failed.\n"); + HDfprintf(stderr, " failure mssg = \"%s\"\n", failure_mssg); + HDexit(EXIT_FAILURE); } } } @@ -1853,15 +1794,6 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size) return; } /* par_insert_cache_image() */ -#else /* H5_HAVE_FORK */ - -static void -par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size) -{ - return; -} /* par_insert_cache_image() */ - -#endif /* H5_HAVE_FORK */ /*------------------------------------------------------------------------- * Function: par_verify_dataset() @@ -2462,158 +2394,6 @@ serial_verify_dataset(int dset_num, hid_t file_id, int mpi_size) } /* serial_verify_dataset() */ /*------------------------------------------------------------------------- - * Function: parse_flags - * - * Purpose: Parse the flags passed to this program, and load the - * values into the supplied field. - * - * Return: Success: 1 - * Failure: 0 - * - * Programmer: J Mainzer - * 4/28/11 - * - *------------------------------------------------------------------------- - */ -static hbool_t -parse_flags(int argc, char *argv[], hbool_t *setup_ptr, hbool_t *ici_ptr, int *file_idx_ptr, - int *mpi_size_ptr, hbool_t display) -{ - const char *fcn_name = "parse_flags()"; - const char *(ops[]) = {"setup", "ici"}; - int success = TRUE; - - HDassert(setup_ptr); - HDassert(*setup_ptr == FALSE); - HDassert(ici_ptr); - HDassert(*ici_ptr == FALSE); - HDassert(file_idx_ptr); - HDassert(mpi_size_ptr); - - if (setup_ptr == NULL) { - - success = FALSE; - HDfprintf(stdout, "%s: bad arg(s) on entry.\n", fcn_name); - } - - if ((success) && ((argc != 1) && (argc != 2) && (argc != 4))) { - - success = FALSE; - usage(); - } - - if ((success) && (argc >= 2)) { - - if (strcmp(argv[1], ops[0]) == 0) { - - if (argc != 2) { - - success = FALSE; - usage(); - } - else { - - *setup_ptr = TRUE; - } - } - else if (strcmp(argv[1], ops[1]) == 0) { - - if (argc != 4) { - - success = FALSE; - usage(); - } - else { - - *ici_ptr = TRUE; - *file_idx_ptr = atoi(argv[2]); - *mpi_size_ptr = atoi(argv[3]); - } - } - } - - if ((success) && (display)) { - - if (*setup_ptr) - - HDfprintf(stdout, "t_cache_image setup\n"); - - else if (*ici_ptr) - - HDfprintf(stdout, "t_cache_image ici %d %d\n", *file_idx_ptr, *mpi_size_ptr); - - else - - HDfprintf(stdout, "t_cache_image\n"); - } - - return (success); - -} /* parse_flags() */ - -/*------------------------------------------------------------------------- - * Function: usage - * - * Purpose: Display a brief message describing the purpose and use - * of the program. - * - * Return: void - * - * Programmer: John Mainzer - * 4/28/11 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -void -usage(void) -{ - const char *s[] = { - "\n", - "t_cache_image:\n", - "\n", - "Run the parallel cache image tests. \n" - "\n" - "In general, this program is run via MPI. However, at present, files\n" - "with cache images can only be constructed by serial processes.\n", - "\n", - "To square this circle, one process in the parallel computation \n" - "forks a serial version of the test program to handle this detail.\n", - "The \"setup\" parameter indicates that t_cache_image is being \n", - "invokde for this purpose.\n", - "\n", - "Similarly, only a serial process can add a cache image to an\n", - "existing file.\n", - "\n", - "Here again, one process forks a serial version of the test program\n", - "with the \"ici\" parameter.\n" - "\n", - "usage: t_cache_image [setup|ici m n]\n", - "\n", - "where:\n", - "\n", - " setup parameter forces creation of test file\n", - "\n", - " ici parameter forces insertion of a cache image into the \n", - " m th test file, created by a parallel computation with .\n", - " n processes\n", - "\n", - "Returns 0 on success, 1 on failure.\n", - "\n", - NULL, - }; - int i = 0; - - while (s[i] != NULL) { - HDfprintf(stdout, "%s", s[i]); - i++; - } - - return; -} /* usage() */ - -/*------------------------------------------------------------------------- * Function: verify_data_sets() * * Purpose: If pass is TRUE on entry, verify that the data sets in the @@ -3814,13 +3594,6 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) } /* smoke_check_1() */ -/* 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. - */ -#ifdef H5_HAVE_FORK - /*------------------------------------------------------------------------- * Function: main * @@ -3850,65 +3623,12 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) int main(int argc, char **argv) { - hbool_t setup = FALSE; - hbool_t ici = FALSE; unsigned nerrs = 0; MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; - int file_idx; - int i; int mpi_size; int mpi_rank; - if (!parse_flags(argc, argv, &setup, &ici, &file_idx, &mpi_size, FALSE)) - exit(1); /* exit now if unable to parse flags */ - - if (setup) { /* construct test files and exit */ - - H5open(); - HDfprintf(stdout, "Constructing test files: \n"); - HDfflush(stdout); - - i = 0; - while ((FILENAMES[i] != NULL) && (i < TEST_FILES_TO_CONSTRUCT)) { - - HDfprintf(stdout, " writing %s ... ", FILENAMES[i]); - HDfflush(stdout); - construct_test_file(i); - - if (pass) { - - HDprintf("done.\n"); - HDfflush(stdout); - } - else { - - HDprintf("failed.\n"); - HDexit(1); - } - i++; - } - - HDfprintf(stdout, "Test file construction complete.\n"); - HDexit(0); - } - else if (ici) { - - if (serial_insert_cache_image(file_idx, mpi_size)) { - - HDexit(0); - } - else { - - HDfprintf(stderr, "\n\nCache image insertion failed.\n"); - HDfprintf(stderr, " failure mssg = \"%s\"\n", failure_mssg); - HDexit(1); - } - } - - HDassert(!setup); - HDassert(!ici); - MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); @@ -3918,9 +3638,8 @@ 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(); @@ -3932,71 +3651,45 @@ main(int argc, char **argv) } if (mpi_size < 2) { - - if (mpi_rank == 0) { - + if (mpi_rank == 0) HDprintf(" Need at least 2 processes. Exiting.\n"); - } goto finish; } if (mpi_rank == 0) { /* create test files */ + int i; - int child_status; - pid_t child_pid; - - child_pid = fork(); - - if (child_pid == 0) { /* this is the child process */ - - /* fun and games to shutup the compiler */ - char param0[32] = "t_cache_image"; - char param1[32] = "setup"; - char *child_argv[] = {param0, param1, NULL}; - - /* we may need to play with the path here */ - if (execv("t_cache_image", child_argv) == -1) { - - HDfprintf(stdout, "execl() of setup process failed. errno = %d(%s)\n", errno, - strerror(errno)); - HDexit(1); - } - } - else if (child_pid != -1) { - /* this is the parent process -- wait until child is done */ - if (-1 == waitpid(child_pid, &child_status, WUNTRACED)) { - - HDfprintf(stdout, "can't wait on setup process.\n"); - } - else if (!WIFEXITED(child_status)) { + HDfprintf(stdout, "Constructing test files: \n"); + HDfflush(stdout); - HDfprintf(stdout, "setup process hasn't exitied.\n"); - } - else if (WEXITSTATUS(child_status) != 0) { + i = 0; + while ((FILENAMES[i] != NULL) && (i < TEST_FILES_TO_CONSTRUCT)) { + HDfprintf(stdout, " writing %s ... ", FILENAMES[i]); + HDfflush(stdout); + construct_test_file(i); - HDfprintf(stdout, "setup process reports failure.\n"); + if (pass) { + HDprintf("done.\n"); + HDfflush(stdout); } else { - - HDfprintf(stdout, "testfile construction complete -- proceeding with tests.\n"); + HDprintf("failed.\n"); + HDexit(EXIT_FAILURE); } + i++; } - else { /* fork failed */ - - HDfprintf(stdout, "can't create process to construct test file.\n"); - } + HDfprintf(stdout, "Test file construction complete.\n"); } /* can't start test until test files exist */ MPI_Barrier(MPI_COMM_WORLD); nerrs += verify_cache_image_RO(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank); -#if 1 nerrs += verify_cache_image_RO(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank); nerrs += verify_cache_image_RW(0, H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY, mpi_rank); nerrs += verify_cache_image_RW(1, H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED, mpi_rank); nerrs += smoke_check_1(comm, info, mpi_rank, mpi_size); -#endif + finish: /* make sure all processes are finished before final report, cleanup @@ -4005,19 +3698,14 @@ finish: MPI_Barrier(MPI_COMM_WORLD); if (mpi_rank == 0) { /* only process 0 reports */ - HDsleep(10); HDprintf("===================================\n"); - if (nerrs > 0) { + if (nerrs > 0) HDprintf("***metadata cache image tests detected %d failures***\n", nerrs); - } - else { + else HDprintf("metadata cache image tests finished with no failures\n"); - } HDprintf("===================================\n"); } - /* takedown_derived_types(); */ - /* close HDF5 library */ H5close(); @@ -4028,13 +3716,3 @@ finish: return (nerrs > 0); } /* main() */ -#else /* H5_HAVE_FORK */ - -int -main(void) -{ - HDfprintf(stderr, "Non-POSIX platform. Skipping.\n"); - return EXIT_SUCCESS; -} /* end main() */ - -#endif /* H5_HAVE_FORK */ diff --git a/testpar/t_dset.c b/testpar/t_dset.c index ec1ecf7..aa51440 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -3985,9 +3985,9 @@ no_collective_cause_tests(void) test_no_collective_cause_mode(TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT); test_no_collective_cause_mode(TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL); #ifdef LATER /* fletcher32 */ - /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and - * H5Dwrite is ready for mpio + filter feature. - */ + /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and + * H5Dwrite is ready for mpio + filter feature. + */ /* test_no_collective_cause_mode (TEST_FILTERS); */ test_no_collective_cause_mode_filter(TEST_FILTERS_READ); #endif /* LATER */ diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index 10d6c27..a50cb24 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -346,7 +346,7 @@ test_filter_read(void) VRFY(hrc >= 0, "H5Pclose"); } #endif /* H5_HAVE_FILTER_SZIP */ - } /* end for */ + } /* end for */ /*---------------------------------------------------------- * STEP 4: Test shuffling by itself. diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index a4bc26d..bf4ce73 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -1456,10 +1456,8 @@ read_attribute(hid_t obj_id, int this_type, int num) if (this_type == is_group) { HDsprintf(attr_name, "Group Attribute %d", num); aid = H5Aopen(obj_id, attr_name, H5P_DEFAULT); - if (MAINPROCESS) { - H5Aread(aid, H5T_NATIVE_INT, &in_num); - vrfy_errors = dataset_vrfy(NULL, NULL, NULL, group_block, &in_num, &num); - } + H5Aread(aid, H5T_NATIVE_INT, &in_num); + vrfy_errors = dataset_vrfy(NULL, NULL, NULL, group_block, &in_num, &num); H5Aclose(aid); } else if (this_type == is_dset) { @@ -1467,10 +1465,8 @@ read_attribute(hid_t obj_id, int this_type, int num) for (i = 0; i < 8; i++) out_data[i] = i; aid = H5Aopen(obj_id, attr_name, H5P_DEFAULT); - if (MAINPROCESS) { - H5Aread(aid, H5T_NATIVE_INT, in_data); - vrfy_errors = dataset_vrfy(NULL, NULL, NULL, dset_block, in_data, out_data); - } + H5Aread(aid, H5T_NATIVE_INT, in_data); + vrfy_errors = dataset_vrfy(NULL, NULL, NULL, dset_block, in_data, out_data); H5Aclose(aid); } diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 1c5e875..be3f6e1 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -578,7 +578,7 @@ hs_dr_pio_test__takedown(struct hs_dr_pio_test_vars_t *tv_ptr) { #if HS_DR_PIO_TEST__TAKEDOWN__DEBUG const char *fcnName = "hs_dr_pio_test__takedown()"; -#endif /* HS_DR_PIO_TEST__TAKEDOWN__DEBUG */ +#endif /* HS_DR_PIO_TEST__TAKEDOWN__DEBUG */ int mpi_rank; /* needed by the VRFY macro */ herr_t ret; /* Generic return value */ diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index ec83d91..aa72998 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -692,7 +692,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* Use the asprintf() routine, since it does what we're trying to do below */ if (HDasprintf(&obj1fullname, "/%s", objname1) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); -#else /* H5_HAVE_ASPRINTF */ +#else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ if ((obj1fullname = (char *)HDmalloc(HDstrlen(objname1) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); @@ -711,7 +711,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char /* Use the asprintf() routine, since it does what we're trying to do below */ if (HDasprintf(&obj2fullname, "/%s", objname2) < 0) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); -#else /* H5_HAVE_ASPRINTF */ +#else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ if ((obj2fullname = (char *)HDmalloc(HDstrlen(objname2) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); @@ -1174,7 +1174,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, if (HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } -#else /* H5_HAVE_ASPRINTF */ +#else /* H5_HAVE_ASPRINTF */ if ((obj1_fullpath = (char *)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); @@ -1192,7 +1192,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, if (HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } -#else /* H5_HAVE_ASPRINTF */ +#else /* H5_HAVE_ASPRINTF */ if ((obj2_fullpath = (char *)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); @@ -1388,7 +1388,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, } /* end else */ } /* end if */ } /* end else */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ if (obj1_fullpath) HDfree(obj1_fullpath); if (obj2_fullpath) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index b998784..b3efeab 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -1279,7 +1279,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co } nfound += diff_ldouble_element(mem1, mem2, elemtno, opts); } /*H5T_NATIVE_LDOUBLE*/ -#endif /* H5_SIZEOF_LONG_DOUBLE */ +#endif /* H5_SIZEOF_LONG_DOUBLE */ break; /* H5T_FLOAT class */ diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 533237c..01577db 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -932,7 +932,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); } } /* end if (sizeof(long long) == nsize) */ -#endif /* H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG */ +#endif /* H5_SIZEOF_LONG != H5_SIZEOF_LONG_LONG */ break; case H5T_COMPOUND: @@ -1268,7 +1268,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai for (x = 0; x < ctx->indent_level + 1; x++) h5tools_str_append(str, "%s", OPT(info->line_indent, "")); } /* end if */ -#endif /* LATER */ +#endif /* LATER */ ctx->indent_level++; diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index 80873fd..969dbab 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -613,7 +613,7 @@ test_populate_ros3_fa(void) hbool_t show_progress = FALSE; int bad_version = 0xf87a; /* arbitrarily wrong version number */ -#endif /* H5_HAVE_ROS3_VFD */ +#endif /* H5_HAVE_ROS3_VFD */ TESTING("programmatic ros3 fapl population"); @@ -1028,7 +1028,7 @@ test_set_configured_fapl(void) "", /* user name */ 2048, /* stream buffer size */ }; -#endif /* H5_HAVE_LIBHDFS */ +#endif /* H5_HAVE_LIBHDFS */ unsigned n_cases = 7; /* number of common testcases */ testcase cases[] = { { @@ -1279,7 +1279,7 @@ main(void) #ifdef _H5TEST_ h5reset(); /* h5test? */ -#endif /* _H5TEST_ */ +#endif /* _H5TEST_ */ HDfprintf(stdout, "Testing h5tools_utils corpus.\n"); diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 91d3ea9..a664e6f 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -405,7 +405,7 @@ # -------------------------------------------------------------------- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files") - if (WIN32 OR MINGW) + if (WIN32) 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}") diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index af73b75..81d619c 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -51,6 +51,7 @@ ${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_nbit.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_objs.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_refs.h5 @@ -1549,6 +1550,11 @@ # Note: this test is experimental for sharing test file among tools 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 (TESTTYPE "TEST") + ADD_H5_FILTER_TEST (HDFFV-10590 "" ${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/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index a95a22e..3764081 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -128,6 +128,8 @@ $SRC_H5REPACK_TESTFILES/h5repack_paged_nopersist.h5 $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 ########tools/testfiles#for#external#links######## $SRC_TOOLS_TESTFILES/tsoftlinks.h5 $SRC_TOOLS_TESTFILES/textlinkfar.h5 @@ -865,6 +867,34 @@ TOOLTESTV() rm -f $outfile } +# Same as TOOLTEST, but expects h5repack fails +# +TOOLTEST_FAIL() +{ + infile=$1 + outfile=$2 + expect="$TESTDIR/$2-$1.ddl" + actual="$TESTDIR/$2-$1.out" + actual_err="$TESTDIR/$2-$1.err" + shift + shift + + # Run test. + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $ENVCMD $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual + RET=$? + if [ $RET == 0 ] ; then + nerrors="`expr $nerrors + 1`" + echo " FAILED" + else + echo " PASSED" + fi + rm -f $outfile +} + # This is same as TOOLTESTV() with comparing display output # with actual filename swapped # @@ -1681,6 +1711,10 @@ TOOLTEST HDFFV-5932 h5repack_attr_refs.h5 # Note: this test is experimental for sharing test file among tools 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" +TOOLTEST_FAIL $arg + # tests for metadata block size option TOOLTEST_META meta_short h5repack_layout.h5 -M 8192 TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 diff --git a/tools/test/h5repack/testfiles/h5repack_HDFFV-10590_CVE-2018-17432.h5 b/tools/test/h5repack/testfiles/h5repack_HDFFV-10590_CVE-2018-17432.h5 Binary files differnew file mode 100644 index 0000000..7a815ba --- /dev/null +++ b/tools/test/h5repack/testfiles/h5repack_HDFFV-10590_CVE-2018-17432.h5 diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst index 9e83ff8..6f586cc 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst @@ -1,7 +1,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dcreate2(): unable to create dataset major: Dataset - minor: Unable to initialize object + minor: Unable to create file #001: (file name) line (number) in H5VL_dataset_create(): dataset create failed major: Virtual Object Layer minor: Unable to create file diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index 22aca04..df4c569 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -465,7 +465,7 @@ parse_args(int argc, char **argv) * End: */ -#else /* H5_HAVE_PARALLEL */ +#else /* H5_HAVE_PARALLEL */ /* dummy program since H5_HAVE_PARALLEL is not configured in */ int main(int H5_ATTR_UNUSED argc, char H5_ATTR_UNUSED **argv) diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index d64f421..2f812d7 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -224,14 +224,14 @@ H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz); #define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/ #define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/ #define HDisatty(F) isatty(F) -#define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ -#define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ -#define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ -#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ -#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ -#define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ -#define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ -#define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ +#define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ +#define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ +#define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ +#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ +#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ +#define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ +#define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ +#define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ #define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/ #define HDkill(P, S) kill(P, S) #define HDlabs(X) labs(X) @@ -458,7 +458,7 @@ H5_DLL int c99_vsnprintf(char *str, size_t size, const char *format, va_list ap) #else /* H5_HAVE_WIN32_API */ #if !defined strdup && !defined H5_HAVE_STRDUP -extern char * strdup(const char *s); +extern char *strdup(const char *s); #endif #define HDstrdup(S) strdup(S) diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 4001257..c0e0793 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -239,14 +239,14 @@ H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz); #define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/ #define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/ #define HDisatty(F) isatty(F) -#define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ -#define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ -#define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ -#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ -#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ -#define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ -#define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ -#define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ +#define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ +#define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ +#define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ +#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ +#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ +#define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ +#define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ +#define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ #define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/ #define HDkill(P, S) kill(P, S) #define HDlabs(X) labs(X) @@ -473,7 +473,7 @@ H5_DLL int c99_vsnprintf(char *str, size_t size, const char *format, va_list ap) #else /* H5_HAVE_WIN32_API */ #if !defined strdup && !defined H5_HAVE_STRDUP -extern char * strdup(const char *s); +extern char *strdup(const char *s); #endif #define HDstrdup(S) strdup(S) |