summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Gruber <gruber1@hdfgroup.org>2012-03-21 22:30:53 (GMT)
committerJacob Gruber <gruber1@hdfgroup.org>2012-03-21 22:30:53 (GMT)
commit6321d6f37b9e6cfa8691d6d1f65dc96a098edb18 (patch)
treea81e1773694f88f3698deb2993d62370386db4dc
parent1dfe7e0483a05d4065cc264f36eec54026d3c595 (diff)
parent0d118ea88a384bb18afa87a8ae068ceb99dc812c (diff)
downloadhdf5-6321d6f37b9e6cfa8691d6d1f65dc96a098edb18.zip
hdf5-6321d6f37b9e6cfa8691d6d1f65dc96a098edb18.tar.gz
hdf5-6321d6f37b9e6cfa8691d6d1f65dc96a098edb18.tar.bz2
[svn-r22118] merged with r22116. Made some minor edits putting existing code in line with the RFC.
-rw-r--r--MANIFEST21
-rw-r--r--README.txt2
-rw-r--r--c++/src/Makefile.in2
-rw-r--r--config/cmake/ConfigureChecks.cmake4
-rw-r--r--config/gnu-flags8
-rw-r--r--config/ibm-aix74
-rw-r--r--config/ibm-flags32
-rw-r--r--config/intel-flags2
-rw-r--r--config/lt_vers.am2
-rwxr-xr-xconfigure24
-rw-r--r--configure.in2
-rw-r--r--fortran/src/Makefile.in2
-rw-r--r--hl/c++/src/Makefile.in2
-rwxr-xr-xhl/fortran/src/H5LTf90proto.h8
-rwxr-xr-xhl/fortran/src/H5LTfc.c51
-rwxr-xr-xhl/fortran/src/H5LTff.f9067
-rw-r--r--hl/fortran/src/Makefile.in2
-rw-r--r--hl/fortran/test/tstlite.f9087
-rw-r--r--hl/src/H5LT.c108
-rw-r--r--hl/src/H5LTpublic.h3
-rw-r--r--hl/src/Makefile.in2
-rw-r--r--[-rwxr-xr-x]hl/test/COPYING0
-rw-r--r--hl/test/test_ds.c826
-rw-r--r--hl/test/test_image.c54
-rw-r--r--hl/test/test_lite.c534
-rw-r--r--hl/test/test_packet.c14
-rw-r--r--hl/test/test_table.c56
-rw-r--r--hl/tools/gif2h5/gif2hdf.c4
-rw-r--r--hl/tools/gif2h5/gif2mem.c2
-rw-r--r--hl/tools/gif2h5/hdf2gif.c4
-rw-r--r--perform/pio_engine.c42
-rw-r--r--perform/pio_perf.c5
-rw-r--r--perform/pio_perf.h1
-rw-r--r--perform/pio_timer.c66
-rw-r--r--perform/pio_timer.h4
-rw-r--r--perform/sio_engine.c28
-rw-r--r--perform/sio_perf.c5
-rw-r--r--perform/sio_perf.h29
-rw-r--r--perform/sio_timer.c36
-rw-r--r--perform/sio_timer.h6
-rw-r--r--perform/zip_perf.c4
-rw-r--r--release_docs/RELEASE.txt59
-rw-r--r--src/H5Dint.c17
-rw-r--r--src/H5FD.c35
-rw-r--r--src/H5FDfamily.c27
-rw-r--r--src/H5FDmpio.c94
-rw-r--r--src/H5FDmulti.c26
-rw-r--r--src/H5FDnull.c80
-rw-r--r--src/H5FDprivate.h2
-rw-r--r--src/H5FDpublic.h2
-rw-r--r--src/H5Fmpi.c82
-rw-r--r--src/H5Fpublic.h4
-rw-r--r--src/H5Fsuper_cache.c17
-rw-r--r--src/H5Oalloc.c46
-rw-r--r--src/H5Ocopy.c3
-rw-r--r--src/H5Odbg.c31
-rw-r--r--src/H5Olayout.c10
-rw-r--r--src/H5Omessage.c5
-rw-r--r--src/H5S.c9
-rw-r--r--src/H5Ztrans.c201
-rw-r--r--src/H5public.h4
-rw-r--r--src/Makefile.in2
-rw-r--r--[-rwxr-xr-x]test/COPYING0
-rw-r--r--test/big.c578
-rw-r--r--[-rwxr-xr-x]test/corrupt_stab_msg.h5bin2928 -> 2928 bytes
-rw-r--r--[-rwxr-xr-x]test/cross_read.c0
-rw-r--r--test/dtransform.c180
-rw-r--r--test/fheap.c13
-rw-r--r--[-rwxr-xr-x]test/gen_cross.c0
-rw-r--r--test/istore.c48
-rw-r--r--[-rwxr-xr-x]test/objcopy.c0
-rw-r--r--[-rwxr-xr-x]test/reserved.c0
-rw-r--r--test/tattr.c342
-rw-r--r--test/th5s.c966
-rw-r--r--test/tmisc.c78
-rw-r--r--testpar/t_dset.c325
-rw-r--r--testpar/testphdf5.c12
-rw-r--r--testpar/testphdf5.h3
-rw-r--r--tools/CMakeLists.txt1
-rw-r--r--tools/h5copy/CMakeLists.txt3
-rw-r--r--tools/h5copy/h5copy.c9
-rw-r--r--tools/h5copy/h5copygentest.c11
-rw-r--r--tools/h5diff/CMakeLists.txt44
-rw-r--r--tools/h5diff/h5diff_common.c5
-rw-r--r--tools/h5diff/h5diff_main.c6
-rw-r--r--tools/h5diff/h5diffgentest.c116
-rw-r--r--tools/h5diff/ph5diff_main.c4
-rw-r--r--tools/h5diff/testfiles/h5diff_465.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_485.txt11
-rw-r--r--tools/h5diff/testfiles/h5diff_486.txt11
-rw-r--r--tools/h5diff/testfiles/h5diff_487.txt12
-rw-r--r--tools/h5diff/testfiles/h5diff_exclude3-1.h5bin0 -> 4792 bytes
-rw-r--r--tools/h5diff/testfiles/h5diff_exclude3-2.h5bin0 -> 2176 bytes
-rwxr-xr-xtools/h5diff/testh5diff.sh24
-rw-r--r--tools/h5dump/CMakeLists.txt78
-rw-r--r--tools/h5dump/h5dump.c608
-rw-r--r--tools/h5dump/h5dump_ddl.c293
-rw-r--r--tools/h5dump/h5dump_defines.h10
-rw-r--r--tools/h5dump/h5dump_xml.c870
-rw-r--r--tools/h5dump/h5dumpgentest.c6
-rw-r--r--tools/h5dump/testh5dump.sh.in61
-rw-r--r--tools/h5import/CMakeLists.txt1
-rwxr-xr-xtools/h5import/h5import.c866
-rwxr-xr-xtools/h5import/h5import.h2
-rw-r--r--tools/h5jam/CMakeLists.txt3
-rw-r--r--tools/h5jam/getub.c28
-rw-r--r--tools/h5jam/h5jam.c6
-rw-r--r--tools/h5jam/h5jamgentest.c4
-rw-r--r--tools/h5jam/h5unjam.c5
-rw-r--r--tools/h5jam/tellub.c26
-rw-r--r--tools/h5ls/CMakeLists.txt197
-rw-r--r--tools/h5ls/h5ls.c1461
-rw-r--r--tools/h5ls/testh5ls.sh.in10
-rw-r--r--tools/h5repack/h5repack.c32
-rw-r--r--tools/h5repack/h5repack_copy.c326
-rw-r--r--tools/h5repack/h5repack_main.c66
-rw-r--r--tools/h5repack/h5repack_opttable.c9
-rw-r--r--tools/h5repack/h5repack_parse.c55
-rw-r--r--tools/h5repack/h5repack_refs.c242
-rw-r--r--tools/h5repack/h5repack_verify.c15
-rw-r--r--tools/h5repack/h5repacktst.c6
-rw-r--r--tools/h5repack/testh5repack_detect_szip.c4
-rw-r--r--tools/h5stat/CMakeLists.txt3
-rw-r--r--tools/h5stat/h5stat.c49
-rw-r--r--tools/h5stat/h5stat_gentest.c50
-rw-r--r--tools/lib/CMakeLists.txt2
-rw-r--r--tools/lib/h5diff.c136
-rw-r--r--tools/lib/h5diff_array.c274
-rw-r--r--tools/lib/h5diff_dset.c2
-rw-r--r--tools/lib/h5diff_util.c2
-rw-r--r--tools/lib/h5tools.c31
-rw-r--r--tools/lib/h5tools.h4
-rw-r--r--tools/lib/h5tools_dump.c88
-rw-r--r--tools/lib/h5tools_dump.h4
-rw-r--r--tools/lib/h5tools_error.h7
-rw-r--r--tools/lib/h5tools_str.c60
-rw-r--r--tools/lib/h5tools_str.h2
-rw-r--r--tools/lib/h5tools_utils.c45
-rw-r--r--tools/lib/h5trav.c6
-rw-r--r--tools/misc/CMakeLists.txt1
-rw-r--r--tools/misc/h5debug.c218
-rw-r--r--tools/misc/h5mkgrp.c8
-rw-r--r--tools/testfiles/filter_fail.ddl4
-rw-r--r--tools/testfiles/h5dump-help.txt13
-rw-r--r--tools/testfiles/tarray6.h5bin6400 -> 6400 bytes
-rw-r--r--tools/testfiles/tattr-1.ddl2
-rw-r--r--tools/testfiles/tattr-2.ddl4
-rw-r--r--tools/testfiles/tattr-3.ddl13
-rw-r--r--tools/testfiles/tattr.h5bin3024 -> 3024 bytes
-rw-r--r--tools/testfiles/tattr.h5.xml2
-rw-r--r--tools/testfiles/tdset-2.ddl36
-rw-r--r--tools/testfiles/textlink.ddl50
-rw-r--r--tools/testfiles/thyperslab.ddl412
-rw-r--r--tools/testfiles/tnofilename-with-packed-bits.ddl14
-rw-r--r--tools/testfiles/tnofilename.ddl86
-rw-r--r--tools/testfiles/tpbitsIncomplete.ddl13
-rw-r--r--tools/testfiles/tpbitsLengthExceeded.ddl13
-rw-r--r--tools/testfiles/tpbitsLengthPositive.ddl13
-rw-r--r--tools/testfiles/tpbitsMaxExceeded.ddl13
-rw-r--r--tools/testfiles/tpbitsOffsetExceeded.ddl13
-rw-r--r--tools/testfiles/tpbitsOffsetNegative.ddl13
-rw-r--r--tools/testfiles/tperror.ddl36
-rw-r--r--vms/src/h5pubconf.h6
-rw-r--r--windows/src/H5pubconf.h6
164 files changed, 7366 insertions, 5464 deletions
diff --git a/MANIFEST b/MANIFEST
index 8a584a1..34c19b1 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1410,10 +1410,13 @@
./tools/testfiles/tmulti-o.h5
./tools/testfiles/tmulti-r.h5
./tools/testfiles/tmulti-s.h5
+./tools/testfiles/tmultifile.ls
+./tools/testfiles/tmultifile.ddl
+./tools/testfiles/tqmarkfile.ddl
+./tools/testfiles/tstarfile.ddl
./tools/testfiles/tnbit.ddl
./tools/testfiles/tnestcomp-1.ddl
./tools/testfiles/tnestedcomp.h5
-./tools/testfiles/tnofilename.ddl
./tools/testfiles/tno-subset.h5
./tools/testfiles/tno-subset.ddl
./tools/testfiles/tnullspace.h5
@@ -1425,6 +1428,7 @@
./tools/testfiles/tscaleoffset.ddl
./tools/testfiles/tslink-1.ddl
./tools/testfiles/tslink-2.ddl
+./tools/testfiles/tslink-D.ddl
./tools/testfiles/tslink.h5
./tools/testfiles/tsplit_file-m.h5
./tools/testfiles/tsplit_file-r.h5
@@ -1851,11 +1855,18 @@
./tools/h5diff/testfiles/h5diff_458.txt
./tools/h5diff/testfiles/h5diff_459.txt
./tools/h5diff/testfiles/h5diff_465.txt
+./tools/h5diff/testfiles/h5diff_466.txt
+./tools/h5diff/testfiles/h5diff_467.txt
+./tools/h5diff/testfiles/h5diff_468.txt
+./tools/h5diff/testfiles/h5diff_469.txt
./tools/h5diff/testfiles/h5diff_480.txt
./tools/h5diff/testfiles/h5diff_481.txt
./tools/h5diff/testfiles/h5diff_482.txt
./tools/h5diff/testfiles/h5diff_483.txt
./tools/h5diff/testfiles/h5diff_484.txt
+./tools/h5diff/testfiles/h5diff_485.txt
+./tools/h5diff/testfiles/h5diff_486.txt
+./tools/h5diff/testfiles/h5diff_487.txt
./tools/h5diff/testfiles/h5diff_500.txt
./tools/h5diff/testfiles/h5diff_501.txt
./tools/h5diff/testfiles/h5diff_502.txt
@@ -1910,6 +1921,8 @@
./tools/h5diff/testfiles/h5diff_exclude1-2.h5
./tools/h5diff/testfiles/h5diff_exclude2-1.h5
./tools/h5diff/testfiles/h5diff_exclude2-2.h5
+./tools/h5diff/testfiles/h5diff_exclude3-1.h5
+./tools/h5diff/testfiles/h5diff_exclude3-2.h5
./tools/h5diff/testfiles/h5diff_comp_vl_strs.h5
./tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5
./tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5
@@ -1954,12 +1967,12 @@
./tools/h5jam/getub.c
# test files for jam
-./tools/h5jam/testfiles/twithub.h5
-./tools/h5jam/testfiles/twithub513.h5
./tools/h5jam/testfiles/h5jam-help.txt
./tools/h5jam/testfiles/h5unjam-help.txt
-./tools/h5jam/testfiles/u10.txt
./tools/h5jam/testfiles/tall.h5
+./tools/h5jam/testfiles/twithub.h5
+./tools/h5jam/testfiles/twithub513.h5
+./tools/h5jam/testfiles/u10.txt
./tools/h5jam/testfiles/u511.txt
./tools/h5jam/testfiles/u512.txt
./tools/h5jam/testfiles/u513.txt
diff --git a/README.txt b/README.txt
index 369b851..1934e39 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.109 currently under development
+HDF5 version 1.9.112 currently under development
Please refer to the release_docs/INSTALL file for installation instructions.
------------------------------------------------------------------------------
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 3724120..159bbf6 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 99
+LT_VERS_REVISION = 102
LT_VERS_AGE = 0
# Include src directory
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 8f9ffb9..963152c 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -132,9 +132,9 @@ IF (WIN32)
SET (H5_HAVE_WIN32_API 1)
IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
SET (WINDOWS 1)
- IF (MSVC_IDE)
+ IF (MSVC)
SET (H5_HAVE_VISUAL_STUDIO 1)
- ENDIF (MSVC_IDE)
+ ENDIF (MSVC)
ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
ENDIF (WIN32)
diff --git a/config/gnu-flags b/config/gnu-flags
index 1222c87..38ea4e4 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -28,8 +28,14 @@
if test X = "X$cc_flags_set"; then
# PathScale compiler spits out gcc version string too. Need to
# filter it out.
+ # icc beginning with version 12 includes a "gcc version compatiblilty"
+ # string, causing the gcc H5_CFLAGS to be erroneously added. The line
+ # "grep -v 'icc version'" causes the discarding of any output
+ # containing 'icc version'. The cc_version for icc is correctly determined
+ # and flags added in the intel-flags script.
cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 | grep -v 'PathScale' |\
- grep 'gcc version' | sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
+ grep -v 'icc version' |\
+ grep 'gcc version' | sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'`
cc_version=`echo $cc_version |sed 's/[-a-z]//g'`
if test X = "X$cc_vendor" -a X != "X$cc_version"; then
diff --git a/config/ibm-aix b/config/ibm-aix
index ff541bc..c8b1fc3 100644
--- a/config/ibm-aix
+++ b/config/ibm-aix
@@ -39,6 +39,42 @@ if test "X-$enable_parallel" = "X-yes" -o X-$CC_BASENAME = X-mpcc_r; then
RUNPARALLEL=${RUNPARALLEL="env MP_PROCS=\$\${NPROCS:=6} MP_TASKS_PER_NODE=\$\${NPROCS:=6} poe"}
fi
+# The default Fortran 90 compiler
+
+if test "X-" = "X-$FC"; then
+ if test "X-$enable_parallel" = "X-yes"; then
+ FC=mpxlf90_r
+ else
+ FC=xlf90
+ fi
+fi
+
+# While we try to avoid setting FCFLAGS directly for use in compilation, in
+# this case we need the -k flag present for some configure checks. As such,
+# the configure script saves the user's set FCFLAGS before running, and
+# restores them when complete. We must then set up both FCFLAGS and H5_FCFLAGS
+# to ensure the flag is present for both configure as well as for the build.
+if test "X-" = "X-$f9x_flags_set"; then
+ F9XSUFFIXFLAG="-qsuffix=f=f90"
+ FCFLAGS="$FCFLAGS -O ${F9XSUFFIXFLAG}"
+ H5_FCFLAGS="$H5_FCFLAGS -O ${F9XSUFFIXFLAG}"
+ FSEARCH_DIRS="-I./ -I../src"
+ DEBUG_FCFLAGS="-O"
+ PROD_FCFLAGS="-O"
+ PROFILE_FCFLAGS="-O"
+ f9x_flags_set=yes
+fi
+
+# The default C++ compiler
+
+# Use AIX supplied C++ compiler by default.
+CXX=${CXX=xlC}
+
+# Added -qweaksymbol to suppress linker messages warning of duplicate
+# symbols; these warnings are harmless. - BMR
+H5_CXXFLAGS="$H5_CXXFLAGS -qweaksymbol"
+AM_CXXFLAGS="$AM_CXXFLAGS"
+
#----------------------------------------------------------------------------
# Compiler flags. The CPPFLAGS values should not include package debug
@@ -112,41 +148,3 @@ ac_cv_sizeof_uint_fast64_t=${ac_cv_sizeof_uint_fast64_t=8}
# Don't cache long since it varies between 32 and 64 bits
#ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
-
-# The default Fortran 90 compiler
-
-if test "X-" = "X-$FC"; then
- if test "X-$enable_parallel" = "X-yes"; then
- FC=mpxlf90_r
- else
- FC=xlf90
- fi
-fi
-
-# While we try to avoid setting FCFLAGS directly for use in compilation, in
-# this case we need the -k flag present for some configure checks. As such,
-# the configure script saves the user's set FCFLAGS before running, and
-# restores them when complete. We must then set up both FCFLAGS and H5_FCFLAGS
-# to ensure the flag is present for both configure as well as for the build.
-if test "X-" = "X-$f9x_flags_set"; then
- F9XSUFFIXFLAG="-qsuffix=f=f90"
- FCFLAGS="$FCFLAGS -O ${F9XSUFFIXFLAG}"
- H5_FCFLAGS="$H5_FCFLAGS -O ${F9XSUFFIXFLAG}"
- FSEARCH_DIRS="-I./ -I../src"
- DEBUG_FCFLAGS="-O"
- PROD_FCFLAGS="-O"
- PROFILE_FCFLAGS="-O"
- f9x_flags_set=yes
-fi
-
-# The default C++ compiler
-
-# Use AIX supplied C++ compiler by default.
-CXX=${CXX=xlC}
-
-# Added -qweaksymbol to suppress linker messages warning of duplicate
-# symbols; these warnings are harmless. - BMR
-H5_CXXFLAGS="$H5_CXXFLAGS -qweaksymbol"
-AM_CXXFLAGS="$AM_CXXFLAGS"
-
-
diff --git a/config/ibm-flags b/config/ibm-flags
index 5e092b8..a1dfa2a 100644
--- a/config/ibm-flags
+++ b/config/ibm-flags
@@ -19,8 +19,8 @@
# if the compiler is not IBM; otherwise `cc_flags_set' is set to `yes'
#
-# Get the compiler version in a way that works for pgcc
-# pgcc unless a compiler version is already known
+# Get the compiler version in a way that works for XL compiler
+# unless a compiler version is already defined.
#
# cc_vendor: The compiler product name: XL
# cc_version: Version number: 10.1
@@ -75,3 +75,31 @@ if test "X-$cc_flags_set" = "X-"; then
cc_version=
cc_version_info=
fi
+
+
+# get fortran version info
+if test X != X$FC; then
+ # Verify this is an IBM XL compiler
+ fc_version="`$FC $FCFLAGS -qversion 2>&1 | grep 'IBM XL Fortran'`"
+ if test X != "X$fc_version"; then
+ fc_vendor="XL"
+ fc_version="`$FC $FCFLAGS -qversion 2>&1 | sed -n 's/Version: \([0-9\.]*\).*/\1/p'`"
+ fc_version_info="IBM XL Fortran $fc_version"
+ echo "compiler '$FC' is IBM $fc_vendor-$fc_version"
+
+ fi
+fi
+
+
+# get c++ version info
+if test X != X$CXX; then
+ # Verify this is an IBM XL compiler
+ cxx_version="`$CXX $CXXFLAGS -qversion 2>&1 | grep 'IBM XL C/C++'`"
+ if test X != "X$cxx_version"; then
+ cxx_vendor="XL"
+ cxx_version="`$CXX $CXXFLAGS -qversion 2>&1 | sed -n 's/Version: \([0-9\.]*\).*/\1/p'`"
+ cxx_version_info="IBM XL C/C++ $cxx_version"
+ echo "compiler '$CXX' is IBM $cxx_vendor-$cxx_version"
+
+ fi
+fi
diff --git a/config/intel-flags b/config/intel-flags
index e6a9c31..1d01d7f 100644
--- a/config/intel-flags
+++ b/config/intel-flags
@@ -93,7 +93,7 @@ fi
# Please follow the pattern below by adding new versions at the top, copying
# the information from the previous version and adding modifications to that.
case "$cc_vendor-$cc_version" in
- icc-11*)
+ icc-11* | icc-12*)
# -s became obsolete; we also fixed bugs that allow us to enable higher level
# of optimization starting with 1.8.7
PROD_CFLAGS="-O3"
diff --git a/config/lt_vers.am b/config/lt_vers.am
index 1f30524..daf5dc6 100644
--- a/config/lt_vers.am
+++ b/config/lt_vers.am
@@ -17,7 +17,7 @@
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 99
+LT_VERS_REVISION = 102
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and
diff --git a/configure b/configure
index 0a33f2c..c6f46b2 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
-# From configure.in Id: configure.in 21910 2012-02-05 15:51:01Z hdftest .
+# From configure.in Id: configure.in 22040 2012-03-11 15:52:04Z hdftest .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for HDF5 1.9.109.
+# Generated by GNU Autoconf 2.68 for HDF5 1.9.112.
#
# Report bugs to <help@hdfgroup.org>.
#
@@ -571,8 +571,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='HDF5'
PACKAGE_TARNAME='hdf5'
-PACKAGE_VERSION='1.9.109'
-PACKAGE_STRING='HDF5 1.9.109'
+PACKAGE_VERSION='1.9.112'
+PACKAGE_STRING='HDF5 1.9.112'
PACKAGE_BUGREPORT='help@hdfgroup.org'
PACKAGE_URL=''
@@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures HDF5 1.9.109 to adapt to many kinds of systems.
+\`configure' configures HDF5 1.9.112 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1533,7 +1533,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of HDF5 1.9.109:";;
+ short | recursive ) echo "Configuration of HDF5 1.9.112:";;
esac
cat <<\_ACEOF
@@ -1726,7 +1726,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-HDF5 configure 1.9.109
+HDF5 configure 1.9.112
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by HDF5 $as_me 1.9.109, which was
+It was created by HDF5 $as_me 1.9.112, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -3636,7 +3636,7 @@ fi
# Define the identity of the package.
PACKAGE='hdf5'
- VERSION='1.9.109'
+ VERSION='1.9.112'
cat >>confdefs.h <<_ACEOF
@@ -30611,7 +30611,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by HDF5 $as_me 1.9.109, which was
+This file was extended by HDF5 $as_me 1.9.112, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -30677,7 +30677,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-HDF5 config.status 1.9.109
+HDF5 config.status 1.9.112
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
@@ -33471,7 +33471,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-HDF5 config.lt 1.9.109
+HDF5 config.lt 1.9.112
configured by $0, generated by GNU Autoconf 2.68.
Copyright (C) 2010 Free Software Foundation, Inc.
diff --git a/configure.in b/configure.in
index 6dfab74..6be679a 100644
--- a/configure.in
+++ b/configure.in
@@ -26,7 +26,7 @@ dnl
dnl NOTE: Don't forget to change the version number here when we do a
dnl release!!!
dnl
-AC_INIT([HDF5], [1.9.109], [help@hdfgroup.org])
+AC_INIT([HDF5], [1.9.112], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AM_CONFIG_HEADER([src/H5config.h])
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index ca2c624..35fafee 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 99
+LT_VERS_REVISION = 102
LT_VERS_AGE = 0
# Include src directory in both Fortran and C flags (C compiler is used
diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in
index 3a34444..6dae65a 100644
--- a/hl/c++/src/Makefile.in
+++ b/hl/c++/src/Makefile.in
@@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 99
+LT_VERS_REVISION = 102
LT_VERS_AGE = 0
# Include src directory
diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h
index 5525af9..205871c 100755
--- a/hl/fortran/src/H5LTf90proto.h
+++ b/hl/fortran/src/H5LTf90proto.h
@@ -149,6 +149,7 @@ H5_FCDLL void HD5packFstring (char *src, char *dest, size_t len);
#define nh5ltget_attribute_ndims_c H5_FC_FUNC_(h5ltget_attribute_ndims_c, H5LTGET_ATTRIBUTE_NDIMS_C)
#define nh5ltget_attribute_info_c H5_FC_FUNC_(h5ltget_attribute_info_c, H5LTGET_ATTRIBUTE_INFO_C)
+#define nh5ltpath_valid_c H5_FC_FUNC_(h5ltpath_valid_c, H5LTPATH_VALID_C)
/*-------------------------------------------------------------------------
* Image
@@ -1197,6 +1198,13 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id,
_fcd name,
char *buf);
+HDF5_HL_F90CSTUBDLL
+int_f
+nh5ltpath_valid_c(hid_t_f *loc_id,
+ _fcd path,
+ int_f *pathlen,
+ int_f *check_object_valid_c);
+
/*-------------------------------------------------------------------------
* Image
*-------------------------------------------------------------------------
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c
index 484acf1..c0b7695 100755
--- a/hl/fortran/src/H5LTfc.c
+++ b/hl/fortran/src/H5LTfc.c
@@ -2124,3 +2124,54 @@ done:
return ret_value;
}
+
+/*-------------------------------------------------------------------------
+* Function: h5ltpath_valid_c
+*
+* Purpose: Calls h5ltpath_valid
+*
+* Return: Success: 0, Failure: -1
+*
+* Programmer: M. Scot Breitenfeld
+*
+* Date: February 18, 2012
+*
+* Comments:
+*
+* Modifications:
+*
+*
+*-------------------------------------------------------------------------
+*/
+
+int_f
+nh5ltpath_valid_c(hid_t_f *loc_id,
+ _fcd path,
+ int_f *pathlen,
+ int_f *check_object_valid_c)
+{
+ htri_t ret = -1;
+ char *c_path = NULL;
+ hbool_t check_object_valid;
+
+ /*
+ * convert FORTRAN name to C name
+ */
+ if( NULL == (c_path = (char *)HD5f2cstring(path, (int)*pathlen)))
+ goto done;
+
+ check_object_valid = FALSE;
+ if(*check_object_valid_c == 1)
+ check_object_valid = TRUE;
+
+ /*
+ * call H5LTpath_valid function.
+ */
+ ret = H5LTpath_valid( (hid_t)*loc_id, c_path, check_object_valid );
+
+done:
+ if(c_path != NULL)
+ free(c_path);
+
+ return (int_f)ret;
+}
diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90
index cbc9b96..7d53ab7 100755
--- a/hl/fortran/src/H5LTff.f90
+++ b/hl/fortran/src/H5LTff.f90
@@ -6308,6 +6308,73 @@ CONTAINS
errcode = h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size)
END SUBROUTINE h5ltget_attribute_info_f
+
+ !-------------------------------------------------------------------------
+ ! Function: h5ltpath_valid_f
+ !
+ ! Purpose: Validates a path
+ !
+ ! Return: Success: 0, Failure: -1
+ !
+ ! Programmer: M. Scot Breitenfeld
+ !
+ ! Date: February 18, 2012
+ !
+ ! Comments:
+ !
+ ! Modifications:
+ !
+ !-------------------------------------------------------------------------
+
+ SUBROUTINE h5ltpath_valid_f(loc_id, path, check_object_valid, path_valid, errcode)
+
+ IMPLICIT NONE
+ !
+ !This definition is needed for Windows DLLs
+ !DEC$if defined(BUILD_HDF5_DLL)
+ !DEC$attributes dllexport :: h5ltpath_valid_f
+ !DEC$endif
+ !
+ INTEGER(hid_t) , INTENT(IN) :: loc_id ! File or group identifier.
+ CHARACTER(LEN=*), INTENT(IN) :: path ! Path to the object to check, relative to loc_id.
+ LOGICAL , INTENT(IN) :: check_object_valid ! Indicates whether to check if the final component
+ ! of the path resolves to a valid object
+ LOGICAL , INTENT(OUT) :: path_valid ! Object status
+ INTEGER , INTENT(OUT) :: errcode ! Error code: 0 on success and -1 on failure
+
+ INTEGER :: pathlen
+ INTEGER :: check_object_valid_c
+ INTEGER :: status
+
+ INTERFACE
+ INTEGER FUNCTION h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c)
+ USE h5global
+ !DEC$IF DEFINED(HDF5F90_WINDOWS)
+ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTPATH_VALID_C'::h5ltpath_valid_c
+ !DEC$ENDIF
+ !DEC$ATTRIBUTES reference :: path
+ INTEGER(hid_t), INTENT(in) :: loc_id
+ CHARACTER(len=*), INTENT(in) :: path
+ INTEGER :: pathlen
+ INTEGER :: check_object_valid_c
+ END FUNCTION h5ltpath_valid_c
+ END INTERFACE
+
+ check_object_valid_c = 0
+ IF(check_object_valid) check_object_valid_c = 1
+
+ pathlen = LEN(path)
+ status = h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c)
+
+ path_valid = .FALSE.
+ errcode = 0
+ IF(status.EQ.1)THEN
+ path_valid = .TRUE.
+ ELSE IF(status.LT.0)THEN
+ errcode = -1
+ ENDIF
+
+ END SUBROUTINE h5ltpath_valid_f
! end
!
END MODULE H5LT
diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in
index d02f832..62d7309 100644
--- a/hl/fortran/src/Makefile.in
+++ b/hl/fortran/src/Makefile.in
@@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 99
+LT_VERS_REVISION = 102
LT_VERS_AGE = 0
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \
-I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src
diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90
index b0e28f9..9329dba 100644
--- a/hl/fortran/test/tstlite.f90
+++ b/hl/fortran/test/tstlite.f90
@@ -1067,6 +1067,9 @@ SUBROUTINE test_datasets()
INTEGER :: has ! general purpose integer
INTEGER :: type_class
INTEGER(SIZE_T) :: type_size
+ LOGICAL :: path_valid ! status of the path
+ CHARACTER(LEN=6) :: chr_exact
+ CHARACTER(LEN=8) :: chr_lg
!
! Initialize FORTRAN predefined datatypes.
@@ -1118,6 +1121,7 @@ SUBROUTINE test_datasets()
CALL passed()
+
!-------------------------------------------------------------------------
! real
!-------------------------------------------------------------------------
@@ -1207,9 +1211,60 @@ SUBROUTINE test_datasets()
CALL passed()
+ CALL test_begin(' Test h5ltpath_valid_f ')
+ !
+ ! test function h5ltpath_valid_f
+ !
+ chr_exact = "/"//dsetname2 ! test character buffer the exact size needed
+ CALL h5ltpath_valid_f(file_id, chr_exact, .TRUE., path_valid, errcode)
+ IF(errcode.LT.0.OR..NOT.path_valid)THEN
+ PRINT *, 'error in h5ltpath_valid_f'
+ STOP
+ ENDIF
+ chr_lg = "/"//dsetname2 ! test character buffer larger then needed
+ CALL h5ltpath_valid_f(file_id, chr_lg, .TRUE., path_valid, errcode)
+ IF(errcode.LT.0.OR..NOT.path_valid)THEN
+ PRINT *, 'error in h5ltpath_valid_f'
+ STOP
+ ENDIF
+ CALL h5ltpath_valid_f(file_id, chr_lg, .FALSE., path_valid, errcode)
+ IF(errcode.LT.0.OR..NOT.path_valid)THEN
+ PRINT *, 'error in h5ltpath_valid_f'
+ STOP
+ ENDIF
+ ! Should fail, dataset does not exist
+ CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .TRUE., path_valid, errcode)
+ IF(errcode.LT.0.OR.path_valid)THEN
+ PRINT *, 'error in h5ltpath_valid_f'
+ STOP
+ ENDIF
+
+ CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .FALSE., path_valid, errcode)
+ IF(errcode.LT.0.OR.path_valid)THEN
+ PRINT *, 'error in h5ltpath_valid_f'
+ STOP
+ ENDIF
+
+ ! Create a dangling soft link
+ CALL h5lcreate_soft_f("/G2", file_id, "/G3", errcode)
+
+ ! Should pass, does not check for dangled link
+ CALL h5ltpath_valid_f(file_id, "/G3", .FALSE., path_valid, errcode)
+ IF(.NOT.path_valid)THEN
+ PRINT *, 'error in h5ltpath_valid_f'
+ STOP
+ ENDIF
+
+ ! Should fail, dangled link
+ CALL h5ltpath_valid_f(file_id, "/G2", .TRUE., path_valid, errcode)
+ IF(path_valid)THEN
+ PRINT *, 'error in h5ltpath_valid_f'
+ STOP
+ ENDIF
+ CALL passed()
CALL test_begin(' Get dataset dimensions/info ')
@@ -1296,6 +1351,8 @@ SUBROUTINE test_attributes()
CHARACTER(LEN=5), PARAMETER :: attrname5 = "attr5" ! Attribute name
CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer
CHARACTER(LEN=8) :: bufr1 ! Data buffer
+ CHARACTER(LEN=10) :: bufr1_lg ! Data buffer
+ CHARACTER(LEN=6) :: bufr1_sm ! Data buffer
INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer
INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer
REAL, DIMENSION(DIM1) :: buf3 ! Data buffer
@@ -1446,20 +1503,46 @@ SUBROUTINE test_attributes()
CALL h5ltset_attribute_string_f(file_id,dsetname1,attrname5,buf1,errcode)
!
- ! read attribute.
+ ! read attribute into a fortran character buf that is the same size as buf1.
!
CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1,errcode)
!
! compare read and write buffers.
!
-
IF ( buf1 .NE. bufr1 ) THEN
PRINT *, 'read buffer differs from write buffer'
PRINT *, buf1, ' and ', bufr1
STOP
ENDIF
+ !
+ ! read attribute into a fortran character buf that is larger then buf1.
+ !
+ CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_lg,errcode)
+
+ !
+ ! compare read and write buffers, make sure C NULL character was removed.
+ !
+ IF ( buf1(1:8) .NE. bufr1_lg(1:8) .AND. bufr1_lg(9:10) .NE. ' ' ) THEN
+ PRINT *, 'larger read buffer differs from write buffer'
+ PRINT *, buf1, ' and ', bufr1_lg
+ STOP
+ ENDIF
+
+ !
+ ! read attribute into a fortran character buf that is smaller then buf1.
+ !
+ CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_sm,errcode)
+
+ !
+ ! compare read and write buffers.
+ !
+ IF ( buf1(1:6) .NE. bufr1_sm(1:6) ) THEN
+ PRINT *, 'smaller read buffer differs from write buffer'
+ PRINT *, buf1, ' and ', bufr1_sm
+ STOP
+ ENDIF
CALL passed()
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 1cc1017..eeaceeb 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -3030,4 +3030,110 @@ out:
}
-
+htri_t
+H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid)
+ {
+ char *tmp_path = NULL; /* Temporary copy of the path */
+ char *curr_name; /* Pointer to current component of path name */
+ char *delimit; /* Pointer to path delimiter during traversal */
+ H5I_type_t obj_type;
+ htri_t link_exists, obj_exists;
+ size_t path_length;
+ htri_t ret_value;
+
+ /* Initialize */
+ ret_value = FALSE;
+
+ /* Find the type of loc_id */
+ if((obj_type = H5Iget_type(loc_id)) == H5I_BADID) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ /* Find the length of the path */
+ path_length = HDstrlen(path);
+
+ /* Check if the identifier is the object itself, i.e. path is '.' */
+ if(HDstrncmp(path, ".", path_length) == 0) {
+ if(check_object_valid) {
+ obj_exists = H5Oexists_by_name(loc_id, path, H5P_DEFAULT);
+ ret_value = obj_exists;
+ goto done;
+ } else {
+ ret_value = TRUE; /* Since the object is the identifier itself,
+ * we can only check if loc_id is a valid type */
+ goto done;
+ }
+ }
+
+ /* Duplicate the path to use */
+ if(NULL == (tmp_path = HDstrdup(path))) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ curr_name = tmp_path;
+
+ /* check if absolute pathname */
+ if(HDstrncmp(path, "/", 1) == 0) curr_name++;
+
+ /* check if relative path name starts with "./" */
+ if(HDstrncmp(path, "./", 2) == 0) curr_name += 2;
+
+ while((delimit=HDstrchr(curr_name,'/'))!=NULL) {
+ /* Change the delimiter to terminate the string */
+ *delimit='\0';
+
+ obj_exists = FALSE;
+ if((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ /* If target link does not exist then no reason to
+ * continue checking the path */
+ if(link_exists != TRUE) {
+ ret_value = FALSE;
+ goto done;
+ }
+
+ /* Determine if link resolves to an actual object */
+ if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ if(obj_exists != TRUE)
+ break;
+
+ /* Change the delimiter back to '/' */
+ *delimit='/';
+
+ /* Advance the pointer in the path to the start of the next component */
+ curr_name = delimit + 1;
+
+ } /* end while */
+
+ /* Should be pointing to the last component in the path name now... */
+
+ /* Check if link does not exist */
+ if((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
+ ret_value = FAIL;
+ } else {
+ ret_value = link_exists;
+ /* Determine if link resolves to an actual object for check_object_valid TRUE */
+ if(check_object_valid == TRUE && link_exists == TRUE) {
+ if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) {
+ ret_value = FAIL;
+ } else {
+ ret_value = obj_exists;
+ }
+ }
+ }
+
+done:
+ if(tmp_path != NULL)
+ HDfree(tmp_path);
+
+ return ret_value;
+ }
diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h
index 7fb873a..6efae68 100644
--- a/hl/src/H5LTpublic.h
+++ b/hl/src/H5LTpublic.h
@@ -340,8 +340,9 @@ H5_HLDLL herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type,
*-------------------------------------------------------------------------
*/
-H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name );
+H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name );
+H5_HLDLL htri_t H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid);
#ifdef __cplusplus
}
diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in
index 337f34f..2623b3a 100644
--- a/hl/src/Makefile.in
+++ b/hl/src/Makefile.in
@@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 99
+LT_VERS_REVISION = 102
LT_VERS_AGE = 0
# This library is our main target.
diff --git a/hl/test/COPYING b/hl/test/COPYING
index 6903daf..6903daf 100755..100644
--- a/hl/test/COPYING
+++ b/hl/test/COPYING
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 2be3d60..e290bbb 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -219,9 +219,9 @@ static hid_t create_test_file(const char *fileext)
{
char filename[65];
- strcpy(filename, FILENAME);
- strcat(filename, fileext);
- strcat(filename, FILEEXT);
+ HDstrcpy(filename, FILENAME);
+ HDstrcat(filename, fileext);
+ HDstrcat(filename, FILEEXT);
return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
}
@@ -229,9 +229,9 @@ static hid_t open_test_file(const char *fileext)
{
char filename[65];
- strcpy(filename, FILENAME);
- strcat(filename, fileext);
- strcat(filename, FILEEXT);
+ HDstrcpy(filename, FILENAME);
+ HDstrcat(filename, fileext);
+ HDstrcat(filename, FILEEXT);
return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
}
@@ -260,8 +260,8 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims)
char s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,120,120,120};
char name[32];
- strcpy(name, DATASET_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DATASET_NAME);
+ HDstrcat(name, dsidx);
/* make a dataset */
if(H5LTmake_dataset_char(fid, name, rank, dims, buf) >= 0) {
if(fulldims==0) {
@@ -313,8 +313,8 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims)
short s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,140,140,140};
char name[32];
- strcpy(name, DATASET_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DATASET_NAME);
+ HDstrcat(name, dsidx);
/* make a dataset */
if(H5LTmake_dataset_short(fid, name, rank, dims, buf) >= 0) {
@@ -362,8 +362,8 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims)
int s22_wbuf[DIM2_SIZE] = {5,10,50,300};
char name[32];
- strcpy(name, DATASET_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DATASET_NAME);
+ HDstrcat(name, dsidx);
/* make a dataset */
if(H5LTmake_dataset_int(fid, name, rank, dims, buf) >= 0) {
@@ -415,7 +415,7 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int
long s44_wbuf[DIM4_SIZE] = {280,280};
char name[32];
- strcpy(name, dsname);
+ HDstrcpy(name, dsname);
/* make a dataset */
if(H5LTmake_dataset_long(fid, name, rank, dims, buf) >= 0) {
@@ -470,8 +470,8 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims)
float s22_wbuf[DIM2_SIZE] = {5,10,50,300};
char name[32];
- strcpy(name, DATASET_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DATASET_NAME);
+ HDstrcat(name, dsidx);
/* make a dataset */
if(H5LTmake_dataset_float(fid, name, rank, dims, buf) >= 0) {
@@ -505,15 +505,15 @@ herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_
{
char name[32];
- strcpy(name, DS_1_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_1_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_11_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_11_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
@@ -530,23 +530,23 @@ herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_
{
char name[32];
- strcpy(name, DS_2_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_2_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the second dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_21_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_21_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_22_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_22_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
@@ -563,31 +563,31 @@ herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_
{
char name[32];
- strcpy(name, DS_3_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_3_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_31_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_31_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_32_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_32_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
}
if(s3_wbuf!=NULL) {
- strcpy(name, DS_33_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_33_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0)
return FAIL;
@@ -604,15 +604,15 @@ herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize
{
char name[32];
- strcpy(name, DS_1_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_1_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_11_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_11_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
@@ -629,24 +629,24 @@ herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize
{
char name[32];
- strcpy(name, DS_2_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_2_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the second dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_21_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_21_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_22_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_22_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
@@ -663,32 +663,32 @@ herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize
{
char name[32];
- strcpy(name, DS_3_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_3_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_31_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_31_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_32_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_32_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
}
if(s3_wbuf!=NULL) {
- strcpy(name, DS_33_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_33_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0)
return FAIL;
@@ -705,16 +705,16 @@ herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t
{
char name[32];
- strcpy(name, DS_1_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_1_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_11_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_11_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
@@ -731,24 +731,24 @@ herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t
{
char name[32];
- strcpy(name, DS_2_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_2_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the second dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_21_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_21_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_22_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_22_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
@@ -765,32 +765,32 @@ herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t
{
char name[32];
- strcpy(name, DS_3_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_3_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_31_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_31_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_32_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_32_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
}
if(s3_wbuf!=NULL) {
- strcpy(name, DS_33_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_33_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0)
return FAIL;
@@ -807,16 +807,16 @@ herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_
{
char name[32];
- strcpy(name, DS_1_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_1_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_11_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_11_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
@@ -833,24 +833,24 @@ herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_
{
char name[32];
- strcpy(name, DS_2_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_2_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_21_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_21_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_22_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_22_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
@@ -867,32 +867,32 @@ herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_
{
char name[32];
- strcpy(name, DS_3_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_3_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_31_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_31_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_32_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_32_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
}
if(s3_wbuf!=NULL) {
- strcpy(name, DS_33_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_33_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0)
return FAIL;
@@ -909,40 +909,40 @@ herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_
{
char name[32];
- strcpy(name, DS_4_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_4_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_41_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_41_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_42_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_42_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
}
if(s3_wbuf!=NULL) {
- strcpy(name, DS_43_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_43_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0)
return FAIL;
}
if(s4_wbuf!=NULL) {
- strcpy(name, DS_44_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_44_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0)
return FAIL;
@@ -959,16 +959,16 @@ herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize
{
char name[32];
- strcpy(name, DS_1_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_1_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_11_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_11_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the first dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
@@ -985,24 +985,24 @@ herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize
{
char name[32];
- strcpy(name, DS_2_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_2_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the second dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_21_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_21_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_22_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_22_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
@@ -1019,32 +1019,32 @@ herr_t create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize
{
char name[32];
- strcpy(name, DS_3_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_3_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset for the first dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0)
return FAIL;
if(s1_wbuf!=NULL) {
- strcpy(name, DS_31_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_31_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0)
return FAIL;
}
if(s2_wbuf!=NULL) {
- strcpy(name, DS_32_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_32_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0)
return FAIL;
}
if(s3_wbuf!=NULL) {
- strcpy(name, DS_33_NAME);
- strcat(name, dsidx);
+ HDstrcpy(name, DS_33_NAME);
+ HDstrcat(name, dsidx);
/* make a DS dataset with an alternate scale for the second dimension */
if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0)
return FAIL;
@@ -1127,13 +1127,13 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc
if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if(H5DSis_attached(did, dsid, idx) == 1) {
if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) {
- name_out = (char*)malloc(name_len * sizeof (char));
+ name_out = (char*)HDmalloc(name_len * sizeof (char));
if(name_out != NULL) {
if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) {
- if(strcmp(scalename,name_out)==0) {
+ if(HDstrcmp(scalename,name_out)==0) {
ret_value = SUCCEED;
}
- free(name_out);
+ HDfree(name_out);
name_out=NULL;
}
}
@@ -1294,8 +1294,8 @@ static int test_char_attachscales(const char *fileext)
hid_t did = -1;
char dsname[32];
char scalename[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "ac");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "ac");
TESTING2("test_char_attachscales");
@@ -1307,18 +1307,18 @@ static int test_char_attachscales(const char *fileext)
goto out;
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "ac");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "ac");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "ac");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "ac");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_3_NAME);
- strcat(scalename, "ac");
+ HDstrcpy(scalename, DS_3_NAME);
+ HDstrcat(scalename, "ac");
if(test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
@@ -1350,8 +1350,8 @@ static int test_short_attachscales(const char *fileext)
hid_t did = -1;
char dsname[32];
char scalename[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "as");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "as");
TESTING2("test_short_attachscales");
@@ -1363,48 +1363,48 @@ static int test_short_attachscales(const char *fileext)
goto out;
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_11_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_11_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_21_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_21_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_22_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_22_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_3_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_3_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- strcpy(scalename, DS_31_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_31_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- strcpy(scalename, DS_32_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_32_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- strcpy(scalename, DS_33_NAME);
- strcat(scalename, "as");
+ HDstrcpy(scalename, DS_33_NAME);
+ HDstrcat(scalename, "as");
if(test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
@@ -1436,8 +1436,8 @@ static int test_int_attachscales(const char *fileext)
hid_t did = -1;
char dsname[32];
char scalename[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "a");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "a");
TESTING2("test_int_attachscales");
@@ -1449,28 +1449,28 @@ static int test_int_attachscales(const char *fileext)
goto out;
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "a");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "a");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_11_NAME);
- strcat(scalename, "a");
+ HDstrcpy(scalename, DS_11_NAME);
+ HDstrcat(scalename, "a");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "a");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "a");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_21_NAME);
- strcat(scalename, "a");
+ HDstrcpy(scalename, DS_21_NAME);
+ HDstrcat(scalename, "a");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_22_NAME);
- strcat(scalename, "a");
+ HDstrcpy(scalename, DS_22_NAME);
+ HDstrcat(scalename, "a");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
@@ -1502,8 +1502,8 @@ static int test_long_attachscales(const char *fileext)
hid_t did = -1;
char dsname[32];
char scalename[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "al");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "al");
TESTING2("test_long_attachscales");
@@ -1515,23 +1515,23 @@ static int test_long_attachscales(const char *fileext)
goto out;
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "al");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "al");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "al");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "al");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_3_NAME);
- strcat(scalename, "al");
+ HDstrcpy(scalename, DS_3_NAME);
+ HDstrcat(scalename, "al");
if(test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- strcpy(scalename, DS_4_NAME);
- strcat(scalename, "al");
+ HDstrcpy(scalename, DS_4_NAME);
+ HDstrcat(scalename, "al");
if(test_attach_scale(fid, did, scalename, DIM3) < 0)
goto out;
@@ -1563,8 +1563,8 @@ static int test_duplicatelong_attachscales(const char *fileext)
hid_t did = -1;
char dsname[32];
char scalename[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "al2");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "al2");
TESTING2("test_duplicatelong_attachscales");
@@ -1576,23 +1576,23 @@ static int test_duplicatelong_attachscales(const char *fileext)
goto out;
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "al");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "al");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "al");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "al");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_3_NAME);
- strcat(scalename, "al");
+ HDstrcpy(scalename, DS_3_NAME);
+ HDstrcat(scalename, "al");
if(test_attach_scale(fid, did, scalename, DIM2) < 0)
goto out;
- strcpy(scalename, DS_4_NAME);
- strcat(scalename, "al");
+ HDstrcpy(scalename, DS_4_NAME);
+ HDstrcat(scalename, "al");
if(test_attach_scale(fid, did, scalename, DIM3) < 0)
goto out;
@@ -1624,8 +1624,8 @@ static int test_float_attachscales(const char *fileext)
hid_t did = -1;
char dsname[32];
char scalename[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "af");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "af");
TESTING2("test_float_attachscales");
@@ -1637,28 +1637,28 @@ static int test_float_attachscales(const char *fileext)
goto out;
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "af");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "af");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_11_NAME);
- strcat(scalename, "af");
+ HDstrcpy(scalename, DS_11_NAME);
+ HDstrcat(scalename, "af");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "af");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "af");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_21_NAME);
- strcat(scalename, "af");
+ HDstrcpy(scalename, DS_21_NAME);
+ HDstrcat(scalename, "af");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
- strcpy(scalename, DS_22_NAME);
- strcat(scalename, "af");
+ HDstrcpy(scalename, DS_22_NAME);
+ HDstrcat(scalename, "af");
if(test_attach_scale(fid, did, scalename, DIM1) < 0)
goto out;
@@ -1691,8 +1691,8 @@ static int test_numberofscales(const char *fileext)
int nscales; /* number of scales in DIM */
char dsname[32];
char scalename[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "a");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "a");
TESTING2("test_numberofscales");
@@ -1718,8 +1718,8 @@ static int test_numberofscales(const char *fileext)
else
goto out;
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "b");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "b");
/* make a dataset */
if(create_int_dataset(fid, "b", 1) < 0)
@@ -1727,8 +1727,8 @@ static int test_numberofscales(const char *fileext)
/* make a DS dataset for the first dimension */
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "b");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "b");
if(test_attach_scale(fid, did, scalename, DIM0) < 0)
goto out;
@@ -1772,38 +1772,38 @@ static int test_char_scalenames(const char *fileext) {
char dsname[32];
char scalename[32];
char name[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "ac");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "ac");
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set char scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "ac");
- strcpy(name, SCALE_1_NAME);
- strcat(name, "ac");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "ac");
+ HDstrcpy(name, SCALE_1_NAME);
+ HDstrcat(name, "ac");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "ac");
- strcpy(name, SCALE_2_NAME);
- strcat(name, "ac");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "ac");
+ HDstrcpy(name, SCALE_2_NAME);
+ HDstrcat(name, "ac");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_3_NAME);
- strcat(scalename, "ac");
- strcpy(name, SCALE_3_NAME);
- strcat(name, "ac");
+ HDstrcpy(scalename, DS_3_NAME);
+ HDstrcat(scalename, "ac");
+ HDstrcpy(name, SCALE_3_NAME);
+ HDstrcat(name, "ac");
if(test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
@@ -1838,98 +1838,98 @@ static int test_short_scalenames(const char *fileext) {
char dsname[32];
char scalename[32];
char name[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "as");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "as");
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set short scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_1_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_1_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_11_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_11_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_11_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_11_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_2_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_2_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_21_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_21_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_21_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_21_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_22_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_22_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_22_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_22_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_3_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_3_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_3_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_3_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- strcpy(scalename, DS_31_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_31_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_31_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_31_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- strcpy(scalename, DS_32_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_32_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_32_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_32_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- strcpy(scalename, DS_33_NAME);
- strcat(scalename, "as");
- strcpy(name, SCALE_33_NAME);
- strcat(name, "as");
+ HDstrcpy(scalename, DS_33_NAME);
+ HDstrcat(scalename, "as");
+ HDstrcpy(name, SCALE_33_NAME);
+ HDstrcat(name, "as");
if(test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
@@ -1964,58 +1964,58 @@ static int test_int_scalenames(const char *fileext) {
char dsname[32];
char scalename[32];
char name[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "a");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "a");
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set int scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "a");
- strcpy(name, SCALE_1_NAME);
- strcat(name, "a");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "a");
+ HDstrcpy(name, SCALE_1_NAME);
+ HDstrcat(name, "a");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_11_NAME);
- strcat(scalename, "a");
- strcpy(name, SCALE_11_NAME);
- strcat(name, "a");
+ HDstrcpy(scalename, DS_11_NAME);
+ HDstrcat(scalename, "a");
+ HDstrcpy(name, SCALE_11_NAME);
+ HDstrcat(name, "a");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "a");
- strcpy(name, SCALE_2_NAME);
- strcat(name, "a");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "a");
+ HDstrcpy(name, SCALE_2_NAME);
+ HDstrcat(name, "a");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_21_NAME);
- strcat(scalename, "a");
- strcpy(name, SCALE_21_NAME);
- strcat(name, "a");
+ HDstrcpy(scalename, DS_21_NAME);
+ HDstrcat(scalename, "a");
+ HDstrcpy(name, SCALE_21_NAME);
+ HDstrcat(name, "a");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_22_NAME);
- strcat(scalename, "a");
- strcpy(name, SCALE_22_NAME);
- strcat(name, "a");
+ HDstrcpy(scalename, DS_22_NAME);
+ HDstrcat(scalename, "a");
+ HDstrcpy(name, SCALE_22_NAME);
+ HDstrcat(name, "a");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
@@ -2050,48 +2050,48 @@ static int test_long_scalenames(const char *fileext) {
char dsname[32];
char scalename[32];
char name[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "al");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "al");
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "al");
- strcpy(name, SCALE_1_NAME);
- strcat(name, "al");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "al");
+ HDstrcpy(name, SCALE_1_NAME);
+ HDstrcat(name, "al");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "al");
- strcpy(name, SCALE_2_NAME);
- strcat(name, "al");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "al");
+ HDstrcpy(name, SCALE_2_NAME);
+ HDstrcat(name, "al");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_3_NAME);
- strcat(scalename, "al");
- strcpy(name, SCALE_3_NAME);
- strcat(name, "al");
+ HDstrcpy(scalename, DS_3_NAME);
+ HDstrcat(scalename, "al");
+ HDstrcpy(name, SCALE_3_NAME);
+ HDstrcat(name, "al");
if(test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- strcpy(scalename, DS_4_NAME);
- strcat(scalename, "al");
- strcpy(name, SCALE_4_NAME);
- strcat(name, "al");
+ HDstrcpy(scalename, DS_4_NAME);
+ HDstrcat(scalename, "al");
+ HDstrcpy(name, SCALE_4_NAME);
+ HDstrcat(name, "al");
if(test_set_scalename(fid, did, scalename, name, DIM3) < 0)
goto out;
@@ -2126,48 +2126,48 @@ static int test_samelong_scalenames(const char *fileext) {
char dsname[32];
char scalename[32];
char name[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "al2");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "al2");
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set same long scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "al");
- strcpy(name, DS_1_NAME);
- strcat(name, "al");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "al");
+ HDstrcpy(name, DS_1_NAME);
+ HDstrcat(name, "al");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "al");
- strcpy(name, DS_2_NAME);
- strcat(name, "al");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "al");
+ HDstrcpy(name, DS_2_NAME);
+ HDstrcat(name, "al");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_3_NAME);
- strcat(scalename, "al");
- strcpy(name, DS_3_NAME);
- strcat(name, "al");
+ HDstrcpy(scalename, DS_3_NAME);
+ HDstrcat(scalename, "al");
+ HDstrcpy(name, DS_3_NAME);
+ HDstrcat(name, "al");
if(test_set_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0)
goto out;
- strcpy(scalename, DS_4_NAME);
- strcat(scalename, "al");
- strcpy(name, DS_4_NAME);
- strcat(name, "al");
+ HDstrcpy(scalename, DS_4_NAME);
+ HDstrcat(scalename, "al");
+ HDstrcpy(name, DS_4_NAME);
+ HDstrcat(name, "al");
if(test_set_scalename(fid, did, scalename, name, DIM3) < 0)
goto out;
@@ -2202,58 +2202,58 @@ static int test_float_scalenames(const char *fileext) {
char dsname[32];
char scalename[32];
char name[32];
- strcpy(dsname, DATASET_NAME);
- strcat(dsname, "af");
+ HDstrcpy(dsname, DATASET_NAME);
+ HDstrcat(dsname, "af");
if((fid = open_test_file(fileext)) < 0)
goto out;
TESTING2("set float scale/cmp scale name");
if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) {
- strcpy(scalename, DS_1_NAME);
- strcat(scalename, "af");
- strcpy(name, SCALE_1_NAME);
- strcat(name, "af");
+ HDstrcpy(scalename, DS_1_NAME);
+ HDstrcat(scalename, "af");
+ HDstrcpy(name, SCALE_1_NAME);
+ HDstrcat(name, "af");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_11_NAME);
- strcat(scalename, "af");
- strcpy(name, SCALE_11_NAME);
- strcat(name, "af");
+ HDstrcpy(scalename, DS_11_NAME);
+ HDstrcat(scalename, "af");
+ HDstrcpy(name, SCALE_11_NAME);
+ HDstrcat(name, "af");
if(test_set_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0)
goto out;
- strcpy(scalename, DS_2_NAME);
- strcat(scalename, "af");
- strcpy(name, SCALE_2_NAME);
- strcat(name, "af");
+ HDstrcpy(scalename, DS_2_NAME);
+ HDstrcat(scalename, "af");
+ HDstrcpy(name, SCALE_2_NAME);
+ HDstrcat(name, "af");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_21_NAME);
- strcat(scalename, "af");
- strcpy(name, SCALE_21_NAME);
- strcat(name, "af");
+ HDstrcpy(scalename, DS_21_NAME);
+ HDstrcat(scalename, "af");
+ HDstrcpy(name, SCALE_21_NAME);
+ HDstrcat(name, "af");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
- strcpy(scalename, DS_22_NAME);
- strcat(scalename, "af");
- strcpy(name, SCALE_22_NAME);
- strcat(name, "af");
+ HDstrcpy(scalename, DS_22_NAME);
+ HDstrcat(scalename, "af");
+ HDstrcpy(name, SCALE_22_NAME);
+ HDstrcat(name, "af");
if(test_set_scalename(fid, did, scalename, name, DIM1) < 0)
goto out;
@@ -3046,13 +3046,11 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- for(i=0; i<5; i++)
- {
+ for(i=0; i<5; i++) {
sprintf(dname,"dset_%d",i);
if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
goto out;
- for(j=0; j<5; j++)
- {
+ for(j=0; j<5; j++) {
sprintf(sname,"ds_%d",j);
if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0)
goto out;
@@ -3099,15 +3097,12 @@ static int test_simple(void)
/* try to detach all dimensions. for dimensions 0 and 2, it is an error */
- for(i=0; i<rank; i++)
- {
- if( i==1 )
- {
+ for(i=0; i<rank; i++) {
+ if( i==1 ) {
if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
goto out;
}
- else
- {
+ else {
if(H5DSdetach_scale(did,dsid,(unsigned)i)!=FAIL)
goto out;
}
@@ -3155,9 +3150,9 @@ static int test_simple(void)
goto out;
if(H5DSget_label(did,DIM1,dim1_label,sizeof(dim1_label)) < 0)
goto out;
- if(strcmp(DIM0_LABEL,dim0_label)!=0)
+ if(HDstrcmp(DIM0_LABEL,dim0_label)!=0)
goto out;
- if(strcmp(DIM1_LABEL,dim1_label)!=0)
+ if(HDstrcmp(DIM1_LABEL,dim1_label)!=0)
goto out;
/*-------------------------------------------------------------------------
@@ -3171,26 +3166,24 @@ static int test_simple(void)
goto out;
/* allocate */
- dim0_labeld = (char*)malloc(dim0_label_size * sizeof (char));
- dim1_labeld = (char*)malloc(dim1_label_size * sizeof (char));
+ dim0_labeld = (char*)HDmalloc(dim0_label_size * sizeof (char));
+ dim1_labeld = (char*)HDmalloc(dim1_label_size * sizeof (char));
if( dim0_labeld==NULL || dim1_labeld==NULL)
goto out;
if(H5DSget_label(did,DIM0,dim0_labeld,(size_t)dim0_label_size) < 0)
goto out;
if(H5DSget_label(did,DIM1,dim1_labeld,(size_t)dim1_label_size) < 0)
goto out;
- if(strncmp(DIM0_LABEL,dim0_labeld,(size_t)(dim0_label_size-1))!=0)
+ if(HDstrncmp(DIM0_LABEL,dim0_labeld,(size_t)(dim0_label_size-1))!=0)
goto out;
- if(strncmp(DIM1_LABEL,dim1_labeld,(size_t)(dim1_label_size-1))!=0)
+ if(HDstrncmp(DIM1_LABEL,dim1_labeld,(size_t)(dim1_label_size-1))!=0)
goto out;
- if(dim0_labeld)
- {
- free(dim0_labeld);
+ if(dim0_labeld) {
+ HDfree(dim0_labeld);
dim0_labeld=NULL;
}
- if(dim1_labeld)
- {
- free(dim1_labeld);
+ if(dim1_labeld) {
+ HDfree(dim1_labeld);
dim1_labeld=NULL;
}
@@ -3204,9 +3197,9 @@ static int test_simple(void)
goto out;
if(H5DSget_label(did,DIM1,dim1_labels,sizeof(dim1_labels)) < 0)
goto out;
- if(strncmp(DIM0_LABEL,dim0_label,sizeof(dim0_labels)-1)!=0)
+ if(HDstrncmp(DIM0_LABEL,dim0_label,sizeof(dim0_labels)-1)!=0)
goto out;
- if(strncmp(DIM1_LABEL,dim1_label,sizeof(dim1_labels)-1)!=0)
+ if(HDstrncmp(DIM1_LABEL,dim1_label,sizeof(dim1_labels)-1)!=0)
goto out;
if(H5Dclose(did))
goto out;
@@ -3239,7 +3232,7 @@ static int test_simple(void)
goto out;
/* allocate a buffer */
- name_out = (char*)malloc(name_len * sizeof (char));
+ name_out = (char*)HDmalloc(name_len * sizeof (char));
if(name_out == NULL)
goto out;
@@ -3247,11 +3240,10 @@ static int test_simple(void)
if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) < 0)
goto out;
- if(strcmp("Latitude set 0",name_out)!=0)
+ if(HDstrcmp("Latitude set 0",name_out)!=0)
goto out;
- if(name_out)
- {
- free(name_out);
+ if(name_out) {
+ HDfree(name_out);
name_out=NULL;
}
@@ -3264,7 +3256,7 @@ static int test_simple(void)
if(H5DSget_scale_name(dsid, sname, sizeof (sname)) < 0)
goto out;
- if(strcmp("Latitude set 0",sname)!=0)
+ if(HDstrcmp("Latitude set 0",sname)!=0)
goto out;
/*-------------------------------------------------------------------------
@@ -3276,7 +3268,7 @@ static int test_simple(void)
if(H5DSget_scale_name(dsid, snames, sizeof (snames)) < 0)
goto out;
- if(strncmp("Latitude set 0",snames,sizeof(snames)-1)!=0)
+ if(HDstrncmp("Latitude set 0",snames,sizeof(snames)-1)!=0)
goto out;
if(H5Dclose(dsid))
goto out;
@@ -3403,8 +3395,7 @@ static int test_simple(void)
int idx = 0; /* scale index to start iterating, on return, index where iterator stoped */
/* iterate trough all the dimensions */
- for(dim=0; dim<(unsigned)rank; dim++)
- {
+ for(dim=0; dim<(unsigned)rank; dim++) {
if((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL)) < 0)
goto out;
@@ -3500,8 +3491,7 @@ static int test_simple(void)
int idx; /* scale index to start iterating, on return, index where iterator stoped */
/* iterate trough all the dimensions */
- for(dim=0; dim<(unsigned)rank; dim++)
- {
+ for(dim=0; dim<(unsigned)rank; dim++) {
/* always start at 1st scale */
idx=0;
@@ -3511,8 +3501,7 @@ static int test_simple(void)
/* "dset_e" was defined with :
dim 0: 2 scales, first is empty
dim 1: 1 scale, empty */
- switch(dim)
- {
+ switch(dim) {
case 0: /* for DIM 0, we get a valid scale at IDX 1 */
if(match_size!=1 && idx!=1)
goto out;
@@ -3522,11 +3511,11 @@ static int test_simple(void)
goto out;
break;
default:
- assert(0);
+ HDassert(0);
break;
}/*switch*/
}/*for*/
- }
+ }
/* close */
if(H5Dclose(did) < 0)
@@ -3594,8 +3583,7 @@ static herr_t verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visit
*/
/* the parameter DS dataset must be a valid DS dataset */
- if((H5DSis_scale(scale_id))==1)
- {
+ if((H5DSis_scale(scale_id))==1) {
ret = 1;
}
@@ -3653,18 +3641,15 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor
if((size=H5Tget_size(mtid))==0)
goto out;
- if(nelmts)
- {
- buf=(char *) malloc((size_t)(nelmts*size));
- if( buf==NULL)
+ if(nelmts) {
+ buf=(char *)HDmalloc((size_t)(nelmts*size));
+ if(buf==NULL)
goto out;
if(H5Dread(scale_id,mtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto out;
- for(i=0; i<nelmts; i++)
- {
- if(buf[i] != data[i])
- {
+ for(i=0; i<nelmts; i++) {
+ if(buf[i] != data[i]) {
printf("read and write buffers differ\n");
goto out;
}
@@ -3679,21 +3664,19 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor
if(H5Tclose(mtid) < 0)
goto out;
if(buf)
- free(buf);
+ HDfree(buf);
return ret;
/* error zone */
out:
- H5E_BEGIN_TRY
- {
+ H5E_BEGIN_TRY {
H5Sclose(sid);
H5Tclose(tid);
H5Tclose(mtid);
- if(buf)
- {
- free(buf);
+ if(buf) {
+ HDfree(buf);
}
} H5E_END_TRY;
@@ -3776,8 +3759,7 @@ static herr_t match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor
return ret;
out:
- H5E_BEGIN_TRY
- {
+ H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
return FAIL;
@@ -3808,8 +3790,7 @@ static herr_t op_continue(hid_t dset, unsigned dim, hid_t scale_id, void *visito
dim = dim;
scale_id = scale_id;
- if ( visitor_data != NULL )
- {
+ if ( visitor_data != NULL ) {
(*(int *)visitor_data)++;
}
@@ -3841,8 +3822,7 @@ static herr_t op_stop(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_da
dim = dim;
scale_id = scale_id;
- if ( visitor_data != NULL )
- {
+ if ( visitor_data != NULL ) {
(*(int *)visitor_data)++;
}
@@ -4325,8 +4305,7 @@ static int test_iterators(void)
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
- for(i=0; i<100; i++)
- {
+ for(i=0; i<100; i++) {
/* make a DS */
sprintf(dname,"ds_%d",i);
if(H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL) < 0)
@@ -4478,8 +4457,7 @@ static int test_rank(void)
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
- for(i=0; i<3; i++)
- {
+ for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
@@ -4507,8 +4485,7 @@ static int test_rank(void)
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
- for(i=0; i<3; i++)
- {
+ for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
@@ -4534,8 +4511,7 @@ static int test_rank(void)
if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
- for(i=0; i<3; i++)
- {
+ for(i=0; i<3; i++) {
sprintf(name,"ds_a_%d",i);
if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
@@ -4553,9 +4529,9 @@ static int test_rank(void)
goto out;
if(H5DSget_label(did,(unsigned)i,namel,sizeof(namel)) < 0)
goto out;
- if(strcmp(name,names)!=0)
+ if(HDstrcmp(name,names)!=0)
goto out;
- if(strcmp(name,namel)!=0)
+ if(HDstrcmp(name,namel)!=0)
goto out;
}
@@ -4857,7 +4833,7 @@ static int test_data(void)
if(H5LTmake_dataset_float(fid, "lat", 1, latdims, latbuf) < 0)
goto out;
- free( latbuf );
+ HDfree( latbuf );
latbuf = NULL;
/* read the longitude */
@@ -4868,7 +4844,7 @@ static int test_data(void)
if(H5LTmake_dataset_float(fid, "lon", 1, londims, lonbuf) < 0)
goto out;
- free( lonbuf );
+ HDfree( lonbuf );
lonbuf = NULL;
/* make a dataset for the data. a fill value is set */
@@ -4888,7 +4864,7 @@ static int test_data(void)
if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, vals) < 0)
goto out;
- free ( vals );
+ HDfree ( vals );
vals = NULL;
if(H5Dclose(did) < 0)
@@ -4964,11 +4940,11 @@ out:
H5_FAILED();
if (latbuf)
- free( latbuf );
+ HDfree( latbuf );
if (lonbuf)
- free( lonbuf );
+ HDfree( lonbuf );
if (vals)
- free( vals );
+ HDfree( vals );
return FAIL;
}
@@ -5001,36 +4977,32 @@ static int read_data( const char* fname,
const char *data_file = H5_get_srcdir_filename(fname);
/* read first data file */
- f = fopen(data_file, "r");
- if( f == NULL )
- {
+ f = HDfopen(data_file, "r");
+ if( f == NULL ) {
printf( "Could not open file %s\n", data_file );
return -1;
}
- for(i=0, nelms=1; i < ndims; i++)
- {
+ for(i=0, nelms=1; i < ndims; i++) {
fscanf( f, "%s %u", str, &j);
fscanf( f, "%d",&n );
dims[i] = n;
nelms *= n;
}
- *buf = (float*) malloc (nelms * sizeof( float ));
+ *buf = (float*) HDmalloc (nelms * sizeof( float ));
- if ( *buf == NULL )
- {
+ if ( *buf == NULL ) {
printf( "memory allocation failed\n" );
- fclose(f);
+ HDfclose(f);
return -1;
}
- for(j = 0; j < nelms; j++)
- {
+ for(j = 0; j < nelms; j++) {
fscanf( f, "%f",&val );
(*buf)[j] = val;
}
- fclose(f);
+ HDfclose(f);
return 1;
@@ -5191,8 +5163,7 @@ static int test_errors2(void)
if (H5DSiterate_scales(did,0,&scale_idx,op_continue,(void *)&count) < 0)
goto out;
- if ( scale_idx != 1 && count != nscales )
- {
+ if ( scale_idx != 1 && count != nscales ) {
goto out;
}
@@ -5202,8 +5173,7 @@ static int test_errors2(void)
if (H5DSiterate_scales(did,0,&scale_idx,op_stop,(void *)&count) < 0)
goto out;
- if ( scale_idx != 0 && count != 1 )
- {
+ if ( scale_idx != 0 && count != 1 ) {
goto out;
}
@@ -5266,7 +5236,7 @@ static int test_attach_detach(void)
goto out;
if((dsid = H5Dcreate2(gid, DS_3_NAME, H5T_IEEE_F32BE, sid,
- H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
goto out;
if(H5Sclose(sid) < 0)
@@ -5283,7 +5253,7 @@ static int test_attach_detach(void)
goto out;
if((var1_id = H5Dcreate2(gid, DS_31_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if(H5Sclose(sid) < 0)
@@ -5303,7 +5273,7 @@ static int test_attach_detach(void)
goto out;
if((var2_id = H5Dcreate2(gid, DS_32_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
if(H5Pclose(dcpl_id) < 0)
@@ -5323,7 +5293,7 @@ static int test_attach_detach(void)
goto out;
if((var3_id = H5Dcreate2(gid, DS_33_NAME, H5T_NATIVE_FLOAT, sid,
- H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
if(H5Pclose(dcpl_id) < 0)
@@ -5462,9 +5432,9 @@ static int test_attach_detach(void)
out:
H5E_BEGIN_TRY
{
- H5Dclose(var1_id);
- H5Dclose(var2_id);
- H5Dclose(var3_id);
+ H5Dclose(var1_id);
+ H5Dclose(var2_id);
+ H5Dclose(var3_id);
H5Dclose(dsid);
H5Gclose(gid);
H5Fclose(fid);
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index 1332841..3914a9f 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -525,7 +525,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
- f = fopen( data_file, "r" ) ;
+ f = HDfopen( data_file, "r" ) ;
if ( f == NULL )
{
printf( "Could not find file %s. Try set $srcdir \n", data_file );
@@ -572,15 +572,15 @@ static int test_generate(void)
fscanf( f, "%d %d %d", &imax, &jmax, &kmax );
fscanf( f, "%f %f %f", &valex, &xmin, &xmax );
- data = (float*) malloc ( imax * jmax * kmax * sizeof( float ));
- image_data = (unsigned char*) malloc ( imax * jmax * kmax * sizeof( unsigned char ));
+ data = (float*) HDmalloc ( imax * jmax * kmax * sizeof( float ));
+ image_data = (unsigned char*) HDmalloc ( imax * jmax * kmax * sizeof( unsigned char ));
for ( i = 0; i < imax * jmax * kmax; i++ )
{
fscanf( f, "%f ", &value );
data[i] = value;
}
- fclose( f );
+ HDfclose( f );
/*-------------------------------------------------------------------------
* transform the data from floating point to unsigned char
@@ -719,7 +719,7 @@ static int read_data( const char* fname, /*IN*/
*-------------------------------------------------------------------------
*/
- f = fopen(data_file, "r");
+ f = HDfopen(data_file, "r");
if ( f == NULL )
{
printf( "Could not open file %s. Try set $srcdir \n", data_file );
@@ -738,18 +738,18 @@ static int read_data( const char* fname, /*IN*/
if ( image_data )
{
- free( image_data );
+ HDfree( image_data );
image_data=NULL;
}
- image_data = (unsigned char*) malloc (w * h * color_planes * sizeof( unsigned char ));
+ image_data = (unsigned char*) HDmalloc (w * h * color_planes * sizeof( unsigned char ));
for (i = 0; i < h * w * color_planes ; i++)
{
fscanf( f, "%d",&n );
image_data[i] = (unsigned char)n;
}
- fclose(f);
+ HDfclose(f);
return 1;
@@ -794,46 +794,46 @@ static int read_palette(const char* fname,
return -1;
/* open the input file */
- if (!(file = fopen(data_file, "r")))
+ if (!(file = HDfopen(data_file, "r")))
{
printf( "Could not open file %s. Try set $srcdir \n", data_file );
return -1;
}
/* read the file ident string */
- if (fgets(buffer, sizeof(buffer), file) == NULL)
+ if (HDfgets(buffer, sizeof(buffer), file) == NULL)
{
- fclose(file);
+ HDfclose(file);
return -1;
}
/* ensure it matches the palette file ident string */
- if ( strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 &&
- strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0 )
+ if ( HDstrncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 &&
+ HDstrncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0 )
{
- fclose(file);
+ HDfclose(file);
return -1;
}
/* read the version string */
- if (fgets(buffer, sizeof(buffer), file) == NULL)
+ if (HDfgets(buffer, sizeof(buffer), file) == NULL)
{
- fclose(file);
+ HDfclose(file);
return -1;
}
/* ensure it matches the palette file version string */
- if ( strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 &&
- strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0 )
+ if ( HDstrncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 &&
+ HDstrncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0 )
{
- fclose(file);
+ HDfclose(file);
return -1;
}
/* read the number of colors */
- if (fgets(buffer, sizeof(buffer), file) == NULL)
+ if (HDfgets(buffer, sizeof(buffer), file) == NULL)
{
- fclose(file);
+ HDfclose(file);
return -1;
}
@@ -842,22 +842,22 @@ static int read_palette(const char* fname,
check for missing version or number of colors
in this case it reads the first entry
*/
- if ( strlen( buffer ) > 4 )
+ if ( HDstrlen( buffer ) > 4 )
{
- fclose(file);
+ HDfclose(file);
return -1;
}
if (sscanf(buffer, "%u", &nentries) != 1)
{
- fclose(file);
+ HDfclose(file);
return -1;
}
/* ensure there are a sensible number of colors in the palette */
if ((nentries > 256) || (nentries > palette_size))
{
- fclose(file);
+ HDfclose(file);
return(-1);
}
@@ -867,7 +867,7 @@ static int read_palette(const char* fname,
/* extract the red, green and blue color components. */
if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3)
{
- fclose(file);
+ HDfclose(file);
return -1;
}
/* store this palette entry */
@@ -877,7 +877,7 @@ static int read_palette(const char* fname,
}
/* close file */
- fclose(file);
+ HDfclose(file);
return nentries;
}
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index c7232e2a..eb00cd7 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -21,6 +21,8 @@
#define FILE_NAME "test_lite1.h5"
#define FILE_NAME2 "test_lite2.h5"
+#define FILE_NAME3 "test_lite3.h5"
+#define FILE_NAME4 "test_lite4.h5"
#define INPUT_FILE "dtype_file.txt"
#define DSET0_NAME "2D int array"
@@ -367,7 +369,7 @@ static int test_dsets( void )
if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 )
goto out;
- if ( strcmp(data_string_in,data_string_out) != 0 )
+ if ( HDstrcmp(data_string_in,data_string_out) != 0 )
goto out;
@@ -536,7 +538,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 )
return -1;
- if ( strcmp( attr_str_in, attr_str_out ) != 0 )
+ if ( HDstrcmp( attr_str_in, attr_str_out ) != 0 )
{
return -1;
}
@@ -1015,25 +1017,25 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
TESTING("H5LTget_attribute_info");
- dims_out = (hsize_t*) malloc( sizeof(hsize_t) * rank_out );
+ if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * rank_out ))) return -1;
- if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class,
- &type_size) < 0 )
+ if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0 ) {
+ HDfree( dims_out );
return -1;
-
- for (i = 0; i < rank_out; i++)
- {
+ }
+
+ for (i = 0; i < rank_out; i++) {
if ( dims_out[i] != 5 ) {
+ HDfree( dims_out );
return -1;
}
}
if ( type_class != H5T_INTEGER ) {
+ HDfree( dims_out );
return -1;
}
-
- if ( dims_out )
- free( dims_out );
+ HDfree( dims_out );
PASSED();
@@ -1066,12 +1068,18 @@ static int test_integers(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
+ goto out;
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
goto out;
- if(strcmp(dt_str, "H5T_STD_I8BE"))
+ }
+ if(HDstrcmp(dt_str, "H5T_STD_I8BE")) {
+ HDfree(dt_str);
goto out;
- free(dt_str);
+ }
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1117,12 +1125,18 @@ static int test_fps(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
+ goto out;
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
goto out;
- if(strcmp(dt_str, "H5T_IEEE_F32BE"))
+ }
+ if(HDstrcmp(dt_str, "H5T_IEEE_F32BE")) {
+ HDfree(dt_str);
goto out;
- free(dt_str);
+ }
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1180,14 +1194,18 @@ static int test_strings(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
+ goto out;
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
goto out;
- if(strcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
+ }
+ if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
printf("dt=\n%s\n", dt_str);
+ HDfree(dt_str);
goto out;
}
- free(dt_str);
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1208,14 +1226,18 @@ static int test_strings(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
+ goto out;
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
goto out;
- if(strcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
+ }
+ if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
printf("dt=\n%s\n", dt_str);
+ HDfree(dt_str);
goto out;
}
- free(dt_str);
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1257,14 +1279,18 @@ static int test_opaques(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
+ goto out;
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
goto out;
- if(strcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) {
+ }
+ if(HDstrcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) {
printf("dt=\n%s\n", dt_str);
+ HDfree(dt_str);
goto out;
}
- free(dt_str);
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1311,7 +1337,7 @@ static int test_enums(void)
if(H5Tenum_nameof(dtype, &value1, name1, size)<0)
goto out;
- if(strcmp(name1, "BLUE"))
+ if(HDstrcmp(name1, "BLUE"))
goto out;
if(H5Tenum_valueof(dtype, name2, &value2)<0)
@@ -1328,16 +1354,20 @@ static int test_enums(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
+ goto out;
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
goto out;
- if(strcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) {
+ }
+ if(HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) {
printf("dt=\n%s\n", dt_str);
+ HDfree(dt_str);
goto out;
}
- free(dt_str);
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1385,14 +1415,18 @@ static int test_variables(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
- if(strcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) {
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
+ goto out;
+ }
+ if(HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) {
printf("dt=\n%s\n", dt_str);
+ HDfree(dt_str);
goto out;
}
- free(dt_str);
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1440,15 +1474,19 @@ static int test_arrays(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
- if(strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) {
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
+ goto out;
+ }
+ if(HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) {
printf("dt=\n%s\n", dt_str);
+ HDfree(dt_str);
goto out;
}
- free(dt_str);
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1492,14 +1530,18 @@ static int test_compounds(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
- if(strcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) {
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
+ goto out;
+ }
+ if(HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) {
printf("dt=\n%s\n", dt_str);
+ HDfree(dt_str);
goto out;
}
- free(dt_str);
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1509,9 +1551,11 @@ static int test_compounds(void)
if((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
- if(strcmp(memb_name, "i16_field"))
+ if(HDstrcmp(memb_name, "i16_field")) {
+ HDfree(memb_name);
goto out;
- free(memb_name);
+ }
+ HDfree(memb_name);
if((memb_class = H5Tget_member_class(dtype, 2))<0)
goto out;
@@ -1575,17 +1619,22 @@ static int test_compound_bug(void)
if((memb_name = H5Tget_member_name(dtype, 2)) == NULL)
goto out;
- if(strcmp(memb_name, "sub"))
+ if(HDstrcmp(memb_name, "sub")) {
+ HDfree(memb_name);
goto out;
- free(memb_name);
+ }
+ HDfree(memb_name);
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
+ goto out;
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
goto out;
- free(dt_str);
+ }
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1607,18 +1656,23 @@ static int test_compound_bug(void)
if((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
- if(strcmp(memb_name, "desc_________________________________________________________________________________________"))
+ if(HDstrcmp(memb_name, "desc_________________________________________________________________________________________")) {
+ HDfree(memb_name);
goto out;
- free(memb_name);
+ }
+ HDfree(memb_name);
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
- dt_str = (char*)calloc(str_len, sizeof(char));
- if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
+ if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
+ if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
+ HDfree(dt_str);
+ goto out;
+ }
- free(dt_str);
+ HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@@ -1648,7 +1702,7 @@ static int test_complicated_compound(void)
TESTING3(" text for complicated compound types");
/* Open input file */
- fp = fopen(filename, "r");
+ fp = HDfopen(filename, "r");
if(fp == NULL) {
printf( "Could not find file %s. Try set $srcdir \n", filename);
goto out;
@@ -1658,23 +1712,23 @@ static int test_complicated_compound(void)
* Library has convenient function getline() but isn't available on
* all machines.
*/
- if((line = (char*)calloc(size, sizeof(char)))==NULL)
+ if((line = (char*)HDcalloc(size, sizeof(char)))==NULL)
goto out;
- if(fgets(line, (int)size, fp)==NULL)
+ if(HDfgets(line, (int)size, fp)==NULL)
goto out;
- while(strlen(line)==size-1) {
+ while(HDstrlen(line)==size-1) {
size *= 2;
if(line)
- free(line);
- if((line = (char*)calloc(size, sizeof(char)))==NULL)
+ HDfree(line);
+ if((line = (char*)HDcalloc(size, sizeof(char)))==NULL)
goto out;
- if(fseek(fp, 0L, SEEK_SET)!=0)
+ if(HDfseek(fp, 0L, SEEK_SET)!=0)
goto out;
- if(fgets(line, (int)size, fp)==NULL)
+ if(HDfgets(line, (int)size, fp)==NULL)
goto out;
}
- fclose(fp);
+ HDfclose(fp);
fp = NULL;
if((dtype = H5LTtext_to_dtype(line, H5LT_DDL))<0)
@@ -1692,7 +1746,7 @@ static int test_complicated_compound(void)
goto out;
if(line)
- free(line);
+ HDfree(line);
PASSED();
return 0;
@@ -1700,9 +1754,9 @@ static int test_complicated_compound(void)
out:
if(line)
- free(line);
+ HDfree(line);
if(fp)
- fclose(fp);
+ HDfclose(fp);
H5_FAILED();
return -1;
@@ -1753,6 +1807,339 @@ out:
}
/*-------------------------------------------------------------------------
+ * test H5LTpath_valid function
+ *-------------------------------------------------------------------------
+ */
+static int test_valid_path(void)
+{
+ hid_t file_id, group;
+ herr_t status;
+ FILE *fp = NULL;
+ htri_t path_valid;
+ char path[10];
+ const char *data_string_in = "test";
+
+ TESTING("H5LTpath_valid");
+
+ /* Create a new file using default properties. */
+
+ /**************************************************************
+ * The file structure should look like this:
+ *
+ * +----------------------------------+
+ * | / |
+ * +----------------------------------+
+ * / | \ \
+ * / | \ \
+ * / | \ \
+ * / | \ G8 (dangled external link)
+ * / DS \
+ * / \
+ * G1 G2
+ * | --> DS1 |
+ * / \--> DS3 / \
+ * / / \
+ * G2 DS4 G7
+ * | (hard link (dangled soft link
+ * | to /G1/DS3) to /G1/G20 )
+ * |
+ * |
+ * | --- Gcyc (soft link to /G1)
+ * / \
+ * / \
+ * G5 \
+ * (soft link G6 (external link /G1 in FILENAME4)
+ * to /G2)
+ *
+ ****************************************************************/
+
+ file_id = H5Fcreate(FILE_NAME3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+
+ /*
+ * Create dataset "/DS"
+ */
+ if(H5LTmake_dataset_string(file_id, "DS", data_string_in)<0)
+ goto out;
+
+ /*
+ * Create an external dangled link
+ */
+ if(H5Lcreate_external("NonExistant_File.h5", "G8", file_id, "DangledExternalLink", H5P_DEFAULT, H5P_DEFAULT)<0)
+ goto out;
+
+ /*
+ * Create a group named "G2" in the file.
+ */
+ if((group = H5Gcreate2(file_id, "G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0)
+ goto out;
+
+ /*
+ * Create a dataset named "G2/DS4" in the file.
+ */
+ if(H5LTmake_dataset_string(group, "/G2/DS4", data_string_in)<0)
+ goto out;
+
+ /*
+ * Create a soft link
+ */
+ if(H5Lcreate_soft("/G1/G20", file_id, "/G2/G7", H5P_DEFAULT, H5P_DEFAULT) <0)
+ goto out;
+
+ if(H5Gclose(group)<0)
+ goto out;
+
+ /*
+ * Create a group named "G1" in the file.
+ */
+ if((group = H5Gcreate2(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0)
+ goto out;
+
+ /*
+ * Create a group named "G1/DS1" in the file.
+ */
+ if(H5LTmake_dataset_string(group, "/G1/DS1", data_string_in)<0)
+ goto out;
+
+ if(H5Gclose(group)<0)
+ goto out;
+
+ /*
+ * Create a hard link
+ */
+ if(H5Lcreate_hard(file_id, "/G2/DS4", file_id, "/G1/DS3",H5P_DEFAULT, H5P_DEFAULT)<0)
+ goto out;
+ /*
+ * Create a group named "/G1/G2" in the file.
+ */
+ if((group = H5Gcreate2(file_id, "/G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0)
+ goto out;
+
+ /*
+ * Create a soft link
+ */
+ if(H5Lcreate_soft("/G2", file_id, "/G1/G2/G5", H5P_DEFAULT, H5P_DEFAULT)<0)
+ goto out;
+
+ /*
+ * Create a cyclic soft link
+ */
+ if(H5Lcreate_soft("/G1", file_id, "/G1/G2/Gcyc", H5P_DEFAULT, H5P_DEFAULT)<0)
+ goto out;
+
+ if(H5Gclose(group)<0)
+ goto out;
+
+ /*
+ * Create a group named "/G1/G2/G6" in the file.
+ */
+ if((group = H5Gcreate2(file_id, "/G1/G2/G6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0)
+ goto out;
+
+ /*
+ * Create an external link
+ */
+ if(H5Lcreate_external( FILE_NAME4, "G1", group, "ExternalLink", H5P_DEFAULT, H5P_DEFAULT)<0)
+ goto out;
+
+ if(H5Gclose(group)<0)
+ goto out;
+ /*
+ * Close the file.
+ */
+ status = H5Fclose (file_id);
+
+ /* Create another file for checking external links */
+
+ /**************************************************************
+ * The file structure should look like this:
+ *
+ * +----+
+ * | / |
+ * +----+
+ * |
+ * |
+ * |
+ * G1
+ * / \
+ * / \
+ * DS1 G2
+ * (dangled soft link to /G1/G20)
+ *
+ ****************************************************************/
+
+ /* Make external link file */
+ file_id = H5Fcreate(FILE_NAME4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+
+ /*
+ * Create a group named "G1" in the file.
+ */
+ if((group = H5Gcreate2(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0)
+ goto out;
+ /*
+ * Create a dataset named "G1/DS1" in the file.
+ */
+ if(H5LTmake_dataset_string(group, "/G1/DS1", data_string_in)<0)
+ goto out;
+
+ /*
+ * Create a dangling soft link
+ */
+
+ if(H5Lcreate_soft("/G1/G2", file_id, "/G1/G20", H5P_DEFAULT, H5P_DEFAULT)<0)
+ goto out;
+
+ if(H5Gclose(group)<0)
+ goto out;
+
+ H5Fclose(file_id);
+
+ /* Open input file */
+ if((file_id = H5Fopen(FILE_NAME3,H5F_ACC_RDONLY, H5P_DEFAULT))<0)
+ goto out;
+
+ /**************************************
+ * CHECK ABSOLUTE PATHS
+ **************************************/
+ if( (path_valid = H5LTpath_valid(file_id, "/G1", TRUE)) != TRUE) {
+ goto out;
+ }
+
+ if((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/DS3", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", FALSE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/DS1", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE)
+ goto out;
+
+ /* check soft link points to a valid object*/
+ if( (path_valid = H5LTpath_valid(file_id, "/G2/DS4", TRUE)) != TRUE)
+ goto out;
+
+ /* check if path exist, but not the object */
+ if( (path_valid = H5LTpath_valid(file_id, "/G2/G7", FALSE)) != TRUE )
+ goto out;
+ /* check if path exist and if the object exists. It should fail
+ * since it is a dangling soft link
+ */
+ if( (path_valid = H5LTpath_valid(file_id, "/G2/G7", TRUE)) == TRUE)
+ goto out;
+
+ /* check soft links */
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", TRUE)) != TRUE)
+ goto out;
+
+ /**************************************
+ * CHECK RELATIVE PATHS
+ ***************************************/
+
+ if( (group = H5Gopen2(file_id, "/G1", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* The identifier (file id) is the object itself, i.e. "." */
+
+ if((path_valid = H5LTpath_valid(file_id, ".", FALSE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, ".", TRUE)) != TRUE)
+ goto out;
+
+ /* The identifier (group id) is the object itself, i.e. "." */
+
+ if( (path_valid = H5LTpath_valid(group, ".", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(group, "DS3", FALSE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(group, "DS3", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(group, "G2/G5", TRUE)) != TRUE)
+ goto out;
+
+ /* Check the "./" case */
+ if( (path_valid = H5LTpath_valid(group, "./DS3", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(group, "./G2/G5", TRUE)) != TRUE)
+ goto out;
+
+ /* Should fail, does not exist */
+ if( (path_valid = H5LTpath_valid(group, "./G2/G20", FALSE)) == TRUE)
+ goto out;
+
+ /* Should fail, does not exist */
+ if( (path_valid = H5LTpath_valid(group, "./G2/G20", TRUE)) == TRUE)
+ goto out;
+
+ if(H5Gclose(group)<0)
+ goto out;
+
+ /*****************************
+ * Check external links
+ *****************************/
+
+ /* The dangled external link path is valid */
+ if( (path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", FALSE)) != TRUE)
+ goto out;
+
+ /* The file however does not exists, so the link dangles -> should return false */
+ if( (path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", TRUE)) == TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", FALSE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/DS1", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/G20", FALSE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/DS1", TRUE)) != TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", FALSE)) != TRUE)
+ goto out;
+
+ /* Should fail, does not exist */
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", TRUE)) == TRUE)
+ goto out;
+
+ if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/Gcyc/G2/G6/ExternalLink/G20", TRUE)) == TRUE)
+ goto out;
+
+
+ if(H5Fclose(file_id)<0)
+ goto out;
+
+ PASSED();
+ return 0;
+
+ out:
+ H5_FAILED();
+ return -1;
+}
+
+
+/*-------------------------------------------------------------------------
* the main program
*-------------------------------------------------------------------------
*/
@@ -1767,7 +2154,7 @@ int main( void )
nerrors += test_attr();
/* test text-dtype functions */
- nerrors += test_text_dtype();
+ nerrors += test_valid_path();
/* check for errors */
if (nerrors)
@@ -1780,4 +2167,3 @@ error:
}
-
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 3c258c1..9d3074d 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -72,7 +72,7 @@ static particle_t testPart[NRECORDS] = {
*/
static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf )
{
- if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
+ if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
rbuf[i].pressure != wbuf[j].pressure ||
@@ -127,7 +127,7 @@ static int create_hl_table(hid_t fid)
/* Define field information */
const char *field_names[NFIELDS] =
- { "Name","Latitude", "Longitude", "Pressure", "Temperature" };
+ { "Name","Latitude", "Longitude", "Pressure", "Temperature" };
hid_t field_type[NFIELDS];
hid_t string_type;
hsize_t chunk_size = 10;
@@ -182,7 +182,7 @@ static int test_create_close(hid_t fid)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- assert(part_t != -1);
+ HDassert(part_t != -1);
/* Create the table */
table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1);
@@ -460,7 +460,7 @@ static int test_big_table(hid_t fid)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- assert(part_t != -1);
+ HDassert(part_t != -1);
/* Create a new table */
table = H5PTcreate_fl(fid, "Packet Test Dataset2", part_t, (hsize_t)33, -1);
@@ -712,7 +712,7 @@ static int test_opaque(hid_t fid)
if ((part_t = H5Tcreate (H5T_OPAQUE, sizeof(particle_t) )) < 0 )
return -1;
- assert(part_t != -1);
+ HDassert(part_t != -1);
/* Tag the opaque datatype */
if ( H5Tset_tag(part_t, "Opaque Particle" ) < 0)
@@ -787,7 +787,7 @@ test_compress(void)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
- assert(part_t != -1);
+ HDassert(part_t != -1);
/* Create a new table with compression level 8 */
table = H5PTcreate_fl(fid1, "Compressed Test Dataset", part_t, (hsize_t)80, 8);
@@ -1059,7 +1059,7 @@ int main(void)
/* create a file using default properties */
fid=H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- puts("Testing packet table");
+ HDputs("Testing packet table");
/* run tests */
if ( test_packet_table(fid) < 0)
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 0fc4c84..e3e040e 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -129,8 +129,8 @@ static hid_t h5file_open(const char *fname, unsigned flags)
/* open */
if ((fid = H5Fopen(data_file,flags,H5P_DEFAULT))<0)
{
- fprintf(stderr,"Error: Cannot open file <%s>\n",data_file );
- exit(1);
+ HDfprintf(stderr,"Error: Cannot open file <%s>\n",data_file );
+ HDexit(1);
}
return fid;
@@ -142,16 +142,16 @@ static hid_t h5file_open(const char *fname, unsigned flags)
*/
static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
{
- if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
+ if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
rbuf[i].pressure != wbuf[j].pressure ||
rbuf[i].temperature != wbuf[j].temperature )
{
- fprintf(stderr,"read and write buffers have differences\n");
- fprintf(stderr,"%s %ld %f %f %d\n",
+ HDfprintf(stderr,"read and write buffers have differences\n");
+ HDfprintf(stderr,"%s %ld %f %f %d\n",
rbuf[i].name,rbuf[i].longi,rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
- fprintf(stderr,"%s %ld %f %f %d\n",
+ HDfprintf(stderr,"%s %ld %f %f %d\n",
wbuf[j].name,wbuf[j].longi,wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
return -1;
}
@@ -495,9 +495,9 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
if(do_write)
- strcpy(tname,"table2");
+ HDstrcpy(tname,"table2");
else
- strcpy(tname,"table1");
+ HDstrcpy(tname,"table1");
rstart=0;
rrecords=8;
@@ -645,7 +645,7 @@ static int test_table(hid_t fid, int do_write)
wbufd[i].longi = wbuf[i].longi;
wbufd[i].pressure = wbuf[i].pressure;
wbufd[i].temperature = wbuf[i].temperature;
- strcpy(wbufd[i].name, wbuf[i].name );
+ HDstrcpy(wbufd[i].name, wbuf[i].name );
}
@@ -1027,9 +1027,9 @@ static int test_table(hid_t fid, int do_write)
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
rbuf[i].pressure != pressure_in[i-NRECORDS_ADD+1] )
{
- fprintf(stderr,"%ld %f %d\n",
+ HDfprintf(stderr,"%ld %f %d\n",
rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati);
- fprintf(stderr,"%ld %f %d\n",
+ HDfprintf(stderr,"%ld %f %d\n",
position_in[i].longi,pressure_in[i],position_in[i].lati);
goto out;
}
@@ -1144,7 +1144,7 @@ static int test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
- if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
+ if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
namepre_out[i].pressure != namepre_in[i].pressure ) {
goto out;
}
@@ -1153,7 +1153,7 @@ static int test_table(hid_t fid, int do_write)
/* reset buffer */
for( i = 0; i < NRECORDS; i++ )
{
- strcpy( namepre_out[i].name, "\0" );
+ HDstrcpy( namepre_out[i].name, "\0" );
namepre_out[i].pressure = -1;
}
@@ -1173,7 +1173,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < 3; i++ )
{
hsize_t iistart = start;
- if ( ( strcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
+ if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
namepre_out[i].pressure != namepre_in[iistart+i].pressure ) {
goto out;
}
@@ -1351,7 +1351,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
- if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
+ if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
namepre_out[i].pressure != namepre_in[i].pressure ) {
goto out;
}
@@ -1360,7 +1360,7 @@ static int test_table(hid_t fid, int do_write)
/* reset buffer */
for( i = 0; i < NRECORDS; i++ )
{
- strcpy( namepre_out[i].name, "\0" );
+ HDstrcpy( namepre_out[i].name, "\0" );
namepre_out[i].pressure = -1;
}
@@ -1382,7 +1382,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < 3; i++ )
{
int iistart = (int) start;
- if ( ( strcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) ||
+ if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) ||
namepre_out[i].pressure != wbuf[iistart+i].pressure ) {
goto out;
}
@@ -1423,7 +1423,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the original array */
for( i = 0; i < NRECORDS; i++ )
{
- if ( ( strcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
+ if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
rbuf2[i].pressure != wbuf[i].pressure ||
@@ -1464,7 +1464,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the original array */
for( i = 0; i < NRECORDS; i++ )
{
- if ( ( strcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
+ if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
rbuf3[i].temperature != wbuf[i].temperature ) {
@@ -1509,10 +1509,10 @@ static int test_table(hid_t fid, int do_write)
TESTING2("getting field info");
/* alocate */
- names_out = (char**) malloc( sizeof(char*) * (size_t)NFIELDS );
+ names_out = (char**) HDmalloc( sizeof(char*) * (size_t)NFIELDS );
for ( i = 0; i < NFIELDS; i++)
{
- names_out[i] = (char*) malloc( sizeof(char) * 255 );
+ names_out[i] = (char*) HDmalloc( sizeof(char) * 255 );
}
/* Get field info */
@@ -1521,7 +1521,7 @@ static int test_table(hid_t fid, int do_write)
for ( i = 0; i < NFIELDS; i++)
{
- if ( (strcmp( field_names[i], names_out[i] ) != 0)) {
+ if ( (HDstrcmp( field_names[i], names_out[i] ) != 0)) {
goto out;
}
}
@@ -1529,9 +1529,9 @@ static int test_table(hid_t fid, int do_write)
/* release */
for ( i = 0; i < NFIELDS; i++)
{
- free ( names_out[i] );
+ HDfree ( names_out[i] );
}
- free ( names_out );
+ HDfree ( names_out );
PASSED();
@@ -1564,7 +1564,7 @@ int main(void)
/* create a file using default properties */
fid=H5Fcreate("test_table.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);
- puts("Testing table with file creation mode (read/write in native architecture):");
+ HDputs("Testing table with file creation mode (read/write in native architecture):");
/* test, do write */
if (test_table(fid,1)<0)
@@ -1577,7 +1577,7 @@ int main(void)
* test2: open a file written in test1 on a big-endian machine
*-------------------------------------------------------------------------
*/
- puts("Testing table with file open mode (read big-endian data):");
+ HDputs("Testing table with file open mode (read big-endian data):");
fid=h5file_open(TEST_FILE_BE,flags);
@@ -1592,7 +1592,7 @@ int main(void)
* test3: open a file written in test1 on a little-endian machine
*-------------------------------------------------------------------------
*/
- puts("Testing table with file open mode (read little-endian data):");
+ HDputs("Testing table with file open mode (read little-endian data):");
fid=h5file_open(TEST_FILE_LE,flags);
@@ -1607,7 +1607,7 @@ int main(void)
* test4: open a file written in test1 on the Cray T3 machine
*-------------------------------------------------------------------------
*/
- puts("Testing table with file open mode (read Cray data):");
+ HDputs("Testing table with file open mode (read Cray data):");
fid=h5file_open(TEST_FILE_CRAY,flags);
diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c
index 1225613..810be78 100644
--- a/hl/tools/gif2h5/gif2hdf.c
+++ b/hl/tools/gif2h5/gif2hdf.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include "gif.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
@@ -49,6 +50,9 @@ main(int argv , char *argc[])
GifMemoryStruct.GifApplicationExtension = NULL;
GifMemoryStruct.GifCommentExtension = NULL;
+ /* Initialize h5tools lib */
+ h5tools_init();
+
if ( argc[1] && (strcmp("-V",argc[1])==0) )
{
print_version("gif2h5");
diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c
index 907fb80..7995bb4 100644
--- a/hl/tools/gif2h5/gif2mem.c
+++ b/hl/tools/gif2h5/gif2mem.c
@@ -37,7 +37,7 @@
#include "gif.h"
-#define VERSION "1.00"
+#define GIF2VERSION "1.00"
GIFTOMEM
Gif2Mem(BYTE *MemGif)
diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c
index cc8e864..090d657 100644
--- a/hl/tools/gif2h5/hdf2gif.c
+++ b/hl/tools/gif2h5/hdf2gif.c
@@ -17,6 +17,7 @@
#include <assert.h>
#include "gif.h"
#include "H5IMpublic.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
@@ -70,6 +71,9 @@ int main(int argc , char **argv)
char *image_name = NULL;
int idx;
+ /* Initialize h5tools lib */
+ h5tools_init();
+
if ( argv[1] && (strcmp("-V",argv[1])==0) )
{
print_version("gif2h5");
diff --git a/perform/pio_engine.c b/perform/pio_engine.c
index abb72fa..0e3190c 100644
--- a/perform/pio_engine.c
+++ b/perform/pio_engine.c
@@ -320,22 +320,22 @@ do_pio(parameters param)
/* Need barrier to make sure everyone starts at the same time */
MPI_Barrier(pio_comm_g);
- set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START);
+ set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, PIO_CREATE | PIO_WRITE);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START);
+ set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
hrc = do_write(&res, &fd, &param, ndsets, nbytes, buf_size, buffer);
hrc == SUCCESS;
- set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP);
+ set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_write failed");
/* Close file for write */
hrc = do_fclose(iot, &fd);
- set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP);
+ set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
if (!param.h5_write_only) {
@@ -349,20 +349,20 @@ do_pio(parameters param)
MPI_Barrier(pio_comm_g);
/* Open file for read */
- set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START);
+ set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, PIO_READ);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START);
+ set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
hrc = do_read(&res, &fd, &param, ndsets, nbytes, buf_size, buffer);
- set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP);
+ set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_read failed");
/* Close file for read */
hrc = do_fclose(iot, &fd);
- set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP);
+ set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
}
@@ -413,7 +413,7 @@ done:
static char *
pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t size)
{
- const char *prefix, *suffix="";
+ const char *prefix, *suffix = "";
char *ptr, last = '\0';
size_t i, j;
@@ -968,7 +968,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end else */
/* Start "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START);
+ set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
while (nbytes_xfer < bytes_count){
/* Write */
@@ -1399,7 +1399,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end while */
/* Stop "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP);
+ set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
/* Calculate write time */
@@ -1899,7 +1899,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end else */
/* Start "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START);
+ set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
while (nbytes_xfer < bytes_count){
/* Read */
@@ -2354,7 +2354,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end while */
/* Stop "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP);
+ set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
/* Calculate read time */
@@ -3115,9 +3115,9 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_READ, START);
+ set_time(timer_g, HDF5_MPI_READ, TSTART);
err=PMPI_File_read_at(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_READ, STOP);
+ set_time(timer_g, HDF5_MPI_READ, TSTOP);
return err;
}
@@ -3126,9 +3126,9 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_READ, START);
+ set_time(timer_g, HDF5_MPI_READ, TSTART);
err=PMPI_File_read_at_all(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_READ, STOP);
+ set_time(timer_g, HDF5_MPI_READ, TSTOP);
return err;
}
@@ -3136,9 +3136,9 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_WRITE, START);
+ set_time(timer_g, HDF5_MPI_WRITE, TSTART);
err=PMPI_File_write_at(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_WRITE, STOP);
+ set_time(timer_g, HDF5_MPI_WRITE, TSTOP);
return err;
}
@@ -3146,9 +3146,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_WRITE, START);
+ set_time(timer_g, HDF5_MPI_WRITE, TSTART);
err=PMPI_File_write_at_all(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_WRITE, STOP);
+ set_time(timer_g, HDF5_MPI_WRITE, TSTOP);
return err;
}
diff --git a/perform/pio_perf.c b/perform/pio_perf.c
index 411fb12..337e982 100644
--- a/perform/pio_perf.c
+++ b/perform/pio_perf.c
@@ -339,6 +339,11 @@ main(int argc, char **argv)
int exit_value = EXIT_SUCCESS;
struct options *opts = NULL;
+#ifndef STANDALONE
+ /* Initialize h5tools lib */
+ h5tools_init();
+#endif
+
output = stdout;
/* initialize MPI and get the maximum num of processors we started with */
diff --git a/perform/pio_perf.h b/perform/pio_perf.h
index 6f510ca..094b31d 100644
--- a/perform/pio_perf.h
+++ b/perform/pio_perf.h
@@ -19,6 +19,7 @@
#ifndef STANDALONE
#include "H5private.h"
#include "h5test.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
#else
#include "pio_standalone.h"
diff --git a/perform/pio_timer.c b/perform/pio_timer.c
index 9c8abb7..aba219e 100644
--- a/perform/pio_timer.c
+++ b/perform/pio_timer.c
@@ -43,15 +43,15 @@ pio_time *timer_g; /* timer: global for stub functions */
* Function: sub_time
* Purpose: Struct two time values, and return the difference, in microseconds
*
- * Note that the function assumes that a > b
+ * Note that the function assumes that a > b
* Programmer: Leon Arber, 1/27/06
*/
static double sub_time(struct timeval* a, struct timeval* b)
{
return (((double)a->tv_sec +
((double)a->tv_usec) / MICROSECOND) -
- ((double)b->tv_sec +
- ((double)b->tv_usec) / MICROSECOND));
+ ((double)b->tv_sec +
+ ((double)b->tv_usec) / MICROSECOND));
}
@@ -89,7 +89,7 @@ pio_time_new(clock_type type)
void
pio_time_destroy(pio_time *pt)
{
- free(pt);
+ HDfree(pt);
/* reset the global timer pointer too. */
timer_g = NULL;
}
@@ -134,37 +134,37 @@ set_time(pio_time *pt, timer_type t, int start_stop)
{
if (pt) {
if (pt->type == MPI_TIMER) {
- if (start_stop == START) {
+ if (start_stop == TSTART) {
pt->mpi_timer[t] = MPI_Wtime();
- /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
- * we compute the time it took to only open the file */
- if(t == HDF5_FINE_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS];
- else if(t == HDF5_FINE_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS];
+ /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
+ * we compute the time it took to only open the file */
+ if(t == HDF5_FINE_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS];
+ else if(t == HDF5_FINE_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS];
} else {
pt->total_time[t] += MPI_Wtime() - pt->mpi_timer[t];
- pt->mpi_timer[t] = MPI_Wtime();
-
- /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
- * we compute the time it took to close the file after the last read/write finished */
- if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS];
- else if(t == HDF5_GROSS_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS];
+ pt->mpi_timer[t] = MPI_Wtime();
+
+ /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
+ * we compute the time it took to close the file after the last read/write finished */
+ if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS];
+ else if(t == HDF5_GROSS_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS];
}
} else {
- if (start_stop == START) {
+ if (start_stop == TSTART) {
HDgettimeofday(&pt->sys_timer[t], NULL);
- /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
- * we compute the time it took to only open the file */
- if(t == HDF5_FINE_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
- else if(t == HDF5_FINE_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
+ /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
+ * we compute the time it took to only open the file */
+ if(t == HDF5_FINE_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
+ else if(t == HDF5_FINE_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
} else {
@@ -178,12 +178,12 @@ set_time(pio_time *pt, timer_type t, int start_stop)
((double)pt->sys_timer[t].tv_sec +
((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/
- /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
- * we compute the time it took to close the file after the last read/write finished */
- if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
- else if(t == HDF5_GROSS_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
+ /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
+ * we compute the time it took to close the file after the last read/write finished */
+ if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
+ else if(t == HDF5_GROSS_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
}
}
@@ -231,7 +231,7 @@ set_time(pio_time *pt, timer_type t, int start_stop)
}
fprintf(output, " Proc %d: %s %s: %.2f\n", myrank, msg,
- (start_stop == START ? "Start" : "Stop"),
+ (start_stop == TSTART ? "Start" : "Stop"),
pt->total_time[t]);
}
}
diff --git a/perform/pio_timer.h b/perform/pio_timer.h
index 943521a..a5ee6d7 100644
--- a/perform/pio_timer.h
+++ b/perform/pio_timer.h
@@ -53,8 +53,8 @@ typedef enum clock_type_ {
/* Miscellaneous identifiers */
enum {
- START, /* Start a specified timer */
- STOP /* Stop a specified timer */
+ TSTART, /* Start a specified timer */
+ TSTOP /* Stop a specified timer */
};
/* The performance time structure */
diff --git a/perform/sio_engine.c b/perform/sio_engine.c
index e892bcc..df2e21e 100644
--- a/perform/sio_engine.c
+++ b/perform/sio_engine.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <fcntl.h>
#ifdef H5_HAVE_UNISTD_H
-# include <unistd.h>
+# include <unistd.h>
#endif
#include <errno.h>
@@ -233,18 +233,18 @@ do_sio(parameters param)
HDfprintf(output, "data filename=%s\n",
fname);
- set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START);
+ set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, SIO_CREATE | SIO_WRITE);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START);
+ set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
hrc = do_write(&res, &fd, &param, buffer);
- set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP);
+ set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_write failed");
/* Close file for write */
hrc = do_fclose(iot, &fd);
- set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP);
+ set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
if (!param.h5_write_only) {
@@ -253,19 +253,19 @@ do_sio(parameters param)
*/
/* Open file for read */
- set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START);
+ set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, SIO_READ);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START);
+ set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
hrc = do_read(&res, &fd, &param, buffer);
- set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP);
+ set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_read failed");
/* Close file for read */
hrc = do_fclose(iot, &fd);
- set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP);
+ set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
}
@@ -551,7 +551,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
}
/* Start "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START);
+ set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
/* Perform write */
hrc = dset_write(rank-1, fd, parms, buffer);
@@ -563,7 +563,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Stop "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP);
+ set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
/* Calculate write time */
@@ -628,7 +628,7 @@ static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void
int cur_dim = order[local_dim]-1;
int ret_code = SUCCESS;
int k;
- hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS];
+ hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS];
long i,j;
herr_t hrc;
@@ -855,7 +855,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
} /* end switch */
/* Start "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START);
+ set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
hrc = dset_read(rank-1, fd, parms, buffer, buffer2);
if (hrc < 0) {
@@ -864,7 +864,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
}
/* Stop "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP);
+ set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
/* Calculate read time */
diff --git a/perform/sio_perf.c b/perform/sio_perf.c
index d852a45..16e1750 100644
--- a/perform/sio_perf.c
+++ b/perform/sio_perf.c
@@ -343,6 +343,11 @@ main(int argc, char **argv)
int exit_value = EXIT_SUCCESS;
struct options *opts = NULL;
+#ifndef STANDALONE
+ /* Initialize h5tools lib */
+ h5tools_init();
+#endif
+
output = stdout;
opts = parse_command_line(argc, argv);
diff --git a/perform/sio_perf.h b/perform/sio_perf.h
index 2417b6f..3e4456a 100644
--- a/perform/sio_perf.h
+++ b/perform/sio_perf.h
@@ -19,6 +19,7 @@
#ifndef STANDALONE
#include "H5private.h"
#include "h5test.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
#else
#include "sio_standalone.h"
@@ -49,24 +50,24 @@ typedef enum vfdtype_ {
} vfdtype;
typedef struct parameters_ {
- iotype io_type; /* The type of IO test to perform */
+ iotype io_type; /* The type of IO test to perform */
vfdtype vfd;
- long num_files; /* Number of files to create */
- long num_dsets; /* Number of datasets to create */
- off_t num_bytes; /* Number of bytes in each dset */
+ long num_files; /* Number of files to create */
+ long num_dsets; /* Number of datasets to create */
+ off_t num_bytes; /* Number of bytes in each dset */
int num_iters; /* Number of times to loop doing the IO */
int rank; /* Rank of dataset */
- off_t dset_size[MAX_DIMS]; /* Dataset size */
- size_t buf_size[MAX_DIMS]; /* Buffer size */
- size_t chk_size[MAX_DIMS]; /* Chunk size */
- int order[MAX_DIMS]; /* Buffer size */
- hsize_t h5_align; /* HDF5 object alignment */
- hsize_t h5_thresh; /* HDF5 object alignment threshold */
- int h5_use_chunks; /* Make HDF5 dataset chunked */
- int h5_extendable; /* Make HDF5 dataset chunked */
- int h5_write_only; /* Perform the write tests only */
+ off_t dset_size[MAX_DIMS]; /* Dataset size */
+ size_t buf_size[MAX_DIMS]; /* Buffer size */
+ size_t chk_size[MAX_DIMS]; /* Chunk size */
+ int order[MAX_DIMS]; /* Buffer size */
+ hsize_t h5_align; /* HDF5 object alignment */
+ hsize_t h5_thresh; /* HDF5 object alignment threshold */
+ int h5_use_chunks; /* Make HDF5 dataset chunked */
+ int h5_extendable; /* Make HDF5 dataset chunked */
+ int h5_write_only; /* Perform the write tests only */
unsigned h5_use_mpi_posix; /* VFD for HDF5 I/O */
- int verify; /* Verify data correctness */
+ int verify; /* Verify data correctness */
} parameters;
typedef struct results_ {
diff --git a/perform/sio_timer.c b/perform/sio_timer.c
index f188a10..f233de3 100644
--- a/perform/sio_timer.c
+++ b/perform/sio_timer.c
@@ -39,15 +39,15 @@ sio_time *timer_g; /* timer: global for stub functions */
* Function: sub_time
* Purpose: Struct two time values, and return the difference, in microseconds
*
- * Note that the function assumes that a > b
+ * Note that the function assumes that a > b
* Programmer: Leon Arber, 1/27/06
*/
static double sub_time(struct timeval* a, struct timeval* b)
{
return (((double)a->tv_sec +
((double)a->tv_usec) / MICROSECOND) -
- ((double)b->tv_sec +
- ((double)b->tv_usec) / MICROSECOND));
+ ((double)b->tv_sec +
+ ((double)b->tv_usec) / MICROSECOND));
}
@@ -82,7 +82,7 @@ sio_time_new(void)
void
sio_time_destroy(sio_time *pt)
{
- free(pt);
+ HDfree(pt);
/* reset the global timer pointer too. */
timer_g = NULL;
}
@@ -100,15 +100,15 @@ sio_time *
set_time(sio_time *pt, timer_type t, int start_stop)
{
if (pt) {
- if (start_stop == START) {
+ if (start_stop == TSTART) {
HDgettimeofday(&pt->sys_timer[t], NULL);
- /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
- * we compute the time it took to only open the file */
- if(t == HDF5_FINE_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
- else if(t == HDF5_FINE_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
+ /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
+ * we compute the time it took to only open the file */
+ if(t == HDF5_FINE_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
+ else if(t == HDF5_FINE_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
} else {
@@ -122,12 +122,12 @@ set_time(sio_time *pt, timer_type t, int start_stop)
((double)pt->sys_timer[t].tv_sec +
((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/
- /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
- * we compute the time it took to close the file after the last read/write finished */
- if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
- else if(t == HDF5_GROSS_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
+ /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
+ * we compute the time it took to close the file after the last read/write finished */
+ if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
+ else if(t == HDF5_GROSS_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
}
@@ -171,7 +171,7 @@ set_time(sio_time *pt, timer_type t, int start_stop)
}
fprintf(output, " %s %s: %.2f\n", msg,
- (start_stop == START ? "Start" : "Stop"),
+ (start_stop == TSTART ? "Start" : "Stop"),
pt->total_time[t]);
}
}
diff --git a/perform/sio_timer.h b/perform/sio_timer.h
index 1fa880d..04432af 100644
--- a/perform/sio_timer.h
+++ b/perform/sio_timer.h
@@ -27,7 +27,7 @@
#endif
#ifdef H5_HAVE_WINSOCK_H
-# include <winsock2.h>
+# include <winsock2.h>
#endif /* H5_HAVE_WINSOCK_H */
/* The different types of timers we can have */
@@ -52,8 +52,8 @@ typedef enum timer_type_ {
/* Miscellaneous identifiers */
enum {
- START, /* Start a specified timer */
- STOP /* Stop a specified timer */
+ TSTART, /* Start a specified timer */
+ TSTOP /* Stop a specified timer */
};
/* The performance time structure */
diff --git a/perform/zip_perf.c b/perform/zip_perf.c
index 897fc7e..585dc13 100644
--- a/perform/zip_perf.c
+++ b/perform/zip_perf.c
@@ -23,6 +23,7 @@
/* our header files */
#include "h5test.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
#ifdef H5_HAVE_FILTER_DEFLATE
@@ -573,6 +574,9 @@ main(int argc, char **argv)
int opt;
prog = argv[0];
+
+ /* Initialize h5tools lib */
+ h5tools_init();
while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) > 0) {
switch ((char)opt) {
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index eb3dfb0..f0f296c 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.109 currently under development
+HDF5 version 1.9.112 currently under development
================================================================================
@@ -39,6 +39,8 @@ New Features
Configuration:
-------------
+ - Added code to display the version information of XL fortran and C++
+ in the summary of configure. (AKC - 2012/02/28 - HDFFV-7793)
- Configure now generates Makefiles that build in "silent make mode"
by default in which compile and link lines are significantly
simplified for clarity. To override this and view actual compile and
@@ -239,12 +241,26 @@ New Features
Tools:
------
+ - 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
+ 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)
+ 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
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.(JIRA HDFFV-7689).
- (ADB - 2012/01/31)
+ name contains a '[' character. HDFFV-7689 (ADB - 2012/01/31)
- h5dump: Corrected schema location:
<hdf5:HDF5-File
xmlns:hdf5="http://hdfgroup.org/HDF5/XML/schema/HDF5-File"
@@ -333,6 +349,10 @@ New Features
h5dsget_scale_name_f
h5dsget_num_scales_f
(EIP for SB - 2011/10/13)
+
+ - 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 does not dangle. (MSB- 2012/3/15)
Documentation
-------------
@@ -348,10 +368,15 @@ Bug Fixes since HDF5-1.8.0 release
Library
-------
-
+ - 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
+ header format. (NAF - 2012/3/15 - HDFFV-7879)
- Creating a dataset in a read-only file caused seg fault when the file
- is closed. It's fixed. The error stack is returned correctly
- now. (SLU - 2012/1/25. Issue 7756)
+ 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
larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833)
- The library allowed the conversion of strings between ASCII and UTF8
@@ -641,9 +666,25 @@ Bug Fixes since HDF5-1.8.0 release
Tools
-----
+ - 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
+ information generated within the library.
+ HDFFV-7958 (ADB 2012/03/12)
+ - 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
+ --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
functions from DDL functions. Corrected indentation and formatting
- errors. Also fixed subsetting counting overflow (HDFFV-5874).
+ 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
comparing the two dangling symlinks with follow-symlinks option.
@@ -891,6 +932,10 @@ Bug Fixes since HDF5-1.8.0 release
Platforms Tested
================
+ AIX 5.3 xlc 10.1.0.5
+ (NASA G-ADA) xlC 10.1.0.5
+ xlf90 12.1.0.6
+
FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719
(loyalty) g++ 4.2.1 [FreeBSD] 20070719
gcc 4.6.1 20110422
diff --git a/src/H5Dint.c b/src/H5Dint.c
index f105e0a..9a80bfc 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -1596,15 +1596,20 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al
switch(layout->type) {
case H5D_CONTIGUOUS:
if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) {
- /* Reserve space in the file for the entire array */
- if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage")
+ /* Check if we have a zero-sized dataset */
+ if(layout->storage.u.contig.size > 0) {
+ /* Reserve space in the file for the entire array */
+ if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage")
+
+ /* Indicate that we should initialize storage space */
+ must_init_space = TRUE;
+ } /* end if */
+ else
+ layout->storage.u.contig.addr = HADDR_UNDEF;
/* Indicate that we set the storage addr */
addr_set = TRUE;
-
- /* Indicate that we should initialize storage space */
- must_init_space = TRUE;
} /* end if */
break;
diff --git a/src/H5FD.c b/src/H5FD.c
index b778a46..8689dde 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -559,15 +559,17 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_null_sb_verify
+ * Function: H5FD_sb_verify
*
* Purpose: Verify that the driver is compatable with the driver
- * that created the file. driver_id is the driver identifier
- * field stored in the superblock. This is called when
- * reopening a file and ensures that the driver is able to
- * decode the superblock info.
- *
- * Return: Success: Non-negative
+ * that created the file. During file creation, drivers that
+ * modify the HDF5 file structure when interacting with the
+ * filesystem identify themselves in the file superblock.
+ * When the file is reopened, the opening driver must verify
+ * that it can reconstruct a logical HDF5 file from the
+ * modified structure in the filesystem.
+ *
+ * Return: Success: TRUE if the driver is compatable, else FALSE
* Failure: Negative
*
* Programmer: Jacob Gruber
@@ -575,25 +577,24 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
-H5FD_sb_verify(H5FD_t *file, const char *driver_id)
+htri_t
+H5FD_sb_verify(H5FD_t *file, const char *sb_driver_id)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_sb_verify, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file && file->cls);
/* Delegate to the driver if possible. If driver doesn't implement
- * this function, it means that it can't support files with driver info
- * in the superblock.
+ * an sb_verify callback, the default return valyue is used,
+ * indicating incompatablility.
*/
if(file->cls->sb_verify) {
- if((file->cls->sb_verify)(file, driver_id) < 0)
+ ret_value = (file->cls->sb_verify)(file, sb_driver_id);
+ if(ret_value < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_verify request failed")
- }
- else
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver doesn't support sb_verify")
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index f8261b1..f38ec86 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -99,7 +99,7 @@ static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/,
unsigned char *buf/*out*/);
static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name,
const unsigned char *buf);
-static herr_t H5FD_family_sb_verify(H5FD_t *_file, const char *driver_id);
+static htri_t H5FD_family_sb_verify(H5FD_t *_file, const char *driver_id);
static H5FD_t *H5FD_family_open(const char *name, unsigned flags,
hid_t fapl_id, haddr_t maxaddr);
static herr_t H5FD_family_close(H5FD_t *_file);
@@ -706,12 +706,9 @@ done:
* Function: H5FD_family_sb_verify
*
* Purpose: Verify that the family driver is compatable with the driver
- * that created the file. driver_id is the driver identifier
- * field stored in the superblock. This is called when
- * reopening a file and ensures that the driver is able to
- * decode the superblock info.
+ * that created the file.
*
- * Return: Success: Non-negative
+ * Return: Success: TRUE if the driver is compatible, esle FALSE
* Failure: Negative
*
* Programmer: Jacob Gruber
@@ -719,20 +716,16 @@ done:
*
*-------------------------------------------------------------------------
*/
-static herr_t
-H5FD_family_sb_verify(H5FD_t UNUSED *_file, const char *driver_id)
+static htri_t
+H5FD_family_sb_verify(H5FD_t UNUSED *_file, const char *sb_driver_id)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_family_sb_verify, FAIL)
-
- if(HDstrncmp(driver_id, "NCSAfami", (size_t)8)) {
- char err_msg[128];
-
- HDsnprintf(err_msg, sizeof(err_msg), "File type %s not supported by the family driver",
- driver_id);
+ FUNC_ENTER_NOAPI(FAIL)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, err_msg)
+ /* Check if the suerblock was written by a family driver. */
+ if(HDstrncmp(sb_driver_id, "NCSAfami", (size_t)8) == 0) {
+ ret_value = TRUE;
}
done:
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 9bf972b..d4fdd4d 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -877,6 +877,100 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n");
/*-------------------------------------------------------------------------
+ * Function: H5FD_set_mpio_atomicity
+ *
+ * Purpose: Sets the atomicity mode
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: Mohamad Chaarawi
+ * Feb 14, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5FD_set_mpio_atomicity(H5FD_t *_file, hbool_t flag)
+{
+ H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
+ int mpi_code; /* MPI return code */
+ int temp_flag;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_Debug[(int)'t'])
+ fprintf(stdout, "Entering H5FD_set_mpio_atomicity\n");
+#endif
+
+ if (FALSE == flag)
+ temp_flag = 0;
+ else
+ temp_flag = 1;
+
+ /* set atomicity value */
+ if (MPI_SUCCESS != (mpi_code=MPI_File_set_atomicity(file->f, temp_flag)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_atomicity", mpi_code)
+
+done:
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_Debug[(int)'t'])
+ fprintf(stdout, "Leaving H5FD_set_mpio_atomicity\n");
+#endif
+ FUNC_LEAVE_NOAPI(ret_value)
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_get_mpio_atomicity
+ *
+ * Purpose: Returns the atomicity mode
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: Mohamad Chaarawi
+ * Feb 14, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5FD_get_mpio_atomicity(H5FD_t *_file, hbool_t *flag)
+{
+ H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
+ int mpi_code; /* MPI return code */
+ int temp_flag;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_Debug[(int)'t'])
+ fprintf(stdout, "Entering H5FD_get_mpio_atomicity\n");
+#endif
+
+ /* get atomicity value */
+ if (MPI_SUCCESS != (mpi_code=MPI_File_get_atomicity(file->f, &temp_flag)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_get_atomicity", mpi_code)
+
+ if (0 != temp_flag)
+ *flag = TRUE;
+ else
+ *flag = FALSE;
+
+done:
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_Debug[(int)'t'])
+ fprintf(stdout, "Leaving H5FD_get_mpio_atomicity\n");
+#endif
+ FUNC_LEAVE_NOAPI(ret_value)
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_mpio_open
*
* Purpose: Opens a file with name NAME. The FLAGS are a bit field with
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 03978fa..6e0df1b 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -123,7 +123,7 @@ static herr_t H5FD_multi_sb_encode(H5FD_t *file, char *name/*out*/,
unsigned char *buf/*out*/);
static herr_t H5FD_multi_sb_decode(H5FD_t *file, const char *name,
const unsigned char *buf);
-static herr_t H5FD_multi_sb_verify(H5FD_t *file, const char *driver_id);
+static htri_t H5FD_multi_sb_verify(H5FD_t *file, const char *driver_id);
static void *H5FD_multi_fapl_get(H5FD_t *file);
static void *H5FD_multi_fapl_copy(const void *_old_fa);
static herr_t H5FD_multi_fapl_free(void *_fa);
@@ -987,12 +987,9 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
* Function: H5FD_multi_sb_verify
*
* Purpose: Verify that the multi driver is compatable with the driver
- * that created the file. driver_id is the driver identifier
- * field stored in the superblock. This is called when
- * reopening a file and ensures that the driver is able to
- * decode the superblock info.
+ * that created the file.
*
- * Return: Success: Non-negative
+ * Return: Success: TRUE if the driver is compatible, else FALSE
* Failure: Negative
*
* Programmer: Jacob Gruber
@@ -1000,20 +997,17 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
*
*-------------------------------------------------------------------------
*/
-static herr_t
-H5FD_multi_sb_verify(H5FD_t *_file, const char *driver_id)
+static htri_t
+H5FD_multi_sb_verify(H5FD_t *_file, const char *sb_driver_id)
{
static const char *func = "H5FD_multi_sb_verify";
- if(strncmp(driver_id, "NCSAmult", (size_t)8)) {
- char err_msg[128];
-
- snprintf(err_msg, sizeof(err_msg), "File type %s not supported by the multi driver",
- driver_id);
-
- H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, err_msg, -1);
+ /* Check that the superblock was written by the multi driver */
+ if(strncmp(sb_driver_id, "NCSAmult", (size_t)8) == 0) {
+ return 1;
}
- return 0;
+
+ return 0;
} /* end H5FD_family_sb_verify() */
diff --git a/src/H5FDnull.c b/src/H5FDnull.c
index c940786..c43b3b2 100644
--- a/src/H5FDnull.c
+++ b/src/H5FDnull.c
@@ -71,7 +71,7 @@ static herr_t H5FD_null_sb_encode(H5FD_t *_file, char *name/*out*/,
unsigned char *buf/*out*/);
static herr_t H5FD_null_sb_decode(H5FD_t *_file, const char *name,
const unsigned char *buf);
-static herr_t H5FD_null_sb_verify(H5FD_t *_file, const char *driver_id);
+static htri_t H5FD_null_sb_verify(H5FD_t *_file, const char *sb_driver_id);
static H5FD_t *H5FD_null_open(const char *name, unsigned flags,
hid_t fapl_id, haddr_t maxaddr);
static herr_t H5FD_null_close(H5FD_t *_file);
@@ -149,7 +149,7 @@ static const H5FD_class_t H5FD_null_g = {
static herr_t
H5FD_null_init_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_null_init_interface)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_LEAVE_NOAPI(H5FD_null_init())
} /* H5FD_null_init_interface() */
@@ -176,7 +176,7 @@ H5FD_null_init(void)
{
hid_t ret_value=H5FD_NULL_g; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_init, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
if (H5I_VFL!=H5Iget_type(H5FD_NULL_g))
H5FD_NULL_g = H5FD_register(&H5FD_null_g,sizeof(H5FD_class_t),FALSE);
@@ -205,7 +205,7 @@ done:
static herr_t
H5FD_null_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_null_term)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Reset VFL ID */
H5FD_NULL_g=0;
@@ -238,7 +238,7 @@ H5Pset_fapl_null(hid_t fapl_id, hid_t inner_fapl_id)
H5FD_null_fapl_t fa={0};
H5P_genplist_t *plist; /* Property list pointer */
- FUNC_ENTER_API(H5Pset_fapl_null, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ii", fapl_id, inner_fapl_id);
/* Check arguments */
@@ -289,7 +289,7 @@ H5Pget_fapl_null(hid_t fapl_id, hid_t *inner_fapl_id/*out*/)
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Pget_fapl_null, FAIL)
+ FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", fapl_id, inner_fapl_id);
/* Check arguments */
@@ -335,7 +335,7 @@ H5FD_null_fapl_get(H5FD_t *_file)
H5P_genplist_t *plist; /* Property list pointer */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_fapl_get, NULL)
+ FUNC_ENTER_NOAPI(NULL)
/* Check agruments */
if(NULL == (fa = (H5FD_null_fapl_t *)H5MM_calloc(sizeof(H5FD_null_fapl_t))))
@@ -380,7 +380,7 @@ H5FD_null_fapl_copy(const void *_old_fa)
H5P_genplist_t *plist; /* Property list pointer */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_fapl_copy, NULL)
+ FUNC_ENTER_NOAPI(NULL)
/* Allocate memory for copy */
if(NULL == (new_fa = (H5FD_null_fapl_t *)H5MM_malloc(sizeof(H5FD_null_fapl_t))))
@@ -433,7 +433,7 @@ H5FD_null_fapl_free(void *_fa)
H5FD_null_fapl_t *fa = (H5FD_null_fapl_t*)_fa;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_fapl_free, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Free the iner FAPL */
if(H5I_dec_ref(fa->inner_fapl_id) < 0)
@@ -468,7 +468,7 @@ H5FD_null_dxpl_copy(const void *_old_dx)
H5P_genplist_t *plist; /* Property list pointer */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_dxpl_copy, NULL)
+ FUNC_ENTER_NOAPI(NULL)
/* Allocate memoryfor copy */
if(NULL == (new_dx = (H5FD_null_dxpl_t *)H5MM_malloc(sizeof(H5FD_null_dxpl_t))))
@@ -520,7 +520,7 @@ H5FD_null_dxpl_free(void *_dx)
H5FD_null_dxpl_t *dx = (H5FD_null_dxpl_t*)_dx;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_dxpl_free, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Free the DXPL */
if(H5I_dec_ref(dx->inner_dxpl_id) < 0)
@@ -557,7 +557,7 @@ H5FD_null_sb_size(H5FD_t *_file)
H5FD_null_t *file = (H5FD_null_t*)_file;
hsize_t ret_value = 0; /*size of header*/
- FUNC_ENTER_NOAPI(H5FD_null_sb_size, UFAIL)
+ FUNC_ENTER_NOAPI(UFAIL)
HDassert(file);
@@ -591,7 +591,7 @@ H5FD_null_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/)
H5FD_null_t *file = (H5FD_null_t*)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5FD_null_sb_encode, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file);
@@ -624,7 +624,7 @@ H5FD_null_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
H5FD_null_t *file = (H5FD_null_t*)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_sb_decode, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file);
@@ -641,13 +641,10 @@ done:
/*-------------------------------------------------------------------------
* Function: H5FD_null_sb_verify
*
- * Purpose: Verify that the inner driver is compatable with the driver
- * that created the file. driver_id is the driver identifier
- * field stored in the superblock. This is called when
- * reopening a file and ensures that the driver is able to
- * decode the superblock info.
+ * Purpose: Verify that the inner driver is compatible with the driver
+ * that created the file.
*
- * Return: Success: Non-negative
+ * Return: Success: TRUE if the driver is compatible, else FALSE
* Failure: Negative
*
* Programmer: Jacob Gruber
@@ -655,18 +652,19 @@ done:
*
*-------------------------------------------------------------------------
*/
-static herr_t
-H5FD_null_sb_verify(H5FD_t *_file, const char *driver_id)
+static htri_t
+H5FD_null_sb_verify(H5FD_t *_file, const char *sb_driver_id)
{
H5FD_null_t *file = (H5FD_null_t*)_file;
- herr_t ret_value = SUCCEED; /* Return value */
+ htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_sb_verify, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file);
/* Delegate to the inner driver */
- if(H5FD_sb_verify(file->inner_file, driver_id) < 0)
+ ret_value = H5FD_sb_verify(file->inner_file, sb_driver_id);
+ if(ret_value < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "inner driver sb_verify failed")
done:
@@ -699,7 +697,7 @@ H5FD_null_open(const char *name, unsigned flags, hid_t fapl_id,
H5FD_null_t *file=NULL;
H5FD_t *ret_value=NULL;
- FUNC_ENTER_NOAPI(H5FD_null_open, NULL)
+ FUNC_ENTER_NOAPI(NULL)
/* Check arguments */
if(!name || !*name)
@@ -781,7 +779,7 @@ H5FD_null_close(H5FD_t *_file)
H5FD_null_t *file = (H5FD_null_t*)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_close, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/* Close the inner file */
if (H5FD_close(file->inner_file) < 0)
@@ -822,8 +820,8 @@ H5FD_null_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
const H5FD_null_t *f2 = (const H5FD_null_t*)_f2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_null_cmp)
-
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
HDassert(f1);
HDassert(f2);
@@ -853,7 +851,7 @@ H5FD_null_query(const H5FD_t * _file, unsigned long *flags /* out */)
{
const H5FD_null_t *file = (const H5FD_null_t*)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_null_query)
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Query the inner driver */
if(flags) {
@@ -885,7 +883,7 @@ H5FD_null_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
const H5FD_null_t *file = (const H5FD_null_t*)_file;
herr_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_null_get_type_map, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file);
@@ -917,7 +915,7 @@ H5FD_null_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
hid_t inner_dxpl_id = H5P_DATASET_XFER_DEFAULT;
herr_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_null_alloc, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/*
* Get the inner data transfer property list.
@@ -966,7 +964,7 @@ H5FD_null_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsiz
hid_t inner_dxpl_id = H5P_DATASET_XFER_DEFAULT;
herr_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_null_free, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/*
* Get the inner data transfer property list.
@@ -1018,7 +1016,7 @@ H5FD_null_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
const H5FD_null_t *file = (const H5FD_null_t*)_file;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_get_eoa, HADDR_UNDEF)
+ FUNC_ENTER_NOAPI(HADDR_UNDEF)
HDassert(file);
@@ -1051,7 +1049,7 @@ H5FD_null_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
H5FD_null_t *file = (H5FD_null_t*)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_set_eoa, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file);
@@ -1084,7 +1082,7 @@ H5FD_null_get_eof(const H5FD_t *_file)
const H5FD_null_t *file = (const H5FD_null_t*)_file;
haddr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_get_eof, HADDR_UNDEF)
+ FUNC_ENTER_NOAPI(HADDR_UNDEF)
HDassert(file);
@@ -1116,7 +1114,7 @@ H5FD_null_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle)
H5FD_null_t *file = (H5FD_null_t *)_file;
herr_t ret_value;
- FUNC_ENTER_NOAPI(H5FD_null_get_handle, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(file);
@@ -1152,7 +1150,7 @@ H5FD_null_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size
hid_t inner_dxpl_id = H5P_DATASET_XFER_DEFAULT;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_read, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/*
* Get the inner data transfer property list.
@@ -1204,7 +1202,7 @@ H5FD_null_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
hid_t inner_dxpl_id = H5P_DATASET_XFER_DEFAULT;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_write, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/*
* Get the inner data transfer property list.
@@ -1253,7 +1251,7 @@ H5FD_null_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
hid_t inner_dxpl_id = H5P_DATASET_XFER_DEFAULT;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_flush, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/*
* Get the inner data transfer property list.
@@ -1302,7 +1300,7 @@ H5FD_null_truncate(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
hid_t inner_dxpl_id = H5P_DATASET_XFER_DEFAULT;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_null_truncate, FAIL)
+ FUNC_ENTER_NOAPI(FAIL)
/*
* Get the inner data transfer property list.
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index 61538dc..4234898 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -70,7 +70,7 @@ H5_DLL H5FD_class_t *H5FD_get_class(hid_t id);
H5_DLL hsize_t H5FD_sb_size(H5FD_t *file);
H5_DLL herr_t H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf);
H5_DLL herr_t H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf);
-H5_DLL herr_t H5FD_sb_verify(H5FD_t *file, const char *driver_id);
+H5_DLL herr_t H5FD_sb_verify(H5FD_t *file, const char *sb_driver_id);
H5_DLL void *H5FD_fapl_get(H5FD_t *file);
H5_DLL herr_t H5FD_fapl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info);
H5_DLL herr_t H5FD_fapl_copy(hid_t driver_id, const void *fapl, void **copied_fapl);
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index a5d8ed9..bded08e 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -236,7 +236,7 @@ typedef struct H5FD_class_t {
herr_t (*sb_encode)(H5FD_t *file, char *name/*out*/,
unsigned char *p/*out*/);
herr_t (*sb_decode)(H5FD_t *f, const char *name, const unsigned char *p);
- herr_t (*sb_verify)(H5FD_t *f, const char *name);
+ htri_t (*sb_verify)(H5FD_t *file, const char *sb_driver_id);
size_t fapl_size;
void * (*fapl_get)(H5FD_t *file);
void * (*fapl_copy)(const void *fapl);
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c
index 4fd04f6..0f612be 100644
--- a/src/H5Fmpi.c
+++ b/src/H5Fmpi.c
@@ -38,6 +38,8 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
#include "H5FDmpi.h" /* MPI-based file drivers */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5Iprivate.h" /* IDs */
/****************/
@@ -177,5 +179,85 @@ H5F_mpi_get_size(const H5F_t *f)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_mpi_get_size() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Fset_mpi_atomicity
+ *
+ * Purpose: Sets the atomicity mode
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: Mohamad Chaarawi
+ * Feb 14, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag)
+{
+ H5F_t *file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "iMi", file_id, flag);
+
+ /* Check args */
+ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
+
+ /* Check VFD */
+ if(!IS_H5FD_MPIO(file))
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, must use MPI-I/O driver")
+
+ /* set atomicity value */
+ if (H5FD_set_mpio_atomicity (file->shared->lf, flag) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set atomicity flag")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Fget_mpi_atomicity
+ *
+ * Purpose: Returns the atomicity mode
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: Mohamad Chaarawi
+ * Feb 14, 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag)
+{
+ H5F_t *file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "iMi", file_id, flag);
+
+ /* Check args */
+ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
+
+ /* Check VFD */
+ if(!IS_H5FD_MPIO(file))
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, must use MPI-I/O driver")
+
+ /* get atomicity value */
+ if (H5FD_get_mpio_atomicity (file->shared->lf, flag) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get atomicity flag")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+}
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index 75a3547..d88538b 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -208,6 +208,10 @@ H5_DLL herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo);
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);
+#ifdef H5_HAVE_PARALLEL
+H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag);
+H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag);
+#endif /* H5_HAVE_PARALLEL */
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index da914b4..10ee11f 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -128,6 +128,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
uint8_t *p; /* Temporary pointer into encoding buffer */
unsigned super_vers; /* Superblock version */
hbool_t *dirtied = (hbool_t *)_udata; /* Set up dirtied out value */
+ htri_t sb_verify_result; /* Result of sb_verify call */
H5F_super_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -360,10 +361,10 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
drv_name[8] = '\0';
p += 8; /* advance past name/version */
- /* Check if driver matches driver information saved. Unfortunately, we can't push this
- * function to each specific driver because we're checking if the driver is correct.
- */
- if(H5FD_sb_verify(lf, drv_name) < 0)
+ /* Check if the driver is compatible with the driver information saved. */
+ if((sb_verify_result = H5FD_sb_verify(lf, drv_name)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to determine driver compatability")
+ else if(sb_verify_result == 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "driver does not support this file")
/* Read in variable-sized portion of driver info block */
@@ -520,10 +521,10 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo, dxpl_id))
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "driver info message not present")
- /* Check if driver matches driver information saved. Unfortunately, we can't push this
- * function to each specific driver because we're checking if the driver is correct.
- */
- if(H5FD_sb_verify(lf, drvinfo.name) < 0)
+ /* Check if the driver is compatible with the driver information saved. */
+ if((sb_verify_result = H5FD_sb_verify(lf, drvinfo.name)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to determine driver compatability")
+ else if(sb_verify_result == 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "driver does not support this file")
/* Decode driver information */
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index a21c2b8..05322af 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -559,26 +559,27 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno,
/* Check for changing the chunk #0 data size enough to need adjusting the flags */
if(oh->version > H5O_VERSION_1 && chunkno == 0) {
uint64_t chunk0_size; /* Size of chunk 0's data */
+ size_t orig_prfx_size = (size_t)1 << (oh->flags & H5O_HDR_CHUNK0_SIZE); /* Original prefix size */
HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh));
chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh);
- /* Check for moving from a 1-byte to a 2-byte size encoding */
- if(chunk0_size <= 255 && (chunk0_size + delta) > 255) {
- extra_prfx_size = 1;
- new_size_flags = H5O_HDR_CHUNK0_2;
+ /* Check for moving to a 8-byte size encoding */
+ if(orig_prfx_size < 8 && (chunk0_size + delta) > 4294967295) {
+ extra_prfx_size = 8 - orig_prfx_size;
+ new_size_flags = H5O_HDR_CHUNK0_8;
adjust_size_flags = TRUE;
} /* end if */
- /* Check for moving from a 2-byte to a 4-byte size encoding */
- else if(chunk0_size <= 65535 && (chunk0_size + delta) > 65535) {
- extra_prfx_size = 2;
+ /* Check for moving to a 4-byte size encoding */
+ else if(orig_prfx_size < 4 && (chunk0_size + delta) > 65535) {
+ extra_prfx_size = 4 - orig_prfx_size;
new_size_flags = H5O_HDR_CHUNK0_4;
adjust_size_flags = TRUE;
} /* end if */
- /* Check for moving from a 4-byte to a 8-byte size encoding */
- else if(chunk0_size <= 4294967295 && (chunk0_size + delta) > 4294967295) {
- extra_prfx_size = 4;
- new_size_flags = H5O_HDR_CHUNK0_8;
+ /* Check for moving to a 2-byte size encoding */
+ else if(orig_prfx_size < 2 && (chunk0_size + delta) > 255) {
+ extra_prfx_size = 2 - orig_prfx_size;
+ new_size_flags = H5O_HDR_CHUNK0_2;
adjust_size_flags = TRUE;
} /* end if */
} /* end if */
@@ -646,17 +647,18 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno,
/* Wipe new space for chunk */
HDmemset(oh->chunk[chunkno].image + old_size, 0, oh->chunk[chunkno].size - old_size);
+ /* Move chunk 0 data up if the size flags changed */
+ if(adjust_size_flags)
+ HDmemmove(oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh),
+ oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh) - extra_prfx_size,
+ old_size - (size_t)H5O_SIZEOF_HDR(oh) + extra_prfx_size);
+
/* Spin through existing messages, adjusting them */
for(u = 0; u < oh->nmesgs; u++) {
/* Adjust raw addresses for messages in this chunk to reflect new 'image' address */
- if(oh->mesg[u].chunkno == chunkno) {
+ if(oh->mesg[u].chunkno == chunkno)
oh->mesg[u].raw = oh->chunk[chunkno].image + extra_prfx_size + (oh->mesg[u].raw - old_image);
- /* Flag message as dirty directly */
- /* (we mark the entire chunk dirty when we update its size) */
- oh->mesg[u].dirty = TRUE;
- } /* endif */
-
/* Find continuation message which points to this chunk and adjust chunk's size */
/* (Chunk 0 doesn't have a continuation message that points to it and
* it's size is directly encoded in the object header) */
@@ -1330,8 +1332,9 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u)
move_end = cont_msg->raw + cont_msg->raw_size;
cont_chunkno = cont_msg->chunkno;
- /* Convert continuation message into a null message */
- if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, TRUE) < 0)
+ /* Convert continuation message into a null message. Do not delete
+ * the target chunk yet, so we can still copy messages from it. */
+ if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message")
/* Protect chunk */
@@ -1353,7 +1356,6 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u)
HDmemcpy(move_start, curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), move_size);
curr_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh);
curr_msg->chunkno = cont_chunkno;
- curr_msg->dirty = TRUE;
chk_dirtied = TRUE;
/* Adjust location to move messages to */
@@ -1361,6 +1363,10 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u)
} /* end else */
} /* end if */
+ /* Delete the target chunk */
+ if(H5O_chunk_delete(f, dxpl_id, oh, deleted_chunkno) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove chunk from cache")
+
HDassert(move_start <= (move_end + gap_size));
/* Check if there is space remaining in the continuation message */
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 337287d..dd649ff 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -974,8 +974,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list")
/* copy the object from the source file to the destination file */
- if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL)
- < 0)
+ if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object")
done:
diff --git a/src/H5Odbg.c b/src/H5Odbg.c
index bd30b90..5c07b64 100644
--- a/src/H5Odbg.c
+++ b/src/H5Odbg.c
@@ -106,7 +106,7 @@ H5O_assert(const H5O_t *oh)
/* Initialize the tracking variables */
hdr_size = 0;
- meta_space = H5O_SIZEOF_HDR(oh) + (H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1));
+ meta_space = (size_t)H5O_SIZEOF_HDR(oh) + (size_t)(H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1));
mesg_space = 0;
free_space = 0;
@@ -140,7 +140,7 @@ H5O_assert(const H5O_t *oh)
/* Check for correct chunk #0 size flags */
if(oh->version > H5O_VERSION_1) {
- uint64_t chunk0_size = oh->chunk[0].size - H5O_SIZEOF_HDR(oh);
+ uint64_t chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh);
if(chunk0_size <= 255)
HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1);
@@ -154,13 +154,21 @@ H5O_assert(const H5O_t *oh)
/* Loop over all messages in object header */
for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) {
+ uint8_t *curr_hdr; /* Start of current message header */
+ size_t curr_tot_size; /* Total size of current message (including header) */
+
+ curr_hdr = curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh);
+ curr_tot_size = curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh);
+
/* Accumulate information, based on the type of message */
if(H5O_NULL_ID == curr_msg->type->id)
- free_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size;
+ free_space += curr_tot_size;
else if(H5O_CONT_ID == curr_msg->type->id) {
H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native;
hbool_t found_chunk = FALSE; /* Found a chunk that matches */
+ HDassert(cont);
+
/* Increment # of continuation messages found */
cont_msgs_found++;
@@ -175,11 +183,14 @@ H5O_assert(const H5O_t *oh)
} /* end for */
HDassert(found_chunk);
- meta_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size;
+ meta_space += curr_tot_size;
} /* end if */
else {
- meta_space += H5O_SIZEOF_MSGHDR_OH(oh);
+ meta_space += (size_t)H5O_SIZEOF_MSGHDR_OH(oh);
mesg_space += curr_msg->raw_size;
+
+ /* Make sure the message has a native form if it is marked dirty */
+ HDassert(curr_msg->native || !curr_msg->dirty);
} /* end else */
/* Make certain that the message is in a valid chunk */
@@ -190,17 +201,19 @@ H5O_assert(const H5O_t *oh)
HDassert(oh->chunk[curr_msg->chunkno].gap == 0);
/* Make certain that the message is completely in a chunk message area */
- HDassert(curr_msg->raw_size <= (oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap));
+ HDassert(curr_tot_size <= (oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap));
if(curr_msg->chunkno == 0)
- HDassert(curr_msg->raw >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)));
+ HDassert(curr_hdr >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)));
else
- HDassert(curr_msg->raw >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_CHKHDR_OH(oh) - H5O_SIZEOF_CHKSUM_OH(oh)));
+ HDassert(curr_hdr >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_CHKHDR_OH(oh) - H5O_SIZEOF_CHKSUM_OH(oh)));
HDassert(curr_msg->raw + curr_msg->raw_size <= (oh->chunk[curr_msg->chunkno].image + oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap));
/* Make certain that no other messages overlap this message */
for(v = 0, tmp_msg = &oh->mesg[0]; v < oh->nmesgs; v++, tmp_msg++) {
if(u != v)
- HDassert(!(tmp_msg->raw >= curr_msg->raw && tmp_msg->raw < (curr_msg->raw + curr_msg->raw_size)));
+ HDassert(!((tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) >= curr_hdr
+ && (tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh))
+ < (curr_hdr + curr_tot_size)));
} /* end for */
} /* end for */
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index e4d6486..1b17bff 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -241,6 +241,8 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
mesg->ops = H5D_LOPS_CHUNK;
break;
+ case H5D_LAYOUT_ERROR:
+ case H5D_NLAYOUTS:
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "Invalid layout class")
} /* end switch */
@@ -342,6 +344,8 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi
UINT32ENCODE(p, mesg->u.chunk.dim[u]);
break;
+ case H5D_LAYOUT_ERROR:
+ case H5D_NLAYOUTS:
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "Invalid layout class")
} /* end switch */
@@ -556,6 +560,8 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data")
break;
+ case H5D_LAYOUT_ERROR:
+ case H5D_NLAYOUTS:
default:
HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "not valid storage type")
} /* end switch */
@@ -641,6 +647,8 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
} /* end if */
break;
+ case H5D_LAYOUT_ERROR:
+ case H5D_NLAYOUTS:
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "Invalid layout class")
} /* end switch */
@@ -737,6 +745,8 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg,
"Data Size:", mesg->storage.u.compact.size);
break;
+ case H5D_LAYOUT_ERROR:
+ case H5D_NLAYOUTS:
default:
HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth,
"Type:", "Unknown", (unsigned)mesg->type);
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index a3d02d1..f12c835 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -2161,9 +2161,8 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg)
/* Make certain that null messages aren't in chunks w/gaps */
if(H5O_NULL_ID == msg_id)
HDassert(oh->chunk[mesg->chunkno].gap == 0);
-
- /* Unknown messages should always have a native pointer */
- if(mesg->type == H5O_MSG_UNKNOWN)
+ else
+ /* Non-null messages should always have a native pointer */
HDassert(mesg->native);
#endif /* NDEBUG */
diff --git a/src/H5S.c b/src/H5S.c
index 59f3085..5d99066 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -86,7 +86,7 @@ H5S_init_interface(void)
/* Allow MPI buf-and-file-type optimizations? */
const char *s = HDgetenv ("HDF5_MPI_OPT_TYPES");
if (s && HDisdigit(*s))
- H5S_mpi_opt_types_g = (int)HDstrtol (s, NULL, 0);
+ H5S_mpi_opt_types_g = (hbool_t)HDstrtol (s, NULL, 0);
}
#endif /* H5_HAVE_PARALLEL */
@@ -186,6 +186,7 @@ H5S_create(H5S_class_t type)
new_ds->extent.nelem = 0;
break;
+ case H5S_NO_CLASS:
default:
HDassert("unknown dataspace (extent) type" && 0);
break;
@@ -512,6 +513,7 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max)
dst->max = NULL;
break;
+ case H5S_NO_CLASS:
default:
HDassert("unknown dataspace type" && 0);
break;
@@ -712,6 +714,7 @@ H5S_get_npoints_max(const H5S_t *ds)
}
break;
+ case H5S_NO_CLASS:
default:
assert("unknown dataspace class" && 0);
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)")
@@ -796,6 +799,7 @@ H5S_get_simple_extent_ndims(const H5S_t *ds)
ret_value = (int)ds->extent.rank;
break;
+ case H5S_NO_CLASS:
default:
HDassert("unknown dataspace class" && 0);
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)")
@@ -894,6 +898,7 @@ H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[])
} /* end for */
break;
+ case H5S_NO_CLASS:
default:
HDassert("unknown dataspace class" && 0);
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)")
@@ -1827,7 +1832,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size)
/* Check for invalid dimension size modification */
if(space->extent.max && H5S_UNLIMITED != space->extent.max[u] &&
space->extent.max[u] < size[u])
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot exceed the existing maximal size")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot exceed the existing maximal size (new: %llu max: %llu)", (unsigned long long)size[u], (unsigned long long)space->extent.max[u])
/* Indicate that dimension size can be modified */
ret_value = TRUE;
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 5a707b5..48948a7 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -94,6 +94,8 @@ static H5Z_node *H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_poi
static H5Z_node *H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers);
static H5Z_node *H5Z_new_node(H5Z_token_type type);
static void H5Z_do_op(H5Z_node* tree);
+static hbool_t H5Z_op_is_numbs(H5Z_node* _tree);
+static hbool_t H5Z_op_is_numbs2(H5Z_node* _tree);
static hid_t H5Z_xform_find_type(const H5T_t* type);
static herr_t H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result* res);
static void H5Z_xform_destroy_parse_tree(H5Z_node *tree);
@@ -105,41 +107,57 @@ static void H5Z_XFORM_DEBUG(H5Z_node *tree);
static void H5Z_print(H5Z_node *tree, FILE *stream);
#endif /* H5Z_XFORM_DEBUG */
-
+/* PGCC (11.8-0) has trouble with the command *p++ = *p OP tree_val. It increments P first before
+ * doing the operation. So I break down the command into two lines:
+ * *p = *p OP tree_val; p++;
+ * Actually, the behavior of *p++ = *p OP tree_val is undefined. (SLU - 2012/3/19)
+ */
#define H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \
{ \
- if( (((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type != H5Z_XFORM_SYMBOL)) || (((RESR).type == H5Z_XFORM_SYMBOL) && ((RESL).type != H5Z_XFORM_SYMBOL))) \
+ size_t u; \
+ \
+ if(((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type != H5Z_XFORM_SYMBOL)) \
+ { \
+ TYPE* p; \
+ double tree_val; \
+ \
+ tree_val = ((RESR).type==H5Z_XFORM_INTEGER ? (double)(RESR).value.int_val : (RESR).value.float_val); \
+ p = (TYPE*)(RESL).value.dat_val; \
+ \
+ for(u=0; u<(SIZE); u++) { \
+ *p = *p OP tree_val; \
+ p++; \
+ } \
+ } \
+ else if(((RESR).type == H5Z_XFORM_SYMBOL) && ((RESL).type != H5Z_XFORM_SYMBOL)) \
{ \
- size_t u; \
TYPE* p; \
double tree_val; \
\
- if((RESL).type == H5Z_XFORM_SYMBOL) \
- { \
- tree_val = ((RESR).type==H5Z_XFORM_INTEGER ? (double)(RESR).value.int_val : (RESR).value.float_val); \
- p = (TYPE*)(RESL).value.dat_val; \
- } \
+ /* The case that the left operand is nothing, like -x or +x */ \
+ if((RESL).type == H5Z_XFORM_ERROR) \
+ tree_val = 0; \
else \
- { \
tree_val = ((RESL).type==H5Z_XFORM_INTEGER ? (double)(RESL).value.int_val : (RESL).value.float_val); \
- p = (TYPE*)(RESR).value.dat_val; \
- } \
- \
- for(u=0; u<(SIZE); u++) \
- *p++ OP tree_val; \
- } \
+ \
+ p = (TYPE*)(RESR).value.dat_val; \
+ for(u=0; u<(SIZE); u++) { \
+ *p = tree_val OP *p; \
+ p++; \
+ } \
+ } \
else if( ((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type==H5Z_XFORM_SYMBOL)) \
{ \
- size_t u; \
TYPE* pl = (TYPE*)(RESL).value.dat_val; \
TYPE* pr = (TYPE*)(RESR).value.dat_val; \
\
- for(u=0; u<(SIZE); u++) \
- *pl++ OP *pr++; \
+ for(u=0; u<(SIZE); u++) { \
+ *pl = *pl OP *pr; \
+ pl++; pr++; \
+ } \
} \
else \
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unexpected type conversion operation") \
- \
}
/* Due to the undefined nature of embedding macros/conditionals within macros, we employ
@@ -277,7 +295,47 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
H5V_array_fill(array, &val, sizeof(TYPE), (SIZE)); \
}
-
+/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x.
+ * The reason that it's seperated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op,
+ * these two macros are called in different ways. (SLU 2012/3/20)
+ */
+#define H5Z_XFORM_DO_OP6(OP) \
+{ \
+ if(!tree->lchild && (tree->rchild->type==H5Z_XFORM_INTEGER)) \
+ { \
+ tree->type = H5Z_XFORM_INTEGER; \
+ tree->value.int_val = OP tree->rchild->value.int_val; \
+ H5MM_xfree(tree->rchild); \
+ tree->rchild = NULL; \
+ } \
+ else if(!tree->lchild && (tree->rchild->type==H5Z_XFORM_FLOAT)) \
+ { \
+ tree->type = H5Z_XFORM_FLOAT; \
+ tree->value.float_val = OP tree->rchild->value.float_val; \
+ H5MM_xfree(tree->rchild); \
+ tree->rchild = NULL; \
+ } \
+ else if((tree->lchild->type == H5Z_XFORM_INTEGER) && (tree->rchild->type==H5Z_XFORM_INTEGER)) \
+ { \
+ tree->type = H5Z_XFORM_INTEGER; \
+ tree->value.int_val = tree->lchild->value.int_val OP tree->rchild->value.int_val; \
+ H5MM_xfree(tree->lchild); \
+ H5MM_xfree(tree->rchild); \
+ tree->lchild = NULL; \
+ tree->rchild = NULL; \
+ } \
+ else if( ( (tree->lchild->type == H5Z_XFORM_FLOAT) || (tree->lchild->type == H5Z_XFORM_INTEGER)) && \
+ ( (tree->rchild->type == H5Z_XFORM_FLOAT) || (tree->rchild->type == H5Z_XFORM_INTEGER))) \
+ { \
+ tree->type = H5Z_XFORM_FLOAT; \
+ tree->value.float_val = ((tree->lchild->type == H5Z_XFORM_FLOAT) ? tree->lchild->value.float_val : (double)tree->lchild->value.int_val) OP \
+ ((tree->rchild->type == H5Z_XFORM_FLOAT) ? tree->rchild->value.float_val : (double)tree->rchild->value.int_val); \
+ H5MM_xfree(tree->lchild); \
+ H5MM_xfree(tree->rchild); \
+ tree->lchild = NULL; \
+ tree->rchild = NULL; \
+ } \
+}
/*
* Programmer: Bill Wendling <wendling@ncsa.uiuc.edu>
@@ -1027,6 +1085,9 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_
/* check args */
HDassert(tree);
+ HDmemset(&resl, 0, sizeof(H5Z_result));
+ HDmemset(&resr, 0, sizeof(H5Z_result));
+
if (tree->type == H5Z_XFORM_INTEGER) {
res->type = H5Z_XFORM_INTEGER;
res->value.int_val = tree->value.int_val;
@@ -1044,7 +1105,7 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_
res->value.dat_val = *((void**)(tree->value.dat_val));
} /* end if */
else {
- if(H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0)
+ if(tree->lchild && H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform")
if(H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform")
@@ -1059,19 +1120,19 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_
switch (tree->type) {
case H5Z_XFORM_PLUS:
- H5Z_XFORM_TYPE_OP(resl, resr, array_type, +=, array_size)
+ H5Z_XFORM_TYPE_OP(resl, resr, array_type, +, array_size)
break;
case H5Z_XFORM_MINUS:
- H5Z_XFORM_TYPE_OP(resl, resr, array_type, -=, array_size)
+ H5Z_XFORM_TYPE_OP(resl, resr, array_type, -, array_size)
break;
case H5Z_XFORM_MULT:
- H5Z_XFORM_TYPE_OP(resl, resr, array_type, *=, array_size)
+ H5Z_XFORM_TYPE_OP(resl, resr, array_type, *, array_size)
break;
case H5Z_XFORM_DIVIDE:
- H5Z_XFORM_TYPE_OP(resl, resr, array_type, /=, array_size)
+ H5Z_XFORM_TYPE_OP(resl, resr, array_type, /, array_size)
break;
default:
@@ -1257,6 +1318,63 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva
/*-------------------------------------------------------------------------
+ * Function: H5Z_op_is_numbs
+ * Purpose: Internal function to facilitate the condition check in
+ * H5Z_xform_reduce_tree to reduce the bulkiness of the code.
+ * Return: TRUE or FALSE
+ * Programmer: Raymond Lu
+ * 15 March 2012
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static hbool_t
+H5Z_op_is_numbs(H5Z_node* _tree)
+{
+ hbool_t ret_value = FALSE;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ assert(_tree);
+
+ if(((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT)) && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT)))
+ ret_value = TRUE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Z_op_is_numbs2
+ * Purpose: Internal function to facilitate the condition check in
+ * H5Z_xform_reduce_tree to reduce the bulkiness of the code.
+ * The difference from H5Z_op_is_numbs is that the left child
+ * can be empty, like -x or +x.
+ * Return: TRUE or FALSE
+ * Programmer: Raymond Lu
+ * 15 March 2012
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static hbool_t
+H5Z_op_is_numbs2(H5Z_node* _tree)
+{
+ hbool_t ret_value = FALSE;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ assert(_tree);
+
+ if((!_tree->lchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) ||
+ ((_tree->lchild && ((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT))) && (_tree->rchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT)))))
+ ret_value = TRUE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5Z_xform_reduce_tree
* Purpose: Simplifies parse tree passed in by performing any obvious
* and trivial arithemtic calculations.
@@ -1274,22 +1392,37 @@ H5Z_xform_reduce_tree(H5Z_node* tree)
FUNC_ENTER_NOAPI_NOINIT_NOERR
if(tree) {
- if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_DIVIDE) ||(tree->type == H5Z_XFORM_MULT) ||(tree->type == H5Z_XFORM_MINUS))
+ if((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT))
{
- if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT)))
+ if(H5Z_op_is_numbs(tree))
+ H5Z_do_op(tree);
+ else
+ {
+ H5Z_xform_reduce_tree(tree->lchild);
+ if(H5Z_op_is_numbs(tree))
+ H5Z_do_op(tree);
+ else {
+ H5Z_xform_reduce_tree(tree->rchild);
+ if(H5Z_op_is_numbs(tree))
+ H5Z_do_op(tree);
+ }
+ }
+ } else if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) {
+ if(H5Z_op_is_numbs2(tree))
H5Z_do_op(tree);
else
{
H5Z_xform_reduce_tree(tree->lchild);
- if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT)))
+ if(H5Z_op_is_numbs2(tree))
H5Z_do_op(tree);
else {
H5Z_xform_reduce_tree(tree->rchild);
- if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT)))
+ if(H5Z_op_is_numbs2(tree))
H5Z_do_op(tree);
}
}
}
+
}
FUNC_LEAVE_NOAPI_VOID;
@@ -1307,7 +1440,11 @@ H5Z_xform_reduce_tree(H5Z_node* tree)
* Programmer: Leon Arber
* April 1, 2004.
* Modifications:
-*
+ * Raymond Lu
+ * 15 March 2012
+ * I added a new macro H5Z_XFORM_DO_OP6 to handle the special
+ * operations like -x or +x when the left operand is empty.
+ *
*-------------------------------------------------------------------------
*/
static void
@@ -1320,9 +1457,9 @@ H5Z_do_op(H5Z_node* tree)
else if(tree->type == H5Z_XFORM_MULT)
H5Z_XFORM_DO_OP3(*)
else if(tree->type == H5Z_XFORM_PLUS)
- H5Z_XFORM_DO_OP3(+)
+ H5Z_XFORM_DO_OP6(+)
else if(tree->type == H5Z_XFORM_MINUS)
- H5Z_XFORM_DO_OP3(-)
+ H5Z_XFORM_DO_OP6(-)
FUNC_LEAVE_NOAPI_VOID;
}
diff --git a/src/H5public.h b/src/H5public.h
index 634decc..1f44ff3 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -75,10 +75,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 109 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 112 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.109" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.112" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/Makefile.in b/src/Makefile.in
index cc0da91..36f0755 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 99
+LT_VERS_REVISION = 102
LT_VERS_AGE = 0
H5detect_CFLAGS = -g $(AM_CFLAGS)
diff --git a/test/COPYING b/test/COPYING
index 6903daf..6903daf 100755..100644
--- a/test/COPYING
+++ b/test/COPYING
diff --git a/test/big.c b/test/big.c
index 24b2d25..dffbbeb 100644
--- a/test/big.c
+++ b/test/big.c
@@ -22,14 +22,14 @@
/*
* The purpose of this test is to verify if a virtual file driver can handle:
* a. Large file (2GB)
- * This should exceed 32bits I/O system since offset is a signed
- * integral type (in order to support negative offset with respect to
- * end of file).
+ * This should exceed 32bits I/O system since offset is a signed
+ * integral type (in order to support negative offset with respect to
+ * end of file).
* b. Extra Large file (4GB)
- * This definite exceeds 32bit I/O and file systems.
+ * This definite exceeds 32bit I/O and file systems.
* c. Huge file (tens of GB)
- * This verifies the HDF5 library handles big logical file size
- * correctly.
+ * This verifies the HDF5 library handles big logical file size
+ * correctly.
* In practice, if a VFD can handle a big file size, there is no need to
* test the smaller file sizes. E.g., If it can handle the Huge file,
* there is no need to test the Extra large or Large files. Therefore the
@@ -81,15 +81,15 @@ typedef enum vfd_t { SEC2_VFD, STDIO_VFD, FAMILY_VFD } vfd_t;
fsizes_t file_size= NOFILE;
const char *FILENAME[] = {
- "big",
- "sec2",
- "stdio",
- NULL
+ "big",
+ "sec2",
+ "stdio",
+ NULL
};
-int cflag=1; /* check file system before test */
-int sparse_support=0; /* sparse file supported, default false */
-int have_space=0; /* enough space for huge file test, default false */
-hsize_t family_size_def=FAMILY_SIZE; /* default family file size */
+int cflag=1; /* check file system before test */
+int sparse_support=0; /* sparse file supported, default false */
+int have_space=0; /* enough space for huge file test, default false */
+hsize_t family_size_def=FAMILY_SIZE; /* default family file size */
/* Protocols */
static void usage(void);
@@ -216,55 +216,55 @@ supports_big(vfd_t vfd)
case FAMILY_VFD:
case SEC2_VFD:
case STDIO_VFD:
- if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0)
- goto error;
-
- /* Write a few byte at the beginning */
- if (5!=HDwrite(fd, "hello", (size_t)5))
- goto quit;
- fsize = SFILE;
-
- /* Write a few bytes at 2GB */
- if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB)
- goto quit;
- if (5!=HDwrite(fd, "hello", (size_t)5))
- goto quit;
- fsize = LFILE;
-
- /* Write a few bytes at 4GB */
- if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB)
- goto quit;
- if (5!=HDwrite(fd, "hello", (size_t)5))
- goto quit;
- fsize = XLFILE;
-
- /* If this supports sparse_file, write a few bytes at 32GB */
- if (!sparse_support)
- goto quit;
- if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB)
- goto quit;
- if (5!=HDwrite(fd, "hello", (size_t)5))
- goto quit;
- fsize = HUGEFILE;
-
- break;
+ if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0)
+ goto error;
+
+ /* Write a few byte at the beginning */
+ if (5!=HDwrite(fd, "hello", (size_t)5))
+ goto quit;
+ fsize = SFILE;
+
+ /* Write a few bytes at 2GB */
+ if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB)
+ goto quit;
+ if (5!=HDwrite(fd, "hello", (size_t)5))
+ goto quit;
+ fsize = LFILE;
+
+ /* Write a few bytes at 4GB */
+ if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB)
+ goto quit;
+ if (5!=HDwrite(fd, "hello", (size_t)5))
+ goto quit;
+ fsize = XLFILE;
+
+ /* If this supports sparse_file, write a few bytes at 32GB */
+ if (!sparse_support)
+ goto quit;
+ if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB)
+ goto quit;
+ if (5!=HDwrite(fd, "hello", (size_t)5))
+ goto quit;
+ fsize = HUGEFILE;
+
+ break;
default:
- /* unknown or unsupported VFD */
- goto error;
- break;
+ /* unknown or unsupported VFD */
+ goto error;
+ break;
}
-
+
quit:
if (HDclose(fd) < 0)
- goto error;
+ goto error;
if (HDremove("y.h5") < 0)
- goto error;
+ goto error;
return(fsize);
error:
if (fd >= 0){
- HDclose(fd);
- HDremove("y.h5");
+ HDclose(fd);
+ HDremove("y.h5");
}
return (fsize);
}
@@ -300,30 +300,30 @@ enough_room(hid_t fapl)
for (i=0; i<NELMTS(fd); i++) fd[i] = -1;
/* Get file name template */
- assert(H5FD_FAMILY==H5Pget_driver(fapl));
+ HDassert(H5FD_FAMILY==H5Pget_driver(fapl));
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
/* Create files */
for (i=0; i<NELMTS(fd); i++) {
- HDsnprintf(name, sizeof name, filename, i);
- if ((fd[i]=HDopen(name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) {
- goto done;
- }
- if ((off_t)size != HDlseek(fd[i], (off_t)size, SEEK_SET)) {
- goto done;
- }
- if (1!=HDwrite(fd[i], "X", (size_t)1)) {
- goto done;
- }
+ HDsnprintf(name, sizeof name, filename, i);
+ if ((fd[i]=HDopen(name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) {
+ goto done;
+ }
+ if ((off_t)size != HDlseek(fd[i], (off_t)size, SEEK_SET)) {
+ goto done;
+ }
+ if (1!=HDwrite(fd[i], "X", (size_t)1)) {
+ goto done;
+ }
}
ret_value = 1;
- done:
+done:
for (i=0; i<NELMTS(fd) && fd[i]>=0; i++) {
- HDsnprintf(name, sizeof name, filename, i);
- if(HDclose(fd[i]) < 0)
+ HDsnprintf(name, sizeof name, filename, i);
+ if(HDclose(fd[i]) < 0)
ret_value=0;
- HDremove(name);
+ HDremove(name);
}
return ret_value;
@@ -356,43 +356,43 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
hsize_t hs_start[1];
hsize_t hs_size[1];
hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1;
- int *buf = (int*)malloc (sizeof(int) * WRT_SIZE);
+ int *buf = (int*)HDmalloc (sizeof(int) * WRT_SIZE);
int i, j;
- FILE *out = fopen(DNAME, "w");
+ FILE *out = HDfopen(DNAME, "w");
hid_t dcpl;
switch(testsize){
case LFILE:
- TESTING("Large dataset write(2GB)");
- /* reduce size1 to produce a 2GB dataset */
- size1[1] = 1024/16;
- size2[0] /= 16;
- break;
+ TESTING("Large dataset write(2GB)");
+ /* reduce size1 to produce a 2GB dataset */
+ size1[1] = 1024/16;
+ size2[0] /= 16;
+ break;
case XLFILE:
- TESTING("Extra large dataset write(4GB)");
- /* reduce size1 to produce a 4GB dataset */
- size1[1] = 1024/8;
- size2[0] /= 8;
- break;
+ TESTING("Extra large dataset write(4GB)");
+ /* reduce size1 to produce a 4GB dataset */
+ size1[1] = 1024/8;
+ size2[0] /= 8;
+ break;
case HUGEFILE:
- TESTING("Huge dataset write");
- /* Leave size1 as 32GB */
- break;
+ TESTING("Huge dataset write");
+ /* Leave size1 as 32GB */
+ break;
case SFILE:
- TESTING("small dataset write(1GB)");
- /* reduce size1 to produce a 1GB dataset */
- size1[1] = 1024/32;
- size2[0] /= 32;
- break;
+ TESTING("small dataset write(1GB)");
+ /* reduce size1 to produce a 1GB dataset */
+ size1[1] = 1024/32;
+ size2[0] /= 32;
+ break;
case NOFILE:
- /* what to do?? */
- HDfprintf(stdout, "Unexpected file size of NOFILE\n");
- goto error;
- break;
+ /* what to do?? */
+ HDfprintf(stdout, "Unexpected file size of NOFILE\n");
+ goto error;
+ break;
}
/*
@@ -400,30 +400,30 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
* which is a family of files. Each member of the family will be 1GB
*/
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
- goto error;
+ goto error;
}
/* Create simple data spaces according to the size specified above. */
if ((space1 = H5Screate_simple (4, size1, size1)) < 0 ||
- (space2 = H5Screate_simple (1, size2, size2)) < 0) {
- goto error;
+ (space2 = H5Screate_simple (1, size2, size2)) < 0) {
+ goto error;
}
/* Create the datasets */
-/*
- * The fix below is provided for bug#921
- * H5Dcreate with H5P_DEFAULT creation properties
- * will create a set of solid 1GB files; test will crash if quotas are enforced
- * or it will take some time to write a file.
- * We should create a dataset allocating space late and never writing fill values.
- * EIP 4/8/03
-*/
+ /*
+ * The fix below is provided for bug#921
+ * H5Dcreate with H5P_DEFAULT creation properties
+ * will create a set of solid 1GB files; test will crash if quotas are enforced
+ * or it will take some time to write a file.
+ * We should create a dataset allocating space late and never writing fill values.
+ * EIP 4/8/03
+ */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ||
- (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
- goto error;
+ (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
+ goto error;
}
@@ -431,15 +431,15 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
hs_size[0] = WRT_SIZE;
if ((mem_space = H5Screate_simple (1, hs_size, hs_size)) < 0) goto error;
for (i=0; i<wrt_n; i++) {
- hs_start[0] = randll (size2[0], i);
- HDfprintf (out, "#%03d 0x%016Hx\n", i, hs_start[0]);
- if (H5Sselect_hyperslab (space2, H5S_SELECT_SET, hs_start, NULL,
- hs_size, NULL) < 0) goto error;
- for (j=0; j<WRT_SIZE; j++) {
- buf[j] = i+1;
- }
- if (H5Dwrite (d2, H5T_NATIVE_INT, mem_space, space2,
- H5P_DEFAULT, buf) < 0) goto error;
+ hs_start[0] = randll (size2[0], i);
+ HDfprintf (out, "#%03d 0x%016Hx\n", i, hs_start[0]);
+ if (H5Sselect_hyperslab (space2, H5S_SELECT_SET, hs_start, NULL,
+ hs_size, NULL) < 0) goto error;
+ for (j=0; j<WRT_SIZE; j++) {
+ buf[j] = i+1;
+ }
+ if (H5Dwrite (d2, H5T_NATIVE_INT, mem_space, space2,
+ H5P_DEFAULT, buf) < 0) goto error;
}
if (H5Dclose (d1) < 0) goto error;
@@ -448,22 +448,22 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
if (H5Sclose (space1) < 0) goto error;
if (H5Sclose (space2) < 0) goto error;
if (H5Fclose (file) < 0) goto error;
- free (buf);
- fclose(out);
+ HDfree (buf);
+ HDfclose(out);
PASSED();
return 0;
- error:
+error:
H5E_BEGIN_TRY {
- H5Dclose(d1);
- H5Dclose(d2);
- H5Sclose(space1);
- H5Sclose(space2);
- H5Sclose(mem_space);
- H5Fclose(file);
+ H5Dclose(d1);
+ H5Dclose(d2);
+ H5Sclose(space1);
+ H5Sclose(space2);
+ H5Sclose(mem_space);
+ H5Fclose(file);
} H5E_END_TRY;
- if (buf) free(buf);
- if (out) fclose(out);
+ if (buf) HDfree(buf);
+ if (out) HDfclose(out);
return 1;
}
@@ -492,11 +492,11 @@ reader(char *filename, hid_t fapl)
char ln[128], *s;
hsize_t hs_offset[1];
hsize_t hs_size[1] = {WRT_SIZE};
- int *buf = (int *)malloc(sizeof(int) * WRT_SIZE);
+ int *buf = (int *)HDmalloc(sizeof(int) * WRT_SIZE);
int i, j, zero, wrong, nerrors = 0;
/* Open script file */
- script = fopen(DNAME, "r");
+ script = HDfopen(DNAME, "r");
/* Open HDF5 file */
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR
@@ -509,58 +509,58 @@ reader(char *filename, hid_t fapl)
if((mspace = H5Screate_simple(1, hs_size, hs_size)) < 0) FAIL_STACK_ERROR
/* Read each region */
- while(fgets(ln, (int)sizeof(ln), script)) {
- if('#' != ln[0])
+ while(HDfgets(ln, (int)sizeof(ln), script)) {
+ if('#' != ln[0])
break;
- i = (int)strtol(ln + 1, &s, 10);
- hs_offset[0] = HDstrtoll(s, NULL, 0);
- HDfprintf(stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], "");
- fflush(stdout);
-
- if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL,
- hs_size, NULL) < 0) FAIL_STACK_ERROR
- if(H5Dread(d2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0)
- FAIL_STACK_ERROR
-
- /* Check */
- for(j = zero = wrong = 0; j < WRT_SIZE; j++) {
- if(0 == buf[j])
- zero++;
- else if(buf[j] != i + 1)
- wrong++;
- }
- if(zero) {
- H5_FAILED();
- printf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
- } else if(wrong) {
- SKIPPED();
- puts(" Possible overlap with another region.");
- nerrors++;
- } else {
- PASSED();
- }
+ i = (int)HDstrtol(ln + 1, &s, 10);
+ hs_offset[0] = HDstrtoll(s, NULL, 0);
+ HDfprintf(stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], "");
+ HDfflush(stdout);
+
+ if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL,
+ hs_size, NULL) < 0) FAIL_STACK_ERROR
+ if(H5Dread(d2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Check */
+ for(j = zero = wrong = 0; j < WRT_SIZE; j++) {
+ if(0 == buf[j])
+ zero++;
+ else if(buf[j] != i + 1)
+ wrong++;
+ }
+ if(zero) {
+ H5_FAILED();
+ printf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
+ } else if(wrong) {
+ SKIPPED();
+ HDputs(" Possible overlap with another region.");
+ nerrors++;
+ } else {
+ PASSED();
+ }
}
if(H5Dclose(d2) < 0) FAIL_STACK_ERROR
- if(H5Sclose(mspace) < 0) FAIL_STACK_ERROR
- if(H5Sclose(fspace) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file) < 0) FAIL_STACK_ERROR
- free(buf);
- fclose(script);
+ if(H5Sclose(mspace) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(fspace) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(file) < 0) FAIL_STACK_ERROR
+ HDfree(buf);
+ HDfclose(script);
return nerrors;
error:
H5E_BEGIN_TRY {
- H5Dclose(d2);
- H5Sclose(mspace);
- H5Sclose(fspace);
- H5Fclose(file);
+ H5Dclose(d2);
+ H5Sclose(mspace);
+ H5Sclose(fspace);
+ H5Fclose(file);
} H5E_END_TRY;
if(buf)
- free(buf);
+ HDfree(buf);
if(script)
- fclose(script);
+ HDfclose(script);
return 1;
}
@@ -584,21 +584,21 @@ static void
usage(void)
{
HDfprintf(stdout,
- "Usage: big [-h] [-c] [-fsize <fsize>}\n"
- "\t-h\tPrint the help page\n"
- "\t-c\tFile system Checking skipped. Caution: this test generates\n"
- "\t\tmany big files and may fill up the file system.\n"
- "\t-fsize\tChange family size default to <fsize> where <fsize> is\n"
- "\t\ta positive float point number. Default value is %Hu.\n"
- "Examples:\n"
- "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n"
- "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n"
- "\tBe sure the file system can support the file size requested\n"
- , (hsize_t)FAMILY_SIZE);
+ "Usage: big [-h] [-c] [-fsize <fsize>}\n"
+ "\t-h\tPrint the help page\n"
+ "\t-c\tFile system Checking skipped. Caution: this test generates\n"
+ "\t\tmany big files and may fill up the file system.\n"
+ "\t-fsize\tChange family size default to <fsize> where <fsize> is\n"
+ "\t\ta positive float point number. Default value is %Hu.\n"
+ "Examples:\n"
+ "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n"
+ "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n"
+ "\tBe sure the file system can support the file size requested\n"
+ , (hsize_t)FAMILY_SIZE);
}
-
+
/* Flush stdout at the end of this test routine to ensure later output to */
/* stderr will not come out before it.*/
int testvfd(vfd_t vfd)
@@ -611,107 +611,107 @@ int testvfd(vfd_t vfd)
switch(vfd){
case FAMILY_VFD:
- /* Test huge file with the family driver */
- puts("Testing big file with the Family Driver ");
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
-
- if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0)
- goto error;
-
- if (cflag){
- /*
- * We shouldn't run this test if the file system doesn't support holes
- * because we would generate multi-gigabyte files.
- */
- puts("Checking if file system is adequate for this test...");
- if (sizeof(long long)<8 || 0==GB8LL) {
- puts("Test skipped because sizeof(long long) is too small. This");
- puts("hardware apparently doesn't support 64-bit integer types.");
- usage();
- goto quit;
- }
- if (!sparse_support) {
- puts("Test skipped because file system does not support holes.");
- usage();
- goto quit;
- }
- if (!enough_room(fapl)) {
- puts("Test skipped because of quota (file size or num open files).");
- usage();
- goto quit;
- }
- }
-
- /* Do the test with the Family Driver */
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
-
- if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error;
- if (reader(filename, fapl)) goto error;
-
- puts("Test passed with the Family Driver.");
- break;
+ /* Test huge file with the family driver */
+ HDputs("Testing big file with the Family Driver ");
+ if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+
+ if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0)
+ goto error;
+
+ if (cflag){
+ /*
+ * We shouldn't run this test if the file system doesn't support holes
+ * because we would generate multi-gigabyte files.
+ */
+ HDputs("Checking if file system is adequate for this test...");
+ if (sizeof(long long)<8 || 0==GB8LL) {
+ HDputs("Test skipped because sizeof(long long) is too small. This");
+ HDputs("hardware apparently doesn't support 64-bit integer types.");
+ usage();
+ goto quit;
+ }
+ if (!sparse_support) {
+ HDputs("Test skipped because file system does not support holes.");
+ usage();
+ goto quit;
+ }
+ if (!enough_room(fapl)) {
+ HDputs("Test skipped because of quota (file size or num open files).");
+ usage();
+ goto quit;
+ }
+ }
+
+ /* Do the test with the Family Driver */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+
+ if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error;
+ if (reader(filename, fapl)) goto error;
+
+ HDputs("Test passed with the Family Driver.");
+ break;
case SEC2_VFD:
- testsize = supports_big(SEC2_VFD);
- if (testsize == NOFILE) {
- HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n");
- goto quit;
- }
- /* Test big file with the SEC2 driver */
- puts("Testing big file with the SEC2 Driver ");
+ testsize = supports_big(SEC2_VFD);
+ if (testsize == NOFILE) {
+ HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n");
+ goto quit;
+ }
+ /* Test big file with the SEC2 driver */
+ HDputs("Testing big file with the SEC2 Driver ");
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
- if(H5Pset_fapl_sec2(fapl) < 0)
- goto error;
+ if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+ if(H5Pset_fapl_sec2(fapl) < 0)
+ goto error;
- h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
- if (writer(filename, fapl, testsize, WRT_N)) goto error;
- if (reader(filename, fapl)) goto error;
+ if (writer(filename, fapl, testsize, WRT_N)) goto error;
+ if (reader(filename, fapl)) goto error;
- puts("Test passed with the SEC2 Driver.");
- break;
+ HDputs("Test passed with the SEC2 Driver.");
+ break;
case STDIO_VFD:
- testsize = supports_big(STDIO_VFD);
- if (testsize == NOFILE) {
- HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n");
- goto quit;
- }
- puts("\nTesting big file with the STDIO Driver ");
+ testsize = supports_big(STDIO_VFD);
+ if (testsize == NOFILE) {
+ HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n");
+ goto quit;
+ }
+ HDputs("\nTesting big file with the STDIO Driver ");
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
- if(H5Pset_fapl_stdio(fapl) < 0)
- goto error;
+ if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+ if(H5Pset_fapl_stdio(fapl) < 0)
+ goto error;
- h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
+ h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
- if (writer(filename, fapl, testsize, WRT_N)) goto error;
- if (reader(filename, fapl)) goto error;
- puts("Test passed with the STDIO Driver.");
- break;
+ if (writer(filename, fapl, testsize, WRT_N)) goto error;
+ if (reader(filename, fapl)) goto error;
+ HDputs("Test passed with the STDIO Driver.");
+ break;
default:
- puts("Unsupprted VFD");
- usage();
- goto error;;
+ HDputs("Unsupprted VFD");
+ usage();
+ goto error;;
} /* end of switch (vfd) */
quit:
/* End with normal return code */
/* Clean up the test file */
if (h5_cleanup(FILENAME, fapl)) HDremove(DNAME);
- fflush(stdout);
+ HDfflush(stdout);
return 0;
error:
if (fapl>=0) H5Pclose(fapl);
- puts("*** TEST FAILED ***");
- fflush(stdout);
+ HDputs("*** TEST FAILED ***");
+ HDfflush(stdout);
return 1;
}
@@ -748,58 +748,58 @@ main (int ac, char **av)
/* parameters setup */
while (--ac > 0){
- av++;
- if (strcmp("-fsize", *av)==0){
- /* specify a different family file size */
- ac--; av++;
- if (ac > 0) {
- family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0);
- }
- else{
- printf("***Missing fsize value***\n");
- usage();
- return 1;
- }
- }
- else if (strcmp("-c", *av)==0){
- /* turn off file system check before test */
- cflag=0;
- }
- else if (strcmp("-h", *av)==0){
- usage();
- return 0;
- }else{
- usage();
- return 1;
- }
+ av++;
+ if (HDstrcmp("-fsize", *av)==0){
+ /* specify a different family file size */
+ ac--; av++;
+ if (ac > 0) {
+ family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0);
+ }
+ else{
+ printf("***Missing fsize value***\n");
+ usage();
+ return 1;
+ }
+ }
+ else if (HDstrcmp("-c", *av)==0){
+ /* turn off file system check before test */
+ cflag=0;
+ }
+ else if (HDstrcmp("-h", *av)==0){
+ usage();
+ return 0;
+ }else{
+ usage();
+ return 1;
+ }
}
/* check sparse file support unless cflag is not set. */
if (cflag)
- sparse_support = is_sparse();
+ sparse_support = is_sparse();
/* Choose random # seed */
seed = (unsigned long)HDtime(NULL);
#ifdef QAK
-/* seed = (unsigned long)1155438845; */
-HDfprintf(stderr, "Random # seed was: %lu\n", seed);
+ /* seed = (unsigned long)1155438845; */
+ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
#endif /* QAK */
HDsrandom(seed);
-/*=================================================*/
+ /*=================================================*/
if (testvfd(FAMILY_VFD) != 0)
- goto error;
+ goto error;
if (testvfd(SEC2_VFD) != 0)
- goto error;
+ goto error;
if (testvfd(STDIO_VFD) != 0)
- goto error;
+ goto error;
/* End with normal exit code */
return 0;
error:
- puts("*** TEST FAILED ***");
+ HDputs("*** TEST FAILED ***");
return 1;
}
diff --git a/test/corrupt_stab_msg.h5 b/test/corrupt_stab_msg.h5
index 4fa287c..4fa287c 100755..100644
--- a/test/corrupt_stab_msg.h5
+++ b/test/corrupt_stab_msg.h5
Binary files differ
diff --git a/test/cross_read.c b/test/cross_read.c
index 308a0c1..308a0c1 100755..100644
--- a/test/cross_read.c
+++ b/test/cross_read.c
diff --git a/test/dtransform.c b/test/dtransform.c
index 5d5cefe..2bcbe8c 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -23,6 +23,7 @@ static int init_test(hid_t file_id);
static int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy);
static int test_trivial(const hid_t dxpl_id_simple);
static int test_poly(const hid_t dxpl_id_polynomial);
+static int test_specials(hid_t file);
static int test_set(void);
static int test_getset(const hid_t dxpl_id_simple);
@@ -50,14 +51,14 @@ const float windchillFfloat[ROWS][COLS] =
const int transformData[ROWS][COLS] =
{ {36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, 28, 34, 40, 46, 52, 57, 63 },
- {34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 0 } ,
- {32, 25, 19, 13, 6, 0, 7, 13, 19, 26, 32, 39, 45, 51, 58, 64, 71, 5 },
+ {34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 1 } ,
+ {32, 25, 19, 13, 6, 2, 7, 13, 19, 26, 32, 39, 45, 51, 58, 64, 71, 5 },
{30, 24, 17, 11, 4, 2, 9, 15, 22, 29, 35, 42, 48, 55, 61, 68, 2, 9 },
{29, 23, 16, 9, 3, 4, 11, 17, 24, 31, 37, 44, 51, 58, 64, 71, 6, 12 },
{28, 22, 15, 8, 1, 5, 12, 19, 26, 33, 39, 46, 53, 60, 67, 1, 8, 15 },
- {28, 21, 14, 7, 0, 7, 14, 21, 27, 34, 41, 48, 55, 62, 69, 4, 10, 17 },
+ {28, 21, 14, 7, 6, 7, 14, 21, 27, 34, 41, 48, 55, 62, 69, 4, 10, 17 },
{27, 20, 13, 6, 1, 8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 6, 12, 19 },
- {26, 19, 12, 5, 2, 9, 16, 23, 30, 37, 44, 51, 58, 65, 0, 7, 14, 21 },
+ {26, 19, 12, 5, 2, 9, 16, 23, 30, 37, 44, 51, 58, 65, 5, 7, 14, 21 },
{26, 19, 12, 4, 3, 10, 17, 24, 31, 38, 45, 52, 60, 67, 2, 9, 16, 23},
{25, 18, 11, 4, 3, 11, 18, 25, 32, 39, 46, 54, 61, 68, 3, 10, 17, 25},
{25, 17, 10, 3, 4, 11, 19, 26, 33, 40, 48, 55, 62, 69, 4, 12, 19, 26}
@@ -97,6 +98,22 @@ const int transformData[ROWS][COLS] =
PASSED(); \
}
+#define COMPARE_INT(VAR1,VAR2) \
+{ \
+ size_t i,j; \
+ \
+ for(i=0; i<ROWS; i++) \
+ for(j=0; j<COLS; j++) \
+ { \
+ if( (VAR1)[i][j] != (VAR2)[i][j] ) \
+ { \
+ H5_FAILED(); \
+ fprintf(stderr, " ERROR: data failed to match computed data\n"); \
+ goto error; \
+ } \
+ } \
+}
+
#define TEST_TYPE_CONTIG(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \
{ \
TYPE array[ROWS][COLS]; \
@@ -332,6 +349,7 @@ int main(void)
if(test_trivial(dxpl_id_simple) < 0) TEST_ERROR;
if(test_poly(dxpl_id_polynomial) < 0) TEST_ERROR;
if(test_getset(dxpl_id_c_to_f) < 0) TEST_ERROR;
+ if(test_specials(file_id) < 0) TEST_ERROR;
/* Close the objects we opened/created */
if(H5Dclose(dset_id_int) < 0) TEST_ERROR;
@@ -502,6 +520,160 @@ error:
}
static int
+test_specials(hid_t file)
+{
+ hid_t dxpl_id, dset_id, dataspace;
+ hsize_t dim[2] = { ROWS, COLS };
+ int read_buf[ROWS][COLS];
+ int data_res[ROWS][COLS];
+ int row, col;
+ const char* special1 = "x*-100";
+ const char* special2 = "100-x";
+ const char* special3 = "1000/x";
+ const char* special4 = "-x";
+ const char* special5 = "+x";
+
+ TESTING("data transform of some special cases")
+
+ if((dataspace = H5Screate_simple(2, dim, NULL)) < 0)
+ TEST_ERROR
+
+ if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
+
+ /*-----------------------------
+ * Operation 1: x*-100
+ *----------------------------*/
+ if(H5Pset_data_transform(dxpl_id, special1) < 0) TEST_ERROR;
+
+ for(row = 0; row < ROWS; row++)
+ for(col = 0; col < COLS; col++)
+ data_res[row][col] = transformData[row][col] * -100;
+
+ if((dset_id = H5Dcreate2(file, "/special1", H5T_NATIVE_INT,
+ dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if(H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ dxpl_id, transformData) < 0)
+ TEST_ERROR
+ if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, read_buf) < 0)
+ TEST_ERROR
+
+ COMPARE_INT(read_buf, data_res)
+
+ if(H5Dclose(dset_id) < 0)
+ TEST_ERROR
+
+ /*-----------------------------
+ * Operation 2: 100-x
+ *----------------------------*/
+ if(H5Pset_data_transform(dxpl_id, special2) < 0) TEST_ERROR;
+
+ for(row = 0; row < ROWS; row++)
+ for(col = 0; col < COLS; col++)
+ data_res[row][col] = 100 - transformData[row][col];
+
+ if((dset_id = H5Dcreate2(file, "/special2", H5T_NATIVE_INT,
+ dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if(H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ dxpl_id, transformData) < 0)
+ TEST_ERROR
+ if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, read_buf) < 0)
+ TEST_ERROR
+
+ COMPARE_INT(read_buf, data_res)
+
+ if(H5Dclose(dset_id) < 0)
+ TEST_ERROR
+
+ /*-----------------------------
+ * Operation 3: 1000/x
+ *----------------------------*/
+ if(H5Pset_data_transform(dxpl_id, special3) < 0) TEST_ERROR;
+
+ for(row = 0; row < ROWS; row++)
+ for(col = 0; col < COLS; col++)
+ data_res[row][col] = 1000 / transformData[row][col];
+
+ if((dset_id = H5Dcreate2(file, "/special3", H5T_NATIVE_INT,
+ dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if(H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ dxpl_id, transformData) < 0)
+ TEST_ERROR
+ if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, read_buf) < 0)
+ TEST_ERROR
+
+ COMPARE_INT(read_buf, data_res)
+
+ if(H5Dclose(dset_id) < 0)
+ TEST_ERROR
+
+ /*-----------------------------
+ * Operation 4: -x
+ *----------------------------*/
+ if(H5Pset_data_transform(dxpl_id, special4) < 0) TEST_ERROR;
+
+ for(row = 0; row < ROWS; row++)
+ for(col = 0; col < COLS; col++)
+ data_res[row][col] = -1 * transformData[row][col];
+
+ if((dset_id = H5Dcreate2(file, "/special4", H5T_NATIVE_INT,
+ dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if(H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ dxpl_id, transformData) < 0)
+ TEST_ERROR
+ if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, read_buf) < 0)
+ TEST_ERROR
+
+ COMPARE_INT(read_buf, data_res)
+
+ if(H5Dclose(dset_id) < 0)
+ TEST_ERROR
+
+ /*-----------------------------
+ * Operation 5: +x
+ *----------------------------*/
+ if(H5Pset_data_transform(dxpl_id, special5) < 0) TEST_ERROR;
+
+ for(row = 0; row < ROWS; row++)
+ for(col = 0; col < COLS; col++)
+ data_res[row][col] = transformData[row][col];
+
+ if((dset_id = H5Dcreate2(file, "/special5", H5T_NATIVE_INT,
+ dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if(H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ dxpl_id, transformData) < 0)
+ TEST_ERROR
+ if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, read_buf) < 0)
+ TEST_ERROR
+
+ COMPARE_INT(read_buf, data_res)
+
+ if(H5Dclose(dset_id) < 0)
+ TEST_ERROR
+
+
+ if(H5Pclose(dxpl_id) < 0)
+ TEST_ERROR
+ if(H5Sclose(dataspace) < 0)
+ TEST_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ return -1;
+}
+
+static int
test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy)
{
int windchillC;
diff --git a/test/fheap.c b/test/fheap.c
index 2cb8796..14cfbe8 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -415,13 +415,20 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off,
if(keep_ids) {
/* Check for needing to increase size of heap ID array */
if(keep_ids->num_ids + 1 > keep_ids->alloc_ids) {
+ unsigned char *tmp_ids;
+ size_t *tmp_lens;
+ size_t *tmp_offs;
+
keep_ids->alloc_ids = MAX(1024, (keep_ids->alloc_ids * 2));
- if(NULL == (keep_ids->ids = (unsigned char *)H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids)))
+ if(NULL == (tmp_ids = (unsigned char *)H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids)))
TEST_ERROR
- if(NULL == (keep_ids->lens = (size_t *)H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids)))
+ keep_ids->ids = tmp_ids;
+ if(NULL == (tmp_lens = (size_t *)H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids)))
TEST_ERROR
- if(NULL == (keep_ids->offs = (size_t *)H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids)))
+ keep_ids->lens = tmp_lens;
+ if(NULL == (tmp_offs = (size_t *)H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids)))
TEST_ERROR
+ keep_ids->offs = tmp_offs;
} /* end if */
/* Append the object info onto the array */
diff --git a/test/gen_cross.c b/test/gen_cross.c
index d960499..d960499 100755..100644
--- a/test/gen_cross.c
+++ b/test/gen_cross.c
diff --git a/test/istore.c b/test/istore.c
index 3ae8da7..0c970bc 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -54,6 +54,42 @@ hsize_t zero[H5O_LAYOUT_NDIMS];
/*-------------------------------------------------------------------------
+ * Function: is_sparse
+ *
+ * Purpose: Determines if the file system of the current working
+ * directory supports holes.
+ *
+ * Return: Success: Non-zero if holes are supported; zero
+ * otherwise.
+ *
+ * Failure: zero
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, July 15, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+is_sparse(void)
+{
+ int fd;
+ h5_stat_t sb;
+
+ if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) return 0;
+ if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0;
+ if (5!=HDwrite(fd, "hello", (size_t)5)) return 0;
+ if (HDclose(fd) < 0) return 0;
+ if (HDstat("x.h5", &sb) < 0) return 0;
+ if (HDremove("x.h5") < 0) return 0;
+#ifdef H5_HAVE_STAT_ST_BLOCKS
+ return ((unsigned long)sb.st_blocks*512 < (unsigned long)sb.st_size);
+#else
+ return (0);
+#endif
+}
+
+
+/*-------------------------------------------------------------------------
* Function: print_array
*
* Purpose: Prints the values in an array
@@ -565,6 +601,7 @@ main(int argc, char *argv[])
unsigned size_of_test;
unsigned u; /* Local index variable */
char filename[1024];
+ int has_sparse_support = 0;
/* Parse arguments or assume these tests (`small', `medium' ) */
if (1 == argc) {
@@ -598,6 +635,12 @@ main(int argc, char *argv[])
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
+ /* Check to see if the file system supports POSIX-style sparse files.
+ * Windows NTFS does not, so we want to avoid tests which create
+ * very large files.
+ */
+ has_sparse_support = is_sparse();
+
/* Reset library */
h5_reset();
fapl = h5_fileaccess();
@@ -656,7 +699,10 @@ main(int argc, char *argv[])
status = test_sparse(file, "sparse", (size_t)2000, (size_t)4, (size_t)2, (size_t)3);
nerrors += status < 0 ? 1 : 0;
}
- if (size_of_test & TEST_LARGE) {
+ if (has_sparse_support && size_of_test & TEST_LARGE) {
+ /* This test is skipped if there is no POSIX-style sparse file support
+ * e.g.: Windows NTFS filesystems
+ */
status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50);
nerrors += status < 0 ? 1 : 0;
}
diff --git a/test/objcopy.c b/test/objcopy.c
index 5c20ee8..5c20ee8 100755..100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
diff --git a/test/reserved.c b/test/reserved.c
index bb6d328..bb6d328 100755..100644
--- a/test/reserved.c
+++ b/test/reserved.c
diff --git a/test/tattr.c b/test/tattr.c
index 60d4ddb..1285f0e 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -128,6 +128,8 @@ float attr_data5=(float)-5.123; /* Test data for 5th attribute */
#define ATTR7_NAME "attr 1 - 000000"
#define ATTR8_NAME "attr 2"
+#define LINK1_NAME "Link1"
+
#define NATTR_MANY_OLD 350
#define NATTR_MANY_NEW 35000
@@ -10216,7 +10218,339 @@ test_attr_bug6(hid_t fcpl, hid_t fapl)
ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
-}
+} /* test_attr_bug6() */
+
+/****************************************************************
+**
+** test_attr_bug7(): Test basic H5A (attribute) code.
+** (Really tests object header allocation code).
+** Tests creating and deleting attributes in such a way as
+** to change the size of the "chunk #0 size" field.
+** Includes testing "skipping" a possible size of the
+** field, i.e. going from 1 to 4 bytes or 4 to 1 byte.
+**
+****************************************************************/
+static void
+test_attr_bug7(hid_t fcpl, hid_t fapl)
+{
+ hid_t fid; /* File ID */
+ hid_t aid; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims_s = 140; /* Small attribute dimensions */
+ hsize_t dims_l = 65480; /* Large attribute dimensions */
+ H5A_info_t ainfo; /* Attribute info */
+ herr_t ret; /* Generic return status */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing adding and deleting large attributes\n"));
+
+
+ /* Create committed datatype to operate on. Use a committed datatype so that
+ * there is nothing after the object header and the first chunk can expand and
+ * contract as necessary. */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+ tid = H5Tcopy(H5T_STD_I32LE);
+ CHECK(tid, FAIL, "H5Tcopy");
+ ret = H5Tcommit2(fid, TYPE1_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /*
+ * Create small attribute
+ */
+ sid = H5Screate_simple(1, &dims_s, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+ aid = H5Acreate2(tid, ATTR1_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Close file */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Open file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Check attribute */
+ tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT);
+ CHECK(tid, FAIL, "H5Topen2");
+ ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_s)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s);
+
+ /*
+ * Create another small attribute. Should cause chunk size field to expand by
+ * 1 byte (1->2).
+ */
+ aid = H5Acreate2(tid, ATTR2_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Close file */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Open file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Check attributes */
+ tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT);
+ CHECK(tid, FAIL, "H5Topen2");
+ ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_s)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s);
+ ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_s)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s);
+
+ /*
+ * Create large attribute. Should cause chunk size field to expand by 2 bytes
+ * (2->4).
+ */
+ ret = H5Sset_extent_simple(sid, 1, &dims_l, NULL);
+ CHECK(ret, FAIL, "H5Sset_extent_simple");
+ aid = H5Acreate2(tid, ATTR3_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Close file */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Open file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Check attributes */
+ tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT);
+ CHECK(tid, FAIL, "H5Topen2");
+ ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_s)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s);
+ ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_s)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s);
+ ret = H5Aget_info_by_name(tid, ".", ATTR3_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_l)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_l);
+
+ /*
+ * Delete last two attributes - should merge into a null message that is too
+ * large, causing the chunk size field to shrink by 3 bytes (4->1).
+ */
+ ret = H5Sset_extent_simple(sid, 1, &dims_l, NULL);
+ CHECK(ret, FAIL, "H5Sset_extent_simple");
+ ret = H5Adelete(tid, ATTR2_NAME);
+ CHECK(ret, FAIL, "H5Adelete");
+ ret = H5Adelete(tid, ATTR3_NAME);
+ CHECK(ret, FAIL, "H5Adelete");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Open file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Check attribute */
+ tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT);
+ CHECK(tid, FAIL, "H5Topen2");
+ ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_s)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s);
+
+ /*
+ * Create large attribute. Should cause chunk size field to expand by 3 bytes
+ * (1->4).
+ */
+ aid = H5Acreate2(tid, ATTR2_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Close file */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Open file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Check attributes */
+ tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT);
+ CHECK(tid, FAIL, "H5Topen2");
+ ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_s)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s);
+ ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims_l)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_l);
+
+ /* Close IDs */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* test_attr_bug7() */
+
+/****************************************************************
+**
+** test_attr_bug8(): Test basic H5A (attribute) code.
+** (Really tests object header code).
+** Tests adding a link and attribute to a group in such a
+** way as to cause the "chunk #0 size" field to expand
+** when some object header messages are not loaded into
+** cache. Before the bug was fixed, this would prevent
+** these messages from being shifted to the correct
+** position as the expansion algorithm marked them dirty,
+** invalidating the raw form, when there was no native
+** form to encode.
+**
+****************************************************************/
+static void
+test_attr_bug8(hid_t fcpl, hid_t fapl)
+{
+ hid_t fid; /* File ID */
+ hid_t aid; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t gid; /* Group ID */
+ hid_t oid; /* Object ID */
+ hsize_t dims = 256; /* Attribute dimensions */
+ H5O_info_t oinfo; /* Object info */
+ H5A_info_t ainfo; /* Attribute info */
+ haddr_t root_addr; /* Root group address */
+ herr_t ret; /* Generic return status */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing attribute expanding object header with undecoded messages\n"));
+
+
+ /* Create committed datatype to operate on. Use a committed datatype so that
+ * there is nothing after the object header and the first chunk can expand and
+ * contract as necessary. */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+ gid = H5Gcreate2(fid, GROUP1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate2");
+
+ /* Get root group address */
+ ret = H5Oget_info(fid, &oinfo);
+ CHECK(ret, FAIL, "H5Oget_info");
+ root_addr = oinfo.addr;
+
+ /*
+ * Create link to root group
+ */
+ ret = H5Lcreate_hard(fid, "/", gid, LINK1_NAME, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lcreate_hard");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Open file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Check link */
+ gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gopen2");
+ oid = H5Oopen(gid, LINK1_NAME, H5P_DEFAULT);
+ CHECK(oid, FAIL, "H5Oopen");
+ ret = H5Oget_info(oid, &oinfo);
+ CHECK(ret, FAIL, "H5Oget_info");
+ if(oinfo.addr != root_addr)
+ TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)oinfo.addr, (long long unsigned)root_addr);
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Oclose(oid);
+ CHECK(ret, FAIL, "H5Oclose");
+
+ /* Open file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /*
+ * Create attribute. Should cause chunk size field to expand by 1 byte
+ * (1->2).
+ */
+ gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gopen2");
+ sid = H5Screate_simple(1, &dims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+ aid = H5Acreate2(gid, ATTR1_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Close file */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Open file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Check link and attribute */
+ gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gopen2");
+ oid = H5Oopen(gid, LINK1_NAME, H5P_DEFAULT);
+ CHECK(oid, FAIL, "H5Oopen");
+ ret = H5Oget_info(oid, &oinfo);
+ CHECK(ret, FAIL, "H5Oget_info");
+ if(oinfo.addr != root_addr)
+ TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)oinfo.addr, (long long unsigned)root_addr);
+ ret = H5Aget_info_by_name(gid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Aget_info_by_name");
+ if(ainfo.data_size != dims)
+ TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims);
+
+ /* Close IDs */
+ ret = H5Oclose(oid);
+ CHECK(ret, FAIL, "H5Oclose");
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* test_attr_bug8() */
/****************************************************************
**
@@ -10364,6 +10698,8 @@ test_attr(void)
test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */
test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */
+ test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */
+ test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
} /* end for */
} /* end if */
else {
@@ -10388,6 +10724,10 @@ test_attr(void)
test_attr_bug4(fcpl, my_fapl); /* Test attributes on named datatypes */
test_attr_bug5(fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
test_attr_bug6(fcpl, my_fapl); /* Test reading empty attribute */
+ /* Skip test_attr_bug7 because it is specific to the new object
+ * header format and in fact fails if used with the old format, due
+ * to the attributes being larger than 64K */
+ test_attr_bug8(fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
} /* end else */
} /* end for */
diff --git a/test/th5s.c b/test/th5s.c
index c17d96e..87aa0f1 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -544,70 +544,13 @@ test_h5s_zero_dim(void)
hssize_t nelem; /* Number of elements */
H5S_sel_type sel_type; /* Type of selection currently */
H5S_class_t stype; /* dataspace type */
+ H5D_alloc_time_t alloc_time; /* Space allocation time */
herr_t ret; /* Generic return value */
unsigned int i, j, k;
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspace with zero dimension size\n"));
- /* Make sure we can create the space with the dimension size 0 (starting from v1.8.7).
- * The dimension doesn't need to be unlimited. */
- sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
-
- ret = H5Sclose(sid1);
- CHECK(ret, FAIL, "H5Sclose");
-
- sid1 = H5Screate(H5S_SIMPLE);
- CHECK(sid1, FAIL, "H5Screate");
-
- /* SID1 has the 1st dimension size as zero. The maximal dimension will be
- * the same as the dimension because of the NULL passed in. */
- ret = H5Sset_extent_simple(sid1,SPACE1_RANK,dims1,NULL);
- CHECK(ret, FAIL, "H5Sset_extent_simple");
-
- /* Check that the dataspace actually has 0 elements */
- nelem = H5Sget_simple_extent_npoints(sid1);
- VERIFY(nelem, 0, "H5Sget_simple_extent_npoints");
-
- /* Check that the dataspace was created with an "all" selection */
- sel_type = H5Sget_select_type(sid1);
- VERIFY(sel_type, H5S_SEL_ALL, "H5Sget_select_type");
-
- /* Check that the dataspace has 0 elements selected */
- nelem = H5Sget_select_npoints(sid1);
- VERIFY(nelem, 0, "H5Sget_select_npoints");
-
- /* Change to "none" selection */
- ret = H5Sselect_none(sid1);
- CHECK(ret, FAIL, "H5Sselect_none");
-
- /* Check that the dataspace has 0 elements selected */
- nelem = H5Sget_select_npoints(sid1);
- VERIFY(nelem, 0, "H5Sget_select_npoints");
-
- /* Try to select all dataspace */
- ret = H5Sselect_all(sid1);
- CHECK(ret, FAIL, "H5Sselect_all");
-
- /* Check that the dataspace has 0 elements selected */
- nelem = H5Sget_select_npoints(sid1);
- VERIFY(nelem, 0, "H5Sget_select_npoints");
-
- /* Create the dataspace for chunked dataset with the first dimension size as zero.
- * The maximal dimensions are bigger than the dimensions for later expansion. */
- sid_chunk = H5Screate_simple(SPACE1_RANK, dims1, max_dims);
- CHECK(sid_chunk, FAIL, "H5Screate_simple");
-
- /*============================================
- * Make sure we can use 0-dimension to create
- * contiguous, chunked, compact, and external
- * datasets, and also attribute.
- *============================================
- */
- fid1 = H5Fcreate(ZEROFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fcreate");
-
/* Initialize the data */
for(i=0; i<SPACE1_DIM2; i++)
for(j=0; j<SPACE1_DIM3; j++) {
@@ -622,509 +565,588 @@ test_h5s_zero_dim(void)
for(k=0; k<SPACE1_DIM3; k++)
wdata_real[i][j][k] = i + j + k;
-
- /*===================== Contiguous dataset =======================*/
- dset1 = H5Dcreate2(fid1, BASICDATASET, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dcreate2");
-
- /* Write "nothing" to the dataset */
- ret = H5Dwrite(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, wdata);
- CHECK(ret, FAIL, "H5Dwrite");
-
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
-
- /* Try reading from the dataset (make certain our buffer is unmodified) */
- ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
-
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++) {
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata[i][j]);
+ /* Test with different space allocation times */
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
+
+ /* Make sure we can create the space with the dimension size 0 (starting from v1.8.7).
+ * The dimension doesn't need to be unlimited. */
+ dims1[0] = 0;
+ dims1[1] = SPACE1_DIM2;
+ dims1[2] = SPACE1_DIM3;
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(sid1, FAIL, "H5Screate_simple");
+
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ sid1 = H5Screate(H5S_SIMPLE);
+ CHECK(sid1, FAIL, "H5Screate");
+
+ /* SID1 has the 1st dimension size as zero. The maximal dimension will be
+ * the same as the dimension because of the NULL passed in. */
+ ret = H5Sset_extent_simple(sid1,SPACE1_RANK,dims1,NULL);
+ CHECK(ret, FAIL, "H5Sset_extent_simple");
+
+ /* Check that the dataspace actually has 0 elements */
+ nelem = H5Sget_simple_extent_npoints(sid1);
+ VERIFY(nelem, 0, "H5Sget_simple_extent_npoints");
+
+ /* Check that the dataspace was created with an "all" selection */
+ sel_type = H5Sget_select_type(sid1);
+ VERIFY(sel_type, H5S_SEL_ALL, "H5Sget_select_type");
+
+ /* Check that the dataspace has 0 elements selected */
+ nelem = H5Sget_select_npoints(sid1);
+ VERIFY(nelem, 0, "H5Sget_select_npoints");
+
+ /* Change to "none" selection */
+ ret = H5Sselect_none(sid1);
+ CHECK(ret, FAIL, "H5Sselect_none");
+
+ /* Check that the dataspace has 0 elements selected */
+ nelem = H5Sget_select_npoints(sid1);
+ VERIFY(nelem, 0, "H5Sget_select_npoints");
+
+ /* Try to select all dataspace */
+ ret = H5Sselect_all(sid1);
+ CHECK(ret, FAIL, "H5Sselect_all");
+
+ /* Check that the dataspace has 0 elements selected */
+ nelem = H5Sget_select_npoints(sid1);
+ VERIFY(nelem, 0, "H5Sget_select_npoints");
+
+ /* Create the dataspace for chunked dataset with the first dimension size as zero.
+ * The maximal dimensions are bigger than the dimensions for later expansion. */
+ sid_chunk = H5Screate_simple(SPACE1_RANK, dims1, max_dims);
+ CHECK(sid_chunk, FAIL, "H5Screate_simple");
+
+ /*============================================
+ * Make sure we can use 0-dimension to create
+ * contiguous, chunked, compact, and external
+ * datasets, and also attribute.
+ *============================================
+ */
+ fid1 = H5Fcreate(ZEROFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fcreate");
+
+ /*===================== Contiguous dataset =======================*/
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(plist_id, FAIL, "H5Pcreate");
+
+ ret = H5Pset_alloc_time(plist_id, alloc_time);
+ CHECK(ret, FAIL, "H5Pset_alloc_time");
+
+ dset1 = H5Dcreate2(fid1, BASICDATASET, H5T_NATIVE_INT, sid1, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+
+ ret = H5Pclose(plist_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Write "nothing" to the dataset */
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
+
+ /* Try reading from the dataset (make certain our buffer is unmodified) */
+ ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++) {
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata[i][j] != 7) {
+ H5_FAILED();
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata[i][j]);
+ }
}
}
- }
- /* Write "nothing" to the dataset (with type conversion :-) */
- ret = H5Dwrite(dset1, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata_short);
- CHECK(ret, FAIL, "H5Dwrite");
+ /* Write "nothing" to the dataset (with type conversion :-) */
+ ret = H5Dwrite(dset1, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata_short);
+ CHECK(ret, FAIL, "H5Dwrite");
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
- /* Try reading from the dataset (make certain our buffer is unmodified) */
- ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, rdata_short);
- CHECK(ret, FAIL, "H5Dread");
+ /* Try reading from the dataset (make certain our buffer is unmodified) */
+ ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, rdata_short);
+ CHECK(ret, FAIL, "H5Dread");
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++) {
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata_short[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata_short[i][j]);
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++) {
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata_short[i][j] != 7) {
+ H5_FAILED();
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata_short[i][j]);
+ }
}
}
- }
-
- /* Select a hyperslab beyond its current dimension sizes, then try to write
- * the data. It should fail. */
- ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL);
- CHECK(ret, FAIL, "H5Sselect_hyperslab");
-
- H5E_BEGIN_TRY {
- ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, wdata);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Dwrite");
-
- /* Change to "none" selection */
- ret = H5Sselect_none(sid1);
- CHECK(ret, FAIL, "H5Sselect_none");
-
- /* Select a point beyond the dimension size, then try to write the data.
- * It should fail. */
- coord[0][0]=2; coord[0][1]=5; coord[0][2]=3;
- ret = H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
- CHECK(ret, FAIL, "H5Sselect_elements");
- H5E_BEGIN_TRY {
- ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, &val);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Dwrite");
+ /* Select a hyperslab beyond its current dimension sizes, then try to write
+ * the data. It should fail. */
+ ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* Restore the selection to all */
- ret = H5Sselect_all(sid1);
- CHECK(ret, FAIL, "H5Sselect_all");
+ H5E_BEGIN_TRY {
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, wdata);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Dwrite");
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Change to "none" selection */
+ ret = H5Sselect_none(sid1);
+ CHECK(ret, FAIL, "H5Sselect_none");
- /*=================== Chunked dataset ====================*/
- plist_id = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(plist_id, FAIL, "H5Pcreate");
+ /* Select a point beyond the dimension size, then try to write the data.
+ * It should fail. */
+ coord[0][0]=2; coord[0][1]=5; coord[0][2]=3;
+ ret = H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
+ CHECK(ret, FAIL, "H5Sselect_elements");
- ret = H5Pset_chunk(plist_id, SPACE1_RANK, chunk_dims);
- CHECK(ret, FAIL, "H5Pset_chunk");
+ H5E_BEGIN_TRY {
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, sid1, H5P_DEFAULT, &val);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Dwrite");
- dset1 = H5Dcreate2(fid1, BASICDATASET1, H5T_NATIVE_INT, sid_chunk, H5P_DEFAULT, plist_id, H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dcreate2");
+ /* Restore the selection to all */
+ ret = H5Sselect_all(sid1);
+ CHECK(ret, FAIL, "H5Sselect_all");
- /* Write "nothing" to the dataset */
- ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- CHECK(ret, FAIL, "H5Dwrite");
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
+ /*=================== Chunked dataset ====================*/
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(plist_id, FAIL, "H5Pcreate");
- /* Try reading from the dataset (make certain our buffer is unmodified) */
- ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
+ ret = H5Pset_chunk(plist_id, SPACE1_RANK, chunk_dims);
+ CHECK(ret, FAIL, "H5Pset_chunk");
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++)
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata[i][j]);
- }
- }
+ // ret = H5Pset_alloc_time(plist_id, alloc_time);
+ // CHECK(ret, FAIL, "H5Pset_alloc_time");
- /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure
- * we can write data to it */
- ret = H5Dset_extent(dset1, extend_dims);
- CHECK(ret, FAIL, "H5Dset_extent");
+ dset1 = H5Dcreate2(fid1, BASICDATASET1, H5T_NATIVE_INT, sid_chunk, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
- ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata_real);
- CHECK(ret, FAIL, "H5Dwrite");
+ /* Write "nothing" to the dataset */
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
- ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_real);
- CHECK(ret, FAIL, "H5Dread");
+ /* Try reading from the dataset (make certain our buffer is unmodified) */
+ ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
- /* Check results */
- for(i=0; i<SPACE1_DIM1; i++) {
- for(j=0; j<SPACE1_DIM2; j++) {
- for(k=0; k<SPACE1_DIM3; k++) {
- if(rdata_real[i][j][k] != wdata_real[i][j][k]) {
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++)
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d][%d] is %d but should have been %d\n",
- i, j, k, rdata_real[i][j][k], wdata_real[i][j][k]);
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata[i][j]);
}
- }
}
- }
-
- /* Now shrink the first dimension size of the dataset to 0 and make sure no data is in it */
- extend_dims[0] = 0;
- ret = H5Dset_extent(dset1, extend_dims);
- CHECK(ret, FAIL, "H5Dset_extent");
-
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
- /* Try reading from the dataset (make certain our buffer is unmodified) */
- ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
-
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++)
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata[i][j]);
+ /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure
+ * we can write data to it */
+ extend_dims[0] = SPACE1_DIM1;
+ ret = H5Dset_extent(dset1, extend_dims);
+ CHECK(ret, FAIL, "H5Dset_extent");
+
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata_real);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
+
+ ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_real);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Check results */
+ for(i=0; i<SPACE1_DIM1; i++) {
+ for(j=0; j<SPACE1_DIM2; j++) {
+ for(k=0; k<SPACE1_DIM3; k++) {
+ if(rdata_real[i][j][k] != wdata_real[i][j][k]) {
+ H5_FAILED();
+ printf("element [%d][%d][%d] is %d but should have been %d\n",
+ i, j, k, rdata_real[i][j][k], wdata_real[i][j][k]);
+ }
+ }
}
- }
+ }
- /* Now extend the first dimension size of the dataset to SPACE1_DIM1*3 past the maximal size.
- * It is supposed to fail. */
- extend_dims[0] = SPACE1_DIM1*3;
- H5E_BEGIN_TRY {
+ /* Now shrink the first dimension size of the dataset to 0 and make sure no data is in it */
+ extend_dims[0] = 0;
ret = H5Dset_extent(dset1, extend_dims);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Dset_extent");
-
- ret = H5Pclose(plist_id);
- CHECK(ret, FAIL, "H5Pclose");
-
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
-
- /*=================== Compact dataset =====================*/
- plist_id = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(plist_id, FAIL, "H5Pcreate");
-
- ret = H5Pset_layout(plist_id, H5D_COMPACT);
- CHECK(ret, FAIL, "H5Pset_layout");
-
- ret = H5Pset_alloc_time(plist_id, H5D_ALLOC_TIME_EARLY);
- CHECK(ret, FAIL, "H5Pset_alloc_time");
+ CHECK(ret, FAIL, "H5Dset_extent");
- dset1 = H5Dcreate2(fid1, BASICDATASET2, H5T_NATIVE_INT, sid1, H5P_DEFAULT, plist_id, H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dcreate2");
-
- /* Write "nothing" to the dataset */
- ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- CHECK(ret, FAIL, "H5Dwrite");
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
+ /* Try reading from the dataset (make certain our buffer is unmodified) */
+ ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
- /* Try reading from the dataset (make certain our buffer is unmodified) */
- ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++)
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata[i][j] != 7) {
+ H5_FAILED();
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata[i][j]);
+ }
+ }
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++)
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata[i][j]);
- }
- }
+ /* Now extend the first dimension size of the dataset to SPACE1_DIM1*3 past the maximal size.
+ * It is supposed to fail. */
+ extend_dims[0] = SPACE1_DIM1*3;
+ H5E_BEGIN_TRY {
+ ret = H5Dset_extent(dset1, extend_dims);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Dset_extent");
- ret = H5Pclose(plist_id);
- CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(plist_id);
+ CHECK(ret, FAIL, "H5Pclose");
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
- /*=========== Contiguous dataset with external storage ============*/
- plist_id = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(plist_id, FAIL, "H5Pcreate");
+ /*=================== Compact dataset =====================*/
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(plist_id, FAIL, "H5Pcreate");
- ret = H5Pset_layout(plist_id, H5D_CONTIGUOUS);
- CHECK(ret, FAIL, "H5Pset_layout");
+ ret = H5Pset_layout(plist_id, H5D_COMPACT);
+ CHECK(ret, FAIL, "H5Pset_layout");
- /* Change the DCPL for contiguous layout with external storage. The size of the reserved
- * space in the external file is the size of the dataset (zero because one dimension size is zero).
- * There's no need to clean up the external file since the library doesn't create it
- * until the data is written to it. */
- ret = H5Pset_external(plist_id, EXTFILE_NAME, (off_t)0, (hsize_t)0);
- CHECK(ret, FAIL, "H5Pset_external");
+ /* Don't set the allocation time for compact storage datasets (must be early) */
- dset1 = H5Dcreate2(fid1, BASICDATASET3, H5T_NATIVE_INT, sid1, H5P_DEFAULT, plist_id, H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dcreate2");
+ dset1 = H5Dcreate2(fid1, BASICDATASET2, H5T_NATIVE_INT, sid1, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
- /* Write "nothing" to the dataset */
- ret = H5Dwrite(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, wdata);
- CHECK(ret, FAIL, "H5Dwrite");
+ /* Write "nothing" to the dataset */
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
- /* Try reading from the dataset (make certain our buffer is unmodified) */
- ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
+ /* Try reading from the dataset (make certain our buffer is unmodified) */
+ ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++) {
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata[i][j]);
- }
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++)
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata[i][j] != 7) {
+ H5_FAILED();
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata[i][j]);
+ }
}
- }
-
- ret = H5Pclose(plist_id);
- CHECK(ret, FAIL, "H5Pclose");
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Pclose(plist_id);
+ CHECK(ret, FAIL, "H5Pclose");
- /*=============== Create an attribute for the file ================*/
- attr = H5Acreate2(fid1, NULLATTR, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
- /* Write "nothing" to the attribute */
- ret = H5Awrite(attr, H5T_NATIVE_INT, wdata);
- CHECK(ret, FAIL, "H5Awrite");
+ /*=========== Contiguous dataset with external storage ============*/
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(plist_id, FAIL, "H5Pcreate");
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
+ /* Change the DCPL for contiguous layout with external storage. The size of the reserved
+ * space in the external file is the size of the dataset (zero because one dimension size is zero).
+ * There's no need to clean up the external file since the library doesn't create it
+ * until the data is written to it. */
+ ret = H5Pset_external(plist_id, EXTFILE_NAME, (off_t)0, (hsize_t)0);
+ CHECK(ret, FAIL, "H5Pset_external");
- /* Try reading from the attribute (make certain our buffer is unmodified) */
- ret = H5Aread(attr, H5T_NATIVE_INT, rdata);
- CHECK(ret, FAIL, "H5Aread");
+ ret = H5Pset_alloc_time(plist_id, alloc_time);
+ CHECK(ret, FAIL, "H5Pset_alloc_time");
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++) {
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata[i][j]);
- }
- }
- }
+ dset1 = H5Dcreate2(fid1, BASICDATASET3, H5T_NATIVE_INT, sid1, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
- /* Write "nothing" to the attribute (with type conversion :-) */
- ret = H5Awrite(attr, H5T_NATIVE_SHORT, wdata_short);
- CHECK(ret, FAIL, "H5Awrite");
+ /* Write "nothing" to the dataset */
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
- /* Try reading from the attribute (with type conversion :-) (make certain our buffer is unmodified) */
- ret = H5Aread(attr, H5T_NATIVE_SHORT, rdata_short);
- CHECK(ret, FAIL, "H5Aread");
+ /* Try reading from the dataset (make certain our buffer is unmodified) */
+ ret = H5Dread(dset1, H5T_NATIVE_INT, sid1, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++) {
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata_short[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata_short[i][j]);
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++) {
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata[i][j] != 7) {
+ H5_FAILED();
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata[i][j]);
+ }
}
}
- }
-
- /* Close attribute */
- ret = H5Aclose(attr);
- CHECK(ret, FAIL, "H5Aclose");
-
- /*===============================================================
- * Extend the dimension to make it a normal dataspace (3x15x13).
- * Verify that data can be written to and read from the chunked
- * dataset now.
- *===============================================================
- */
- dims1[0]=SPACE1_DIM1;
- ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,max_dims);
- CHECK(ret, FAIL, "H5Sset_extent_simple");
-
- nelem = H5Sget_simple_extent_npoints(sid_chunk);
- CHECK(nelem, FAIL, "H5Sget_simple_extent_npoints");
- VERIFY(nelem, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
- "H5Sget_simple_extent_npoints");
-
- rank = H5Sget_simple_extent_ndims(sid_chunk);
- CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
- VERIFY(rank, SPACE1_RANK, "H5Sget_simple_extent_ndims");
-
- rank = H5Sget_simple_extent_dims(sid_chunk, tdims, NULL);
- CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
- VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
- /* Set it to chunked dataset */
- plist_id = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(plist_id, FAIL, "H5Pcreate");
+ ret = H5Pclose(plist_id);
+ CHECK(ret, FAIL, "H5Pclose");
- ret = H5Pset_chunk(plist_id, SPACE1_RANK, chunk_dims);
- CHECK(ret, FAIL, "H5Pset_chunk");
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
- dset1 = H5Dcreate2(fid1, BASICDATASET4, H5T_NATIVE_INT, sid_chunk, H5P_DEFAULT, plist_id, H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dcreate2");
+ /*=============== Create an attribute for the file ================*/
+ attr = H5Acreate2(fid1, NULLATTR, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
- ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata_real);
- CHECK(ret, FAIL, "H5Dwrite");
+ /* Write "nothing" to the attribute */
+ ret = H5Awrite(attr, H5T_NATIVE_INT, wdata);
+ CHECK(ret, FAIL, "H5Awrite");
- ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
- CHECK(ret, FAIL, "H5Fflush");
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
- ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_real);
- CHECK(ret, FAIL, "H5Dread");
+ /* Try reading from the attribute (make certain our buffer is unmodified) */
+ ret = H5Aread(attr, H5T_NATIVE_INT, rdata);
+ CHECK(ret, FAIL, "H5Aread");
- /* Check results */
- for(i=0; i<SPACE1_DIM1; i++) {
- for(j=0; j<SPACE1_DIM2; j++) {
- for(k=0; k<SPACE1_DIM3; k++) {
- if(rdata_real[i][j][k] != wdata_real[i][j][k]) {
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++) {
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata[i][j] != 7) {
H5_FAILED();
- printf("element [%d][%d][%d] is %d but should have been %d\n",
- i, j, k, rdata_real[i][j][k], wdata_real[i][j][k]);
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata[i][j]);
}
}
}
- }
-
- ret = H5Pclose(plist_id);
- CHECK(ret, FAIL, "H5Pclose");
-
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
-
- /* Change the dimensions to make them zero size again (0x0x0). Verify that
- * no element is in the dataspace. */
- dims1[0]=dims1[1]=dims1[2]=0;
- ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,NULL);
- CHECK(ret, FAIL, "H5Sset_extent_simple");
-
- /* Check that the dataspace actually has 0 elements */
- nelem = H5Sget_simple_extent_npoints(sid_chunk);
- VERIFY(nelem, 0, "H5Sget_simple_extent_npoints");
-
- /* Check that the dataspace was created with an "all" selection */
- sel_type = H5Sget_select_type(sid_chunk);
- VERIFY(sel_type, H5S_SEL_ALL, "H5Sget_select_type");
-
- /* Check that the dataspace has 0 elements selected */
- nelem = H5Sget_select_npoints(sid_chunk);
- VERIFY(nelem, 0, "H5Sget_select_npoints");
-
- /* Change to "none" selection */
- ret = H5Sselect_none(sid_chunk);
- CHECK(ret, FAIL, "H5Sselect_none");
-
- /* Check that the dataspace has 0 elements selected */
- nelem = H5Sget_select_npoints(sid_chunk);
- VERIFY(nelem, 0, "H5Sget_select_npoints");
-
- ret = H5Sclose(sid_chunk);
- CHECK(ret, FAIL, "H5Sclose");
-
- ret = H5Sclose(sid1);
- CHECK(ret, FAIL, "H5Sclose");
-
- ret = H5Fclose(fid1);
- CHECK(ret, FAIL, "H5Fclose");
-
- /*============================================
- * Reopen the file to check the data space
- *============================================
- */
- fid1 = H5Fopen(ZEROFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fopen");
-
- /* Reopen the chunked dataset */
- dset1 = H5Dopen2(fid1, BASICDATASET1, H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dopen2");
- /* Get the space of the dataset and querry it */
- sid1 = H5Dget_space(dset1);
- CHECK(sid1, FAIL, "H5Dget_space");
+ /* Write "nothing" to the attribute (with type conversion :-) */
+ ret = H5Awrite(attr, H5T_NATIVE_SHORT, wdata_short);
+ CHECK(ret, FAIL, "H5Awrite");
- /* Verify the class type of dataspace */
- stype = H5Sget_simple_extent_type(sid1);
- VERIFY(stype, H5S_SIMPLE, "H5Sget_simple_extent_type");
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
- /* Verify there is zero element in the dataspace */
- nelem = H5Sget_simple_extent_npoints(sid1);
- VERIFY(nelem, 0, "H5Sget_simple_extent_npoints");
+ /* Try reading from the attribute (with type conversion :-) (make certain our buffer is unmodified) */
+ ret = H5Aread(attr, H5T_NATIVE_SHORT, rdata_short);
+ CHECK(ret, FAIL, "H5Aread");
- /* Verify the dimension sizes are correct */
- rank = H5Sget_simple_extent_dims(sid1, tdims, NULL);
- CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
- VERIFY(tdims[0], 0, "H5Sget_simple_extent_dims");
- VERIFY(tdims[1], SPACE1_DIM2, "H5Sget_simple_extent_dims");
- VERIFY(tdims[2], SPACE1_DIM3, "H5Sget_simple_extent_dims");
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++) {
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata_short[i][j] != 7) {
+ H5_FAILED();
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata_short[i][j]);
+ }
+ }
+ }
- /* Try reading from the dataset (make certain our buffer is unmodified) */
- ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /*===============================================================
+ * Extend the dimension to make it a normal dataspace (3x15x13).
+ * Verify that data can be written to and read from the chunked
+ * dataset now.
+ *===============================================================
+ */
+ dims1[0]=SPACE1_DIM1;
+ ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,max_dims);
+ CHECK(ret, FAIL, "H5Sset_extent_simple");
+
+ nelem = H5Sget_simple_extent_npoints(sid_chunk);
+ CHECK(nelem, FAIL, "H5Sget_simple_extent_npoints");
+ VERIFY(nelem, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
+ "H5Sget_simple_extent_npoints");
+
+ rank = H5Sget_simple_extent_ndims(sid_chunk);
+ CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
+ VERIFY(rank, SPACE1_RANK, "H5Sget_simple_extent_ndims");
+
+ rank = H5Sget_simple_extent_dims(sid_chunk, tdims, NULL);
+ CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
+ VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
+ "H5Sget_simple_extent_dims");
+
+ /* Set it to chunked dataset */
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(plist_id, FAIL, "H5Pcreate");
+
+ ret = H5Pset_chunk(plist_id, SPACE1_RANK, chunk_dims);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ ret = H5Pset_alloc_time(plist_id, alloc_time);
+ CHECK(ret, FAIL, "H5Pset_alloc_time");
+
+ dset1 = H5Dcreate2(fid1, BASICDATASET4, H5T_NATIVE_INT, sid_chunk, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+
+ ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata_real);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ ret = H5Fflush(fid1, H5F_SCOPE_GLOBAL);
+ CHECK(ret, FAIL, "H5Fflush");
+
+ ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_real);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Check results */
+ for(i=0; i<SPACE1_DIM1; i++) {
+ for(j=0; j<SPACE1_DIM2; j++) {
+ for(k=0; k<SPACE1_DIM3; k++) {
+ if(rdata_real[i][j][k] != wdata_real[i][j][k]) {
+ H5_FAILED();
+ printf("element [%d][%d][%d] is %d but should have been %d\n",
+ i, j, k, rdata_real[i][j][k], wdata_real[i][j][k]);
+ }
+ }
+ }
+ }
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++) {
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata[i][j]);
+ ret = H5Pclose(plist_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Change the dimensions to make them zero size again (0x0x0). Verify that
+ * no element is in the dataspace. */
+ dims1[0]=dims1[1]=dims1[2]=0;
+ ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,NULL);
+ CHECK(ret, FAIL, "H5Sset_extent_simple");
+
+ /* Check that the dataspace actually has 0 elements */
+ nelem = H5Sget_simple_extent_npoints(sid_chunk);
+ VERIFY(nelem, 0, "H5Sget_simple_extent_npoints");
+
+ /* Check that the dataspace was created with an "all" selection */
+ sel_type = H5Sget_select_type(sid_chunk);
+ VERIFY(sel_type, H5S_SEL_ALL, "H5Sget_select_type");
+
+ /* Check that the dataspace has 0 elements selected */
+ nelem = H5Sget_select_npoints(sid_chunk);
+ VERIFY(nelem, 0, "H5Sget_select_npoints");
+
+ /* Change to "none" selection */
+ ret = H5Sselect_none(sid_chunk);
+ CHECK(ret, FAIL, "H5Sselect_none");
+
+ /* Check that the dataspace has 0 elements selected */
+ nelem = H5Sget_select_npoints(sid_chunk);
+ VERIFY(nelem, 0, "H5Sget_select_npoints");
+
+ ret = H5Sclose(sid_chunk);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /*============================================
+ * Reopen the file to check the data space
+ *============================================
+ */
+ fid1 = H5Fopen(ZEROFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fopen");
+
+ /* Reopen the chunked dataset */
+ dset1 = H5Dopen2(fid1, BASICDATASET1, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dopen2");
+
+ /* Get the space of the dataset and querry it */
+ sid1 = H5Dget_space(dset1);
+ CHECK(sid1, FAIL, "H5Dget_space");
+
+ /* Verify the class type of dataspace */
+ stype = H5Sget_simple_extent_type(sid1);
+ VERIFY(stype, H5S_SIMPLE, "H5Sget_simple_extent_type");
+
+ /* Verify there is zero element in the dataspace */
+ nelem = H5Sget_simple_extent_npoints(sid1);
+ VERIFY(nelem, 0, "H5Sget_simple_extent_npoints");
+
+ /* Verify the dimension sizes are correct */
+ rank = H5Sget_simple_extent_dims(sid1, tdims, NULL);
+ CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
+ VERIFY(tdims[0], 0, "H5Sget_simple_extent_dims");
+ VERIFY(tdims[1], SPACE1_DIM2, "H5Sget_simple_extent_dims");
+ VERIFY(tdims[2], SPACE1_DIM3, "H5Sget_simple_extent_dims");
+
+ /* Try reading from the dataset (make certain our buffer is unmodified) */
+ ret = H5Dread(dset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++) {
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata[i][j] != 7) {
+ H5_FAILED();
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata[i][j]);
+ }
}
}
- }
- /* Close the dataset and its dataspace */
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Close the dataset and its dataspace */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
- ret = H5Sclose(sid1);
- CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
- /* Open the attribute for the file */
- attr = H5Aopen(fid1, NULLATTR, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Aopen");
+ /* Open the attribute for the file */
+ attr = H5Aopen(fid1, NULLATTR, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Aopen");
- /* Get the space of the dataset */
- attr_sid = H5Aget_space(attr);
- CHECK(attr_sid, FAIL, "H5Aget_space");
+ /* Get the space of the dataset */
+ attr_sid = H5Aget_space(attr);
+ CHECK(attr_sid, FAIL, "H5Aget_space");
- /* Verify the class type of dataspace */
- stype = H5Sget_simple_extent_type(attr_sid);
- VERIFY(stype, H5S_SIMPLE, "H5Sget_simple_extent_type");
+ /* Verify the class type of dataspace */
+ stype = H5Sget_simple_extent_type(attr_sid);
+ VERIFY(stype, H5S_SIMPLE, "H5Sget_simple_extent_type");
- /* Verify there is zero element in the dataspace */
- nelem = H5Sget_simple_extent_npoints(attr_sid);
- VERIFY(nelem, 0, "H5Sget_simple_extent_npoints");
+ /* Verify there is zero element in the dataspace */
+ nelem = H5Sget_simple_extent_npoints(attr_sid);
+ VERIFY(nelem, 0, "H5Sget_simple_extent_npoints");
- /* Try reading from the attribute (make certain our buffer is unmodified) */
- ret = H5Aread(attr, H5T_NATIVE_SHORT, rdata_short);
- CHECK(ret, FAIL, "H5Aread");
+ /* Try reading from the attribute (make certain our buffer is unmodified) */
+ ret = H5Aread(attr, H5T_NATIVE_SHORT, rdata_short);
+ CHECK(ret, FAIL, "H5Aread");
- /* Check results */
- for(i=0; i<SPACE1_DIM2; i++) {
- for(j=0; j<SPACE1_DIM3; j++) {
- if(rdata_short[i][j] != 7) {
- H5_FAILED();
- printf("element [%d][%d] is %d but should have been 7\n",
- i, j, rdata_short[i][j]);
+ /* Check results */
+ for(i=0; i<SPACE1_DIM2; i++) {
+ for(j=0; j<SPACE1_DIM3; j++) {
+ if(rdata_short[i][j] != 7) {
+ H5_FAILED();
+ printf("element [%d][%d] is %d but should have been 7\n",
+ i, j, rdata_short[i][j]);
+ }
}
}
- }
- /* Close attribute */
- ret=H5Aclose(attr);
- CHECK(ret, FAIL, "H5Aclose");
+ /* Close attribute */
+ ret=H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
- /* Close the dataspace */
- ret = H5Sclose(attr_sid);
- CHECK(ret, FAIL, "H5Sclose");
+ /* Close the dataspace */
+ ret = H5Sclose(attr_sid);
+ CHECK(ret, FAIL, "H5Sclose");
- ret = H5Fclose(fid1);
- CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_zero_dim() */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+ } /* end for */
+} /* test_h5s_zero_dim() */
/****************************************************************
diff --git a/test/tmisc.c b/test/tmisc.c
index cb61eaa..5539cee 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -15,7 +15,7 @@
/***********************************************************
*
-* Test program: tmisc
+* Test program: tmisc
*
* Test miscellaneous features not tested elsewhere. Generally
* regression tests for bugs that are reported and don't
@@ -23,7 +23,7 @@
*
*************************************************************/
-#define H5D_PACKAGE /*suppress error about including H5Dpkg */
+#define H5D_PACKAGE /*suppress error about including H5Dpkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5D_TESTING
@@ -31,10 +31,10 @@
#include "hdf5.h"
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5Dpkg.h" /* Datasets */
+#include "H5Dpkg.h" /* Datasets */
/* Definitions for misc. test #1 */
-#define MISC1_FILE "tmisc1.h5"
+#define MISC1_FILE "tmisc1.h5"
#define MISC1_VAL (13417386) /* 0xccbbaa */
#define MISC1_VAL2 (15654348) /* 0xeeddcc */
#define MISC1_DSET_NAME "/scalar_set"
@@ -166,8 +166,8 @@ typedef struct
/* Definitions for misc. test #12 */
#define MISC12_FILE "tmisc12.h5"
#define MISC12_DSET_NAME "Dataset"
-#define MISC12_SPACE1_RANK 1
-#define MISC12_SPACE1_DIM1 4
+#define MISC12_SPACE1_RANK 1
+#define MISC12_SPACE1_DIM1 4
#define MISC12_CHUNK_SIZE 2
#define MISC12_APPEND_SIZE 5
@@ -453,7 +453,7 @@ static void test_misc2_write_attribute(void)
ret = H5Aread(att1, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- free(data_check.string);
+ HDfree(data_check.string);
ret = H5Aclose(att1);
CHECK(ret, FAIL, "HAclose");
@@ -464,8 +464,6 @@ static void test_misc2_write_attribute(void)
ret = H5Fclose(file1);
CHECK(ret, FAIL, "H5Fclose");
-
-
root2 = H5Gopen2(file2, "/", H5P_DEFAULT);
CHECK(root2, FAIL, "H5Gopen2");
@@ -480,7 +478,7 @@ static void test_misc2_write_attribute(void)
ret = H5Aread(att2, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- free(data_check.string);
+ HDfree(data_check.string);
ret = H5Aclose(att2);
CHECK(ret, FAIL, "HAclose");
@@ -497,8 +495,8 @@ static void test_misc2_write_attribute(void)
ret = H5Fclose(file2);
CHECK(ret, FAIL, "H5Fclose");
- free(string_att1);
- free(string_att2);
+ HDfree(string_att1);
+ HDfree(string_att2);
return;
}
@@ -524,7 +522,7 @@ static void test_misc2_read_attribute(const char *filename, const char *att_name
ret = H5Aread(att, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- free(data_check.string);
+ HDfree(data_check.string);
ret = H5Aclose(att);
CHECK(ret, FAIL, "H5Aclose");
@@ -732,7 +730,7 @@ delete_struct3(misc5_struct3_hndl *str3hndl)
ret=H5Tclose(str3hndl->st3h_base);
CHECK(ret,FAIL,"H5Tclose");
- free(str3hndl);
+ HDfree(str3hndl);
}
static void
@@ -783,7 +781,7 @@ delete_struct2(misc5_struct2_hndl *str2hndl)
H5Tclose(str2hndl->st2h_base);
CHECK(ret,FAIL,"H5Tclose");
- free(str2hndl);
+ HDfree(str2hndl);
}
static void
@@ -794,7 +792,7 @@ set_struct2(misc5_struct2 *buf)
buf->st2_el1=MISC5_DBGELVAL2;
buf->st2_el2.len=MISC5_DBGNELM3;
- buf->st2_el2.p=malloc((buf->st2_el2.len)*sizeof(misc5_struct3));
+ buf->st2_el2.p=HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3));
CHECK(buf->st2_el2.p,NULL,"malloc");
for(i=0; i<(buf->st2_el2.len); i++)
@@ -804,7 +802,7 @@ set_struct2(misc5_struct2 *buf)
static void
clear_struct2(misc5_struct2 *buf)
{
- free(buf->st2_el2.p);
+ HDfree(buf->st2_el2.p);
}
/*********************** struct1 ***********************/
@@ -849,7 +847,7 @@ delete_struct1(misc5_struct1_hndl *str1hndl)
ret=H5Tclose(str1hndl->st1h_base);
CHECK(ret,FAIL,"H5Tclose");
- free(str1hndl);
+ HDfree(str1hndl);
}
static void
@@ -860,7 +858,7 @@ set_struct1(misc5_struct1 *buf)
buf->st1_el1=MISC5_DBGELVAL1;
buf->st1_el2.len=MISC5_DBGNELM2;
- buf->st1_el2.p=malloc((buf->st1_el2.len)*sizeof(misc5_struct2));
+ buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2));
CHECK(buf->st1_el2.p,NULL,"malloc");
for(i=0; i<(buf->st1_el2.len); i++)
@@ -874,7 +872,7 @@ clear_struct1(misc5_struct1 *buf)
for(i=0;i<buf->st1_el2.len;i++)
clear_struct2(&((( misc5_struct2 *)(buf->st1_el2.p))[i]));
- free(buf->st1_el2.p);
+ HDfree(buf->st1_el2.p);
}
static void
@@ -910,7 +908,7 @@ test_misc5(void)
/* Create the variable-length buffer */
buf.len = MISC5_DBGNELM1;
- buf.p = malloc((buf.len) * sizeof(misc5_struct1));
+ buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1));
CHECK(buf.p, NULL, "malloc");
/* Create the top-level VL information */
@@ -926,7 +924,7 @@ test_misc5(void)
clear_struct1(&(((misc5_struct1 *)(buf.p))[j]));
/* Free the variable-length buffer */
- free(buf.p);
+ HDfree(buf.p);
/* Close dataset */
ret = H5Dclose(dataset_id);
@@ -1236,10 +1234,10 @@ test_misc8(void)
MESSAGE(5, ("Testing dataset storage sizes\n"));
/* Allocate space for the data to write & read */
- wdata=malloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1);
+ wdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1);
CHECK(wdata,NULL,"malloc");
#ifdef VERIFY_DATA
- rdata=malloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1);
+ rdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1);
CHECK(rdata,NULL,"malloc");
#endif /* VERIFY_DATA */
@@ -1677,7 +1675,7 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free the read & write buffers */
- free(wdata);
+ HDfree(wdata);
#ifdef VERIFY_DATA
free(rdata);
#endif /* VERIFY_DATA */
@@ -1800,10 +1798,10 @@ test_misc11(void)
unsigned sym_ik; /* Symbol table B-tree initial 'K' value */
unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */
unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */
- unsigned nindexes; /* Shared message number of indexes */
- H5F_info2_t finfo; /* global information about file */
- H5F_file_space_type_t strategy; /* File/free space strategy */
- hsize_t threshold; /* Free-space section threshold */
+ unsigned nindexes; /* Shared message number of indexes */
+ H5F_info2_t finfo; /* global information about file */
+ H5F_file_space_type_t strategy; /* File/free space strategy */
+ hsize_t threshold; /* Free-space section threshold */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1958,10 +1956,10 @@ test_misc12(void)
hsize_t dimsn[] = {MISC12_APPEND_SIZE};
hsize_t maxdims1[1] = {H5S_UNLIMITED};
hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE};
- hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE};
- hsize_t offset[1] = {MISC12_SPACE1_DIM1};
- hsize_t count[1] = {MISC12_APPEND_SIZE};
- int i; /* counting variable */
+ hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE};
+ hsize_t offset[1] = {MISC12_SPACE1_DIM1};
+ hsize_t count[1] = {MISC12_APPEND_SIZE};
+ int i; /* counting variable */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -2215,7 +2213,7 @@ create_hdf_file(const char *name)
/* Close the file */
ret = H5Fclose(fid);
- assert(ret >= 0);
+ HDassert(ret >= 0);
CHECK(ret, FAIL, "H5Fclose");
}
@@ -2245,7 +2243,7 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz
VERIFY(written, size, "HDfwrite");
/* Open the old file */
- old_fp=fopen(old_name,"rb");
+ old_fp=HDfopen(old_name,"rb");
CHECK(old_fp, NULL, "HDfopen");
/* Allocate space for the copy buffer */
@@ -2268,10 +2266,10 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz
VERIFY(ret, 0, "HDfclose");
/* Free the copy buffer */
- free(copy_buf);
+ HDfree(copy_buf);
/* Free the user block */
- free(user_block);
+ HDfree(user_block);
}
static void
@@ -4452,7 +4450,6 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Fclose");
-
/* Re-open file */
fid = H5Fopen(MISC25A_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -4496,7 +4493,6 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Fclose");
-
/* Re-open file */
fid = H5Fopen(MISC25A_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -5125,7 +5121,7 @@ test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t UNUSED
{
H5O_info_t object_info;
- return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT);
+ return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT);
}
static int
@@ -5174,7 +5170,7 @@ test_misc30(void)
CHECK(fid, FAIL, "H5Fopen");
if(get_info) {
- ret = test_misc30_get_info(fid);
+ ret = test_misc30_get_info(fid);
CHECK(ret, FAIL, "test_misc30_get_info");
}
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index d2f061d..33cf765 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -3047,3 +3047,328 @@ actual_io_mode_tests(void) {
test_actual_io_mode(TEST_ACTUAL_IO_RESET);
return;
}
+
+/*
+ * Test consistency semantics of atomic mode
+ */
+
+/*
+ * Example of using the parallel HDF5 library to create a dataset,
+ * where process 0 writes and the other processes read at the same
+ * time. If atomic mode is set correctly, the other processes should
+ * read the old values in the dataset or the new ones.
+ */
+
+void
+dataset_atomicity(void)
+{
+ hid_t fid; /* HDF5 file ID */
+ hid_t acc_tpl; /* File access templates */
+ hid_t sid; /* Dataspace ID */
+ hid_t dataset1; /* Dataset IDs */
+ hbool_t use_gpfs = FALSE; /* Use GPFS hints */
+ hsize_t dims[RANK]; /* dataset dim sizes */
+ int *write_buf = NULL; /* data buffer */
+ int *read_buf = NULL; /* data buffer */
+ int buf_size;
+ hid_t dataset2;
+ hid_t file_dataspace; /* File dataspace ID */
+ hid_t mem_dataspace; /* Memory dataspace ID */
+ hsize_t start[RANK];
+ hsize_t stride[RANK];
+ hsize_t count[RANK];
+ hsize_t block[RANK];
+ const char *filename;
+ herr_t ret; /* Generic return value */
+ int mpi_size, mpi_rank;
+ int i, j, k;
+ hbool_t atomicity = FALSE;
+ MPI_Comm comm = MPI_COMM_WORLD;
+ MPI_Info info = MPI_INFO_NULL;
+
+ dim0 = 64; dim1 = 32;
+ filename = GetTestParameters();
+ if(VERBOSE_MED)
+ printf("Independent write test on file %s\n", filename);
+
+ /* set up MPI parameters */
+ MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
+
+ buf_size = dim0 * dim1;
+ /* allocate memory for data buffer */
+ write_buf = (int *)calloc(buf_size, sizeof(int));
+ VRFY((write_buf != NULL), "write_buf malloc succeeded");
+ /* allocate memory for data buffer */
+ read_buf = (int *)calloc(buf_size, sizeof(int));
+ VRFY((read_buf != NULL), "read_buf malloc succeeded");
+
+ /* setup file access template */
+ acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs);
+ VRFY((acc_tpl >= 0), "");
+
+ /* create the file collectively */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
+ VRFY((fid >= 0), "H5Fcreate succeeded");
+
+ /* Release file-access template */
+ ret = H5Pclose(acc_tpl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+
+ /* setup dimensionality object */
+ dims[0] = dim0;
+ dims[1] = dim1;
+ sid = H5Screate_simple (RANK, dims, NULL);
+ VRFY((sid >= 0), "H5Screate_simple succeeded");
+
+ /* create datasets */
+ dataset1 = H5Dcreate2(fid, DATASETNAME5, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
+
+ dataset2 = H5Dcreate2(fid, DATASETNAME6, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset2 >= 0), "H5Dcreate2 succeeded");
+
+ /* initialize datasets to 0s */
+ if (0 == mpi_rank) {
+ ret = H5Dwrite(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, write_buf);
+ VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
+
+ ret = H5Dwrite(dataset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, write_buf);
+ VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
+ }
+
+ ret = H5Dclose(dataset1);
+ VRFY((ret >= 0), "H5Dclose succeeded");
+ ret = H5Dclose(dataset2);
+ VRFY((ret >= 0), "H5Dclose succeeded");
+ ret = H5Sclose(sid);
+ VRFY((ret >= 0), "H5Sclose succeeded");
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
+
+ MPI_Barrier (comm);
+
+ /* make sure setting atomicity fails on a serial file ID */
+ /* open the file collectively */
+ fid=H5Fopen(filename,H5F_ACC_RDWR,H5P_DEFAULT);
+ VRFY((fid >= 0), "H5Fopen succeeed");
+
+ /* should fail */
+ ret = H5Fset_mpi_atomicity (fid , TRUE);
+ VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed");
+
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
+
+ MPI_Barrier (comm);
+
+ /* setup file access template */
+ acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs);
+ VRFY((acc_tpl >= 0), "");
+
+ /* open the file collectively */
+ fid=H5Fopen(filename,H5F_ACC_RDWR,acc_tpl);
+ VRFY((fid >= 0), "H5Fopen succeeded");
+
+ /* Release file-access template */
+ ret = H5Pclose(acc_tpl);
+ VRFY((ret >= 0), "H5Pclose succeeded");
+
+ ret = H5Fset_mpi_atomicity (fid , TRUE);
+ VRFY((ret >= 0), "H5Fset_mpi_atomicity succeeded");
+
+ /* open dataset1 (contiguous case) */
+ dataset1 = H5Dopen2(fid, DATASETNAME5, H5P_DEFAULT);
+ VRFY((dataset1 >= 0), "H5Dopen2 succeeded");
+
+ if (0 == mpi_rank) {
+ for (i=0 ; i<buf_size ; i++) {
+ write_buf[i] = 5;
+ }
+ }
+ else {
+ for (i=0 ; i<buf_size ; i++) {
+ read_buf[i] = 8;
+ }
+ }
+
+ /* check that the atomicity flag is set */
+ ret = H5Fget_mpi_atomicity (fid , &atomicity);
+ VRFY((ret >= 0), "atomcity get failed");
+ VRFY((atomicity == TRUE), "atomcity set failed");
+
+ MPI_Barrier (comm);
+
+ /* Process 0 writes contiguously to the entire dataset */
+ if (0 == mpi_rank) {
+ ret = H5Dwrite(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf);
+ VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
+ }
+ /* The other processes read the entire dataset */
+ else {
+ ret = H5Dread(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf);
+ VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded");
+ }
+
+ if(VERBOSE_MED) {
+ i=0;j=0;k=0;
+ for (i=0 ; i<dim0 ; i++) {
+ printf ("\n");
+ for (j=0 ; j<dim1 ; j++)
+ printf ("%d ", read_buf[k++]);
+ }
+ }
+
+ /* The processes that read the dataset must either read all values
+ as 0 (read happened before process 0 wrote to dataset 1), or 5
+ (read happened after process 0 wrote to dataset 1) */
+ if (0 != mpi_rank) {
+ int compare = read_buf[0];
+
+ VRFY((compare == 0 || compare == 5),
+ "Atomicity Test Failed Process %d: Value read should be 0 or 5\n");
+ for (i=1; i<buf_size; i++) {
+ if (read_buf[i] != compare) {
+ printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, i, read_buf[i], compare);
+ nerrors ++;
+ }
+ }
+ }
+
+ ret = H5Dclose(dataset1);
+ VRFY((ret >= 0), "H5D close succeeded");
+
+ /* release data buffers */
+ if(write_buf) free(write_buf);
+ if(read_buf) free(read_buf);
+
+ /* open dataset2 (non-contiguous case) */
+ dataset2 = H5Dopen2(fid, DATASETNAME6, H5P_DEFAULT);
+ VRFY((dataset2 >= 0), "H5Dopen2 succeeded");
+
+ /* allocate memory for data buffer */
+ write_buf = (int *)calloc(buf_size, sizeof(int));
+ VRFY((write_buf != NULL), "write_buf malloc succeeded");
+ /* allocate memory for data buffer */
+ read_buf = (int *)calloc(buf_size, sizeof(int));
+ VRFY((read_buf != NULL), "read_buf malloc succeeded");
+
+ for (i=0 ; i<buf_size ; i++) {
+ write_buf[i] = 5;
+ }
+ for (i=0 ; i<buf_size ; i++) {
+ read_buf[i] = 8;
+ }
+
+ atomicity = FALSE;
+ /* check that the atomicity flag is set */
+ ret = H5Fget_mpi_atomicity (fid , &atomicity);
+ VRFY((ret >= 0), "atomcity get failed");
+ VRFY((atomicity == TRUE), "atomcity set failed");
+
+
+ block[0] = dim0/mpi_size - 1;
+ block[1] = dim1/mpi_size - 1;
+ stride[0] = block[0] + 1;
+ stride[1] = block[1] + 1;
+ count[0] = mpi_size;
+ count[1] = mpi_size;
+ start[0] = 0;
+ start[1] = 0;
+
+ /* create a file dataspace */
+ file_dataspace = H5Dget_space (dataset2);
+ VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
+
+ /* create a memory dataspace */
+ mem_dataspace = H5Screate_simple (RANK, dims, NULL);
+ VRFY((mem_dataspace >= 0), "");
+
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
+
+ MPI_Barrier (comm);
+
+ /* Process 0 writes to the dataset */
+ if (0 == mpi_rank) {
+ ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
+ H5P_DEFAULT, write_buf);
+ VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
+ }
+ /* All processes wait for the write to finish. This works because
+ atomicity is set to true */
+ MPI_Barrier (comm);
+ /* The other processes read the entire dataset */
+ if (0 != mpi_rank) {
+ ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
+ H5P_DEFAULT, read_buf);
+ VRFY((ret >= 0), "H5Dread dataset2 succeeded");
+ }
+
+ if(VERBOSE_MED) {
+ if (mpi_rank == 1) {
+ i=0;j=0;k=0;
+ for (i=0 ; i<dim0 ; i++) {
+ printf ("\n");
+ for (j=0 ; j<dim1 ; j++)
+ printf ("%d ", read_buf[k++]);
+ }
+ printf ("\n");
+ }
+ }
+
+ /* The processes that read the dataset must either read all values
+ as 5 (read happened after process 0 wrote to dataset 1) */
+ if (0 != mpi_rank) {
+ int compare;
+ i=0;j=0;k=0;
+
+ compare = 5;
+
+ for (i=0 ; i<dim0 ; i++) {
+ if (i >= mpi_rank*(block[0]+1)) {
+ break;
+ }
+ if ((i+1)%(block[0]+1)==0) {
+ k += dim1;
+ continue;
+ }
+ for (j=0 ; j<dim1 ; j++) {
+ if (j >= mpi_rank*(block[1]+1)) {
+ k += dim1 - mpi_rank*(block[1]+1);
+ break;
+ }
+ if ((j+1)%(block[1]+1)==0) {
+ k++;
+ continue;
+ }
+ else if (compare != read_buf[k]) {
+ printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, k, read_buf[k], compare);
+ nerrors++;
+ }
+ k ++;
+ }
+ }
+ }
+
+ ret = H5Dclose(dataset2);
+ VRFY((ret >= 0), "H5Dclose succeeded");
+ ret = H5Sclose(file_dataspace);
+ VRFY((ret >= 0), "H5Sclose succeeded");
+ ret = H5Sclose(mem_dataspace);
+ VRFY((ret >= 0), "H5Sclose succeeded");
+
+ /* release data buffers */
+ if(write_buf) free(write_buf);
+ if(read_buf) free(read_buf);
+
+ ret = H5Fclose(fid);
+ VRFY((ret >= 0), "H5Fclose succeeded");
+
+}
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index e3c72ef..4ec05ca 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -512,6 +512,18 @@ int main(int argc, char **argv)
/* Parse command line arguments */
TestParseCmdLine(argc, argv);
+ if((mpi_size < 2)&& MAINPROCESS ) {
+ printf("Atomicity tests need at least 2 processes to participate\n");
+ printf("8 is more recommended.. Atomicity tests will be skipped \n");
+ }
+ else if (facc_type != FACC_MPIO && MAINPROCESS) {
+ printf("Atomicity tests will not work with a non MPIO VFD\n");
+ }
+ else if(mpi_size >= 2 && facc_type == FACC_MPIO){
+ AddTest("atomicity", dataset_atomicity, NULL,
+ "dataset atomic updates", PARATESTFILE);
+ }
+
if (facc_type == FACC_MPIPOSIX && MAINPROCESS){
printf("===================================\n"
" Using MPIPOSIX driver\n"
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index 11656f9..15ef75f 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -43,6 +43,8 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD,
#define DATASETNAME2 "Data2"
#define DATASETNAME3 "Data3"
#define DATASETNAME4 "Data4"
+#define DATASETNAME5 "Data5"
+#define DATASETNAME6 "Data6"
/* Hyperslab layout styles */
#define BYROW 1 /* divide into slabs of rows */
@@ -225,6 +227,7 @@ void independent_group_read(void);
void test_fapl_mpio_dup(void);
void test_fapl_mpiposix_dup(void);
void test_split_comm_access(void);
+void dataset_atomicity(void);
void dataset_writeInd(void);
void dataset_writeAll(void);
void extend_writeInd(void);
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index fad517c..6cdfcac 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
# If testing was NOT enabled, then we need to build the tools library
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt
index b0b9aa8..f9e7c12 100644
--- a/tools/h5copy/CMakeLists.txt
+++ b/tools/h5copy/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5COPY)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
# Add the h5copy and test executables
@@ -27,7 +26,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c)
TARGET_NAMING (h5copygentest ${LIB_TYPE})
- TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c
index fb8bb81..574ba94 100644
--- a/tools/h5copy/h5copy.c
+++ b/tools/h5copy/h5copy.c
@@ -55,7 +55,7 @@ static void
leave(int ret)
{
h5tools_close();
- exit(ret);
+ HDexit(ret);
}
@@ -75,7 +75,7 @@ leave(int ret)
static void
usage (void)
{
- fprintf(stdout, "\
+ HDfprintf(stdout, "\
usage: h5copy [OPTIONS] [OBJECTS...]\n\
OBJECTS\n\
-i, --input input file name\n\
@@ -219,6 +219,7 @@ main (int argc, const char *argv[])
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+
/* initialize h5tools lib */
h5tools_init();
@@ -464,7 +465,7 @@ main (int argc, const char *argv[])
/* free link info path */
if (linkinfo.trg_path)
- HDfree(linkinfo.trg_path);
+ HDfree((char*)linkinfo.trg_path);
/* close propertis */
if(H5Pclose(ocpl_id)<0)
@@ -496,7 +497,7 @@ error:
/* free link info path */
if (linkinfo.trg_path)
- HDfree(linkinfo.trg_path);
+ HDfree((char*)linkinfo.trg_path);
H5E_BEGIN_TRY {
H5Pclose(ocpl_id);
diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c
index 85bcb29..e658e92 100644
--- a/tools/h5copy/h5copygentest.c
+++ b/tools/h5copy/h5copygentest.c
@@ -19,10 +19,6 @@
#include <stdlib.h>
#include "hdf5.h"
#include "H5private.h"
-#include "h5tools.h"
-
-/* Name of tool */
-#define PROGRAMNAME "h5copygentest"
/* HDF file names */
#define HDF_FILE1 "h5copytst.h5"
@@ -365,7 +361,7 @@ static void gent_empty_group(hid_t loc_id)
* Function: gent_nested_datasets
*
* Purpose: Generate a group in a location and populate it with the "standard"
- * datasets
+ * datasets
*
*-------------------------------------------------------------------------
*/
@@ -387,7 +383,7 @@ static void gent_nested_datasets(hid_t loc_id)
* Function: gent_nested_group
*
* Purpose: Generate a group in a location and populate it with another group
- * containing the "standard" datasets
+ * containing the "standard" datasets
*
*-------------------------------------------------------------------------
*/
@@ -891,9 +887,6 @@ out:
int main(void)
{
- h5tools_setprogname(PROGRAMNAME);
- h5tools_setstatus(EXIT_SUCCESS);
-
Test_Obj_Copy();
Test_Ref_Copy();
Test_Extlink_Copy();
diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt
index 1fa1cf3..dfd1800 100644
--- a/tools/h5diff/CMakeLists.txt
+++ b/tools/h5diff/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5DIFF)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
# Add the h5diff executables
@@ -43,7 +42,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c)
TARGET_NAMING (h5diffgentest ${LIB_TYPE})
- TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>)
@@ -131,11 +130,18 @@ IF (BUILD_TESTING)
h5diff_458.txt
h5diff_459.txt
h5diff_465.txt
+ h5diff_466.txt
+ h5diff_467.txt
+ h5diff_468.txt
+ h5diff_469.txt
h5diff_480.txt
h5diff_481.txt
h5diff_482.txt
h5diff_483.txt
h5diff_484.txt
+ h5diff_485.txt
+ h5diff_486.txt
+ h5diff_487.txt
h5diff_50.txt
h5diff_51.txt
h5diff_52.txt
@@ -250,6 +256,8 @@ IF (BUILD_TESTING)
h5diff_exclude1-2.h5
h5diff_exclude2-1.h5
h5diff_exclude2-2.h5
+ h5diff_exclude3-1.h5
+ h5diff_exclude3-2.h5
h5diff_comp_vl_strs.h5
h5diff_attr_v_level1.h5
h5diff_attr_v_level2.h5
@@ -487,6 +495,9 @@ IF (BUILD_TESTING)
# different structure and obj names
SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5)
SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5)
+ # Only one file contains unique objs. Common objs are same.
+ SET (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5)
+ SET (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5)
# compound type with multiple vlen string types
SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5)
# container types (array,vlen) with multiple nested compound types
@@ -658,6 +669,14 @@ IF (BUILD_TESTING)
h5diff_459.out.err
h5diff_465.out
h5diff_465.out.err
+ h5diff_466.out
+ h5diff_466.out.err
+ h5diff_467.out
+ h5diff_467.out.err
+ h5diff_468.out
+ h5diff_468.out.err
+ h5diff_469.out
+ h5diff_469.out.err
h5diff_480.out
h5diff_480.out.err
h5diff_481.out
@@ -1267,7 +1286,16 @@ ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} $
# dangling link --follow-symlinks (obj vs obj)
# (HDFFV-7836)
-ADD_H5_TEST (h5diff_465 1 --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1)
+ADD_H5_TEST (h5diff_465 0 --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1)
+# (HDFFV-7835)
+# soft dangling vs. soft dangling
+ADD_H5_TEST (h5diff_466 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1)
+# soft link vs. soft dangling
+ADD_H5_TEST (h5diff_467 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2)
+# ext dangling vs. ext dangling
+ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4)
+# ext link vs. ext dangling
+ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2)
# ##############################################################################
# # test for group diff recursivly
@@ -1339,6 +1367,16 @@ ADD_H5_TEST (h5diff_483 1 -v --exclude-path "/group1" ${EXCLUDE_FILE2_1} ${EXCLU
# Exclude from group compare
ADD_H5_TEST (h5diff_484 0 -v --exclude-path "/dset3" ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2} /group1)
+#
+# Only one file contains unique objs. Common objs are same.
+# (HDFFV-7837)
+#
+ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5)
+ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5)
+ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5)
+
+
+
# ##############################################################################
# # diff various multiple vlen and fixed strings in a compound type dataset
# ##############################################################################
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index f7532f2..b8e46f3 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -17,6 +17,7 @@
#include <string.h>
#include "h5diff.h"
#include "h5diff_common.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
static int check_n_input( const char* );
@@ -53,7 +54,7 @@ static struct long_options l_opts[] = {
*
*-------------------------------------------------------------------------
*/
-static check_options(diff_opt_t* options)
+static void check_options(diff_opt_t* options)
{
/*--------------------------------------------------------------
* check for mutually exclusive options
@@ -179,7 +180,7 @@ void parse_command_line(int argc,
}
/* init */
- exclude_node->obj_path = opt_arg;
+ exclude_node->obj_path = (char*)opt_arg;
exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN;
exclude_prev = exclude_head;
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c
index a014a9e..607d58e 100644
--- a/tools/h5diff/h5diff_main.c
+++ b/tools/h5diff/h5diff_main.c
@@ -18,6 +18,7 @@
#include <memory.h>
#include "h5diff.h"
#include "h5diff_common.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
@@ -81,11 +82,14 @@ int main(int argc, const char *argv[])
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+
+ /* Initialize h5tools lib */
+ h5tools_init();
+
/*-------------------------------------------------------------------------
* process the command-line
*-------------------------------------------------------------------------
*/
-
parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
/*-------------------------------------------------------------------------
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index b29ed41..b57c98a 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -17,12 +17,18 @@
#include <stdlib.h>
#include "hdf5.h"
#include "H5private.h"
-#include "h5tools.h"
-#include "h5tools_utils.h"
-
-/* Name of tool */
-#define PROGRAMNAME "h5diffgentest"
+/*
+ * The output functions need a temporary buffer to hold a piece of the
+ * dataset while it's being printed. This constant sets the limit on the
+ * size of that temporary buffer in bytes. For efficiency's sake, choose the
+ * largest value suitable for your machine (for testing use a small value).
+ */
+/* Maximum size used in a call to malloc for a dataset
+ * NOTE: this value should stay in sync with the value defined in the tools
+ * library file: h5tools_utils.h
+ */
+hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024);
/*-------------------------------------------------------------------------
* Program: h5diffgentest
@@ -71,6 +77,9 @@
/* different structure and obj names */
#define EXCLUDE_FILE2_1 "h5diff_exclude2-1.h5"
#define EXCLUDE_FILE2_2 "h5diff_exclude2-2.h5"
+/* only one file has unique objs */
+#define EXCLUDE_FILE3_1 "h5diff_exclude3-1.h5"
+#define EXCLUDE_FILE3_2 "h5diff_exclude3-2.h5"
/* compound type with multiple vlen string types */
#define COMP_VL_STRS_FILE "h5diff_comp_vl_strs.h5"
/* attribute compre with verbose level */
@@ -138,6 +147,7 @@ static int test_group_recurse(const char *fname1, const char *fname2);
static int test_group_recurse2(void);
static int test_exclude_obj1(const char *fname1, const char *fname2);
static int test_exclude_obj2(const char *fname1, const char *fname2);
+static int test_exclude_obj3(const char *fname1, const char *fname2);
static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new);
static int test_attributes_verbose_level(const char *fname1, const char *fname2);
static int test_enums(const char *fname);
@@ -207,6 +217,7 @@ int main(void)
test_exclude_obj1(EXCLUDE_FILE1_1, EXCLUDE_FILE1_2);
test_exclude_obj2(EXCLUDE_FILE2_1, EXCLUDE_FILE2_2);
+ test_exclude_obj3(EXCLUDE_FILE3_1, EXCLUDE_FILE3_2);
/* diff various multiple vlen and fixlen string types in a compound dataset */
test_comp_vlen_strings(COMP_VL_STRS_FILE, "group", 1);
@@ -3338,6 +3349,100 @@ out:
/*-------------------------------------------------------------------------
*
+* Purpose: Create test files for excluding obj.
+* Only one file contains unique objs. Common objs are same.
+* Test : exclude unique objs to verify the rest are same
+* - HDFFV-7837
+*
+* Programmer: Jonathan Kim (Mar, 19, 2012)
+*
+*-------------------------------------------------------------------------*/
+static int test_exclude_obj3(const char *fname1, const char *fname2)
+{
+ hid_t fid1=0;
+ hid_t fid2=0;
+ hid_t gid1=0;
+ hsize_t dims2[2] = {2,4};
+ int data1[4][2] = {{0,0},{0,0},{0,0},{0,0}};
+ herr_t status = SUCCEED;
+
+ /*-----------------------------------------------------------------------
+ * Create file(s)
+ *------------------------------------------------------------------------*/
+ fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if (fid1 < 0)
+ {
+ fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ status = FAIL;
+ goto out;
+ }
+
+ fid2 = H5Fcreate (fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if (fid2 < 0)
+ {
+ fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ status = FAIL;
+ goto out;
+ }
+
+
+ /*-----------------------------------------------------------------------
+ * Group
+ *------------------------------------------------------------------------*/
+ /* file1 */
+ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (gid1 < 0)
+ {
+ fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ status = FAIL;
+ goto out;
+ }
+
+ /*-----------------------------------------------------------------------
+ * Datasets
+ *------------------------------------------------------------------------*/
+ /* file1 */
+ status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1);
+ if (status == FAIL)
+ {
+ fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ status = FAIL;
+ goto out;
+ }
+
+ status = write_dset(gid1,2,dims2,"dset",H5T_NATIVE_INT,data1);
+ if (status == FAIL)
+ {
+ fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ status = FAIL;
+ goto out;
+ }
+
+ /* file2 */
+ status = write_dset(fid2,2,dims2,"dset1",H5T_NATIVE_INT,data1);
+ if (status == FAIL)
+ {
+ fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ status = FAIL;
+ goto out;
+ }
+
+out:
+ /*-----------------------------------------------------------------------
+ * Close
+ *-----------------------------------------------------------------------*/
+ if(fid1)
+ H5Fclose(fid1);
+ if(fid2)
+ H5Fclose(fid2);
+ if(gid1)
+ H5Gclose(gid1);
+
+ return status;
+}
+
+/*-------------------------------------------------------------------------
+*
* Purpose: Create test files for multiple variable length string/string array
* along with fixed length string/string array types in
* a compound type dataset.
@@ -4711,7 +4816,6 @@ static void test_non_comparables (const char * fname, int make_diffs)
int rank_attr;
char data1_str[DIM_ARRY][STR_SIZE]= {"ab","cd","ef"};
herr_t status = SUCCEED;
- int i;
void *dset_data_ptr1=NULL;
void *dset_data_ptr2=NULL;
void *dset_data_ptr3=NULL;
diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c
index 67b0c92..1fc563b 100644
--- a/tools/h5diff/ph5diff_main.c
+++ b/tools/h5diff/ph5diff_main.c
@@ -19,6 +19,7 @@
#include <string.h>
#include <assert.h>
#include "h5diff_common.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
/* Name of tool */
@@ -68,6 +69,9 @@ int main(int argc, const char *argv[])
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+ /* Initialize h5tools lib */
+ h5tools_init();
+
outBuffOffset = 0;
g_Parallel = 1;
diff --git a/tools/h5diff/testfiles/h5diff_465.txt b/tools/h5diff/testfiles/h5diff_465.txt
index 827e88e..eca5994 100644
--- a/tools/h5diff/testfiles/h5diff_465.txt
+++ b/tools/h5diff/testfiles/h5diff_465.txt
@@ -1,2 +1 @@
-1 differences found
-EXIT CODE: 1
+EXIT CODE: 0
diff --git a/tools/h5diff/testfiles/h5diff_485.txt b/tools/h5diff/testfiles/h5diff_485.txt
new file mode 100644
index 0000000..4175809
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_485.txt
@@ -0,0 +1,11 @@
+
+file1 file2
+---------------------------------------
+ x x /
+ x x /dset1
+
+group : </> and </>
+0 differences found
+dataset: </dset1> and </dset1>
+0 differences found
+EXIT CODE: 0
diff --git a/tools/h5diff/testfiles/h5diff_486.txt b/tools/h5diff/testfiles/h5diff_486.txt
new file mode 100644
index 0000000..4175809
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_486.txt
@@ -0,0 +1,11 @@
+
+file1 file2
+---------------------------------------
+ x x /
+ x x /dset1
+
+group : </> and </>
+0 differences found
+dataset: </dset1> and </dset1>
+0 differences found
+EXIT CODE: 0
diff --git a/tools/h5diff/testfiles/h5diff_487.txt b/tools/h5diff/testfiles/h5diff_487.txt
new file mode 100644
index 0000000..8555a71
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_487.txt
@@ -0,0 +1,12 @@
+
+file1 file2
+---------------------------------------
+ x x /
+ x x /dset1
+ x /group1
+
+group : </> and </>
+0 differences found
+dataset: </dset1> and </dset1>
+0 differences found
+EXIT CODE: 1
diff --git a/tools/h5diff/testfiles/h5diff_exclude3-1.h5 b/tools/h5diff/testfiles/h5diff_exclude3-1.h5
new file mode 100644
index 0000000..f9cc83d
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_exclude3-1.h5
Binary files differ
diff --git a/tools/h5diff/testfiles/h5diff_exclude3-2.h5 b/tools/h5diff/testfiles/h5diff_exclude3-2.h5
new file mode 100644
index 0000000..f811905
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_exclude3-2.h5
Binary files differ
diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh
index aa0f502..27fb253 100755
--- a/tools/h5diff/testh5diff.sh
+++ b/tools/h5diff/testh5diff.sh
@@ -111,6 +111,8 @@ $SRC_H5DIFF_TESTFILES/h5diff_exclude1-1.h5
$SRC_H5DIFF_TESTFILES/h5diff_exclude1-2.h5
$SRC_H5DIFF_TESTFILES/h5diff_exclude2-1.h5
$SRC_H5DIFF_TESTFILES/h5diff_exclude2-2.h5
+$SRC_H5DIFF_TESTFILES/h5diff_exclude3-1.h5
+$SRC_H5DIFF_TESTFILES/h5diff_exclude3-2.h5
$SRC_H5DIFF_TESTFILES/h5diff_comp_vl_strs.h5
$SRC_H5DIFF_TESTFILES/compounds_array_vlen1.h5
$SRC_H5DIFF_TESTFILES/compounds_array_vlen2.h5
@@ -201,6 +203,10 @@ $SRC_H5DIFF_TESTFILES/h5diff_457.txt
$SRC_H5DIFF_TESTFILES/h5diff_458.txt
$SRC_H5DIFF_TESTFILES/h5diff_459.txt
$SRC_H5DIFF_TESTFILES/h5diff_465.txt
+$SRC_H5DIFF_TESTFILES/h5diff_466.txt
+$SRC_H5DIFF_TESTFILES/h5diff_467.txt
+$SRC_H5DIFF_TESTFILES/h5diff_468.txt
+$SRC_H5DIFF_TESTFILES/h5diff_469.txt
$SRC_H5DIFF_TESTFILES/h5diff_480.txt
$SRC_H5DIFF_TESTFILES/h5diff_481.txt
$SRC_H5DIFF_TESTFILES/h5diff_482.txt
@@ -943,6 +949,15 @@ TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links h5diff_extlin
# dangling link --follow-symlinks (obj vs obj)
# (HDFFV-7836)
TOOLTEST h5diff_465.txt --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1
+# (HDFFV-7835)
+# soft dangling vs. soft dangling
+TOOLTEST h5diff_466.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1
+# soft link vs. soft dangling
+TOOLTEST h5diff_467.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2
+# ext dangling vs. ext dangling
+TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4
+# ext link vs. ext dangling
+TOOLTEST h5diff_469.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2
# ##############################################################################
# # test for group diff recursivly
@@ -1014,6 +1029,15 @@ TOOLTEST h5diff_483.txt -v --exclude-path "/group1" h5diff_exclude2-1.h5 h5diff_
# Exclude from group compare
TOOLTEST h5diff_484.txt -v --exclude-path "/dset3" h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 /group1
+#
+# Only one file contains unique objs. Common objs are same.
+# (HDFFV-7837)
+#
+TOOLTEST h5diff_485.txt -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5
+TOOLTEST h5diff_486.txt -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5
+TOOLTEST h5diff_487.txt -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5
+
+
# ##############################################################################
# # diff various multiple vlen and fixed strings in a compound type dataset
# ##############################################################################
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index 652fe83..a6e452d 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5DUMP)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
# Add the h5dump executables
@@ -128,10 +127,12 @@ IF (BUILD_TESTING)
tlonglinks.ddl
tloop-1.ddl
tmulti.ddl
+ tmultifile.ddl
+# tqmarkfile.ddl
+# tstarfile.ddl
tnamed_dtype_attr.ddl
tnestcomp-1.ddl
tnbit.ddl
- tnofilename.ddl
tno-subset.ddl
tnullspace.ddl
zerodim.ddl
@@ -151,6 +152,7 @@ IF (BUILD_TESTING)
tshuffle.ddl
tslink-1.ddl
tslink-2.ddl
+ tslink-D.ddl
tsplit_file.ddl
tstr-1.ddl
tstr-2.ddl
@@ -832,14 +834,18 @@ IF (BUILD_TESTING)
tloop-1.out.err
tmulti.out
tmulti.out.err
+ tmultifile.out
+ tmultifile.out.err
+# tqmarkfile.out
+# tqmarkfile.out.err
+# tstarfile.out
+# tstarfile.out.err
tnamed_dtype_attr.out
tnamed_dtype_attr.out.err
tnestcomp-1.out
tnestcomp-1.out.err
tnbit.out
tnbit.out.err
- tnofilename.out
- tnofilename.out.err
tno-subset.out
tno-subset.out.err
tnullspace.out
@@ -878,6 +884,8 @@ IF (BUILD_TESTING)
tslink-1.out.err
tslink-2.out
tslink-2.out.err
+ tslink-D.out
+ tslink-D.out.err
tsplit_file.out
tsplit_file.out.err
tstr-1.out
@@ -926,19 +934,21 @@ IF (BUILD_TESTING)
# test for displaying groups
ADD_H5_TEST (tgroup-1 0 --enable-error-stack tgroup.h5)
# test for displaying the selected groups
+ # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tgroup-2 1 --enable-error-stack --group=/g2 --group / -g /y tgroup.h5)
+ # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group names are similar to version numbers
ADD_H5_TEST (tgroup-2 1 --group=/g2 --group / -g /y tgroup.h5)
# test for displaying simple space datasets
ADD_H5_TEST (tdset-1 0 --enable-error-stack tdset.h5)
# test for displaying selected datasets
- ADD_H5_TEST (tdset-2 1 -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5)
+ ADD_H5_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5)
# test for displaying attributes
ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5)
# test for displaying the selected attributes of string type and scalar space
- ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5)
+ ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /\\\\/attr1 --attribute /attr4 --attribute=/attr5 tattr.h5)
# test for header and error messages
- ADD_H5_TEST (tattr-3 1 --header -a /attr2 --attribute=/attr tattr.h5)
+ ADD_H5_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5)
# test for displaying attributes in shared datatype (also in group and dataset)
ADD_H5_TEST (tnamed_dtype_attr 0 --enable-error-stack tnamed_dtype_attr.h5)
# test for displaying at least 9 attributes on root from a be machine
@@ -950,6 +960,8 @@ IF (BUILD_TESTING)
# test for displaying the selected link
ADD_H5_TEST (tslink-2 0 --enable-error-stack -l slink2 tslink.h5)
ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5)
+ # test for displaying dangling soft links
+ ADD_H5_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5)
# tests for hard links
ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5)
@@ -972,7 +984,8 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5)
# test for options
- # JIRA HDFFV-7936 ADD_H5_TEST (tall-1 0 --enable-error-stack tall.h5)
+ # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tall-1 0 --enable-error-stack tall.h5)
+ # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group/dataset names are similar to version numbers
ADD_H5_TEST (tall-1 0 tall.h5)
ADD_H5_TEST (tall-2 0 --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5)
ADD_H5_TEST (tall-3 0 --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5)
@@ -1010,6 +1023,11 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tarray7 0 --enable-error-stack tarray7.h5)
ADD_H5_TEST (tarray8 0 --enable-error-stack tarray8.h5)
+ # test for wildcards in filename (does not work with cmake)
+ #ADD_H5_MASK_TEST (tstarfile 0 --enable-error-stack -H -d Dataset1 tarr*.h5)
+ #ADD_H5_MASK_TEST (tqmarkfile 0 --enable-error-stack -H -d Dataset1 tarray?.h5)
+ ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5)
+
# test for files with empty data
ADD_H5_TEST (tempty 0 --enable-error-stack tempty.h5)
@@ -1025,7 +1043,8 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tlarge_objname 0 --enable-error-stack -w157 tlarge_objname.h5)
# test '-A' to suppress data but print attr's
- # JIRA HDFFV-7936 ADD_H5_TEST (tall-2A 0 --enable-error-stack -A tall.h5)
+ # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5)
+ # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group/dataset names are similar to version numbers
ADD_H5_TEST (tall-2A 0 -A tall.h5)
# test '-r' to print attributes in ASCII instead of decimal
@@ -1048,7 +1067,7 @@ IF (BUILD_TESTING)
ADD_H5_TEST (file_space 0 --enable-error-stack -B file_space.h5)
# test -p with a non existing dataset
- ADD_H5_TEST (tperror 1 -p -d bogus tfcontents1.h5)
+ ADD_H5_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5)
# test for file contents
ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5)
@@ -1093,10 +1112,10 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tindicessub4 0 --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5)
# Exceed the dimensions for subsetting
- ADD_H5_TEST (texceedsubstart 1 -d 1d -s 1,3 taindices.h5)
- ADD_H5_TEST (texceedsubcount 1 -d 1d -c 1,3 taindices.h5)
- ADD_H5_TEST (texceedsubstride 1 -d 1d -S 1,3 taindices.h5)
- ADD_H5_TEST (texceedsubblock 1 -d 1d -k 1,3 taindices.h5)
+ ADD_H5_TEST (texceedsubstart 1 --enable-error-stack -d 1d -s 1,3 taindices.h5)
+ ADD_H5_TEST (texceedsubcount 1 --enable-error-stack -d 1d -c 1,3 taindices.h5)
+ ADD_H5_TEST (texceedsubstride 1 --enable-error-stack -d 1d -S 1,3 taindices.h5)
+ ADD_H5_TEST (texceedsubblock 1 --enable-error-stack -d 1d -k 1,3 taindices.h5)
# tests for filters
# SZIP
@@ -1104,49 +1123,49 @@ IF (BUILD_TESTING)
IF (NOT USE_FILTER_SZIP)
SET (TESTTYPE "SKIP")
ENDIF (NOT USE_FILTER_SZIP)
- ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} -H -p -d szip tfilters.h5)
+ ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} --enable-error-stack -H -p -d szip tfilters.h5)
# deflate
SET (TESTTYPE "TEST")
IF (NOT USE_FILTER_DEFLATE)
SET (TESTTYPE "SKIP")
ENDIF (NOT USE_FILTER_DEFLATE)
- ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} -H -p -d deflate tfilters.h5)
+ ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} --enable-error-stack -H -p -d deflate tfilters.h5)
# shuffle
SET (TESTTYPE "TEST")
IF (NOT USE_FILTER_SHUFFLE)
SET (TESTTYPE "SKIP")
ENDIF (NOT USE_FILTER_SHUFFLE)
- ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} -H -p -d shuffle tfilters.h5)
+ ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} --enable-error-stack -H -p -d shuffle tfilters.h5)
# fletcher32
SET (TESTTYPE "TEST")
IF (NOT USE_FILTER_FLETCHER32)
SET (TESTTYPE "SKIP")
ENDIF (NOT USE_FILTER_FLETCHER32)
- ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} -H -p -d fletcher32 tfilters.h5)
+ ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} --enable-error-stack -H -p -d fletcher32 tfilters.h5)
# nbit
SET (TESTTYPE "TEST")
IF (NOT USE_FILTER_NBIT)
SET (TESTTYPE "SKIP")
ENDIF (NOT USE_FILTER_NBIT)
- ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} -H -p -d nbit tfilters.h5)
+ ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} --enable-error-stack -H -p -d nbit tfilters.h5)
# scaleoffset
SET (TESTTYPE "TEST")
IF (NOT USE_FILTER_SCALEOFFSET)
SET (TESTTYPE "SKIP")
ENDIF (NOT USE_FILTER_SCALEOFFSET)
- ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} -H -p -d scaleoffset tfilters.h5)
+ ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} --enable-error-stack -H -p -d scaleoffset tfilters.h5)
# all
SET (TESTTYPE "TEST")
IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET)
SET (TESTTYPE "SKIP")
ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET)
- ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} -H -p -d all tfilters.h5)
+ ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} --enable-error-stack -H -p -d all tfilters.h5)
# user defined
ADD_H5_TEST (tuserfilter 0 --enable-error-stack -H -p -d myfilter tfilters.h5)
@@ -1282,8 +1301,7 @@ IF (BUILD_TESTING)
ADD_H5_TEST (textlinkfar 0 textlinkfar.h5)
# test for dangling external links
- # JIRA HDFFV-7936 ADD_H5_TEST (textlink 0 --enable-error-stack textlink.h5)
- ADD_H5_TEST (textlink 0 textlink.h5)
+ ADD_H5_MASK_TEST (textlink 0 --enable-error-stack textlink.h5)
# test for error stack display (BZ2048)
ADD_H5_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5)
@@ -1413,7 +1431,7 @@ IF (BUILD_TESTING)
# test failure handling
# Missing file name
- ADD_H5_TEST (tnofilename-with-packed-bits 1)
+ ADD_H5_TEST (tnofilename-with-packed-bits 1 --enable-error-stack)
# Limits:
# Maximum number of packed bits is 8 (for now).
# Maximum integer size is 8*sizeof(long long).
@@ -1472,23 +1490,23 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tpbitsArray 0 --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5)
# Test Error handling.
# Too many packed bits requested. Max is 8 for now.
- ADD_H5_TEST (tpbitsMaxExceeded 1 -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5)
+ ADD_H5_TEST (tpbitsMaxExceeded 1 --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5)
# Offset too large. Max is 8*sizeof(long long.
- ADD_H5_TEST (tpbitsOffsetExceeded 1 -d /DS08BITS -M 64,1 packedbits.h5)
+ ADD_H5_TEST (tpbitsOffsetExceeded 1 --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5)
ADD_H5_TEST (tpbitsCharOffsetExceeded 0 --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5)
ADD_H5_TEST (tpbitsIntOffsetExceeded 0 --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5)
ADD_H5_TEST (tpbitsLongOffsetExceeded 0 --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5)
# Bad offset, must not be negative.
- ADD_H5_TEST (tpbitsOffsetNegative 1 -d /DS08BITS -M -1,1 packedbits.h5)
+ ADD_H5_TEST (tpbitsOffsetNegative 1 --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5)
# Bad length, must not be positive.
- ADD_H5_TEST (tpbitsLengthPositive 1 -d /DS08BITS -M 4,0 packedbits.h5)
+ ADD_H5_TEST (tpbitsLengthPositive 1 --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5)
# Offset+Length is too large. Max is 8*sizeof(long long).
- ADD_H5_TEST (tpbitsLengthExceeded 1 -d /DS08BITS -M 37,28 packedbits.h5)
+ ADD_H5_TEST (tpbitsLengthExceeded 1 --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5)
ADD_H5_TEST (tpbitsCharLengthExceeded 0 --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5)
ADD_H5_TEST (tpbitsIntLengthExceeded 0 --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5)
ADD_H5_TEST (tpbitsLongLengthExceeded 0 --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5)
# Incomplete pair of packed bits request.
- ADD_H5_TEST (tpbitsIncomplete 1 -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5)
+ ADD_H5_TEST (tpbitsIncomplete 1 --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5)
IF (HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 09dead0..2799d95 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -210,7 +210,7 @@ leave(int ret)
{
h5tools_close();
- exit(ret);
+ HDexit(ret);
}
@@ -230,35 +230,38 @@ leave(int ret)
static void
usage(const char *prog)
{
- fflush(stdout);
- fprintf(stdout, "usage: %s [OPTIONS] file\n", prog);
- fprintf(stdout, " OPTIONS\n");
- fprintf(stdout, " -h, --help Print a usage message and exit\n");
- fprintf(stdout, " -n, --contents Print a list of the file contents and exit\n");
- fprintf(stdout, " -B, --superblock Print the content of the super block\n");
- fprintf(stdout, " -H, --header Print the header only; no data is displayed\n");
- fprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n");
- fprintf(stdout, " -i, --object-ids Print the object ids\n");
- fprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n");
- fprintf(stdout, " -e, --escape Escape non printing characters\n");
- fprintf(stdout, " -V, --version Print version number and exit\n");
- fprintf(stdout, " -a P, --attribute=P Print the specified attribute\n");
- fprintf(stdout, " -d P, --dataset=P Print the specified dataset\n");
- fprintf(stdout, " -y, --noindex Do not print array indices with the data\n");
- fprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n");
- fprintf(stdout, " -f D, --filedriver=D Specify which driver to open the file with\n");
- fprintf(stdout, " -g P, --group=P Print the specified group and all members\n");
- fprintf(stdout, " -l P, --soft-link=P Print the value(s) of the specified soft link\n");
- fprintf(stdout, " -o F, --output=F Output raw data into file F\n");
- fprintf(stdout, " -b B, --binary=B Binary file output, of form B\n");
- fprintf(stdout, " -t P, --datatype=P Print the specified named datatype\n");
- fprintf(stdout, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n");
- fprintf(stdout, " sets the number of columns to the maximum (65535).\n");
- fprintf(stdout, " Default width is 80 columns.\n");
- fprintf(stdout, " -m T, --format=T Set the floating point output format\n");
- fprintf(stdout, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n");
- fprintf(stdout, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
- fprintf(stdout,
+ HDfflush(rawoutstream);
+ HDfprintf(rawoutstream, "usage: %s [OPTIONS] files\n", prog);
+ HDfprintf(rawoutstream, " OPTIONS\n");
+ HDfprintf(rawoutstream, " -h, --help Print a usage message and exit\n");
+ HDfprintf(rawoutstream, " -n, --contents Print a list of the file contents and exit\n");
+ HDfprintf(rawoutstream, " -B, --superblock Print the content of the super block\n");
+ HDfprintf(rawoutstream, " -H, --header Print the header only; no data is displayed\n");
+ HDfprintf(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n");
+ HDfprintf(rawoutstream, " -i, --object-ids Print the object ids\n");
+ HDfprintf(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n");
+ HDfprintf(rawoutstream, " -e, --escape Escape non printing characters\n");
+ HDfprintf(rawoutstream, " -V, --version Print version number and exit\n");
+ HDfprintf(rawoutstream, " -a P, --attribute=P Print the specified attribute\n");
+ HDfprintf(rawoutstream, " If an attribute name contains a slash (/), escape the\n");
+ HDfprintf(rawoutstream, " slash with a preceding backslash (\\).\n");
+ HDfprintf(rawoutstream, " (See example section below.)\n");
+ HDfprintf(rawoutstream, " -d P, --dataset=P Print the specified dataset\n");
+ HDfprintf(rawoutstream, " -y, --noindex Do not print array indices with the data\n");
+ HDfprintf(rawoutstream, " -p, --properties Print dataset filters, storage layout and fill value\n");
+ HDfprintf(rawoutstream, " -f D, --filedriver=D Specify which driver to open the file with\n");
+ HDfprintf(rawoutstream, " -g P, --group=P Print the specified group and all members\n");
+ HDfprintf(rawoutstream, " -l P, --soft-link=P Print the value(s) of the specified soft link\n");
+ HDfprintf(rawoutstream, " -o F, --output=F Output raw data into file F\n");
+ HDfprintf(rawoutstream, " -b B, --binary=B Binary file output, of form B\n");
+ HDfprintf(rawoutstream, " -t P, --datatype=P Print the specified named datatype\n");
+ HDfprintf(rawoutstream, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n");
+ HDfprintf(rawoutstream, " sets the number of columns to the maximum (65535).\n");
+ HDfprintf(rawoutstream, " Default width is 80 columns.\n");
+ HDfprintf(rawoutstream, " -m T, --format=T Set the floating point output format\n");
+ HDfprintf(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n");
+ HDfprintf(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
+ HDfprintf(rawoutstream,
" -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n"
" format L for an integer dataset specified with\n"
" option -d. L is a list of offset,length values,\n"
@@ -266,69 +269,77 @@ usage(const char *prog)
" the data value and length is the number of bits of\n"
" the mask.\n"
);
- fprintf(stdout, " -R, --region Print dataset pointed by region references\n");
- fprintf(stdout, " -x, --xml Output in XML using Schema\n");
- fprintf(stdout, " -u, --use-dtd Output in XML using DTD\n");
- fprintf(stdout, " -D U, --xml-dtd=U Use the DTD or schema at U\n");
- fprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n");
- fprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n");
- fprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n");
- fprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
- fprintf(stdout, " occur.\n");
- fprintf(stdout, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
- fprintf(stdout, " of \"[\" in datset names.\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " Subsetting is available by using the following options with a dataset\n");
- fprintf(stdout, " attribute. Subsetting is done by selecting a hyperslab from the data.\n");
- fprintf(stdout, " Thus, the options mirror those for performing a hyperslab selection.\n");
- fprintf(stdout, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n");
- fprintf(stdout, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n");
- fprintf(stdout, " each dimension. START is optional and will default to 0 in each dimension.\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n");
- fprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n");
- fprintf(stdout, " -c COUNT, --count=COUNT Number of blocks to include in selection\n");
- fprintf(stdout, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n");
- fprintf(stdout, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n");
- fprintf(stdout, " number of dimensions in the dataspace being queried\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " D - is the file driver to use in opening the file. Acceptable values\n");
- fprintf(stdout, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n");
- fprintf(stdout, " the file driver flag, the file will be opened with each driver in\n");
- fprintf(stdout, " turn and in the order specified above until one driver succeeds\n");
- fprintf(stdout, " in opening the file.\n");
- fprintf(stdout, " F - is a filename.\n");
- fprintf(stdout, " P - is the full path from the root group to the object.\n");
- fprintf(stdout, " N - is an integer greater than 1.\n");
- fprintf(stdout, " T - is a string containing the floating point format, e.g '%%.3f'\n");
- fprintf(stdout, " U - is a URI reference (as defined in [IETF RFC 2396],\n");
- fprintf(stdout, " updated by [IETF RFC 2732])\n");
- fprintf(stdout, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n");
- fprintf(stdout, " file type, LE or BE for pre-existing little or big endian types.\n");
- fprintf(stdout, " Must be used with -o (output file) and it is recommended that\n");
- fprintf(stdout, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n");
- fprintf(stdout, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n");
- fprintf(stdout, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " Examples:\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n");
- fprintf(stdout, " using a little-endian type\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n");
- fprintf(stdout, "\n");
- fprintf(stdout, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
- fprintf(stdout, "\n");
+ HDfprintf(rawoutstream, " -R, --region Print dataset pointed by region references\n");
+ HDfprintf(rawoutstream, " -x, --xml Output in XML using Schema\n");
+ HDfprintf(rawoutstream, " -u, --use-dtd Output in XML using DTD\n");
+ HDfprintf(rawoutstream, " -D U, --xml-dtd=U Use the DTD or schema at U\n");
+ HDfprintf(rawoutstream, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n");
+ HDfprintf(rawoutstream, " \":\": no namespace, default: \"hdf5:\"\n");
+ HDfprintf(rawoutstream, " E.g., to dump a file called `-f', use h5dump -- -f\n");
+ HDfprintf(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
+ HDfprintf(rawoutstream, " occur.\n");
+ HDfprintf(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
+ HDfprintf(rawoutstream, " of \"[\" in datset names.\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " Subsetting is available by using the following options with a dataset\n");
+ HDfprintf(rawoutstream, " attribute. Subsetting is done by selecting a hyperslab from the data.\n");
+ HDfprintf(rawoutstream, " Thus, the options mirror those for performing a hyperslab selection.\n");
+ HDfprintf(rawoutstream, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n");
+ HDfprintf(rawoutstream, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n");
+ HDfprintf(rawoutstream, " each dimension. START is optional and will default to 0 in each dimension.\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " -s START, --start=START Offset of start of subsetting selection\n");
+ HDfprintf(rawoutstream, " -S STRIDE, --stride=STRIDE Hyperslab stride\n");
+ HDfprintf(rawoutstream, " -c COUNT, --count=COUNT Number of blocks to include in selection\n");
+ HDfprintf(rawoutstream, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n");
+ HDfprintf(rawoutstream, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n");
+ HDfprintf(rawoutstream, " number of dimensions in the dataspace being queried\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " D - is the file driver to use in opening the file. Acceptable values\n");
+ HDfprintf(rawoutstream, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n");
+ HDfprintf(rawoutstream, " the file driver flag, the file will be opened with each driver in\n");
+ HDfprintf(rawoutstream, " turn and in the order specified above until one driver succeeds\n");
+ HDfprintf(rawoutstream, " in opening the file.\n");
+ HDfprintf(rawoutstream, " F - is a filename.\n");
+ HDfprintf(rawoutstream, " P - is the full path from the root group to the object.\n");
+ HDfprintf(rawoutstream, " N - is an integer greater than 1.\n");
+ HDfprintf(rawoutstream, " T - is a string containing the floating point format, e.g '%%.3f'\n");
+ HDfprintf(rawoutstream, " U - is a URI reference (as defined in [IETF RFC 2396],\n");
+ HDfprintf(rawoutstream, " updated by [IETF RFC 2732])\n");
+ HDfprintf(rawoutstream, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n");
+ HDfprintf(rawoutstream, " file type, LE or BE for pre-existing little or big endian types.\n");
+ HDfprintf(rawoutstream, " Must be used with -o (output file) and it is recommended that\n");
+ HDfprintf(rawoutstream, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n");
+ HDfprintf(rawoutstream, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n");
+ HDfprintf(rawoutstream, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " Examples:\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " 1) Attribute foo of the group /bar_none in file quux.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " h5dump -a /bar_none/foo quux.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " Attribute \"high/low\" of the group /bar_none in the file quux.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " h5dump -a \"/bar_none/high\\/low\" quux.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n");
+ HDfprintf(rawoutstream, " using a little-endian type\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " h5dump -d /dset -b LE -o out.bin quux.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5\n");
+ HDfprintf(rawoutstream, "\n");
+ HDfprintf(rawoutstream, " h5dump -d /foo multi1.h5 multi2.h5 multi3.h5\n");
+ HDfprintf(rawoutstream, "\n");
}
@@ -454,9 +465,8 @@ table_list_free(void)
table_list.nalloc = table_list.nused = 0;
} /* end table_list_free() */
-
/*-------------------------------------------------------------------------
- * Function: set_output_file
+ * Function: set_data_output_file
*
* Purpose: Open fname as the output file for dataset raw data.
* Set rawdatastream as its file stream.
@@ -472,27 +482,27 @@ table_list_free(void)
*-------------------------------------------------------------------------
*/
static int
-set_output_file(const char *fname, int is_bin)
+set_data_output_file(const char *fname, int is_bin)
{
FILE *f; /* temporary holding place for the stream pointer
* so that rawdatastream is changed only when succeeded */
if (rawdatastream && rawdatastream != stdout) {
- if (fclose(rawdatastream))
- perror("closing rawdatastream");
+ if (HDfclose(rawdatastream))
+ HDperror("closing rawdatastream");
else
rawdatastream = NULL;
}
/* binary output */
if (is_bin) {
- if ((f = fopen(fname, "wb")) != NULL) {
+ if ((f = HDfopen(fname, "wb")) != NULL) {
rawdatastream = f;
return 0;
}
}
else {
- if ((f = fopen(fname, "w")) != NULL) {
+ if ((f = HDfopen(fname, "w")) != NULL) {
rawdatastream = f;
return 0;
}
@@ -502,6 +512,70 @@ set_output_file(const char *fname, int is_bin)
}
/*-------------------------------------------------------------------------
+ * Function: set_output_file
+ *
+ * Purpose: Open fname as the output file for raw output.
+ * Set rawoutstream as its file stream.
+ *
+ * Return: 0 -- succeeded
+ * negative -- failed
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+set_output_file(const char *fname)
+{
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawoutstream is changed only when succeeded */
+
+ if (rawoutstream && rawoutstream != stdout) {
+ if (HDfclose(rawoutstream))
+ HDperror("closing rawoutstream");
+ else
+ rawoutstream = NULL;
+ }
+
+ if ((f = HDfopen(fname, "w")) != NULL) {
+ rawoutstream = f;
+ return 0;
+ }
+
+ return -1;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: set_error_file
+ *
+ * Purpose: Open fname as the error output file for dataset raw error.
+ * Set rawerrorstream as its file stream.
+ *
+ * Return: 0 -- succeeded
+ * negative -- failed
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+set_error_file(const char *fname)
+{
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawerrorstream is changed only when succeeded */
+
+ if (rawerrorstream && rawerrorstream != stderr) {
+ if (HDfclose(rawerrorstream))
+ HDperror("closing rawerrorstream");
+ else
+ rawerrorstream = NULL;
+ }
+
+ if ((f = HDfopen(fname, "w")) != NULL) {
+ rawerrorstream = f;
+ return 0;
+ }
+
+ return -1;
+}
+
+/*-------------------------------------------------------------------------
* Function: set_binary_form
*
* Purpose: set the binary form of output by translating from a string input
@@ -521,15 +595,15 @@ set_binary_form(const char *form)
{
int bform = -1;
- if (strcmp(form,"NATIVE") == 0 || strcmp(form,"MEMORY") == 0) {
+ if (HDstrcmp(form,"NATIVE") == 0 || HDstrcmp(form,"MEMORY") == 0) {
/* native form */
bform = 0;
}
- else if (strcmp(form,"FILE") == 0) /* file type form */
+ else if (HDstrcmp(form,"FILE") == 0) /* file type form */
bform = 1;
- else if (strcmp(form,"LE") == 0) /* convert to little endian */
+ else if (HDstrcmp(form,"LE") == 0) /* convert to little endian */
bform = 2;
- else if (strcmp(form,"BE") == 0) /* convert to big endian */
+ else if (HDstrcmp(form,"BE") == 0) /* convert to big endian */
bform = 3;
return bform;
@@ -556,9 +630,9 @@ set_sort_by(const char *form)
{
H5_index_t idx_type = H5_INDEX_UNKNOWN;
- if (strcmp(form,"name")==0) /* H5_INDEX_NAME */
+ if (HDstrcmp(form,"name")==0) /* H5_INDEX_NAME */
idx_type = H5_INDEX_NAME;
- else if (strcmp(form,"creation_order")==0) /* H5_INDEX_CRT_ORDER */
+ else if (HDstrcmp(form,"creation_order")==0) /* H5_INDEX_CRT_ORDER */
idx_type = H5_INDEX_CRT_ORDER;
return idx_type;
@@ -585,9 +659,9 @@ set_sort_order(const char *form)
{
H5_iter_order_t iter_order = H5_ITER_UNKNOWN;
- if (strcmp(form,"ascending")==0) /* H5_ITER_INC */
+ if (HDstrcmp(form,"ascending")==0) /* H5_ITER_INC */
iter_order = H5_ITER_INC;
- else if (strcmp(form,"descending")==0) /* H5_ITER_DEC */
+ else if (HDstrcmp(form,"descending")==0) /* H5_ITER_DEC */
iter_order = H5_ITER_DEC;
return iter_order;
@@ -626,7 +700,7 @@ parse_hsize_list(const char *h_list, subset_d *d)
/* count how many integers do we have */
for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++)
- if (isdigit(*ptr)) {
+ if (HDisdigit(*ptr)) {
if (!last_digit)
/* the last read character wasn't a digit */
size_count++;
@@ -642,14 +716,14 @@ parse_hsize_list(const char *h_list, subset_d *d)
return;
/* allocate an array for the integers in the list */
- p_list = (hsize_t *)calloc(size_count, sizeof(hsize_t));
+ p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t));
for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++)
- if(isdigit(*ptr)) {
+ if(HDisdigit(*ptr)) {
/* we should have an integer now */
- p_list[i++] = (hsize_t)atof(ptr);
+ p_list[i++] = (hsize_t)HDatof(ptr);
- while (isdigit(*ptr))
+ while (HDisdigit(*ptr))
/* scroll to end of integer */
ptr++;
}
@@ -681,10 +755,10 @@ parse_subset_params(char *dset)
struct subset_t *s = NULL;
register char *brace;
- if (!disable_compact_subset && ((brace = strrchr(dset, '[')) != NULL)) {
+ if (!disable_compact_subset && ((brace = HDstrrchr(dset, '[')) != NULL)) {
*brace++ = '\0';
- s = (struct subset_t *)calloc(1, sizeof(struct subset_t));
+ s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t));
parse_hsize_list(brace, &s->start);
while (*brace && *brace != ';')
@@ -906,7 +980,7 @@ parse_command_line(int argc, const char *argv[])
}
/* this will be plenty big enough to hold the info */
- if((hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t)))==NULL) {
+ if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) {
goto error;
}
@@ -1031,13 +1105,13 @@ parse_start:
case 'o':
if ( bin_output ) {
- if (set_output_file(opt_arg, 1) < 0) {
+ if (set_data_output_file(opt_arg, 1) < 0) {
usage(h5tools_getprogname());
goto error;
}
}
else {
- if (set_output_file(opt_arg, 0) < 0) {
+ if (set_data_output_file(opt_arg, 0) < 0) {
usage(h5tools_getprogname());
goto error;
}
@@ -1058,7 +1132,7 @@ parse_start:
}
bin_output = TRUE;
if (outfname!=NULL) {
- if (set_output_file(outfname, 1) < 0) {
+ if (set_data_output_file(outfname, 1) < 0) {
/* failed to set output file */
usage(h5tools_getprogname());
goto error;
@@ -1133,7 +1207,7 @@ parse_start:
usage(h5tools_getprogname());
goto error;
}
- if (strcmp(opt_arg,":") == 0) {
+ if (HDstrcmp(opt_arg,":") == 0) {
xmlnsprefix = "";
}
else {
@@ -1163,7 +1237,7 @@ parse_start:
s = last_dset->subset_info;
}
else {
- last_dset->subset_info = s = (struct subset_t *)calloc(1, sizeof(struct subset_t));
+ last_dset->subset_info = s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t));
}
/*
@@ -1306,11 +1380,13 @@ main(int argc, const char *argv[])
hid_t fid = -1;
hid_t gid = -1;
H5E_auto2_t func;
+ H5E_auto2_t tools_func;
H5O_info_t oi;
- struct handler_t *hand;
+ struct handler_t *hand = NULL;
int i;
unsigned u;
void *edata;
+ void *tools_edata;
char *fname = NULL;
h5tools_setprogname(PROGRAMNAME);
@@ -1325,6 +1401,10 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
+ /* Disable tools error reporting */
+ H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata);
+ H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL);
+
if((hand = parse_command_line(argc, argv))==NULL) {
goto done;
}
@@ -1335,8 +1415,10 @@ main(int argc, const char *argv[])
goto done;
}
- if (enable_error_stack)
+ if (enable_error_stack) {
H5Eset_auto2(H5E_DEFAULT, func, edata);
+ H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata);
+ }
/* Check for conflicting options */
if (doxml) {
@@ -1379,169 +1461,186 @@ main(int argc, const char *argv[])
h5tools_setstatus(EXIT_FAILURE);
goto done;
}
- fname = HDstrdup(argv[opt_ind]);
-
- fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0);
+ while(opt_ind < argc) {
+ fname = HDstrdup(argv[opt_ind++]);
- if (fid < 0) {
- error_msg("unable to open file \"%s\"\n", fname);
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
+ fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0);
- /* allocate and initialize internal data structure */
- init_prefix(&prefix, prefix_len);
+ if (fid < 0) {
+ error_msg("unable to open file \"%s\"\n", fname);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
- /* Prepare to find objects that might be targets of a reference */
- fill_ref_path_table(fid);
+ /* allocate and initialize internal data structure */
+ init_prefix(&prefix, prefix_len);
- if(doxml) {
- /* initialize XML */
- /* reset prefix! */
- HDstrcpy(prefix, "");
+ /* Prepare to find objects that might be targets of a reference */
+ fill_ref_path_table(fid);
- /* make sure the URI is initialized to something */
- if (xml_dtd_uri == NULL) {
- if (useschema) {
- xml_dtd_uri = DEFAULT_XSD;
+ if(doxml) {
+ /* initialize XML */
+ /* reset prefix! */
+ HDstrcpy(prefix, "");
+
+ /* make sure the URI is initialized to something */
+ if (xml_dtd_uri == NULL) {
+ if (useschema) {
+ xml_dtd_uri = DEFAULT_XSD;
+ }
+ else {
+ xml_dtd_uri = DEFAULT_DTD;
+ xmlnsprefix = "";
+ }
}
else {
- xml_dtd_uri = DEFAULT_DTD;
- xmlnsprefix = "";
- }
- }
- else {
- if (useschema && strcmp(xmlnsprefix,"")) {
- error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n");
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
+ if (useschema && HDstrcmp(xmlnsprefix,"")) {
+ error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n");
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
}
}
- }
-
- /* Get object info for root group */
- if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) {
- error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
- /* Initialize object tables */
- if(table_list_add(fid, oi.fileno) < 0) {
- error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
- group_table = table_list.tables[0].group_table;
- dset_table = table_list.tables[0].dset_table;
- type_table = table_list.tables[0].type_table;
-
- /* does there exist unamed committed datatype */
- for (u = 0; u < type_table->nobjs; u++)
- if (!type_table->objs[u].recorded) {
- unamedtype = 1;
- break;
- } /* end if */
+ /* Get object info for root group */
+ if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) {
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
- /* start to dump - display file header information */
- if (!doxml) {
- begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin);
- }
- else {
- HDfprintf(stdout, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ /* Initialize object tables */
+ if(table_list_add(fid, oi.fileno) < 0) {
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ }
+ group_table = table_list.tables[0].group_table;
+ dset_table = table_list.tables[0].dset_table;
+ type_table = table_list.tables[0].type_table;
+
+ /* does there exist unamed committed datatype */
+ for (u = 0; u < type_table->nobjs; u++)
+ if (!type_table->objs[u].recorded) {
+ unamedtype = 1;
+ break;
+ } /* end if */
+
+ /* start to dump - display file header information */
+ if (!doxml) {
+ begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin);
+ }
+ else {
+ HDfprintf(rawoutstream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- /* alternative first element, depending on schema or DTD. */
- if (useschema) {
- if (strcmp(xmlnsprefix,"") == 0) {
- HDfprintf(stdout, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n",
- xml_dtd_uri);
+ /* alternative first element, depending on schema or DTD. */
+ if (useschema) {
+ if (HDstrcmp(xmlnsprefix,"") == 0) {
+ HDfprintf(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n",
+ xml_dtd_uri);
+ }
+ else {
+ /* TO DO: make -url option work in this case (may need new option) */
+ char *ns;
+ char *indx;
+
+ ns = HDstrdup(xmlnsprefix);
+ indx = HDstrrchr(ns,(int)':');
+ if (indx) *indx = '\0';
+
+ HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"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\">\n",xmlnsprefix,ns);
+ HDfree(ns);
+ }
}
else {
-/* TO DO: make -url option work in this case (may need new option) */
- char *ns;
- char *indx;
-
- ns = HDstrdup(xmlnsprefix);
- indx = strrchr(ns,(int)':');
- if (indx) *indx = '\0';
-
- HDfprintf(stdout, "<%sHDF5-File xmlns:%s=\"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\">\n",xmlnsprefix,ns);
- HDfree(ns);
+ HDfprintf(rawoutstream, "<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n", xml_dtd_uri);
+ HDfprintf(rawoutstream, "<HDF5-File>\n");
}
- }
- else {
- HDfprintf(stdout, "<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n", xml_dtd_uri);
- HDfprintf(stdout, "<HDF5-File>\n");
}
- }
- if (!doxml) {
- if (display_fi) {
- HDfprintf(stdout, "\n");
- dump_fcontents(fid);
- end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend);
- HDfprintf(stdout, "\n");
- goto done;
+ if (!doxml) {
+ if (display_fi) {
+ HDfprintf(rawoutstream, "\n");
+ dump_fcontents(fid);
+ end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend);
+ HDfprintf(rawoutstream, "\n");
+ goto done;
+ }
+
+ if (display_bb)
+ dump_fcpl(fid);
}
- if (display_bb)
- dump_fcpl(fid);
- }
+ if(display_all) {
+ if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) {
+ error_msg("unable to open root group\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+ else {
+ if (!doxml)
+ dump_indent += COL;
+ dump_function_table->dump_group_function(gid, "/" );
+ if (!doxml)
+ dump_indent -= COL;
+ HDfprintf(rawoutstream, "\n");
+ }
+
+ if(H5Gclose(gid) < 0) {
+ error_msg("unable to close root group\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
- if(display_all) {
- if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) {
- error_msg("unable to open root group\n");
- h5tools_setstatus(EXIT_FAILURE);
}
else {
- if (!doxml)
- dump_indent += COL;
- dump_function_table->dump_group_function(gid, "/" );
- if (!doxml)
- dump_indent -= COL;
- HDfprintf(stdout, "\n");
+ /* Note: this option is not supported for XML */
+ if(doxml) {
+ error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
+ h5tools_setstatus(EXIT_FAILURE);
+ goto done;
+ } /* end if */
+
+ for(i = 0; i < argc; i++) {
+ if(hand[i].func) {
+ hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL);
+ }
+ }
+ HDfprintf(rawoutstream, "\n");
}
- if(H5Gclose(gid) < 0) {
- error_msg("unable to close root group\n");
- h5tools_setstatus(EXIT_FAILURE);
+ if (!doxml) {
+ end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend);
+ HDfprintf(rawoutstream, "\n");
+ }
+ else {
+ HDfprintf(rawoutstream, "</%sHDF5-File>\n", xmlnsprefix);
}
+ /* Free tables for objects */
+ table_list_free();
- }
- else {
- /* Note: this option is not supported for XML */
- if(doxml) {
- error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- } /* end if */
+ if(fid >=0)
+ if (H5Fclose(fid) < 0)
+ h5tools_setstatus(EXIT_FAILURE);
- for(i = 0; i < argc; i++) {
- if(hand[i].func) {
- hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL);
- }
- }
- HDfprintf(stdout, "\n");
- }
+ if(prefix)
+ HDfree(prefix);
+ if(fname)
+ HDfree(fname);
+ } /* end while */
- if (!doxml) {
- end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend);
- HDfprintf(stdout, "\n");
- }
- else {
- HDfprintf(stdout, "</%sHDF5-File>\n", xmlnsprefix);
- }
+ if(hand)
+ free_handler(hand, argc);
+
+ /* To Do: clean up XML table */
+
+ leave(h5tools_getstatus());
done:
/* Free tables for objects */
table_list_free();
- if(hand)
- free_handler(hand, argc);
-
if(fid >=0)
if (H5Fclose(fid) < 0)
h5tools_setstatus(EXIT_FAILURE);
@@ -1551,6 +1650,9 @@ done:
if(fname)
HDfree(fname);
+ if(hand)
+ free_handler(hand, argc);
+
/* To Do: clean up XML table */
H5Eset_auto2(H5E_DEFAULT, func, edata);
diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c
index c9e5571..b8deaf9 100644
--- a/tools/h5dump/h5dump_ddl.c
+++ b/tools/h5dump/h5dump_ddl.c
@@ -49,7 +49,7 @@ dump_datatype(hid_t type)
ctx.cur_column = dump_indent;
h5dump_type_table = type_table;
- h5tools_dump_datatype(stdout, outputformat, &ctx, type);
+ h5tools_dump_datatype(rawoutstream, outputformat, &ctx, type);
h5dump_type_table = NULL;
}
@@ -77,7 +77,7 @@ dump_dataspace(hid_t space)
ctx.indent_level = dump_indent/COL;
ctx.cur_column = dump_indent;
- h5tools_dump_dataspace(stdout, outputformat, &ctx, space);
+ h5tools_dump_dataspace(rawoutstream, outputformat, &ctx, space);
}
@@ -134,7 +134,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo
outputformat = &string_dataformat;
h5dump_type_table = type_table;
- h5tools_dump_attribute(stdout, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char);
+ h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char);
h5dump_type_table = NULL;
if(attr_id < 0) {
@@ -264,30 +264,30 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->datasetbegin, name,
h5tools_dump_header_format->datasetblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->datasetblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->datasetblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend);
- if(strlen(h5tools_dump_header_format->datasetend))
+ if(HDstrlen(h5tools_dump_header_format->datasetend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->datasetend))
+ if(HDstrlen(h5tools_dump_header_format->datasetend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
@@ -298,14 +298,14 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
}
else if(found_obj->displayed) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->datasetbegin, name,
h5tools_dump_header_format->datasetblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
@@ -314,23 +314,23 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->datasetblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->datasetblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend);
- if(strlen(h5tools_dump_header_format->datasetend))
+ if(HDstrlen(h5tools_dump_header_format->datasetend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->datasetend))
+ if(HDstrlen(h5tools_dump_header_format->datasetend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
H5Dclose(obj);
goto done;
@@ -383,7 +383,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->softlinkbegin, name,
h5tools_dump_header_format->softlinkblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
@@ -396,29 +396,29 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
/* print the value of a soft link */
/* Standard DDL: no modification */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "LINKTARGET \"%s\"", targbuf);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->softlinkblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->softlinkblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend);
- if(strlen(h5tools_dump_header_format->softlinkend))
+ if(HDstrlen(h5tools_dump_header_format->softlinkend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->softlinkend))
+ if(HDstrlen(h5tools_dump_header_format->softlinkend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(targbuf);
break;
@@ -428,14 +428,14 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
HDassert(targbuf);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->extlinkbegin, name,
h5tools_dump_header_format->extlinkblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) {
indentation(dump_indent);
@@ -457,20 +457,20 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "TARGETFILE \"%s\"", filename);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "TARGETPATH \"%s\"", targname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
/* dump the external link */
dump_extlink(group, name, targname);
@@ -478,56 +478,56 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED
} /* end else */
} /* end else */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->extlinkblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->extlinkblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend);
- if(strlen(h5tools_dump_header_format->extlinkend))
+ if(HDstrlen(h5tools_dump_header_format->extlinkend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->extlinkend))
+ if(HDstrlen(h5tools_dump_header_format->extlinkend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(targbuf);
break;
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->udlinkbegin, name,
h5tools_dump_header_format->udlinkblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "LINKCLASS %d", linfo->type);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->udlinkblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->udlinkblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkblockend);
- if(strlen(h5tools_dump_header_format->udlinkend))
+ if(HDstrlen(h5tools_dump_header_format->udlinkend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->udlinkend))
+ if(HDstrlen(h5tools_dump_header_format->udlinkend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
} /* end switch */
@@ -618,7 +618,7 @@ dump_named_datatype(hid_t tid, const char *name)
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->datatypebegin, name,
h5tools_dump_header_format->datatypeblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
H5Oget_info(tid, &oinfo);
@@ -639,7 +639,7 @@ dump_named_datatype(hid_t tid, const char *name)
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
goto done;
}
else
@@ -648,13 +648,13 @@ dump_named_datatype(hid_t tid, const char *name)
/* Render the element */
h5tools_str_reset(&buffer);
- h5tools_print_datatype(stdout, &buffer, outputformat, &ctx, tid, FALSE);
+ h5tools_print_datatype(rawoutstream, &buffer, outputformat, &ctx, tid, FALSE);
if(H5Tget_class(tid) != H5T_COMPOUND) {
h5tools_str_append(&buffer, ";");
}
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
/* print attributes */
dump_indent += COL;
@@ -680,14 +680,14 @@ dump_named_datatype(hid_t tid, const char *name)
done:
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->datatypeblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->datatypeblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend);
- if(strlen(h5tools_dump_header_format->datatypeend))
+ if(HDstrlen(h5tools_dump_header_format->datatypeend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->datatypeend))
+ if(HDstrlen(h5tools_dump_header_format->datatypeend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
}
@@ -779,7 +779,7 @@ dump_group(hid_t gid, const char *name)
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->groupbegin, name,
h5tools_dump_header_format->groupblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
@@ -800,10 +800,10 @@ dump_group(hid_t gid, const char *name)
} /* end if */
if(display_oid) {
- h5tools_dump_oid(stdout, outputformat, &ctx, gid);
+ h5tools_dump_oid(rawoutstream, outputformat, &ctx, gid);
}
- h5tools_dump_comment(stdout, outputformat, &ctx, gid);
+ h5tools_dump_comment(rawoutstream, outputformat, &ctx, gid);
H5Oget_info(gid, &oinfo);
@@ -825,7 +825,7 @@ dump_group(hid_t gid, const char *name)
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
found_obj->displayed = TRUE;
@@ -882,18 +882,18 @@ dump_group(hid_t gid, const char *name)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->groupblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->groupblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupblockend);
- if(strlen(h5tools_dump_header_format->groupend))
+ if(HDstrlen(h5tools_dump_header_format->groupend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->groupend))
+ if(HDstrlen(h5tools_dump_header_format->groupend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
}
@@ -962,36 +962,36 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->datasetbegin, name,
h5tools_dump_header_format->datasetblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
- h5tools_dump_comment(stdout, outputformat, &ctx, did);
+ h5tools_dump_comment(rawoutstream, outputformat, &ctx, did);
dump_indent += COL;
ctx.indent_level++;
type = H5Dget_type(did);
h5dump_type_table = type_table;
- h5tools_dump_datatype(stdout, outputformat, &ctx, type);
+ h5tools_dump_datatype(rawoutstream, outputformat, &ctx, type);
h5dump_type_table = NULL;
space = H5Dget_space(did);
- h5tools_dump_dataspace(stdout, outputformat, &ctx, space);
+ h5tools_dump_dataspace(rawoutstream, outputformat, &ctx, space);
H5Sclose(space);
if(display_oid) {
- h5tools_dump_oid(stdout, outputformat, &ctx, did);
+ h5tools_dump_oid(rawoutstream, outputformat, &ctx, did);
}
if(display_dcpl) {
h5dump_type_table = type_table;
- h5tools_dump_dcpl(stdout, outputformat, &ctx, dcpl_id, type, did);
+ h5tools_dump_dcpl(rawoutstream, outputformat, &ctx, dcpl_id, type, did);
h5dump_type_table = NULL;
}
H5Pclose(dcpl_id);
@@ -1004,25 +1004,25 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
for(i=0; i<data_loop; i++) {
if(display_packed_bits) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
packed_data_mask = packed_mask[i];
packed_data_offset = packed_offset[i];
packed_data_length = packed_length[i];
h5tools_print_packed_bits(&buffer, type);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
switch(H5Tget_class(type)) {
case H5T_TIME:
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "DATA{ not yet implemented.}");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
break;
@@ -1038,7 +1038,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
case H5T_VLEN:
case H5T_ARRAY:
{
- h5tools_dump_data(stdout, outputformat, &ctx, did, TRUE, sset, display_ai, display_char);
+ h5tools_dump_data(rawoutstream, outputformat, &ctx, did, TRUE, sset, display_ai, display_char);
}
break;
@@ -1069,18 +1069,18 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->datasetblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->datasetblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend);
- if(strlen(h5tools_dump_header_format->datasetend))
+ if(HDstrlen(h5tools_dump_header_format->datasetend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->datasetend))
+ if(HDstrlen(h5tools_dump_header_format->datasetend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
}
@@ -1131,7 +1131,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index)
if(obj_data == DATASET_DATA)
print_dataset = TRUE;
- h5tools_dump_data(stdout, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char);
+ h5tools_dump_data(rawoutstream, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char);
}
@@ -1185,23 +1185,23 @@ dump_fcpl(hid_t fid)
* SUPER_BLOCK
*-------------------------------------------------------------------------
*/
- HDfprintf(stdout, "\n%s %s\n",SUPER_BLOCK, BEGIN);
+ HDfprintf(rawoutstream, "\n%s %s\n",SUPER_BLOCK, BEGIN);
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %u\n","SUPERBLOCK_VERSION", finfo.super.version);
+ HDfprintf(rawoutstream, "%s %u\n","SUPERBLOCK_VERSION", finfo.super.version);
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %u\n","FREELIST_VERSION", finfo.free.version);
+ HDfprintf(rawoutstream, "%s %u\n","FREELIST_VERSION", finfo.free.version);
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */
+ HDfprintf(rawoutstream, "%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version);
+ HDfprintf(rawoutstream, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version);
indentation(dump_indent + COL);
- HDfprintf(stdout,"%s %Hd\n","OFFSET_SIZE", (long long)off_size);
+ HDfprintf(rawoutstream,"%s %Hd\n","OFFSET_SIZE", (long long)off_size);
indentation(dump_indent + COL);
- HDfprintf(stdout,"%s %Hd\n","LENGTH_SIZE", (long long)len_size);
+ HDfprintf(rawoutstream,"%s %Hd\n","LENGTH_SIZE", (long long)len_size);
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %u\n","BTREE_RANK", sym_ik);
+ HDfprintf(rawoutstream, "%s %u\n","BTREE_RANK", sym_ik);
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %d\n","BTREE_LEAF", sym_lk);
+ HDfprintf(rawoutstream, "%s %d\n","BTREE_LEAF", sym_lk);
#ifdef SHOW_FILE_DRIVER
if (H5FD_CORE==fdriver)
@@ -1232,37 +1232,37 @@ dump_fcpl(hid_t fid)
/* Take out this because the driver used can be different from the
* standard output. */
/*indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %s\n","FILE_DRIVER", dname);*/
+ HDfprintf(rawoutstream, "%s %s\n","FILE_DRIVER", dname);*/
#endif
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %u\n","ISTORE_K", istore_ik);
+ HDfprintf(rawoutstream, "%s %u\n","ISTORE_K", istore_ik);
indentation(dump_indent + COL);
if(fs_strategy == H5F_FILE_SPACE_ALL_PERSIST)
- HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST");
+ HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST");
else if(fs_strategy == H5F_FILE_SPACE_ALL)
- HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL");
+ HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL");
else if(fs_strategy == H5F_FILE_SPACE_AGGR_VFD)
- HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD");
+ HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD");
else if(fs_strategy == H5F_FILE_SPACE_VFD)
- HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD");
+ HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD");
else
- HDfprintf(stdout, "%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy");
+ HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy");
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold);
+ HDfprintf(rawoutstream, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold);
/*-------------------------------------------------------------------------
* USER_BLOCK
*-------------------------------------------------------------------------
*/
indentation(dump_indent + COL);
- HDfprintf(stdout, "USER_BLOCK %s\n",BEGIN);
+ HDfprintf(rawoutstream, "USER_BLOCK %s\n",BEGIN);
indentation(dump_indent + COL + COL);
- HDfprintf(stdout,"%s %Hu\n","USERBLOCK_SIZE", userblock);
+ HDfprintf(rawoutstream,"%s %Hu\n","USERBLOCK_SIZE", userblock);
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s\n",END);
+ HDfprintf(rawoutstream, "%s\n",END);
- HDfprintf(stdout, "%s",END);
+ HDfprintf(rawoutstream, "%s",END);
}
/*-------------------------------------------------------------------------
@@ -1281,7 +1281,7 @@ dump_fcpl(hid_t fid)
void
dump_fcontents(hid_t fid)
{
- HDfprintf(stdout, "%s %s\n",FILE_CONTENTS, BEGIN);
+ HDfprintf(rawoutstream, "%s %s\n",FILE_CONTENTS, BEGIN);
/* special case of unamed types in root group */
if (unamedtype) {
@@ -1289,14 +1289,14 @@ dump_fcontents(hid_t fid)
for (u = 0; u < type_table->nobjs; u++) {
if (!type_table->objs[u].recorded)
- HDfprintf(stdout, " %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno);
+ HDfprintf(rawoutstream, " %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno);
}
}
/* print objects in the files */
h5trav_print(fid);
- HDfprintf(stdout, " %s\n",END);
+ HDfprintf(rawoutstream, " %s\n",END);
}
/*-------------------------------------------------------------------------
@@ -1322,7 +1322,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
hid_t oid = -1;
hid_t attr_id = -1;
char *obj_name;
- const char *attr_name;
+ char *attr_name;
int j;
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
@@ -1337,7 +1337,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
/* find the last / */
while(j >= 0) {
- if (attr[j] == '/')
+ if (attr[j] == '/' && (j==0 || (j>0 && attr[j-1]!='\\')))
break;
j--;
}
@@ -1372,37 +1372,40 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
string_dataformat.do_escape = display_escape;
outputformat = &string_dataformat;
- attr_name = attr + j + 1;
+ //attr_name = attr + j + 1;
+ // need to replace escape characters
+ attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/");
- /* Open the object with the attribute */
+
+ /* handle error case: cannot open the object with the attribute */
if((oid = H5Oopen(fid, obj_name, H5P_DEFAULT)) < 0) {
/* setup */
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->attributebegin, attr,
h5tools_dump_header_format->attributeblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
error_msg("unable to open object \"%s\"\n", obj_name);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->attributeblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->attributeblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeblockend);
- if(strlen(h5tools_dump_header_format->attributeend))
+ if(HDstrlen(h5tools_dump_header_format->attributeend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->attributeend))
+ if(HDstrlen(h5tools_dump_header_format->attributeend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
@@ -1415,7 +1418,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
attr_data_output = display_attr_data;
h5dump_type_table = type_table;
- h5tools_dump_attribute(stdout, outputformat, &ctx, oid, attr, attr_id, display_ai, display_char);
+ h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char);
h5dump_type_table = NULL;
if(attr_id < 0) {
@@ -1428,6 +1431,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
} /* end if */
HDfree(obj_name);
+ HDfree(attr_name);
dump_indent -= COL;
return;
@@ -1435,6 +1439,9 @@ error:
h5tools_setstatus(EXIT_FAILURE);
if(obj_name)
HDfree(obj_name);
+
+ if (attr_name)
+ HDfree(attr_name);
H5E_BEGIN_TRY {
H5Oclose(oid);
@@ -1474,13 +1481,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
if((dsetid = H5Dopen2(fid, dset, H5P_DEFAULT)) < 0) {
if (pe) {
- HDfprintf(stdout, "\n");
- begin_obj(h5tools_dump_header_format->datasetbegin, real_name, h5tools_dump_header_format->datasetblockbegin);
- HDfprintf(stdout, "\n");
- indentation(COL);
- error_msg("unable to open dataset \"%s\"\n", real_name);
- end_obj(h5tools_dump_header_format->datasetend, h5tools_dump_header_format->datasetblockend);
- h5tools_setstatus(EXIT_FAILURE);
+ handle_links(fid, dset, data, pe, display_name);
}
return;
} /* end if */
@@ -1502,26 +1503,26 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
* dimensions */
if(!sset->start.data) {
/* default to (0, 0, ...) for the start coord */
- sset->start.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t));
+ sset->start.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t));
sset->start.len = ndims;
}
if(!sset->stride.data) {
- sset->stride.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t));
+ sset->stride.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t));
sset->stride.len = ndims;
for (i = 0; i < ndims; i++)
sset->stride.data[i] = 1;
}
if(!sset->count.data) {
- sset->count.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t));
+ sset->count.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t));
sset->count.len = ndims;
for (i = 0; i < ndims; i++)
sset->count.data[i] = 1;
}
if(!sset->block.data) {
- sset->block.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t));
+ sset->block.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t));
sset->block.len = ndims;
for (i = 0; i < ndims; i++)
sset->block.data[i] = 1;
@@ -1577,12 +1578,12 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
if(found_obj) {
if (found_obj->displayed) {
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
indentation(dump_indent);
begin_obj(h5tools_dump_header_format->datasetbegin, real_name, h5tools_dump_header_format->datasetblockbegin);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
indentation(dump_indent + COL);
- HDfprintf(stdout, "%s \"%s\"\n", HARDLINK, found_obj->objname);
+ HDfprintf(rawoutstream, "%s \"%s\"\n", HARDLINK, found_obj->objname);
indentation(dump_indent);
end_obj(h5tools_dump_header_format->datasetend, h5tools_dump_header_format->datasetblockend);
}
@@ -1634,9 +1635,9 @@ handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const cha
if((gid = H5Gopen2(fid, group, H5P_DEFAULT)) < 0) {
if (pe) {
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
begin_obj(h5tools_dump_header_format->groupbegin, real_name, h5tools_dump_header_format->groupblockbegin);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
indentation(COL);
error_msg("unable to open group \"%s\"\n", real_name);
end_obj(h5tools_dump_header_format->groupend, h5tools_dump_header_format->groupblockend);
@@ -1691,15 +1692,15 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co
}
else {
char *buf = (char *)HDmalloc(linfo.u.val_size);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
switch(linfo.type) {
case H5L_TYPE_SOFT: /* Soft link */
begin_obj(h5tools_dump_header_format->softlinkbegin, links, h5tools_dump_header_format->softlinkblockbegin);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
indentation(COL);
if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0)
- HDfprintf(stdout, "LINKTARGET \"%s\"\n", buf);
+ HDfprintf(rawoutstream, "LINKTARGET \"%s\"\n", buf);
else {
error_msg("h5dump error: unable to get link value for \"%s\"\n", links);
h5tools_setstatus(EXIT_FAILURE);
@@ -1709,21 +1710,21 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co
case H5L_TYPE_EXTERNAL:
begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
indentation(COL);
begin_obj(h5tools_dump_header_format->extlinkbegin, links, h5tools_dump_header_format->extlinkblockbegin);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) {
const char *elink_file;
const char *elink_path;
if(H5Lunpack_elink_val(buf, linfo.u.val_size, NULL, &elink_file, &elink_path)>=0) {
indentation(COL);
- HDfprintf(stdout, "LINKCLASS %d\n", linfo.type);
+ HDfprintf(rawoutstream, "LINKCLASS %d\n", linfo.type);
indentation(COL);
- HDfprintf(stdout, "TARGETFILE \"%s\"\n", elink_file);
+ HDfprintf(rawoutstream, "TARGETFILE \"%s\"\n", elink_file);
indentation(COL);
- HDfprintf(stdout, "TARGETPATH \"%s\"\n", elink_path);
+ HDfprintf(rawoutstream, "TARGETPATH \"%s\"\n", elink_path);
}
else {
error_msg("h5dump error: unable to unpack external link value for \"%s\"\n", links);
@@ -1739,12 +1740,12 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co
default:
begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
indentation(COL);
begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
indentation(COL);
- HDfprintf(stdout, "LINKCLASS %d\n", linfo.type);
+ HDfprintf(rawoutstream, "LINKCLASS %d\n", linfo.type);
end_obj(h5tools_dump_header_format->udlinkend, h5tools_dump_header_format->udlinkblockend);
break;
} /* end switch */
@@ -1798,9 +1799,9 @@ handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const
if(idx == type_table->nobjs) {
if (pe) {
/* unknown type */
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
begin_obj(h5tools_dump_header_format->datatypebegin, real_name, h5tools_dump_header_format->datatypeblockbegin);
- HDfprintf(stdout, "\n");
+ HDfprintf(rawoutstream, "\n");
indentation(COL);
error_msg("unable to open datatype \"%s\"\n", real_name);
end_obj(h5tools_dump_header_format->datatypeend, h5tools_dump_header_format->datatypeblockend);
diff --git a/tools/h5dump/h5dump_defines.h b/tools/h5dump/h5dump_defines.h
index a801cac..4af5360 100644
--- a/tools/h5dump/h5dump_defines.h
+++ b/tools/h5dump/h5dump_defines.h
@@ -26,20 +26,20 @@
#define begin_obj(obj,name,begin) \
do { \
if (name) \
- HDfprintf(stdout, "%s \"%s\" %s", (obj), (name), (begin)); \
+ HDfprintf(rawoutstream, "%s \"%s\" %s", (obj), (name), (begin)); \
else \
- HDfprintf(stdout, "%s %s", (obj), (begin)); \
+ HDfprintf(rawoutstream, "%s %s", (obj), (begin)); \
} while(0);
#define end_obj(obj,end) \
do { \
if(HDstrlen(end)) { \
- HDfprintf(stdout, "%s", end); \
+ HDfprintf(rawoutstream, "%s", end); \
if(HDstrlen(obj)) \
- HDfprintf(stdout, " "); \
+ HDfprintf(rawoutstream, " "); \
} \
if(HDstrlen(obj)) \
- HDfprintf(stdout, "%s", obj); \
+ HDfprintf(rawoutstream, "%s", obj); \
} while(0);
diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c
index 5b6cba1..e6f8043 100644
--- a/tools/h5dump/h5dump_xml.c
+++ b/tools/h5dump/h5dump_xml.c
@@ -156,30 +156,30 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s \"%s\" %s",
h5tools_dump_header_format->datasetbegin, name,
h5tools_dump_header_format->datasetblockbegin);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
- if(strlen(h5tools_dump_header_format->datasetblockend)) {
+ if(HDstrlen(h5tools_dump_header_format->datasetblockend)) {
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend);
- if(strlen(h5tools_dump_header_format->datasetend))
+ if(HDstrlen(h5tools_dump_header_format->datasetend))
h5tools_str_append(&buffer, " ");
}
- if(strlen(h5tools_dump_header_format->datasetend))
+ if(HDstrlen(h5tools_dump_header_format->datasetend))
h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
@@ -203,7 +203,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -216,31 +216,31 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
t_obj_path, /* H5Path */
parentxid, /* Parents */
t_prefix); /* H5ParentPaths */
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
xml_name_to_XID(found_obj->objname, pointerxid, sizeof(pointerxid), 1);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDatasetPtr OBJ-XID=\"%s\" H5Path=\"%s\"/>",
xmlnsprefix,
pointerxid,t_objname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataset>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_name);
HDfree(t_obj_path);
@@ -326,7 +326,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
if (res == 0) {
/* target obj found */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -343,12 +343,12 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
targetxid, /* TargetObj */
parentxid, /* Parents */
t_prefix); /* H5ParentPaths */
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
/* dangling link -- omit from xml attributes */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -364,7 +364,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
t_targbuf, /* TargetPath */
parentxid, /* Parents */
t_prefix); /* H5ParentPaths */
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
HDfree(t_prefix);
@@ -409,7 +409,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -427,7 +427,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
targname, /* TargetPath*/
parentxid, /* Parents */
t_prefix); /* H5ParentPaths */
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_prefix);
HDfree(t_name);
@@ -452,7 +452,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -468,7 +468,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNU
linfo->type, /* LinkClass */
parentxid, /* Parents */
t_prefix); /* H5ParentPaths */
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_prefix);
HDfree(t_name);
@@ -567,24 +567,24 @@ xml_escape_the_name(const char *str)
return NULL;
cp = str;
- len = strlen(str);
+ len = HDstrlen(str);
extra = 0;
for (i = 0; i < len; i++) {
if (*cp == '\"') {
- extra += (strlen(quote) - 1);
+ extra += (HDstrlen(quote) - 1);
}
else if (*cp == '\'') {
- extra += (strlen(apos) - 1);
+ extra += (HDstrlen(apos) - 1);
}
else if (*cp == '<') {
- extra += (strlen(lt) - 1);
+ extra += (HDstrlen(lt) - 1);
}
else if (*cp == '>') {
- extra += (strlen(gt) - 1);
+ extra += (HDstrlen(gt) - 1);
}
else if (*cp == '&') {
- extra += (strlen(amp) - 1);
+ extra += (HDstrlen(amp) - 1);
}
cp++;
@@ -601,28 +601,28 @@ xml_escape_the_name(const char *str)
for (i = 0; i < len; i++) {
if (*cp == '\'') {
- strncpy(ncp, apos, strlen(apos));
- ncp += strlen(apos);
+ HDstrncpy(ncp, apos, HDstrlen(apos));
+ ncp += HDstrlen(apos);
cp++;
}
else if (*cp == '<') {
- strncpy(ncp, lt, strlen(lt));
- ncp += strlen(lt);
+ HDstrncpy(ncp, lt, HDstrlen(lt));
+ ncp += HDstrlen(lt);
cp++;
}
else if (*cp == '>') {
- strncpy(ncp, gt, strlen(gt));
- ncp += strlen(gt);
+ HDstrncpy(ncp, gt, HDstrlen(gt));
+ ncp += HDstrlen(gt);
cp++;
}
else if (*cp == '\"') {
- strncpy(ncp, quote, strlen(quote));
- ncp += strlen(quote);
+ HDstrncpy(ncp, quote, HDstrlen(quote));
+ ncp += HDstrlen(quote);
cp++;
}
else if (*cp == '&') {
- strncpy(ncp, amp, strlen(amp));
- ncp += strlen(amp);
+ HDstrncpy(ncp, amp, HDstrlen(amp));
+ ncp += HDstrlen(amp);
cp++;
}
else {
@@ -664,7 +664,7 @@ xml_escape_the_string(const char *str, int slen)
cp = str;
if (slen < 0)
- len = strlen(str);
+ len = HDstrlen(str);
else
len = slen;
@@ -678,22 +678,22 @@ xml_escape_the_string(const char *str, int slen)
extra++;
}
else if (*cp == '\'') {
- extra += (strlen(apos) - 1);
+ extra += (HDstrlen(apos) - 1);
}
else if (*cp == '<') {
- extra += (strlen(lt) - 1);
+ extra += (HDstrlen(lt) - 1);
}
else if (*cp == '>') {
- extra += (strlen(gt) - 1);
+ extra += (HDstrlen(gt) - 1);
}
else if (*cp == '&') {
- extra += (strlen(amp) - 1);
+ extra += (HDstrlen(amp) - 1);
}
cp++;
}
cp = str;
- rcp = ncp = (char *) calloc((len + extra + 1), sizeof(char));
+ rcp = ncp = (char *) HDcalloc((len + extra + 1), sizeof(char));
if (ncp == NULL)
return NULL; /* ?? */
@@ -708,23 +708,23 @@ xml_escape_the_string(const char *str, int slen)
*ncp++ = *cp++;
}
else if (*cp == '\'') {
- strncpy(ncp, apos, strlen(apos));
- ncp += strlen(apos);
+ HDstrncpy(ncp, apos, HDstrlen(apos));
+ ncp += HDstrlen(apos);
cp++;
}
else if (*cp == '<') {
- strncpy(ncp, lt, strlen(lt));
- ncp += strlen(lt);
+ HDstrncpy(ncp, lt, HDstrlen(lt));
+ ncp += HDstrlen(lt);
cp++;
}
else if (*cp == '>') {
- strncpy(ncp, gt, strlen(gt));
- ncp += strlen(gt);
+ HDstrncpy(ncp, gt, HDstrlen(gt));
+ ncp += HDstrlen(gt);
cp++;
}
else if (*cp == '&') {
- strncpy(ncp, amp, strlen(amp));
- ncp += strlen(amp);
+ HDstrncpy(ncp, amp, HDstrlen(amp));
+ ncp += HDstrlen(amp);
cp++;
}
else {
@@ -828,38 +828,38 @@ xml_print_datatype(hid_t type, unsigned in_group)
as it's name. */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"/%s\"/>",
xmlnsprefix, dtxid);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
/* point to the NDT by name */
char *t_objname = xml_escape_the_name(found_obj->objname);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>",
xmlnsprefix, dtxid, t_objname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_objname);
}
HDfree(dtxid);
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- h5dump error: unknown committed type. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_setstatus(EXIT_FAILURE);
}
}
@@ -868,12 +868,12 @@ xml_print_datatype(hid_t type, unsigned in_group)
switch (H5Tget_class(type)) {
case H5T_INTEGER:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
/* <hdf5:IntegerType ByteOrder="bo" Sign="torf" Size="bytes"/> */
@@ -881,7 +881,7 @@ xml_print_datatype(hid_t type, unsigned in_group)
sgn = H5Tget_sign(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -915,16 +915,16 @@ xml_print_datatype(hid_t type, unsigned in_group)
sz = H5Tget_size(type);
h5tools_str_append(&buffer, "%lu", (unsigned long)sz);
h5tools_str_append(&buffer, "\" />");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_FLOAT:
@@ -935,16 +935,16 @@ xml_print_datatype(hid_t type, unsigned in_group)
ord = H5Tget_order(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -971,45 +971,45 @@ xml_print_datatype(hid_t type, unsigned in_group)
h5tools_str_append(&buffer, "\" SignBitLocation=\"%lu\" ", (unsigned long)spos);
h5tools_str_append(&buffer, "ExponentBits=\"%lu\" ExponentLocation=\"%lu\" ", (unsigned long)esize, (unsigned long)epos);
h5tools_str_append(&buffer, "MantissaBits=\"%lu\" MantissaLocation=\"%lu\" />", (unsigned long)msize, (unsigned long)mpos);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_TIME:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sTimeType />",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_append(&buffer, "<!-- H5T_TIME: not yet implemented -->");
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_STRING:
@@ -1020,17 +1020,17 @@ xml_print_datatype(hid_t type, unsigned in_group)
is_vlstr = H5Tis_variable_str(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1057,16 +1057,16 @@ xml_print_datatype(hid_t type, unsigned in_group)
else {
h5tools_str_append(&buffer, "H5T_STR_ERROR\"/>");
}
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_BITFIELD:
@@ -1074,16 +1074,16 @@ xml_print_datatype(hid_t type, unsigned in_group)
ord = H5Tget_order(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1103,33 +1103,33 @@ xml_print_datatype(hid_t type, unsigned in_group)
size = H5Tget_size(type);
h5tools_str_append(&buffer, "\" Size=\"%lu\"/>", (unsigned long)size);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_OPAQUE:
/* <hdf5:OpaqueType Tag="tag" Size="bytes" /> */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
mname = H5Tget_tag(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -1137,16 +1137,16 @@ xml_print_datatype(hid_t type, unsigned in_group)
HDfree(mname);
size = H5Tget_size(type);
h5tools_str_append(&buffer, "Size=\"%lu\"/>", (unsigned long)size);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_COMPOUND:
@@ -1156,12 +1156,12 @@ xml_print_datatype(hid_t type, unsigned in_group)
nmembers = H5Tget_nmembers(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sCompoundType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
/* List each member Field of the type */
/* <hdf5:Field FieldName="name" > */
@@ -1176,12 +1176,12 @@ xml_print_datatype(hid_t type, unsigned in_group)
t_fname = xml_escape_the_name(mname);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sField FieldName=\"%s\">",xmlnsprefix, t_fname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(mname);
HDfree(t_fname);
@@ -1189,12 +1189,12 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
xml_print_datatype(mtype,0);
@@ -1202,80 +1202,80 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_indent -= COL;
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sField>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
dump_indent -= COL;
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sCompoundType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_REFERENCE:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
/* Only Object references supported at this time */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sReferenceType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sObjectReferenceType />",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sReferenceType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_ENUM:
@@ -1283,62 +1283,62 @@ xml_print_datatype(hid_t type, unsigned in_group)
nmembs = H5Tget_nmembers(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_indent += COL;
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sEnumType Nelems=\"%d\">",xmlnsprefix, nmembs);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
xml_print_enum(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sEnumType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_indent -= COL;
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAtomicType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_VLEN:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sVLType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
super = H5Tget_super(type);
dump_indent += COL;
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_indent += COL;
ctx.indent_level++;
xml_print_datatype(super,0);
@@ -1346,22 +1346,22 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_indent -= COL;
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sVLType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
H5Tclose(super);
break;
@@ -1372,14 +1372,14 @@ xml_print_datatype(hid_t type, unsigned in_group)
/* Print lead-in */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sArrayType Ndims=\"",xmlnsprefix);
ndims = H5Tget_array_ndims(type);
h5tools_str_append(&buffer, "%u\">", ndims);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
/* Get array information */
H5Tget_array_dims2(type, dims);
@@ -1388,12 +1388,12 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
for (i = 0; i < ndims; i++) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sArrayDimension DimSize=\"%u\"/>", xmlnsprefix, (int) dims[i]);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.indent_level--;
@@ -1401,12 +1401,12 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_indent += COL;
ctx.indent_level++;
xml_print_datatype(super,0);
@@ -1414,34 +1414,34 @@ xml_print_datatype(hid_t type, unsigned in_group)
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_indent -= COL;
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sArrayType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
/* Close array base type */
H5Tclose(super);
break;
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- unknown datatype -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_setstatus(EXIT_FAILURE);
break;
}
@@ -1521,48 +1521,48 @@ xml_dump_datatype(hid_t type)
*/
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\"/>",
xmlnsprefix, dtxid);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
/* pointer to a named datatype already in XML */
char *t_objname = xml_escape_the_name(found_obj->objname);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\" />",
xmlnsprefix, dtxid, t_objname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_objname);
}
HDfree(dtxid);
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- h5dump error: unknown committed type. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataType>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
xml_print_datatype(type, 0);
@@ -1570,12 +1570,12 @@ xml_dump_datatype(hid_t type)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataType>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.indent_level--;
dump_indent -= COL;
@@ -1638,12 +1638,12 @@ xml_dump_dataspace(hid_t space)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataspace>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
switch (space_type) {
@@ -1651,12 +1651,12 @@ xml_dump_dataspace(hid_t space)
/* scalar dataspace (just a tag, no XML attrs. defined */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sScalarDataspace />",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5S_SIMPLE:
@@ -1664,56 +1664,56 @@ xml_dump_dataspace(hid_t space)
/* <hdf5:SimpleDataspace Ndims="nd"> */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sSimpleDataspace Ndims=\"%d\">",xmlnsprefix, ndims);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
/* print the <hdf5:Dimension> elements */
ctx.indent_level++;
for (i = 0; i < ndims; i++) {
if (maxsize[i] == H5S_UNLIMITED) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"UNLIMITED\"/>",
xmlnsprefix,size[i]);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else if (maxsize[i] == (hsize_t) 0) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>",
xmlnsprefix,size[i], size[i]);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>",
xmlnsprefix, size[i], maxsize[i]);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
}
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sSimpleDataspace>", xmlnsprefix );
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
#ifdef TMP
@@ -1722,35 +1722,35 @@ xml_dump_dataspace(hid_t space)
/* null dataspace (just a tag, no XML attrs. defined */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNullDataspace />",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
#endif /* TMP */
case H5S_NO_CLASS:
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- unknown dataspace -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataspace>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
h5tools_str_close(&buffer);
@@ -1821,22 +1821,22 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
outputformat = &string_dataformat;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
@@ -1857,7 +1857,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
datactx.need_prefix = TRUE;
datactx.indent_level = ctx.indent_level;
datactx.cur_column = ctx.cur_column;
- status = h5tools_dump_dset(stdout, outputformat, &datactx, obj_id, -1, NULL);
+ status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, -1, NULL);
}
}
else {
@@ -1906,7 +1906,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
datactx.need_prefix = TRUE;
datactx.indent_level = ctx.indent_level;
datactx.cur_column = ctx.cur_column;
- status = h5tools_dump_mem(stdout, outputformat, &datactx, obj_id, p_type, space, buf);
+ status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf);
}
/* Reclaim any VL memory, if necessary */
if (vl_data)
@@ -1923,12 +1923,12 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "Unable to print data.");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
@@ -1944,17 +1944,17 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataFromFile>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
}
@@ -2013,12 +2013,12 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info,
outputformat = &string_dataformat;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sAttribute Name=\"%s\">", xmlnsprefix, t_aname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_aname);
if ((attr_id = H5Aopen(attr, attr_name, H5P_DEFAULT)) >= 0) {
@@ -2049,44 +2049,44 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info,
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Time data not yet implemented. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<hdf5:Data>");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
dump_indent -= COL;
@@ -2094,112 +2094,112 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info,
case H5T_COMPOUND:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Note: format of compound data not specified -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0);
break;
case H5T_REFERENCE:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
if (!H5Tequal(type, H5T_STD_REF_OBJ)) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Note: Region references not supported -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
xml_print_refs(attr_id, ATTRIBUTE_DATA);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_VLEN:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Note: format of VL data not specified -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0);
break;
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Unknown datatype: %d -->", H5Tget_class(type));
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
}
}
@@ -2207,32 +2207,32 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info,
/* The case of an attribute never yet written ??
* Or dataspace is H5S_NULL. */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.indent_level--;
dump_indent -= COL;
@@ -2242,12 +2242,12 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info,
H5Aclose(attr_id);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAttribute>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
return SUCCEED;
@@ -2257,22 +2257,22 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info,
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- h5dump error: unable to open attribute. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sAttribute>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
@@ -2357,7 +2357,7 @@ xml_dump_named_datatype(hid_t type, const char *name)
*/
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2366,13 +2366,13 @@ xml_dump_named_datatype(hid_t type, const char *name)
xmlnsprefix,
name, dtxid,
parentxid, HDstrcmp(prefix,"") ? t_prefix : "/");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
H5O_info_t oinfo; /* Object info */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2381,7 +2381,7 @@ xml_dump_named_datatype(hid_t type, const char *name)
xmlnsprefix,
t_name, dtxid,
t_tmp, parentxid, (HDstrcmp(prefix, "") ? t_prefix : "/"));
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
/* Check uniqueness of named datatype */
H5Oget_info(type, &oinfo);
@@ -2409,22 +2409,22 @@ xml_dump_named_datatype(hid_t type, const char *name)
xml_name_to_XID(found_obj->objname, pointerxid, sizeof(pointerxid), 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNamedDatatypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", xmlnsprefix, pointerxid, t_objname);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sNamedDataType>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_objname);
goto done;
}
@@ -2437,12 +2437,12 @@ xml_dump_named_datatype(hid_t type, const char *name)
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
@@ -2451,23 +2451,23 @@ xml_dump_named_datatype(hid_t type, const char *name)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sNamedDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
done:
@@ -2607,13 +2607,13 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID("/", grpxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">",
xmlnsprefix, grpxid, "/");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
t_objname = xml_escape_the_name(found_obj->objname);
@@ -2622,7 +2622,7 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID(par, parentxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2630,7 +2630,7 @@ xml_dump_group(hid_t gid, const char *name)
"Parents=\"%s\" H5ParentPaths=\"%s\">",
xmlnsprefix,t_name, grpxid, get_next_xid(),
t_objname, parentxid, par_name);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_objname);
HDfree(par_name);
@@ -2642,7 +2642,7 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID(par, parentxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2650,7 +2650,7 @@ xml_dump_group(hid_t gid, const char *name)
"Parents=\"%s\" H5ParentPaths=\"%s\" />",
xmlnsprefix,
ptrstr, t_objname, parentxid, par_name);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
@@ -2666,13 +2666,13 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID("/", grpxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">",
xmlnsprefix, grpxid, "/");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
char *t_tmp = xml_escape_the_name(tmp);
@@ -2682,14 +2682,14 @@ xml_dump_group(hid_t gid, const char *name)
xml_name_to_XID(par, parentxid, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" "
"Parents=\"%s\" H5ParentPaths=\"%s\" >",
xmlnsprefix,t_name, grpxid, t_tmp, parentxid, par_name);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_tmp);
HDfree(par_name);
@@ -2752,7 +2752,7 @@ xml_dump_group(hid_t gid, const char *name)
char *parentxid = (char *)HDmalloc(100);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2773,7 +2773,7 @@ xml_dump_group(hid_t gid, const char *name)
HDfree(t_tmp);
HDfree(par_name);
}
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_name);
HDfree(grpxid);
@@ -2825,7 +2825,7 @@ xml_dump_group(hid_t gid, const char *name)
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -2833,7 +2833,7 @@ xml_dump_group(hid_t gid, const char *name)
h5tools_str_append(&buffer, "</%sRootGroup>", xmlnsprefix);
else
h5tools_str_append(&buffer, "</%sGroup>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
@@ -2899,7 +2899,7 @@ xml_print_refs(hid_t did, int source)
if ((tsiz = H5Tget_size(type)) == 0)
goto error;
- buf = (char *) calloc((size_t)(ssiz * tsiz), sizeof(char));
+ buf = (char *) HDcalloc((size_t)(ssiz * tsiz), sizeof(char));
if (buf == NULL)
goto error;
e = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -2915,7 +2915,7 @@ xml_print_refs(hid_t did, int source)
if ((tsiz = H5Tget_size(type)) == 0)
goto error;
- buf = (char *) calloc((size_t)(ssiz * tsiz), sizeof(char));
+ buf = (char *) HDcalloc((size_t)(ssiz * tsiz), sizeof(char));
if (buf == NULL) {
goto error;
}
@@ -2958,23 +2958,23 @@ xml_print_refs(hid_t did, int source)
if (!path) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"%s\"", "NULL");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
char *t_path = xml_escape_the_string(path, -1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"%s\"", t_path);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_path);
}
ctx.indent_level--;
@@ -3085,7 +3085,7 @@ xml_print_strs(hid_t did, int source)
bp = (char*) buf;
if (!is_vlstr)
- onestring = (char *) calloc(tsiz, sizeof(char));
+ onestring = (char *) HDcalloc(tsiz, sizeof(char));
/* setup */
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -3124,23 +3124,23 @@ xml_print_strs(hid_t did, int source)
if (!onestring) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "NULL");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
char *t_onestring = xml_escape_the_string(onestring, (int) str_size);
if (t_onestring) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"%s\"", t_onestring);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_onestring);
}
}
@@ -3235,7 +3235,7 @@ check_filters(hid_t dcpl)
if (filter == H5Z_FILTER_DEFLATE) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3248,36 +3248,36 @@ check_filters(hid_t dcpl)
h5tools_str_append(&buffer, "%d", cd_values[0]);
}
h5tools_str_append(&buffer, "\"/>");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
}
else if (filter == H5Z_FILTER_FLETCHER32) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sFletcher32 />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
}
else if (filter == H5Z_FILTER_SHUFFLE) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sShuffle />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
}
else if (filter == H5Z_FILTER_SZIP) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3318,7 +3318,7 @@ check_filters(hid_t dcpl)
h5tools_str_append(&buffer, "Header=\"Raw\"");
}
h5tools_str_append(&buffer, "/>");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
}
else {
@@ -3371,12 +3371,12 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
@@ -3389,126 +3389,126 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
const char * path = lookup_ref_path(*(hobj_ref_t *) buf);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
if (!path) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"%s\"", "NULL");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
char *t_path = xml_escape_the_string(path, -1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"%s\"", t_path);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_path);
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else if (H5Tget_class(type) == H5T_STRING) {
/* ????? */
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- String fill values not yet implemented. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
/* all other data */
switch (H5Tget_class(type)) {
case H5T_INTEGER:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"%d\"", *(int *) buf);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_FLOAT:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"%f\"", *(float *) buf);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_BITFIELD:
case H5T_OPAQUE:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
sz = H5Tget_size(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3518,126 +3518,126 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
buf = (char *) buf + sizeof(unsigned int);
}
h5tools_str_append(&buffer, "\"");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_ENUM:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
name = H5Tget_member_name(type, *(unsigned *) buf);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"%s\"", name);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_ARRAY:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Array fill values not yet implemented. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_TIME:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Time fill not yet implemented. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_COMPOUND:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Compound fill not yet implemented. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_VLEN:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- VL fill not yet implemented. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Unknown fill datatype: %d -->", H5Tget_class(type));
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
}
}
@@ -3646,12 +3646,12 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
dump_indent -= COL;
@@ -3738,14 +3738,14 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
xml_name_to_XID(prefix, pstr, 100, 1);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataset Name=\"%s\" OBJ-XID=\"%s\" H5Path= \"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">",
xmlnsprefix, t_name, rstr, t_tmp, pstr,
strcmp(prefix, "") ? t_prefix : "/");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_name);
HDfree(t_tmp);
@@ -3769,24 +3769,24 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sChunkedLayout ", xmlnsprefix);
ndims = H5Pget_chunk(dcpl, maxdims, chsize);
h5tools_str_append(&buffer, "Ndims=\"%d\">", ndims);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
@@ -3794,21 +3794,21 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
for (i = 0; i < ndims; i++) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" />", xmlnsprefix, chsize[i]);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sRequiredFilter>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
@@ -3817,33 +3817,33 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sRequiredFilter>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sChunkedLayout>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sStorageLayout>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
dump_indent -= COL;
HDfree(chsize);
@@ -3852,60 +3852,60 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sContiguousLayout/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sStorageLayout>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
}
else if (H5D_COMPACT == H5Pget_layout(dcpl)) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sCompactLayout/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sStorageLayout>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
}
/* and check for external.... ?? */
@@ -3916,7 +3916,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -3957,30 +3957,30 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
}
h5tools_str_append(&buffer, "\"");
h5tools_str_append(&buffer, ">");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sFillValue>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
H5Pfill_value_defined(dcpl, &fvstatus);
if (fvstatus == H5D_FILL_VALUE_UNDEFINED || (fvstatus == H5D_FILL_VALUE_DEFAULT && ft == H5D_FILL_TIME_IFSET)) {
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoFill/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
}
else {
@@ -3988,23 +3988,23 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sFillValue>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sFillValueInfo>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
dump_indent -= COL;
@@ -4052,48 +4052,48 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Time data not yet implemented. -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
break;
case H5T_COMPOUND:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Note: format of compound data not specified -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
@@ -4104,68 +4104,68 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
case H5T_REFERENCE:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
if (!H5Tequal(type, H5T_STD_REF_OBJ)) {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Note: Region references not supported -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
else {
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
xml_print_refs(did, DATASET_DATA);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataFromFile>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
case H5T_VLEN:
ctx.indent_level--;
dump_indent -= COL;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Note: format of VL data not specified -->");
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
dump_indent += COL;
@@ -4177,36 +4177,36 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
break;
default:
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<!-- Unknown datatype: %d -->", H5Tget_class(type));
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
break;
}
}
@@ -4215,30 +4215,30 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sData>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
}
@@ -4247,12 +4247,12 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset)
H5Pclose(dcpl);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataset>", xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
h5tools_str_close(&buffer);
}
@@ -4316,22 +4316,22 @@ xml_print_enum(hid_t type)
super = H5Tget_super(type);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
xml_print_datatype(super,0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sDataType>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
/*
* Determine what datatype to use for the native values. To simplify
@@ -4355,8 +4355,8 @@ xml_print_enum(hid_t type)
}
/* Get the names and raw values of all members */
- name = (char **)calloc(nmembs, sizeof(char *));
- value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size));
+ name = (char **)HDcalloc(nmembs, sizeof(char *));
+ value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size));
for (i = 0; i < nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
@@ -4377,41 +4377,41 @@ xml_print_enum(hid_t type)
char *t_name = xml_escape_the_name(name[i]);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sEnumElement>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "%s", t_name);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
HDfree(t_name);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sEnumElement>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "<%sEnumValue>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level++;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
@@ -4429,16 +4429,16 @@ xml_print_enum(hid_t type)
h5tools_str_append(&buffer,"%" H5_PRINTF_LL_WIDTH "d",
*((long long *) ((void *) (value + i * dst_size))));
}
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
ctx.indent_level--;
ctx.need_prefix = TRUE;
- h5tools_simple_prefix(stdout, outputformat, &ctx, 0, 0);
+ h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0);
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "</%sEnumValue>",xmlnsprefix);
- h5tools_render_element(stdout, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0);
}
ctx.indent_level--;
dump_indent -= COL;
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index f87f93a..b28f3de 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -426,7 +426,7 @@ gent_attribute(void)
/* attribute 1 */
dims[0] = 24;
space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(root, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
+ attr = H5Acreate2(root, "/attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
sprintf(buf, "attribute of root group");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
@@ -3528,7 +3528,7 @@ void gent_split_file(void)
root = H5Gopen2(fid, "/", H5P_DEFAULT);
atype = H5Tcopy(H5T_C_S1);
- H5Tset_size(atype, strlen(meta) + 1);
+ H5Tset_size(atype, HDstrlen(meta) + 1);
H5Tset_strpad(atype, H5T_STR_NULLTERM);
dims[0] = 1;
@@ -3729,7 +3729,7 @@ static void gent_char(void)
hid_t sid1; /* Dataspace ID */
hsize_t dims1[1];
- dims1[0] = strlen(wdata);
+ dims1[0] = HDstrlen(wdata);
/* Create file */
fid1 = H5Fcreate(FILE39, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index ee91880..25a30c5 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -50,6 +50,7 @@ if test -z "$srcdir"; then
fi
# source dirs
SRC_TOOLS="$srcdir/../"
+
SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles"
# testfiles source dirs for tools
SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES"
@@ -244,10 +245,12 @@ $SRC_H5DUMP_TESTFILES/tlarge_objname.ddl
$SRC_H5DUMP_TESTFILES/tlonglinks.ddl
$SRC_H5DUMP_TESTFILES/tloop-1.ddl
$SRC_H5DUMP_TESTFILES/tmulti.ddl
+$SRC_H5DUMP_TESTFILES/tmultifile.ddl
+$SRC_H5DUMP_TESTFILES/tqmarkfile.ddl
+$SRC_H5DUMP_TESTFILES/tstarfile.ddl
$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl
$SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl
$SRC_H5DUMP_TESTFILES/tnbit.ddl
-$SRC_H5DUMP_TESTFILES/tnofilename.ddl
$SRC_H5DUMP_TESTFILES/tno-subset.ddl
$SRC_H5DUMP_TESTFILES/tnullspace.ddl
$SRC_H5DUMP_TESTFILES/zerodim.ddl
@@ -267,6 +270,7 @@ $SRC_H5DUMP_TESTFILES/tscaleoffset.ddl
$SRC_H5DUMP_TESTFILES/tshuffle.ddl
$SRC_H5DUMP_TESTFILES/tslink-1.ddl
$SRC_H5DUMP_TESTFILES/tslink-2.ddl
+$SRC_H5DUMP_TESTFILES/tslink-D.ddl
$SRC_H5DUMP_TESTFILES/tsplit_file.ddl
$SRC_H5DUMP_TESTFILES/tstr-1.ddl
$SRC_H5DUMP_TESTFILES/tstr-2.ddl
@@ -713,14 +717,14 @@ TOOLTEST tgroup-2.ddl --group=/g2 --group / -g /y tgroup.h5
# test for displaying simple space datasets
TOOLTEST tdset-1.ddl --enable-error-stack tdset.h5
# test for displaying selected datasets
-TOOLTEST tdset-2.ddl -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5
+TOOLTEST3 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5
# test for displaying attributes
TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5
# test for displaying the selected attributes of string type and scalar space
-TOOLTEST tattr-2.ddl --enable-error-stack -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5
+TOOLTEST tattr-2.ddl --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 tattr.h5
# test for header and error messages
-TOOLTEST tattr-3.ddl --header -a /attr2 --attribute=/attr tattr.h5
+TOOLTEST3 tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5
# test for displaying at least 9 attributes on root from a BE machine
TOOLTEST tattr-4_be.ddl --enable-error-stack tattr4_be.h5
# test for displaying attributes in shared datatype (also in group and dataset)
@@ -732,6 +736,8 @@ TOOLTEST tudlink-1.ddl --enable-error-stack tudlink.h5
# test for displaying the selected link
TOOLTEST tslink-2.ddl --enable-error-stack -l slink2 tslink.h5
TOOLTEST tudlink-2.ddl --enable-error-stack -l udlink2 tudlink.h5
+# test for displaying dangling soft links
+TOOLTEST3 tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5
# tests for hard links
TOOLTEST thlink-1.ddl --enable-error-stack thlink.h5
@@ -792,6 +798,11 @@ TOOLTEST tarray6.ddl --enable-error-stack tarray6.h5
TOOLTEST tarray7.ddl --enable-error-stack tarray7.h5
TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5
+# test for wildcards in filename (does not work with cmake)
+# inconsistent across platforms TOOLTEST3 tstarfile.ddl --enable-error-stack -H -d Dataset1 tarr*.h5
+TOOLTEST3 tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5
+TOOLTEST tmultifile.ddl --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5
+
# test for files with empty data
TOOLTEST tempty.ddl --enable-error-stack tempty.h5
@@ -831,7 +842,7 @@ TOOLTEST tboot2.ddl --enable-error-stack -B tfcontents2.h5
TOOLTEST file_space.ddl --enable-error-stack -B file_space.h5
# test -p with a non existing dataset
-TOOLTEST tperror.ddl -p -d bogus tfcontents1.h5
+TOOLTEST3 tperror.ddl --enable-error-stack -p -d bogus tfcontents1.h5
# test for file contents
TOOLTEST tcontents.ddl --enable-error-stack -n tfcontents1.h5
@@ -876,57 +887,57 @@ TOOLTEST tindicessub3.ddl --enable-error-stack -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2
TOOLTEST tindicessub4.ddl --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5
#Exceed the dimensions for subsetting
-TOOLTEST texceedsubstart.ddl -d 1d -s 1,3 taindices.h5
-TOOLTEST texceedsubcount.ddl -d 1d -c 1,3 taindices.h5
-TOOLTEST texceedsubstride.ddl -d 1d -S 1,3 taindices.h5
-TOOLTEST texceedsubblock.ddl -d 1d -k 1,3 taindices.h5
+TOOLTEST texceedsubstart.ddl --enable-error-stack -d 1d -s 1,3 taindices.h5
+TOOLTEST texceedsubcount.ddl --enable-error-stack -d 1d -c 1,3 taindices.h5
+TOOLTEST texceedsubstride.ddl --enable-error-stack -d 1d -S 1,3 taindices.h5
+TOOLTEST texceedsubblock.ddl --enable-error-stack -d 1d -k 1,3 taindices.h5
+
-###### 2/17 SKIP tests because compression values are different ############
# tests for filters
# SZIP
-option="-H -p -d szip tfilters.h5"
+option="--enable-error-stack -H -p -d szip tfilters.h5"
if test $USE_FILTER_SZIP != "yes"; then
SKIP $option
else
TOOLTEST tszip.ddl $option
fi
# deflate
-option="-H -p -d deflate tfilters.h5"
+option="--enable-error-stack -H -p -d deflate tfilters.h5"
if test $USE_FILTER_DEFLATE != "yes"; then
SKIP $option
else
TOOLTEST tdeflate.ddl $option
fi
# shuffle
-option="-H -p -d shuffle tfilters.h5"
+option="--enable-error-stack -H -p -d shuffle tfilters.h5"
if test $USE_FILTER_SHUFFLE != "yes"; then
SKIP $option
else
TOOLTEST tshuffle.ddl $option
fi
# fletcher32
-option="-H -p -d fletcher32 tfilters.h5"
+option="--enable-error-stack -H -p -d fletcher32 tfilters.h5"
if test $USE_FILTER_FLETCHER32 != "yes"; then
SKIP $option
else
TOOLTEST tfletcher32.ddl $option
fi
# nbit
-option="-H -p -d nbit tfilters.h5"
+option="--enable-error-stack -H -p -d nbit tfilters.h5"
if test $USE_FILTER_NBIT != "yes"; then
SKIP $option
else
TOOLTEST tnbit.ddl $option
fi
# scaleoffset
-option="-H -p -d scaleoffset tfilters.h5"
+option="--enable-error-stack -H -p -d scaleoffset tfilters.h5"
if test $USE_FILTER_SCALEOFFSET != "yes"; then
SKIP $option
else
TOOLTEST tscaleoffset.ddl $option
fi
# all
-option="-H -p -d all tfilters.h5"
+option="--enable-error-stack -H -p -d all tfilters.h5"
if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes"; then
SKIP $option
else
@@ -1023,7 +1034,7 @@ TOOLTEST textlinkfar.ddl textlinkfar.h5
# test for dangling external links
# JIRA HDFFV-7936 TOOLTEST textlink.ddl --enable-error-stack textlink.h5
-TOOLTEST textlink.ddl textlink.h5
+TOOLTEST3 textlink.ddl --enable-error-stack textlink.h5
# test for error stack display (BZ2048)
TOOLTEST3 filter_fail.ddl --enable-error-stack filter_fail.h5
@@ -1035,7 +1046,7 @@ TOOLTEST tall-6.ddl --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h
# test failure handling
# Missing file name
-TOOLTEST tnofilename-with-packed-bits.ddl
+TOOLTEST tnofilename-with-packed-bits.ddl --enable-error-stack
# Limits:
# Maximum number of packed bits is 8 (for now).
# Maximum integer size is 64 (for now).
@@ -1094,23 +1105,23 @@ TOOLTEST tpbitsCompound.ddl --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.
TOOLTEST tpbitsArray.ddl --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5
# Test Error handling.
# Too many packed bits requested. Max is 8 for now.
-TOOLTEST tpbitsMaxExceeded.ddl -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5
+TOOLTEST tpbitsMaxExceeded.ddl --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5
# Offset too large. Max is 7 (8-1) for now.
-TOOLTEST tpbitsOffsetExceeded.ddl -d /DS08BITS -M 64,1 packedbits.h5
+TOOLTEST tpbitsOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5
TOOLTEST tpbitsCharOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5
TOOLTEST tpbitsIntOffsetExceeded.ddl --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5
TOOLTEST tpbitsLongOffsetExceeded.ddl --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5
# Bad offset, must not be negative.
-TOOLTEST tpbitsOffsetNegative.ddl -d /DS08BITS -M -1,1 packedbits.h5
+TOOLTEST tpbitsOffsetNegative.ddl --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5
# Bad length, must not be positive.
-TOOLTEST tpbitsLengthPositive.ddl -d /DS08BITS -M 4,0 packedbits.h5
+TOOLTEST tpbitsLengthPositive.ddl --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5
# Offset+Length is too large. Max is 8 for now.
-TOOLTEST tpbitsLengthExceeded.ddl -d /DS08BITS -M 37,28 packedbits.h5
+TOOLTEST tpbitsLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5
TOOLTEST tpbitsCharLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5
TOOLTEST tpbitsIntLengthExceeded.ddl --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5
TOOLTEST tpbitsLongLengthExceeded.ddl --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5
# Incomplete pair of packed bits request.
-TOOLTEST tpbitsIncomplete.ddl -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5
+TOOLTEST tpbitsIncomplete.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5
# Report test results and exit
diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt
index bb8de26..76dcf26 100644
--- a/tools/h5import/CMakeLists.txt
+++ b/tools/h5import/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5IMPORT)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
# Add the h5import executables
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 232f3c1..56dc5ab 100755
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <ctype.h>
#include "h5import.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
/* Name of tool */
@@ -53,19 +54,22 @@ int main(int argc, char *argv[])
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+ /* Initialize h5tools lib */
+ h5tools_init();
+
(void) HDsetvbuf(stderr, (char *) NULL, _IOLBF, 0);
(void) HDsetvbuf(stdout, (char *) NULL, _IOLBF, 0);
if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) {
print_version(PROGRAMNAME);
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
}
/*
* validate the number of command line arguments
*/
if (argc < 2) {
- (void) fprintf(stderr, err1, argc);
+ (void) HDfprintf(stderr, err1, argc);
usage(argv[0]);
goto err;
}
@@ -95,7 +99,7 @@ int main(int argc, char *argv[])
opt.fcount++;
}
else {
- (void) fprintf(stderr, err9, argv[i]);
+ (void) HDfprintf(stderr, err9, argv[i]);
goto err;
}
@@ -119,7 +123,7 @@ int main(int argc, char *argv[])
case 6: /* -h found; help, then exit */
help(argv[0]);
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
break;
case 7: /* -d found; look for dimensions */
@@ -127,7 +131,7 @@ int main(int argc, char *argv[])
case 8: /* read dimensions */
if (parseDimensions(in, argv[i]) == -1) {
- (void) fprintf(stderr, err6, argv[i]);
+ (void) HDfprintf(stderr, err6, argv[i]);
goto err;
}
break;
@@ -137,7 +141,7 @@ int main(int argc, char *argv[])
case 10: /* read path name */
if (parsePathInfo(&in->path, argv[i]) == -1) {
- (void) fprintf(stderr, err5, argv[i]);
+ (void) HDfprintf(stderr, err5, argv[i]);
goto err;
}
break;
@@ -147,7 +151,7 @@ int main(int argc, char *argv[])
case 12: /* read data type */
if (getInputClass(in, argv[i]) == -1) {
- (void) fprintf(stderr, err7, argv[i]);
+ (void) HDfprintf(stderr, err7, argv[i]);
goto err;
}
@@ -164,7 +168,7 @@ int main(int argc, char *argv[])
case 14: /* read data size */
if (getInputSize(in, (int) HDstrtol(argv[i], NULL, BASE_10)) == -1) {
- (void) fprintf(stderr, err8, argv[i]);
+ (void) HDfprintf(stderr, err8, argv[i]);
goto err;
}
/*set default value for output-size */
@@ -173,14 +177,14 @@ int main(int argc, char *argv[])
case ERR: /* command syntax error */
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
usage(argv[0]);
goto err;
}
}
if (FALSE == outfile_named) {
- (void) fprintf(stderr, "%s", err3);
+ (void) HDfprintf(stderr, "%s", err3);
usage(argv[0]);
goto err;
}
@@ -204,7 +208,7 @@ int main(int argc, char *argv[])
return (EXIT_SUCCESS);
err:
- (void) fprintf(stderr, "%s", err4);
+ (void) HDfprintf(stderr, "%s", err4);
for (i = 0; i < opt.fcount; i++) {
in = &(opt.infiles[i].in);
if (in->sizeOfDimension)
@@ -272,7 +276,7 @@ static int gtoken(char *s)
}
if (token == ERR)
- (void) fprintf(stderr, err1, s);
+ (void) HDfprintf(stderr, err1, s);
}
else { /* filename */
token = FILNAME;
@@ -318,7 +322,7 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id)
if (in->inputClass == 4 /* "IN" */|| in->inputClass == 3 /* "FP" */|| in->inputClass == 7 /* "UIN" */) {
if ((strm = HDfopen(infile, READ_OPEN_FLAGS)) == NULL) {
- (void) fprintf(stderr, err1, infile);
+ (void) HDfprintf(stderr, err1, infile);
return (-1);
}
}
@@ -328,7 +332,7 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id)
*/
else {
if ((strm = HDfopen(infile, "r")) == NULL) {
- (void) fprintf(stderr, err1, infile);
+ (void) HDfprintf(stderr, err1, infile);
return (-1);
}
}
@@ -337,13 +341,13 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id)
case 0: /* TEXTIN */
case 4: /* IN */
if (allocateIntegerStorage(in) == -1) {
- (void) fprintf(stderr, err2, infile);
+ (void) HDfprintf(stderr, err2, infile);
HDfclose(strm);
return (-1);
}
if (readIntegerData(strm, in) == -1) {
- (void) fprintf(stderr, err4, infile);
+ (void) HDfprintf(stderr, err4, infile);
HDfclose(strm);
return (-1);
}
@@ -353,14 +357,14 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id)
case 2: /* TEXTFPE */
case 3: /* FP */
if (allocateFloatStorage(in) == -1) {
- (void) fprintf(stderr, err3, infile);
+ (void) HDfprintf(stderr, err3, infile);
HDfclose(strm);
return (-1);
}
if (readFloatData(strm, in) == -1) {
- (void) fprintf(stderr, err5, infile);
+ (void) HDfprintf(stderr, err5, infile);
HDfclose(strm);
return (-1);
}
@@ -369,7 +373,7 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id)
case 5: /* STR */
if (processStrData(strm, in, file_id) == -1) {
- (void) fprintf(stderr, err11, infile);
+ (void) HDfprintf(stderr, err11, infile);
HDfclose(strm);
return (-1);
}
@@ -379,19 +383,19 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id)
case 6: /* TEXTUIN */
case 7: /* UIN */
if (allocateUIntegerStorage(in) == -1) {
- (void) fprintf(stderr, err6, infile);
+ (void) HDfprintf(stderr, err6, infile);
HDfclose(strm);
return (-1);
}
if (readUIntegerData(strm, in) == -1) {
- (void) fprintf(stderr, err7, infile);
+ (void) HDfprintf(stderr, err7, infile);
HDfclose(strm);
return (-1);
}
break;
default:
- (void) fprintf(stderr, "%s", err10);
+ (void) HDfprintf(stderr, "%s", err10);
HDfclose(strm);
return (-1);
}
@@ -427,7 +431,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
in08 = (H5DT_INT8 *) in->data;
for (i = 0; i < len; i++, in08++) {
if (fscanf(strm, "%hd", &temp) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
(*in08) = (H5DT_INT8) temp;
@@ -438,14 +442,14 @@ static int readIntegerData(FILE *strm, struct Input *in)
in08 = (H5DT_INT8 *) in->data;
for (i = 0; i < len; i++, in08++) {
if (HDfread((char *) in08, sizeof(H5DT_INT8), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
@@ -456,7 +460,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in16++) {
if (fscanf(strm, "%hd", in16) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
@@ -466,14 +470,14 @@ static int readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in16++) {
if (HDfread((char *) in16, sizeof(H5DT_INT16), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
@@ -484,7 +488,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in32++) {
if (fscanf(strm, "%d", in32) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
@@ -493,14 +497,14 @@ static int readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in32++) {
if (HDfread((char *) in32, sizeof(H5DT_INT32), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
@@ -512,7 +516,7 @@ static int readIntegerData(FILE *strm, struct Input *in)
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in64++) {
if (fscanf(strm, "%s", buffer) < 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
*in64 = (H5DT_INT64) HDstrtoll(buffer, NULL, 10);
@@ -522,21 +526,21 @@ static int readIntegerData(FILE *strm, struct Input *in)
case 4: /* IN */
for (i = 0; i < len; i++, in64++) {
if (HDfread((char *) in64, sizeof(H5DT_INT64), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
#endif /* ifdef H5_SIZEOF_LONG_LONG */
default:
- (void) fprintf(stderr, "%s", err3);
+ (void) HDfprintf(stderr, "%s", err3);
break;
}
return (0);
@@ -569,7 +573,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
in08 = (H5DT_UINT8 *) in->data;
for (i = 0; i < len; i++, in08++) {
if (fscanf(strm, "%hu", &temp) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
(*in08) = (H5DT_UINT8) temp;
@@ -580,14 +584,14 @@ static int readUIntegerData(FILE *strm, struct Input *in)
in08 = (H5DT_UINT8 *) in->data;
for (i = 0; i < len; i++, in08++) {
if (HDfread((char *) in08, sizeof(H5DT_UINT8), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
@@ -598,7 +602,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in16++) {
if (fscanf(strm, "%hu", in16) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
@@ -607,14 +611,14 @@ static int readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in16++) {
if (HDfread((char *) in16, sizeof(H5DT_UINT16), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
@@ -625,7 +629,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in32++) {
if (fscanf(strm, "%u", in32) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
@@ -634,14 +638,14 @@ static int readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in32++) {
if (HDfread((char *) in32, sizeof(H5DT_UINT32), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
@@ -653,7 +657,7 @@ static int readUIntegerData(FILE *strm, struct Input *in)
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in64++) {
if (fscanf(strm, "%s", buffer) < 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
*in64 = (H5DT_UINT64) HDstrtoll(buffer, NULL, 10);
@@ -663,21 +667,21 @@ static int readUIntegerData(FILE *strm, struct Input *in)
case 7: /* UIN */
for (i = 0; i < len; i++, in64++) {
if (HDfread((char *) in64, sizeof(H5DT_UINT64), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
#endif /* ifdef H5_SIZEOF_LONG_LONG */
default:
- (void) fprintf(stderr, "%s", err3);
+ (void) HDfprintf(stderr, "%s", err3);
break;
}
return (0);
@@ -705,7 +709,7 @@ static int readFloatData(FILE *strm, struct Input *in)
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp32++) {
if (fscanf(strm, "%f", fp32) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
@@ -718,7 +722,7 @@ static int readFloatData(FILE *strm, struct Input *in)
for (i = 0; i < len; i++, fp32++) {
if (fscanf(strm, "%f", fp32) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
@@ -729,14 +733,14 @@ static int readFloatData(FILE *strm, struct Input *in)
case 3: /* FP */
for (i = 0; i < len; i++, fp32++) {
if (HDfread((char *) fp32, sizeof(H5DT_FLOAT32), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
@@ -747,7 +751,7 @@ static int readFloatData(FILE *strm, struct Input *in)
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp64++) {
if (fscanf(strm, "%lf", fp64) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
@@ -760,7 +764,7 @@ static int readFloatData(FILE *strm, struct Input *in)
for (i = 0; i < len; i++, fp64++) {
if (fscanf(strm, "%lf", fp64) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
@@ -771,20 +775,20 @@ static int readFloatData(FILE *strm, struct Input *in)
case 3: /* FP */
for (i = 0; i < len; i++, fp64++) {
if (HDfread((char *) fp64, sizeof(H5DT_FLOAT64), 1, strm) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
break;
default:
- (void) fprintf(stderr, "%s", err3);
+ (void) HDfprintf(stderr, "%s", err3);
break;
}
return (0);
@@ -953,34 +957,34 @@ static int allocateIntegerStorage(struct Input *in)
switch (in->inputSize) {
case 8:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT8))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
case 16:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT16))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
case 32:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT32))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
case 64:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT64))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
break;
}
return (0);
@@ -999,34 +1003,34 @@ static int allocateUIntegerStorage(struct Input *in)
switch (in->inputSize) {
case 8:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT8))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
case 16:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT16))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
case 32:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT32))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
case 64:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT64))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
break;
}
return (0);
@@ -1045,20 +1049,20 @@ static int allocateFloatStorage(struct Input *in)
switch (in->inputSize) {
case 32:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT32))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
case 64:
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT64))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
break;
default:
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
break;
}
return (0);
@@ -1116,30 +1120,30 @@ static int processConfigurationFile(char *infile, struct Input *in)
*/
if ((strm = HDfopen(infile, "r")) == NULL) {
- (void) fprintf(stderr, err1, infile);
+ (void) HDfprintf(stderr, err1, infile);
return (-1);
}
while (fscanf(strm, "%s", key) == 1) {
if ((kindex = mapKeywordToIndex(key)) == -1) {
- (void) fprintf(stderr, err2, infile);
+ (void) HDfprintf(stderr, err2, infile);
HDfclose(strm);
return (-1);
}
switch (kindex) {
case 0: /* PATH */
if (in->configOptionVector[PATH] == 1) {
- (void) fprintf(stderr, err3a, infile);
+ (void) HDfprintf(stderr, err3a, infile);
HDfclose(strm);
return (-1);
}
if (fscanf(strm, "%s", temp) != 1) {
- (void) fprintf(stderr, "%s", err18);
+ (void) HDfprintf(stderr, "%s", err18);
HDfclose(strm);
return (-1);
}
if (parsePathInfo(&in->path, temp) == -1) {
- (void) fprintf(stderr, err3b, infile);
+ (void) HDfprintf(stderr, err3b, infile);
HDfclose(strm);
return (-1);
}
@@ -1148,18 +1152,18 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 1: /* INPUT-CLASS */
if (in->configOptionVector[INPUT_CLASS] == 1) {
- (void) fprintf(stderr, err4a, infile);
+ (void) HDfprintf(stderr, err4a, infile);
HDfclose(strm);
return (-1);
}
if (fscanf(strm, "%s", temp) != 1) {
- (void) fprintf(stderr, "%s", err18);
+ (void) HDfprintf(stderr, "%s", err18);
HDfclose(strm);
return (-1);
}
if (getInputClass(in, temp) == -1) {
- (void) fprintf(stderr, err4b, infile);
+ (void) HDfprintf(stderr, err4b, infile);
HDfclose(strm);
return (-1);
}
@@ -1180,17 +1184,17 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 2: /* INPUT-SIZE */
if (in->configOptionVector[INPUT_SIZE] == 1) {
- (void) fprintf(stderr, err5a, infile);
+ (void) HDfprintf(stderr, err5a, infile);
HDfclose(strm);
return (-1);
}
if (fscanf(strm, "%d", (&ival)) != 1) {
- (void) fprintf(stderr, "%s", err19);
+ (void) HDfprintf(stderr, "%s", err19);
HDfclose(strm);
return (-1);
}
if (getInputSize(in, ival) == -1) {
- (void) fprintf(stderr, err5b, infile);
+ (void) HDfprintf(stderr, err5b, infile);
HDfclose(strm);
return (-1);
}
@@ -1203,13 +1207,13 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 3: /* RANK */
if (in->configOptionVector[RANK] == 1) {
- (void) fprintf(stderr, err6a, infile);
+ (void) HDfprintf(stderr, err6a, infile);
HDfclose(strm);
return (-1);
}
if (getRank(in, strm) == -1) {
- (void) fprintf(stderr, err6b, infile);
+ (void) HDfprintf(stderr, err6b, infile);
HDfclose(strm);
return (-1);
}
@@ -1218,18 +1222,18 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 4: /* DIMENSION-SIZES */
if (in->configOptionVector[DIM] == 1) {
- (void) fprintf(stderr, err7a, infile);
+ (void) HDfprintf(stderr, err7a, infile);
HDfclose(strm);
return (-1);
}
if (in->configOptionVector[RANK] == 0) {
- (void) fprintf(stderr, err7b, infile);
+ (void) HDfprintf(stderr, err7b, infile);
HDfclose(strm);
return (-1);
}
if (getDimensionSizes(in, strm) == -1) {
- (void) fprintf(stderr, err7c, infile);
+ (void) HDfprintf(stderr, err7c, infile);
HDfclose(strm);
return (-1);
}
@@ -1238,13 +1242,13 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 5: /* OUTPUT-CLASS */
if (in->configOptionVector[OUTPUT_CLASS] == 1) {
- (void) fprintf(stderr, err8a, infile);
+ (void) HDfprintf(stderr, err8a, infile);
HDfclose(strm);
return (-1);
}
if (getOutputClass(in, strm) == -1) {
- (void) fprintf(stderr, err8b, infile);
+ (void) HDfprintf(stderr, err8b, infile);
HDfclose(strm);
return (-1);
}
@@ -1253,13 +1257,13 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 6: /* OUTPUT-SIZE */
if (in->configOptionVector[OUTPUT_SIZE] == 1) {
- (void) fprintf(stderr, err9a, infile);
+ (void) HDfprintf(stderr, err9a, infile);
HDfclose(strm);
return (-1);
}
if (getOutputSize(in, strm) == -1) {
- (void) fprintf(stderr, err9b, infile);
+ (void) HDfprintf(stderr, err9b, infile);
HDfclose(strm);
return (-1);
}
@@ -1268,13 +1272,13 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 7: /* OUTPUT-ARCHITECTURE */
if (in->configOptionVector[OUTPUT_ARCH] == 1) {
- (void) fprintf(stderr, err10a, infile);
+ (void) HDfprintf(stderr, err10a, infile);
HDfclose(strm);
return (-1);
}
if (getOutputArchitecture(in, strm) == -1) {
- (void) fprintf(stderr, err10b, infile);
+ (void) HDfprintf(stderr, err10b, infile);
HDfclose(strm);
return (-1);
}
@@ -1283,13 +1287,13 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 8: /* OUTPUT-BYTE-ORDER */
if (in->configOptionVector[OUTPUT_B_ORDER] == 1) {
- (void) fprintf(stderr, err11a, infile);
+ (void) HDfprintf(stderr, err11a, infile);
HDfclose(strm);
return (-1);
}
if (getOutputByteOrder(in, strm) == -1) {
- (void) fprintf(stderr, err11b, infile);
+ (void) HDfprintf(stderr, err11b, infile);
HDfclose(strm);
return (-1);
}
@@ -1298,19 +1302,19 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 9: /* CHUNKED-DIMENSION-SIZES */
if (in->configOptionVector[CHUNK] == 1) {
- (void) fprintf(stderr, err12a, infile);
+ (void) HDfprintf(stderr, err12a, infile);
HDfclose(strm);
return (-1);
}
/* cant appear before dimension sizes have been provided */
if (in->configOptionVector[DIM] == 0) {
- (void) fprintf(stderr, err12b, infile);
+ (void) HDfprintf(stderr, err12b, infile);
HDfclose(strm);
return (-1);
}
if (getChunkedDimensionSizes(in, strm) == -1) {
- (void) fprintf(stderr, err12c, infile);
+ (void) HDfprintf(stderr, err12c, infile);
HDfclose(strm);
return (-1);
}
@@ -1319,13 +1323,13 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 10: /* COMPRESSION-TYPE */
if (in->configOptionVector[COMPRESS] == 1) {
- (void) fprintf(stderr, err13a, infile);
+ (void) HDfprintf(stderr, err13a, infile);
HDfclose(strm);
return (-1);
}
if (getCompressionType(in, strm) == -1) {
- (void) fprintf(stderr, err13b, infile);
+ (void) HDfprintf(stderr, err13b, infile);
HDfclose(strm);
return (-1);
}
@@ -1339,13 +1343,13 @@ static int processConfigurationFile(char *infile, struct Input *in)
case 11: /* COMPRESSION-PARAM */
if (in->configOptionVector[COMPRESS_PARAM] == 1) {
- (void) fprintf(stderr, err14a, infile);
+ (void) HDfprintf(stderr, err14a, infile);
HDfclose(strm);
return (-1);
}
if (getCompressionParameter(in, strm) == -1) {
- (void) fprintf(stderr, err14b, infile);
+ (void) HDfprintf(stderr, err14b, infile);
HDfclose(strm);
return (-1);
}
@@ -1358,34 +1362,34 @@ static int processConfigurationFile(char *infile, struct Input *in)
break;
case 12: /* EXTERNAL-STORAGE */
- if (in->configOptionVector[EXTERNAL] == 1) {
- (void) fprintf(stderr, err15a, infile);
+ if (in->configOptionVector[EXTERNALSTORE] == 1) {
+ (void) HDfprintf(stderr, err15a, infile);
HDfclose(strm);
return (-1);
}
if (getExternalFilename(in, strm) == -1) {
- (void) fprintf(stderr, err15b, infile);
+ (void) HDfprintf(stderr, err15b, infile);
HDfclose(strm);
return (-1);
}
- in->configOptionVector[EXTERNAL] = 1;
+ in->configOptionVector[EXTERNALSTORE] = 1;
break;
case 13: /* MAXIMUM-DIMENSIONS */
if (in->configOptionVector[EXTEND] == 1) {
- (void) fprintf(stderr, err16a, infile);
+ (void) HDfprintf(stderr, err16a, infile);
HDfclose(strm);
return (-1);
}
/* cant appear before dimension sizes have been provided */
if (in->configOptionVector[DIM] == 0) {
- (void) fprintf(stderr, err16b, infile);
+ (void) HDfprintf(stderr, err16b, infile);
HDfclose(strm);
return (-1);
}
if (getMaximumDimensionSizes(in, strm) == -1) {
- (void) fprintf(stderr, err16c, infile);
+ (void) HDfprintf(stderr, err16c, infile);
HDfclose(strm);
return (-1);
}
@@ -1402,7 +1406,7 @@ static int processConfigurationFile(char *infile, struct Input *in)
*/
if (validateConfigurationParameters(in) == -1) {
- (void) fprintf(stderr, err17, infile);
+ (void) HDfprintf(stderr, err17, infile);
HDfclose(strm);
return (-1);
}
@@ -1428,20 +1432,20 @@ static int validateConfigurationParameters(struct Input *in)
return (0);
if ((in->configOptionVector[DIM] != 1) || (in->configOptionVector[RANK] != 1)) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
- if (in->configOptionVector[EXTERNAL] == 1) {
+ if (in->configOptionVector[EXTERNALSTORE] == 1) {
if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[CHUNK] == 1) || (in->configOptionVector[EXTEND] == 1)) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
}
if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[EXTEND] == 1)) {
if (in->configOptionVector[CHUNK] != 1) {
- (void) fprintf(stderr, "%s", err3);
+ (void) HDfprintf(stderr, "%s", err3);
return (-1);
}
}
@@ -1449,26 +1453,26 @@ static int validateConfigurationParameters(struct Input *in)
/* Arch cant be STD if O/p class is FP */
if (in->outputArchitecture == 1)
if (in->outputClass == 1) {
- (void) fprintf(stderr, "%s", err4a);
+ (void) HDfprintf(stderr, "%s", err4a);
return (-1);
}
/* Arch cant be IEEE if O/p class is IN */
if (in->outputArchitecture == 2)
if (in->outputClass == 0) {
- (void) fprintf(stderr, "%s", err4b);
+ (void) HDfprintf(stderr, "%s", err4b);
return (-1);
}
if (in->outputClass == 1)
if (in->outputSize != 32 && in->outputSize != 64) {
- (void) fprintf(stderr, "%s", err5);
+ (void) HDfprintf(stderr, "%s", err5);
return (-1);
}
#ifndef H5_SIZEOF_LONG_LONG
if (in->inputSize == 64 && (in->inputClass == 0 || in->inputClass == 4 || in->inputClass == 6 || in->inputClass == 7) ) {
- (void) fprintf(stderr, "%s", err6);
+ (void) HDfprintf(stderr, "%s", err6);
return -1;
}
#endif
@@ -1494,7 +1498,7 @@ static int parsePathInfo(struct path_info *path, char *temp)
token = HDstrtok (temp, delimiter);
if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) {
- (void) fprintf(stderr, err1);
+ (void) HDfprintf(stderr, err1);
return (-1);
}
HDstrcpy(path->group[i++],token);
@@ -1504,7 +1508,7 @@ static int parsePathInfo(struct path_info *path, char *temp)
if (token == NULL)
break;
if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) {
- (void) fprintf(stderr, err1);
+ (void) HDfprintf(stderr, err1);
return (-1);
}
HDstrcpy(path->group[i++],token);
@@ -1533,7 +1537,7 @@ static int parseDimensions(struct Input *in, char *strm)
}
in->rank = i + 1;
if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1560,12 +1564,12 @@ static int getOutputClass(struct Input *in, FILE *strm)
const char *err2 = "Invalid value for output class.\n";
if (fscanf(strm, "%s", temp) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
if ((kindex = OutputClassStrToInt(temp)) == -1) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
@@ -1593,7 +1597,7 @@ static int getOutputSize(struct Input *in, FILE *strm)
const char *err2 = "Invalid value for output size.\n";
if (fscanf(strm, "%d", (&ival)) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1602,7 +1606,7 @@ static int getOutputSize(struct Input *in, FILE *strm)
in->outputSize = ival;
return (0);
}
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
@@ -1612,7 +1616,7 @@ static int getInputClass(struct Input *in, char * temp)
const char *err1 = "Invalid value for input class.\n";
if ((kindex = InputClassStrToInt(temp)) == -1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1642,7 +1646,7 @@ static int getInputSize(struct Input *in, int ival)
in->inputSize = ival;
return (0);
}
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1654,7 +1658,7 @@ static int getRank(struct Input *in, FILE *strm)
const char *err2 = "Invalid value for rank.\n";
if (fscanf(strm, "%d", (&ival)) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
if (ival >= MIN_NUM_DIMENSION && ival <= MAX_NUM_DIMENSION) {
@@ -1662,7 +1666,7 @@ static int getRank(struct Input *in, FILE *strm)
return (0);
}
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
@@ -1676,7 +1680,7 @@ static int getDimensionSizes(struct Input *in, FILE *strm)
const char *err2 = "No. of dimensions for which dimension sizes provided is not equal to provided rank.\n";
if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1684,7 +1688,7 @@ static int getDimensionSizes(struct Input *in, FILE *strm)
in->sizeOfDimension[i++] = ival;
if (in->rank != i) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
return (0);
@@ -1700,7 +1704,7 @@ static int getChunkedDimensionSizes(struct Input *in, FILE *strm)
const char *err3 = "The CHUNKED-DIMENSION-SIZES cannot exceed the sizes of DIMENSION-SIZES\n";
if ((in->sizeOfChunk = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1708,13 +1712,13 @@ static int getChunkedDimensionSizes(struct Input *in, FILE *strm)
in->sizeOfChunk[i++] = ival;
if (in->rank != i) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
for (i = 0; i < in->rank; i++)
if (in->sizeOfChunk[i] > in->sizeOfDimension[i]) {
- (void) fprintf(stderr, "%s", err3);
+ (void) HDfprintf(stderr, "%s", err3);
return (-1);
}
return (0);
@@ -1730,7 +1734,7 @@ static int getMaximumDimensionSizes(struct Input *in, FILE *strm)
const char *err3 = "The MAXIMUM-DIMENSIONS cannot be less than the sizes of DIMENSION-SIZES. Exception: can be -1 to indicate unlimited size\n";
if ((in->maxsizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1742,14 +1746,14 @@ static int getMaximumDimensionSizes(struct Input *in, FILE *strm)
}
if (in->rank != i) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
for (i = 0; i < in->rank; i++) {
if (in->maxsizeOfDimension[i] != H5S_UNLIMITED)
if (in->maxsizeOfDimension[i] < in->sizeOfDimension[i]) {
- (void) fprintf(stderr, "%s", err3);
+ (void) HDfprintf(stderr, "%s", err3);
return (-1);
}
}
@@ -1764,12 +1768,12 @@ static int getOutputArchitecture(struct Input *in, FILE *strm)
const char *err2 = "Invalid value for output architecture.\n";
if (fscanf(strm, "%s", temp) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
if ((kindex = OutputArchStrToInt(temp)) == -1) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
@@ -1796,12 +1800,12 @@ static int getOutputByteOrder(struct Input *in, FILE *strm)
const char *err2 = "Invalid value for output byte-order.\n";
if (fscanf(strm, "%s", temp) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
if ((kindex = OutputByteOrderStrToInt(temp)) == -1) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
@@ -1827,12 +1831,12 @@ static int getCompressionType(struct Input *in, FILE *strm)
const char *err2 = "Invalid value for compression.\n";
if (fscanf(strm, "%s", temp) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
if ((kindex = CompressionTypeStrToInt(temp)) == -1) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
@@ -1868,19 +1872,19 @@ static int getCompressionParameter(struct Input *in, FILE *strm)
switch (in->compressionType) {
case 0: /* GZIP */
if (fscanf(strm, "%d", (&ival)) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
if (ival < 0 || ival > 9) {
- (void) fprintf(stderr, "%s", err2);
+ (void) HDfprintf(stderr, "%s", err2);
return (-1);
}
in->compressionParam = ival;
return (0);
default:
- (void) fprintf(stderr, "%s", err3);
+ (void) HDfprintf(stderr, "%s", err3);
return (-1);
}
}
@@ -1891,7 +1895,7 @@ static int getExternalFilename(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
if (fscanf(strm, "%s", temp) != 1) {
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -2183,7 +2187,7 @@ hid_t createOutputDataType(struct Input *in)
break;
default:
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
return new_type;
@@ -2255,7 +2259,7 @@ hid_t createInputDataType(struct Input *in)
break;
default:
- (void) fprintf(stderr, "%s", err1);
+ (void) HDfprintf(stderr, "%s", err1);
return (-1);
}
return new_type;
@@ -2288,7 +2292,7 @@ static int process(struct Options *opt)
{
if ((file_id = H5Fopen(opt->outfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) {
if ((file_id = H5Fcreate(opt->outfile, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == FAIL) {
- (void) fprintf(stderr, err1, opt->outfile);
+ (void) HDfprintf(stderr, err1, opt->outfile);
return (-1);
}
}
@@ -2299,13 +2303,13 @@ static int process(struct Options *opt)
in = &(opt->infiles[k].in);
if (opt->infiles[k].config == 1) {
if (processConfigurationFile(opt->infiles[k].configfile, in) == -1) {
- (void) fprintf(stderr, err2, opt->infiles[k].configfile);
+ (void) HDfprintf(stderr, err2, opt->infiles[k].configfile);
return (-1);
}
}
if (processDataFile(opt->infiles[k].datafile, in, file_id) == -1) {
- (void) fprintf(stderr, err3, opt->infiles[k].datafile);
+ (void) HDfprintf(stderr, err3, opt->infiles[k].datafile);
return (-1);
}
@@ -2357,10 +2361,10 @@ static int process(struct Options *opt)
H5Pset_deflate(proplist, (unsigned) in->compressionParam);
}
- if (in->configOptionVector[EXTERNAL] == 1) {
+ if (in->configOptionVector[EXTERNALSTORE] == 1) {
/* creating the external file if it doesnt exist */
if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) {
- (void) fprintf(stderr, "%s", err4);
+ (void) HDfprintf(stderr, "%s", err4);
H5Pclose(proplist);
H5Sclose(dataspace);
H5Fclose(file_id);
@@ -2381,7 +2385,7 @@ static int process(struct Options *opt)
{
/* create data set */
if ((dataset = H5Dcreate2(handle, in->path.group[j], outtype, dataspace, H5P_DEFAULT, proplist, H5P_DEFAULT)) < 0) {
- (void) fprintf(stderr, "%s", err5);
+ (void) HDfprintf(stderr, "%s", err5);
H5Pclose(proplist);
H5Sclose(dataspace);
H5Fclose(file_id);
@@ -2394,7 +2398,7 @@ static int process(struct Options *opt)
/* write dataset */
if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) in->data) < 0) {
- (void) fprintf(stderr, "%s", err6);
+ (void) HDfprintf(stderr, "%s", err6);
H5Dclose(dataset);
H5Pclose(proplist);
H5Sclose(dataspace);
@@ -2423,405 +2427,405 @@ static int process(struct Options *opt)
void help(char *name)
{
- (void) fprintf(stdout, "Name:\n\n");
- (void) fprintf(stdout, "\t%s\n\n", name);
- (void) fprintf(stdout, "\t TOOL NAME:\n");
- (void) fprintf(stdout, "\t %s\n", name);
- (void) fprintf(stdout, "\t SYNTAX:\n");
- (void) fprintf(stdout, "\t %s -h[elp], OR\n", name);
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "Name:\n\n");
+ (void) HDfprintf(stdout, "\t%s\n\n", name);
+ (void) HDfprintf(stdout, "\t TOOL NAME:\n");
+ (void) HDfprintf(stdout, "\t %s\n", name);
+ (void) HDfprintf(stdout, "\t SYNTAX:\n");
+ (void) HDfprintf(stdout, "\t %s -h[elp], OR\n", name);
+ (void) HDfprintf(stdout,
"\t %s <infile> -c[onfig] <configfile> [<infile> -c[config] <configfile>...]", name);
- (void) fprintf(stdout, "\t\t\t\t -o[utfile] <outfile>\n\n");
- (void) fprintf(stdout, "\t PURPOSE:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t\t\t\t -o[utfile] <outfile>\n\n");
+ (void) HDfprintf(stdout, "\t PURPOSE:\n");
+ (void) HDfprintf(stdout,
"\t To convert data stored in one or more ASCII or binary files\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t into one or more datasets (in accordance with the \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t user-specified type and storage properties) in an existing \n");
- (void) fprintf(stdout, "\t or new HDF5 file.\n\n");
- (void) fprintf(stdout, "\t DESCRIPTION:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t or new HDF5 file.\n\n");
+ (void) HDfprintf(stdout, "\t DESCRIPTION:\n");
+ (void) HDfprintf(stdout,
"\t The primary objective of the utility is to convert floating\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t point or integer data stored in ASCII text or binary form \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t into a data-set according to the type and storage properties\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t specified by the user. The utility can also accept ASCII\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t text files and store the contents in a compact form as an\n");
- (void) fprintf(stdout, "\t array of one-dimensional strings.\n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t array of one-dimensional strings.\n\n");
+ (void) HDfprintf(stdout,
"\t The input data to be written as a data-set can be provided\n");
- (void) fprintf(stdout, "\t to the utility in one of the following forms:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t to the utility in one of the following forms:\n");
+ (void) HDfprintf(stdout,
"\t 1. ASCII text file with numeric data (floating point or \n");
- (void) fprintf(stdout, "\t integer data). \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t integer data). \n");
+ (void) HDfprintf(stdout,
"\t 2. Binary file with native floating point data (32-bit or \n");
- (void) fprintf(stdout, "\t 64-bit) \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t 64-bit) \n");
+ (void) HDfprintf(stdout,
"\t 3. Binary file with native integer (signed or unsigned)\n");
- (void) fprintf(stdout, "\t data (8-bit or 16-bit or 32-bit or 64-bit). \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t data (8-bit or 16-bit or 32-bit or 64-bit). \n");
+ (void) HDfprintf(stdout,
"\t 4. ASCII text file containing strings (text data).\n");
- (void) fprintf(stdout, "\t \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t \n");
+ (void) HDfprintf(stdout,
"\t Every input file is associated with a configuration file \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t also provided as an input to the utility. (See Section \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t \"CONFIGURATION FILE\" to know how it is to be organized).\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t The class, size and dimensions of the input data is \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t specified in this configuration file. A point to note is\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t that the floating point data in the ASCII text file may be\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t organized in the fixed floating form (for example 323.56)\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t or in a scientific notation (for example 3.23E+02). A \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t different input-class specification is to be used for both\n");
- (void) fprintf(stdout, "\t forms.\n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t forms.\n\n");
+ (void) HDfprintf(stdout,
"\t The utility extracts the input data from the input file \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t according to the specified parameters and saves it into \n");
- (void) fprintf(stdout, "\t an H5 dataset. \n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t an H5 dataset. \n\n");
+ (void) HDfprintf(stdout,
"\t The user can specify output type and storage properties in \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t the configuration file. The user is requited to specify the \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t path of the dataset. If the groups in the path leading to \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t the data-set do not exist, the groups will be created by the\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t utility. If no group is specified, the dataset will be\n");
- (void) fprintf(stdout, "\t created under the root group.\n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t created under the root group.\n\n");
+ (void) HDfprintf(stdout,
"\t In addition to the name, the user is also required to \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t provide the class and size of output data to be written to \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t the dataset and may optionally specify the output-architecure,\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t and the output-byte-order. If output-architecture is not \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t specified the default is NATIVE. Output-byte-orders are fixed\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t for some architectures and may be specified only if output-\n");
- (void) fprintf(stdout, "\t architecture is IEEE, UNIX or STD.\n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t architecture is IEEE, UNIX or STD.\n\n");
+ (void) HDfprintf(stdout,
"\t Also, layout and other storage properties such as \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t compression, external storage and extendible data-sets may be\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t optionally specified. The layout and storage properties \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t denote how raw data is to be organized on the disk. If these \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t options are not specified the default is Contiguous layout \n");
- (void) fprintf(stdout, "\t and storage.\n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t and storage.\n\n");
+ (void) HDfprintf(stdout,
"\t The dataset can be organized in any of the following ways:\n");
- (void) fprintf(stdout, "\t 1. Contiguous.\n");
- (void) fprintf(stdout, "\t 2. Chunked.\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t 1. Contiguous.\n");
+ (void) HDfprintf(stdout, "\t 2. Chunked.\n");
+ (void) HDfprintf(stdout,
"\t 3. External Storage File (has to be contiguous)\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t 4. Extendible data sets (has to be chunked)\n");
- (void) fprintf(stdout, "\t 5. Compressed. (has to be chunked)\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t 5. Compressed. (has to be chunked)\n");
+ (void) HDfprintf(stdout,
"\t 6. Compressed & Extendible (has to be chunked)\n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t If the user wants to store raw data in a non-HDF file then \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t the external storage file option is to be used and the name \n");
- (void) fprintf(stdout, "\t of the file is to be specified. \n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t of the file is to be specified. \n\n");
+ (void) HDfprintf(stdout,
"\t If the user wants the dimensions of the data-set to be\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t unlimited, the extendible data set option can be chosen. \n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t The user may also specify the type of compression and the \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t level to which the data set must be compresses by setting \n");
- (void) fprintf(stdout, "\t the compressed option.\n\n");
- (void) fprintf(stdout, "\t SYNOPSIS:\n");
- (void) fprintf(stdout, "\t h5import -h[elp], OR\n");
- (void) fprintf( stdout,
+ (void) HDfprintf(stdout, "\t the compressed option.\n\n");
+ (void) HDfprintf(stdout, "\t SYNOPSIS:\n");
+ (void) HDfprintf(stdout, "\t h5import -h[elp], OR\n");
+ (void) HDfprintf( stdout,
"\t h5import <infile> -c[onfig] <configfile> \
[<infile> -c[config] <confile2>...] -o[utfile] <outfile>\n\n");
- (void) fprintf(stdout, "\t -h[elp]:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t -h[elp]:\n");
+ (void) HDfprintf(stdout,
"\t Prints this summary of usage, and exits.\n\n");
- (void) fprintf(stdout, "\t <infile(s)>:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t <infile(s)>:\n");
+ (void) HDfprintf(stdout,
"\t Name of the Input file(s), containing a \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t single n-dimensional floating point or integer array \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t in either ASCII text, native floating point(32-bit \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t or 64-bit) or native integer(8-bit or 16-bit or \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t 32-bit or 64-bit). Data to be specified in the order\n");
- (void) fprintf(stdout, "\t of fastest changing dimensions first.\n\n");
- (void) fprintf(stdout, "\t -c[config] <configfile>:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t of fastest changing dimensions first.\n\n");
+ (void) HDfprintf(stdout, "\t -c[config] <configfile>:\n");
+ (void) HDfprintf(stdout,
"\t Every input file should be associated with a \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t configuration file and this is done by the -c option.\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t <configfile> is the name of the configuration file.\n");
- (void) fprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n");
- (void) fprintf(stdout, "\t -o[utfile] <outfile>:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n");
+ (void) HDfprintf(stdout, "\t -o[utfile] <outfile>:\n");
+ (void) HDfprintf(stdout,
"\t Name of the HDF5 output file. Data from one or more \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t input files are stored as one or more data sets in \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t <outfile>. The output file may be an existing file or \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t it maybe new in which case it will be created.\n\n\n");
- (void) fprintf(stdout, "\t CONFIGURATION FILE:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t CONFIGURATION FILE:\n");
+ (void) HDfprintf(stdout,
"\t The configuration file is an ASCII text file and must be \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t organized as \"CONFIG-KEYWORD VALUE\" pairs, one pair on each \n");
- (void) fprintf(stdout, "\t line.\n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t line.\n\n");
+ (void) HDfprintf(stdout,
"\t The configuration file may have the following keywords each \n");
- (void) fprintf(stdout, "\t followed by an acceptable value.\n\n");
- (void) fprintf(stdout, "\t Required KEYWORDS:\n");
- (void) fprintf(stdout, "\t PATH\n");
- (void) fprintf(stdout, "\t INPUT-CLASS\n");
- (void) fprintf(stdout, "\t INPUT-SIZE\n");
- (void) fprintf(stdout, "\t RANK\n");
- (void) fprintf(stdout, "\t DIMENSION-SIZES\n");
- (void) fprintf(stdout, "\t OUTPUT-CLASS\n");
- (void) fprintf(stdout, "\t OUTPUT-SIZE\n\n");
- (void) fprintf(stdout, "\t Optional KEYWORDS:\n");
- (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE\n");
- (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER\n");
- (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n");
- (void) fprintf(stdout, "\t COMPRESSION-TYPE\n");
- (void) fprintf(stdout, "\t COMPRESSION-PARAM\n");
- (void) fprintf(stdout, "\t EXTERNAL-STORAGE\n");
- (void) fprintf(stdout, "\t MAXIMUM-DIMENSIONS\n\n\n");
- (void) fprintf(stdout, "\t Values for keywords:\n");
- (void) fprintf(stdout, "\t PATH:\n");
- (void) fprintf(stdout, "\t Strings separated by spaces to represent\n");
- (void) fprintf(stdout, "\t the path of the data-set. If the groups in\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t followed by an acceptable value.\n\n");
+ (void) HDfprintf(stdout, "\t Required KEYWORDS:\n");
+ (void) HDfprintf(stdout, "\t PATH\n");
+ (void) HDfprintf(stdout, "\t INPUT-CLASS\n");
+ (void) HDfprintf(stdout, "\t INPUT-SIZE\n");
+ (void) HDfprintf(stdout, "\t RANK\n");
+ (void) HDfprintf(stdout, "\t DIMENSION-SIZES\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-CLASS\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-SIZE\n\n");
+ (void) HDfprintf(stdout, "\t Optional KEYWORDS:\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER\n");
+ (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n");
+ (void) HDfprintf(stdout, "\t COMPRESSION-TYPE\n");
+ (void) HDfprintf(stdout, "\t COMPRESSION-PARAM\n");
+ (void) HDfprintf(stdout, "\t EXTERNAL-STORAGE\n");
+ (void) HDfprintf(stdout, "\t MAXIMUM-DIMENSIONS\n\n\n");
+ (void) HDfprintf(stdout, "\t Values for keywords:\n");
+ (void) HDfprintf(stdout, "\t PATH:\n");
+ (void) HDfprintf(stdout, "\t Strings separated by spaces to represent\n");
+ (void) HDfprintf(stdout, "\t the path of the data-set. If the groups in\n");
+ (void) HDfprintf(stdout,
"\t the path do no exist, they will be created. \n");
- (void) fprintf(stdout, "\t For example,\n");
- (void) fprintf(stdout, "\t PATH grp1/grp2/dataset1\n");
- (void) fprintf(stdout, "\t PATH: keyword\n");
- (void) fprintf(stdout, "\t grp1: group under the root. If\n");
- (void) fprintf(stdout, "\t non-existent will be created.\n");
- (void) fprintf(stdout, "\t grp2: group under grp1. If \n");
- (void) fprintf(stdout, "\t non-existent will be created \n");
- (void) fprintf(stdout, "\t under grp1.\n");
- (void) fprintf(stdout, "\t dataset1: the name of the data-set \n");
- (void) fprintf(stdout, "\t to be created.\n\n");
- (void) fprintf(stdout, "\t INPUT-CLASS:\n");
- (void) fprintf(stdout, "\t String denoting the type of input data.\n");
- (void) fprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n");
- (void) fprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t For example,\n");
+ (void) HDfprintf(stdout, "\t PATH grp1/grp2/dataset1\n");
+ (void) HDfprintf(stdout, "\t PATH: keyword\n");
+ (void) HDfprintf(stdout, "\t grp1: group under the root. If\n");
+ (void) HDfprintf(stdout, "\t non-existent will be created.\n");
+ (void) HDfprintf(stdout, "\t grp2: group under grp1. If \n");
+ (void) HDfprintf(stdout, "\t non-existent will be created \n");
+ (void) HDfprintf(stdout, "\t under grp1.\n");
+ (void) HDfprintf(stdout, "\t dataset1: the name of the data-set \n");
+ (void) HDfprintf(stdout, "\t to be created.\n\n");
+ (void) HDfprintf(stdout, "\t INPUT-CLASS:\n");
+ (void) HDfprintf(stdout, "\t String denoting the type of input data.\n");
+ (void) HDfprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n");
+ (void) HDfprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n");
+ (void) HDfprintf(stdout,
"\t INPUT-CLASS \"TEXTIN\" denotes an ASCII text \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t file with signed integer data in ASCII form,\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t INPUT-CLASS \"TEXTUIN\" denotes an ASCII text \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t file with unsigned integer data in ASCII form,\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t \"TEXTFP\" denotes an ASCII text file containing\n");
- (void) fprintf(stdout, "\t floating point data in the fixed notation\n");
- (void) fprintf(stdout, "\t (325.34),\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t floating point data in the fixed notation\n");
+ (void) HDfprintf(stdout, "\t (325.34),\n");
+ (void) HDfprintf(stdout,
"\t \"FP\" denotes a floating point binary file,\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t \"IN\" denotes a signed integer binary file,\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t \"UIN\" denotes an unsigned integer binary file,\n");
- (void) fprintf(stdout, "\t & \"STR\" denotes an ASCII text file the \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t & \"STR\" denotes an ASCII text file the \n");
+ (void) HDfprintf(stdout,
"\t contents of which should be stored as an 1-D \n");
- (void) fprintf(stdout, "\t array of strings.\n");
- (void) fprintf(stdout, "\t If INPUT-CLASS is \"STR\", then RANK, \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t array of strings.\n");
+ (void) HDfprintf(stdout, "\t If INPUT-CLASS is \"STR\", then RANK, \n");
+ (void) HDfprintf(stdout,
"\t DIMENSION-SIZES, OUTPUT-CLASS, OUTPUT-SIZE, \n");
- (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE and OUTPUT-BYTE-ORDER \n");
- (void) fprintf(stdout, "\t will be ignored.\n\n\n");
- (void) fprintf(stdout, "\t INPUT-SIZE:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE and OUTPUT-BYTE-ORDER \n");
+ (void) HDfprintf(stdout, "\t will be ignored.\n\n\n");
+ (void) HDfprintf(stdout, "\t INPUT-SIZE:\n");
+ (void) HDfprintf(stdout,
"\t Integer denoting the size of the input data \n");
- (void) fprintf(stdout, "\t (8, 16, 32, 64). \n\n");
- (void) fprintf(stdout, "\t For floating point,\n");
- (void) fprintf(stdout, "\t INPUT-SIZE can be 32 or 64.\n");
- (void) fprintf(stdout, "\t For integers (signed and unsigned)\n");
- (void) fprintf(stdout, "\t INPUT-SIZE can be 8, 16, 32 or 64.\n\n");
- (void) fprintf(stdout, "\t RANK:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t (8, 16, 32, 64). \n\n");
+ (void) HDfprintf(stdout, "\t For floating point,\n");
+ (void) HDfprintf(stdout, "\t INPUT-SIZE can be 32 or 64.\n");
+ (void) HDfprintf(stdout, "\t For integers (signed and unsigned)\n");
+ (void) HDfprintf(stdout, "\t INPUT-SIZE can be 8, 16, 32 or 64.\n\n");
+ (void) HDfprintf(stdout, "\t RANK:\n");
+ (void) HDfprintf(stdout,
"\t Integer denoting the number of dimensions.\n\n");
- (void) fprintf(stdout, "\t DIMENSION-SIZES:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t DIMENSION-SIZES:\n");
+ (void) HDfprintf(stdout,
"\t Integers separated by spaces to denote the \n");
- (void) fprintf(stdout, "\t dimension sizes for the no. of dimensions \n");
- (void) fprintf(stdout, "\t determined by rank.\n\n");
- (void) fprintf(stdout, "\t OUTPUT-CLASS:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t dimension sizes for the no. of dimensions \n");
+ (void) HDfprintf(stdout, "\t determined by rank.\n\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-CLASS:\n");
+ (void) HDfprintf(stdout,
"\t String dentoting data type of the dataset to \n");
- (void) fprintf(stdout, "\t be written (\"IN\",\"FP\", \"UIN\")\n\n");
- (void) fprintf(stdout, "\t OUTPUT-SIZE:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t be written (\"IN\",\"FP\", \"UIN\")\n\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-SIZE:\n");
+ (void) HDfprintf(stdout,
"\t Integer denoting the size of the data in the \n");
- (void) fprintf(stdout, "\t output dataset to be written.\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t output dataset to be written.\n");
+ (void) HDfprintf(stdout,
"\t If OUTPUT-CLASS is \"FP\", OUTPUT-SIZE can be \n");
- (void) fprintf(stdout, "\t 32 or 64.\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t 32 or 64.\n");
+ (void) HDfprintf(stdout,
"\t If OUTPUT-CLASS is \"IN\" or \"UIN\", OUTPUT-SIZE\n");
- (void) fprintf(stdout, "\t can be 8, 16, 32 or 64.\n\n");
- (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE:\n");
- (void) fprintf(stdout, "\t STRING denoting the type of output \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t can be 8, 16, 32 or 64.\n\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE:\n");
+ (void) HDfprintf(stdout, "\t STRING denoting the type of output \n");
+ (void) HDfprintf(stdout,
"\t architecture. Can accept the following values\n");
- (void) fprintf(stdout, "\t STD\n");
- (void) fprintf(stdout, "\t IEEE\n");
- (void) fprintf(stdout, "\t INTEL\n");
- (void) fprintf(stdout, "\t CRAY\n");
- (void) fprintf(stdout, "\t MIPS\n");
- (void) fprintf(stdout, "\t ALPHA\n");
- (void) fprintf(stdout, "\t NATIVE (default)\n");
- (void) fprintf(stdout, "\t UNIX\n\n");
- (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t STD\n");
+ (void) HDfprintf(stdout, "\t IEEE\n");
+ (void) HDfprintf(stdout, "\t INTEL\n");
+ (void) HDfprintf(stdout, "\t CRAY\n");
+ (void) HDfprintf(stdout, "\t MIPS\n");
+ (void) HDfprintf(stdout, "\t ALPHA\n");
+ (void) HDfprintf(stdout, "\t NATIVE (default)\n");
+ (void) HDfprintf(stdout, "\t UNIX\n\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER:\n");
+ (void) HDfprintf(stdout,
"\t String denoting the output-byte-order. Ignored\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t if the OUTPUT-ARCHITECTURE is not specified or\n");
- (void) fprintf(stdout, "\t if it is IEEE, UNIX or STD. Can accept the \n");
- (void) fprintf(stdout, "\t following values.\n");
- (void) fprintf(stdout, "\t BE (default)\n");
- (void) fprintf(stdout, "\t LE\n\n");
- (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES:\n");
- (void) fprintf(stdout, "\t Integers separated by spaces to denote the \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t if it is IEEE, UNIX or STD. Can accept the \n");
+ (void) HDfprintf(stdout, "\t following values.\n");
+ (void) HDfprintf(stdout, "\t BE (default)\n");
+ (void) HDfprintf(stdout, "\t LE\n\n");
+ (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES:\n");
+ (void) HDfprintf(stdout, "\t Integers separated by spaces to denote the \n");
+ (void) HDfprintf(stdout,
"\t dimension sizes of the chunk for the no. of \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t dimensions determined by rank. Required field\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t to denote that the dataset will be stored with\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t chunked storage. If this field is absent the\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t dataset will be stored with contiguous storage.\n\n");
- (void) fprintf(stdout, "\t COMPRESSION-TYPE:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t COMPRESSION-TYPE:\n");
+ (void) HDfprintf(stdout,
"\t String denoting the type of compression to be\n");
- (void) fprintf(stdout, "\t used with the chunked storage. Requires the\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t used with the chunked storage. Requires the\n");
+ (void) HDfprintf(stdout,
"\t CHUNKED-DIMENSION-SIZES to be specified. The only \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t currently supported compression method is GZIP. \n");
- (void) fprintf(stdout, "\t Will accept the following value\n");
- (void) fprintf(stdout, "\t GZIP\n\n");
- (void) fprintf(stdout, "\t COMPRESSION-PARAM:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t Will accept the following value\n");
+ (void) HDfprintf(stdout, "\t GZIP\n\n");
+ (void) HDfprintf(stdout, "\t COMPRESSION-PARAM:\n");
+ (void) HDfprintf(stdout,
"\t Integer used to denote compression level and \n");
- (void) fprintf(stdout, "\t this option is to be always specified when \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t this option is to be always specified when \n");
+ (void) HDfprintf(stdout,
"\t the COMPRESSION-TYPE option is specified. The\n");
- (void) fprintf(stdout, "\t values are applicable only to GZIP \n");
- (void) fprintf(stdout, "\t compression.\n");
- (void) fprintf(stdout, "\t Value 1-9: The level of Compression. \n");
- (void) fprintf(stdout, "\t 1 will result in the fastest \n");
- (void) fprintf(stdout, "\t compression while 9 will result in \n");
- (void) fprintf(stdout, "\t the best compression ratio. The default\n");
- (void) fprintf(stdout, "\t level of compression is 6.\n\n");
- (void) fprintf(stdout, "\t EXTERNAL-STORAGE:\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t values are applicable only to GZIP \n");
+ (void) HDfprintf(stdout, "\t compression.\n");
+ (void) HDfprintf(stdout, "\t Value 1-9: The level of Compression. \n");
+ (void) HDfprintf(stdout, "\t 1 will result in the fastest \n");
+ (void) HDfprintf(stdout, "\t compression while 9 will result in \n");
+ (void) HDfprintf(stdout, "\t the best compression ratio. The default\n");
+ (void) HDfprintf(stdout, "\t level of compression is 6.\n\n");
+ (void) HDfprintf(stdout, "\t EXTERNAL-STORAGE:\n");
+ (void) HDfprintf(stdout,
"\t String to denote the name of the non-HDF5 file \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t to store data to. Cannot be used if CHUNKED-\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t DIMENSIONS or COMPRESSION-TYPE or EXTENDIBLE-\n");
- (void) fprintf(stdout, "\t DATASET is specified.\n");
- (void) fprintf(stdout, "\t Value <external-filename>: the name of the \n");
- (void) fprintf(stdout, "\t external file as a string to be used.\n\n");
- (void) fprintf(stdout, "\t MAXIMUM-DIMENSIONS:\n");
- (void) fprintf(stdout, "\t Integers separated by spaces to denote the \n");
- (void) fprintf(stdout, "\t maximum dimension sizes of all the \n");
- (void) fprintf(stdout, "\t dimensions determined by rank. Requires the\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t DATASET is specified.\n");
+ (void) HDfprintf(stdout, "\t Value <external-filename>: the name of the \n");
+ (void) HDfprintf(stdout, "\t external file as a string to be used.\n\n");
+ (void) HDfprintf(stdout, "\t MAXIMUM-DIMENSIONS:\n");
+ (void) HDfprintf(stdout, "\t Integers separated by spaces to denote the \n");
+ (void) HDfprintf(stdout, "\t maximum dimension sizes of all the \n");
+ (void) HDfprintf(stdout, "\t dimensions determined by rank. Requires the\n");
+ (void) HDfprintf(stdout,
"\t CHUNKED-DIMENSION-SIZES to be specified. A value of \n");
- (void) fprintf(stdout, "\t -1 for any dimension implies UNLIMITED \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t -1 for any dimension implies UNLIMITED \n");
+ (void) HDfprintf(stdout,
"\t DIMENSION size for that particular dimension.\n\n");
- (void) fprintf(stdout, "\t EXAMPLES:\n");
- (void) fprintf(stdout, "\t 1. Configuration File may look like:\n\n");
- (void) fprintf(stdout, "\t PATH work h5 pkamat First-set\n");
- (void) fprintf(stdout, "\t INPUT-CLASS TEXTFP\n");
- (void) fprintf(stdout, "\t RANK 3\n");
- (void) fprintf(stdout, "\t DIMENSION-SIZES 5 2 4\n");
- (void) fprintf(stdout, "\t OUTPUT-CLASS FP\n");
- (void) fprintf(stdout, "\t OUTPUT-SIZE 64\n");
- (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE IEEE\n");
- (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 \n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t EXAMPLES:\n");
+ (void) HDfprintf(stdout, "\t 1. Configuration File may look like:\n\n");
+ (void) HDfprintf(stdout, "\t PATH work h5 pkamat First-set\n");
+ (void) HDfprintf(stdout, "\t INPUT-CLASS TEXTFP\n");
+ (void) HDfprintf(stdout, "\t RANK 3\n");
+ (void) HDfprintf(stdout, "\t DIMENSION-SIZES 5 2 4\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-CLASS FP\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-SIZE 64\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE IEEE\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 \n\n");
+ (void) HDfprintf(stdout,
"\t The above configuration will accept a floating point array \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t (5 x 2 x 4) in an ASCII file with the rank and dimension sizes \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t specified and will save it in a chunked data-set (of pattern \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t 2 X 2 X 2) of 64-bit floating point in the little-endian order \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t and IEEE architecture. The dataset will be stored at\n");
- (void) fprintf(stdout, "\t \"/work/h5/pkamat/First-set\"\n\n");
- (void) fprintf(stdout, "\t 2. Another configuration could be:\n\n");
- (void) fprintf(stdout, "\t PATH Second-set\n");
- (void) fprintf(stdout, "\t INPUT-CLASS IN \n");
- (void) fprintf(stdout, "\t RANK 5\n");
- (void) fprintf(stdout, "\t DIMENSION-SIZES 6 3 5 2 4\n");
- (void) fprintf(stdout, "\t OUTPUT-CLASS IN\n");
- (void) fprintf(stdout, "\t OUTPUT-SIZE 32\n");
- (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 2 2\n");
- (void) fprintf(stdout, "\t EXTENDIBLE-DATASET 1 3 \n");
- (void) fprintf(stdout, "\t COMPRESSION-TYPE GZIP\n");
- (void) fprintf(stdout, "\t COMPRESSION-PARAM 7\n\n\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t \"/work/h5/pkamat/First-set\"\n\n");
+ (void) HDfprintf(stdout, "\t 2. Another configuration could be:\n\n");
+ (void) HDfprintf(stdout, "\t PATH Second-set\n");
+ (void) HDfprintf(stdout, "\t INPUT-CLASS IN \n");
+ (void) HDfprintf(stdout, "\t RANK 5\n");
+ (void) HDfprintf(stdout, "\t DIMENSION-SIZES 6 3 5 2 4\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-CLASS IN\n");
+ (void) HDfprintf(stdout, "\t OUTPUT-SIZE 32\n");
+ (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 2 2\n");
+ (void) HDfprintf(stdout, "\t EXTENDIBLE-DATASET 1 3 \n");
+ (void) HDfprintf(stdout, "\t COMPRESSION-TYPE GZIP\n");
+ (void) HDfprintf(stdout, "\t COMPRESSION-PARAM 7\n\n\n");
+ (void) HDfprintf(stdout,
"\t The above configuration will accept an integer array \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t (6 X 3 X 5 x 2 x 4) in a binary file with the rank and \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t dimension sizes specified and will save it in a chunked data-set\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t (of pattern 2 X 2 X 2 X 2 X 2) of 32-bit floating point in \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t native format (as output-architecture is not specified). The \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t first and the third dimension will be defined as unlimited. The \n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout,
"\t data-set will be compressed using GZIP and a compression level \n");
- (void) fprintf(stdout, "\t of 7.\n");
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\t of 7.\n");
+ (void) HDfprintf(stdout,
"\t The dataset will be stored at \"/Second-set\"\n\n");
return;
}
void usage(char *name)
{
- (void) fprintf(stdout, "\nUsage:\t%s -h[elp], OR\n", name);
- (void) fprintf(stdout,
+ (void) HDfprintf(stdout, "\nUsage:\t%s -h[elp], OR\n", name);
+ (void) HDfprintf(stdout,
"\t%s <infile> -c[onfig] <configfile> \
[<infile> -c[config] <configfile>...] -o[utfile] <outfile> \n\n", name);
return;
diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h
index 05de476..dbc6844 100755
--- a/tools/h5import/h5import.h
+++ b/tools/h5import/h5import.h
@@ -47,7 +47,7 @@
#define CHUNK 0
#define COMPRESS 1
#define EXTEND 2
-#define EXTERNAL 3
+#define EXTERNALSTORE 3
#define DIM 4
#define RANK 5
#define PATH 6
diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt
index e5caa11..a03d139 100644
--- a/tools/h5jam/CMakeLists.txt
+++ b/tools/h5jam/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5JAM)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
# Add the h5jam executables
@@ -50,7 +49,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c)
TARGET_NAMING (h5jamgentest ${LIB_TYPE})
- TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>)
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c
index 293aa17..f536605 100644
--- a/tools/h5jam/getub.c
+++ b/tools/h5jam/getub.c
@@ -21,6 +21,7 @@
#endif
#include "H5private.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
void parse_command_line (int argc, const char *argv[]);
@@ -32,9 +33,9 @@ void parse_command_line (int argc, const char *argv[]);
#define PROGRAMNAME "getub"
char *nbytes = NULL;
-static const char *s_opts = "c:"; /* add more later ? */
+static const char *s_opts = "c:"; /* add more later ? */
static struct long_options l_opts[] = {
- {"c", require_arg, 'c'}, /* input file */
+ {"c", require_arg, 'c'}, /* input file */
{NULL, 0, '\0'}
};
@@ -84,15 +85,15 @@ parse_command_line (int argc, const char *argv[])
while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF)
{
switch ((char) opt)
- {
- case 'c':
- nbytes = HDstrdup (opt_arg);
- break;
- case '?':
- default:
- usage (h5tools_getprogname());
- exit (EXIT_FAILURE);
- }
+ {
+ case 'c':
+ nbytes = HDstrdup (opt_arg);
+ break;
+ case '?':
+ default:
+ usage (h5tools_getprogname());
+ exit (EXIT_FAILURE);
+ }
}
if (argc <= opt_ind)
@@ -115,6 +116,9 @@ main (int argc, const char *argv[])
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+ /* Initialize h5tools lib */
+ h5tools_init();
+
parse_command_line (argc, argv);
if (nbytes == NULL)
@@ -161,7 +165,7 @@ main (int argc, const char *argv[])
if (res < (long)size)
{
if (buf)
- free (buf);
+ free (buf);
HDclose (fd);
exit (EXIT_FAILURE);
}
diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c
index 5520dc7..981eead 100644
--- a/tools/h5jam/h5jam.c
+++ b/tools/h5jam/h5jam.c
@@ -15,6 +15,7 @@
#include "hdf5.h"
#include "H5private.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
/* Name of tool */
@@ -139,7 +140,7 @@ leave(int ret)
h5tools_close();
- exit(ret);
+ HDexit(ret);
}
/*-------------------------------------------------------------------------
@@ -237,6 +238,9 @@ main (int argc, const char *argv[])
H5Eget_auto2(H5E_DEFAULT, &func, &edata);
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+ /* Initialize h5tools lib */
+ h5tools_init();
+
parse_command_line (argc, argv);
if (ub_file == NULL) {
diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c
index c64053c..ca3d86c 100644
--- a/tools/h5jam/h5jamgentest.c
+++ b/tools/h5jam/h5jamgentest.c
@@ -335,7 +335,7 @@ create_textfile(const char *name, size_t size)
fd = HDcreat(name,0777);
HDassert(fd >= 0);
- buf = calloc(size, (size_t)1);
+ buf = HDcalloc(size, (size_t)1);
HDassert(buf);
/* fill buf with pattern */
@@ -363,7 +363,7 @@ create_binfile(char *name, off_t size)
fd = creat(name,0777);
HDassert(fd >= 0);
- buf = calloc(size,1);
+ buf = HDcalloc(size,1);
HDassert(buf);
/* fill buf with pattern */
diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c
index 14ed651..4751dad 100644
--- a/tools/h5jam/h5unjam.c
+++ b/tools/h5jam/h5unjam.c
@@ -15,6 +15,7 @@
#include "hdf5.h"
#include "H5private.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
/* Name of tool */
@@ -142,7 +143,7 @@ leave(int ret)
h5tools_close();
- exit(ret);
+ HDexit(ret);
}
/*-------------------------------------------------------------------------
@@ -199,7 +200,7 @@ parse_command_line(int argc, const char *argv[])
if (argc <= opt_ind+2) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
*/
}
diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c
index f1b6756..0169d71 100644
--- a/tools/h5jam/tellub.c
+++ b/tools/h5jam/tellub.c
@@ -21,6 +21,7 @@
#include "hdf5.h"
#include "H5private.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
#define TRUE 1
@@ -60,7 +61,7 @@ usage (const char *prog)
fflush (stdout);
fprintf (stdout, "usage: %s h5_file\n", prog);
fprintf (stdout,
- " Check that h5_fil is HDF5 file and print size of user block \n");
+ " Check that h5_fil is HDF5 file and print size of user block \n");
fprintf (stdout, " %s -h\n", prog);
fprintf (stdout, " Print a usage message and exit\n");
}
@@ -90,15 +91,15 @@ parse_command_line (int argc, const char *argv[])
while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF)
{
switch ((char) opt)
- {
- case 'h':
- usage (h5tools_getprogname());
- exit (EXIT_SUCCESS);
- case '?':
- default:
- usage (h5tools_getprogname());
- exit (EXIT_FAILURE);
- }
+ {
+ case 'h':
+ usage (h5tools_getprogname());
+ exit (EXIT_SUCCESS);
+ case '?':
+ default:
+ usage (h5tools_getprogname());
+ exit (EXIT_FAILURE);
+ }
}
/* check for file name to be processed */
@@ -139,6 +140,9 @@ main (int argc, const char *argv[])
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+ /* Initialize h5tools lib */
+ h5tools_init();
+
/* Disable error reporting */
H5Eget_auto2(H5E_DEFAULT, &func, &edata);
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
@@ -174,7 +178,7 @@ main (int argc, const char *argv[])
if (plist < 0)
{
error_msg("Can't get file creation plist for file \"%s\"\n",
- ifname);
+ ifname);
return (EXIT_FAILURE);
}
diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt
index ad37da0..0dec21c 100644
--- a/tools/h5ls/CMakeLists.txt
+++ b/tools/h5ls/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5LS)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
#-----------------------------------------------------------------------------
# Add the h5ls executable
@@ -29,111 +28,105 @@ IF (BUILD_TESTING)
# --------------------------------------------------------------------
# Copy all the test files from source directory to test directory
# --------------------------------------------------------------------
- SET (LIST_EXPECT_OUTPUT_FILES
- help-1.ls
- help-2.ls
- help-3.ls
- nosuchfile.ls
- tall-1.ls
- tall-2.ls
- tarray1.ls
- tattr2.ls
- tattrreg_le.ls
- tattrreg_be.ls
- tcomp-1.ls
- tdataregbe.ls
- tdataregle.ls
- tdset-1.ls
- tempty.ls
- textlink-1.ls
- textlinksrc-1.ls
- textlinksrc-2.ls
- textlinksrc-3.ls
- textlinksrc-4.ls
- textlinksrc-5.ls
- textlinksrc-6.ls
- textlinksrc-7.ls
- textlinksrc-1-old.ls
- textlinksrc-2-old.ls
- textlinksrc-3-old.ls
- textlinksrc-6-old.ls
- textlinksrc-7-old.ls
- tsoftlinks-1.ls
- tsoftlinks-2.ls
- tsoftlinks-3.ls
- tsoftlinks-4.ls
- tsoftlinks-5.ls
- textlinksrc-nodangle-1.ls
- textlinksrc-nodangle-2.ls
- tgrp_comments.ls
- tsoftlinks-nodangle-1.ls
- thlinks-nodangle-1.ls
- tgroup.ls
- tgroup-1.ls
- tgroup-2.ls
- tgroup-3.ls
- thlink-1.ls
- tloop-1.ls
- tnestcomp-1.ls
- tnestcomp-2.ls
- tnestcomp-3.ls
- tnestcomp-4.ls
- tsaf.ls
- tslink-1.ls
- tstr-1.ls
- tudlink-1.ls
- tvldtypes1.ls
- tvldtypes2le.ls
- tvldtypes2be.ls
- )
SET (LIST_HDF5_TEST_FILES
- tall.h5
- tarray1.h5
- tattr2.h5
- tattrreg.h5
- tcompound.h5
- tdatareg.h5
- tdset.h5
- tempty.h5
- textlink.h5
- textlinksrc.h5
- textlinktar.h5
- tgroup.h5
- tgrp_comments.h5
- thlink.h5
- tloop.h5
- tnestedcomp.h5
- tsaf.h5
- tslink.h5
- tsoftlinks.h5
- tstr.h5
- tudlink.h5
- tvldtypes1.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5
)
- # copy the list of expected output files
- FOREACH (out_file ${LIST_EXPECT_OUTPUT_FILES})
- SET (out_dest "${PROJECT_BINARY_DIR}/${out_file}")
- #MESSAGE (STATUS " Translating ${out_file}")
- ADD_CUSTOM_COMMAND (
- TARGET h5ls
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${out_file} ${out_dest}
- )
- ENDFOREACH (out_file ${LIST_EXPECT_OUTPUT_FILES})
+ SET (LIST_OTHER_TEST_FILES
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/nosuchfile.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_le.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_be.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregbe.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregle.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-4.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-5.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1-old.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2-old.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3-old.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6-old.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7-old.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-2.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-3.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-4.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-5.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-2.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-nodangle-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/thlinks-nodangle-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-2.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-3.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-4.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2le.ls
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2be.ls
+ )
+
+ FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- # copy the list of hdf5 test files
- FOREACH (h5_file ${LIST_HDF5_TEST_FILES})
- SET (h5_dest "${PROJECT_BINARY_DIR}/${h5_file}")
- #MESSAGE (STATUS " Copying ${h5_file}")
+ # copy the list of test files
+ FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
+ GET_FILENAME_COMPONENT(fname "${listfiles}" NAME)
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ #MESSAGE (STATUS " Copying ${listfiles} to ${dest}")
ADD_CUSTOM_COMMAND (
TARGET h5ls
POST_BUILD
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${h5_dest}
+ ARGS -E copy_if_different ${listfiles} ${dest}
)
- ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES})
+ ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
+
##############################################################################
##############################################################################
@@ -145,6 +138,7 @@ IF (BUILD_TESTING)
# If using memchecker add tests without using scripts
IF (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
+ SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
IF (${resultcode} STREQUAL "1")
SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
ENDIF (${resultcode} STREQUAL "1")
@@ -156,14 +150,14 @@ IF (BUILD_TESTING)
ADD_TEST (
NAME H5LS-clear-${resultfile}-objects
COMMAND ${CMAKE_COMMAND}
- -E remove ${resultfile}.out ${resultfile}.out.err
+ -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err
)
ADD_TEST (
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
-D "TEST_ARGS=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ls"
@@ -361,6 +355,11 @@ IF (BUILD_TESTING)
# when used file with no dangling links - expected exit code 0
ADD_H5_TEST (thlinks-nodangle-1 0 -w80 --follow-symlinks --no-dangling-links thlink.h5)
+# test for wildcards in filename (does not work with cmake)
+# ADD_H5_TEST (tstarfile 0 -w80 t*link.h5)
+# ADD_H5_TEST (tqmarkfile 0 -w80 t?link.h5)
+ ADD_H5_TEST (tmultifile 0 -w80 thlink.h5 tslink.h5)
+
# tests for hard links
ADD_H5_TEST (thlink-1 0 -w80 thlink.h5)
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 9766170..2171682 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -176,7 +176,7 @@ static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter);
static void
usage (void)
{
- fprintf(stderr, "\
+ HDfprintf(rawerrorstream, "\
usage: %s [OPTIONS] [OBJECTS...]\n\
OPTIONS\n\
-h, -?, --help Print a usage message and exit\n\
@@ -239,1071 +239,6 @@ usage: %s [OPTIONS] [OBJECTS...]\n\
}
-/*-------------------------------------------------------------------------
- * Function: display_string
- *
- * Purpose: Print a string value by escaping unusual characters. If
- * STREAM is null then we only count how large the output would
- * be.
- *
- * Return: Number of characters printed.
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static int
-display_string(FILE *stream, const char *s, hbool_t escape_spaces)
-{
- int nprint=0;
-
- for (/*void*/; s && *s; s++) {
- switch (*s) {
- case '"':
- if (stream) fprintf(stream, "\\\"");
- nprint += 2;
- break;
- case '\\':
- if (stream) fprintf(stream, "\\\\");
- nprint += 2;
- break;
- case '\b':
- if (stream) fprintf(stream, "\\b");
- nprint += 2;
- break;
- case '\f':
- if (stream) fprintf(stream, "\\f");
- nprint += 2;
- break;
- case '\n':
- if (stream) fprintf(stream, "\\n");
- nprint += 2;
- break;
- case '\r':
- if (stream) fprintf(stream, "\\r");
- nprint += 2;
- break;
- case '\t':
- if (stream) fprintf(stream, "\\t");
- nprint += 2;
- break;
- case ' ':
- if (escape_spaces) {
- if (stream) fprintf(stream, "\\ ");
- nprint += 2;
- } else {
- if (stream) fprintf(stream, " ");
- nprint++;
- }
- break;
- default:
- if (isprint((int)*s)) {
- if (stream) putc(*s, stream);
- nprint++;
- } else {
- if (stream) {
- fprintf(stream, "\\%03o", *((const unsigned char*)s));
- }
- nprint += 4;
- }
- break;
- }
- }
- return nprint;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_obj_name
- *
- * Purpose: Print an object name and another string.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Quincey Koziol
- * Tuesday, November 6, 2007
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static int
-display_obj_name(FILE *stream, const iter_t *iter, const char *oname,
- const char *s)
-{
- static char fullname[NAME_BUF_SIZE]; /* Buffer for file and/or object name */
- const char *name = fullname; /* Pointer to buffer for printing */
- int n;
-
- if(show_file_name_g)
- sprintf(fullname, "%s/%s", iter->fname, oname + iter->name_start);
- else
- name = oname + iter->name_start;
-
- /* Print the object name, either full name or base name */
- if(fullname_g)
- n = display_string(stream, name, TRUE);
- else {
- const char *last_sep; /* The location of the last group separator */
-
- /* Find the last component of the path name */
- if(NULL == (last_sep = HDstrrchr(name, '/')))
- last_sep = name;
- else {
- last_sep++;
- } /* end else */
- n = display_string(stream, last_sep, TRUE);
- } /* end else */
- printf("%*s ", MAX(0, (24 - n)), s);
-
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_native_type
- *
- * Purpose: Prints the name of a native C data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed.
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-06-11
- * Added the C9x types, but we still prefer to display the types
- * from the C language itself (like `int' vs. `int32_t').
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_native_type(hid_t type, int UNUSED ind)
-{
- if (H5Tequal(type, H5T_NATIVE_SCHAR)==TRUE) {
- printf("native signed char");
- } else if (H5Tequal(type, H5T_NATIVE_UCHAR)==TRUE) {
- printf("native unsigned char");
- } else if (H5Tequal(type, H5T_NATIVE_INT)==TRUE) {
- printf("native int");
- } else if (H5Tequal(type, H5T_NATIVE_UINT)==TRUE) {
- printf("native unsigned int");
- } else if (H5Tequal(type, H5T_NATIVE_SHORT)==TRUE) {
- printf("native short");
- } else if (H5Tequal(type, H5T_NATIVE_USHORT)==TRUE) {
- printf("native unsigned short");
- } else if (H5Tequal(type, H5T_NATIVE_LONG)==TRUE) {
- printf("native long");
- } else if (H5Tequal(type, H5T_NATIVE_ULONG)==TRUE) {
- printf("native unsigned long");
- } else if (H5Tequal(type, H5T_NATIVE_LLONG)==TRUE) {
- printf("native long long");
- } else if (H5Tequal(type, H5T_NATIVE_ULLONG)==TRUE) {
- printf("native unsigned long long");
- } else if (H5Tequal(type, H5T_NATIVE_FLOAT)==TRUE) {
- printf("native float");
- } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)==TRUE) {
- printf("native double");
-#if H5_SIZEOF_LONG_DOUBLE !=0
- } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)==TRUE) {
- printf("native long double");
-#endif
- } else if (H5Tequal(type, H5T_NATIVE_INT8)==TRUE) {
- printf("native int8_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT8)==TRUE) {
- printf("native uint8_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT16)==TRUE) {
- printf("native int16_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT16)==TRUE) {
- printf("native uint16_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT32)==TRUE) {
- printf("native int32_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT32)==TRUE) {
- printf("native uint32_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT64)==TRUE) {
- printf("native int64_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT64)==TRUE) {
- printf("native uint64_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST8)==TRUE) {
- printf("native int_least8_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST8)==TRUE) {
- printf("native uint_least8_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST16)==TRUE) {
- printf("native int_least16_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST16)==TRUE) {
- printf("native uint_least16_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST32)==TRUE) {
- printf("native int_least32_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST32)==TRUE) {
- printf("native uint_least32_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST64)==TRUE) {
- printf("native int_least64_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST64)==TRUE) {
- printf("native uint_least64_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_FAST8)==TRUE) {
- printf("native int_fast8_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST8)==TRUE) {
- printf("native uint_fast8_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_FAST16)==TRUE) {
- printf("native int_fast16_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST16)==TRUE) {
- printf("native uint_fast16_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_FAST32)==TRUE) {
- printf("native int_fast32_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST32)==TRUE) {
- printf("native uint_fast32_t");
- } else if (H5Tequal(type, H5T_NATIVE_INT_FAST64)==TRUE) {
- printf("native int_fast64_t");
- } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST64)==TRUE) {
- printf("native uint_fast64_t");
- } else if (H5Tequal(type, H5T_NATIVE_B8)==TRUE) {
- printf("native 8-bit field");
- } else if (H5Tequal(type, H5T_NATIVE_B16)==TRUE) {
- printf("native 16-bit field");
- } else if (H5Tequal(type, H5T_NATIVE_B32)==TRUE) {
- printf("native 32-bit field");
- } else if (H5Tequal(type, H5T_NATIVE_B64)==TRUE) {
- printf("native 64-bit field");
- } else if (H5Tequal(type, H5T_NATIVE_HSIZE)==TRUE) {
- printf("native hsize_t");
- } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)==TRUE) {
- printf("native hssize_t");
- } else if (H5Tequal(type, H5T_NATIVE_HERR)==TRUE) {
- printf("native herr_t");
- } else if (H5Tequal(type, H5T_NATIVE_HBOOL)==TRUE) {
- printf("native hbool_t");
- } else {
- return FALSE;
- }
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_ieee_type
- *
- * Purpose: Print the name of an IEEE floating-point data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_ieee_type(hid_t type, int UNUSED ind)
-{
- if (H5Tequal(type, H5T_IEEE_F32BE)==TRUE) {
- printf("IEEE 32-bit big-endian float");
- } else if (H5Tequal(type, H5T_IEEE_F32LE)==TRUE) {
- printf("IEEE 32-bit little-endian float");
- } else if (H5Tequal(type, H5T_IEEE_F64BE)==TRUE) {
- printf("IEEE 64-bit big-endian float");
- } else if (H5Tequal(type, H5T_IEEE_F64LE)==TRUE) {
- printf("IEEE 64-bit little-endian float");
- } else {
- return FALSE;
- }
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_precision
- *
- * Purpose: Prints information on the next line about precision and
- * padding if the precision is less than the total data type
- * size.
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static void
-display_precision(hid_t type, int ind)
-{
- size_t prec; /* precision */
- H5T_pad_t plsb, pmsb; /* lsb and msb padding */
- const char *plsb_s=NULL; /* lsb padding string */
- const char *pmsb_s=NULL; /* msb padding string */
- size_t nbits; /* number of bits */
-
- /* If the precision is less than the total size then show the precision
- * and offset on the following line. Also display the padding
- * information. */
- if (8*H5Tget_size(type)!=(prec=H5Tget_precision(type))) {
- printf("\n%*s(%lu bit%s of precision beginning at bit %lu)",
- ind, "", (unsigned long)prec, 1==prec?"":"s",
- (unsigned long)H5Tget_offset(type));
-
- H5Tget_pad(type, &plsb, &pmsb);
- if (H5Tget_offset(type)>0) {
- switch (plsb) {
- case H5T_PAD_ZERO:
- plsb_s = "zero";
- break;
- case H5T_PAD_ONE:
- plsb_s = "one";
- break;
- case H5T_PAD_BACKGROUND:
- plsb_s = "bkg";
- break;
- case H5T_PAD_ERROR:
- case H5T_NPAD:
- plsb_s = "unknown";
- break;
- default:
- ;
- break;
- }
- }
- if (H5Tget_offset(type)+prec<8*H5Tget_size(type)) {
- switch (pmsb) {
- case H5T_PAD_ZERO:
- pmsb_s = "zero";
- break;
- case H5T_PAD_ONE:
- pmsb_s = "one";
- break;
- case H5T_PAD_BACKGROUND:
- pmsb_s = "bkg";
- break;
- case H5T_PAD_ERROR:
- case H5T_NPAD:
- pmsb_s = "unknown";
- break;
- default:
- ;
- break;
- }
- }
- if (plsb_s || pmsb_s) {
- printf("\n%*s(", ind, "");
- if (plsb_s) {
- nbits = H5Tget_offset(type);
- printf("%lu %s bit%s at bit 0",
- (unsigned long)nbits, plsb_s, 1==nbits?"":"s");
- }
- if (plsb_s && pmsb_s) printf(", ");
- if (pmsb_s) {
- nbits = 8*H5Tget_size(type)-(H5Tget_offset(type)+prec);
- printf("%lu %s bit%s at bit %lu",
- (unsigned long)nbits, pmsb_s, 1==nbits?"":"s",
- (unsigned long)(8*H5Tget_size(type)-nbits));
- }
- printf(")");
- }
- }
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_int_type
- *
- * Purpose: Print the name of an integer data type. Common information
- * like number of bits, byte order, and sign scheme appear on
- * the first line. Additional information might appear in
- * parentheses on the following lines.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_int_type(hid_t type, int ind)
-{
- H5T_order_t order; /* byte order value */
- const char *order_s=NULL; /* byte order string */
- H5T_sign_t sign; /* sign scheme value */
- const char *sign_s=NULL; /* sign scheme string */
-
- if (H5T_INTEGER!=H5Tget_class(type)) return FALSE;
-
- /* Byte order */
- if (H5Tget_size(type)>1) {
- order = H5Tget_order(type);
- if (H5T_ORDER_LE==order) {
- order_s = " little-endian";
- } else if (H5T_ORDER_BE==order) {
- order_s = " big-endian";
- } else if (H5T_ORDER_VAX==order) {
- order_s = " mixed-endian";
- } else {
- order_s = " unknown-byte-order";
- }
- } else {
- order_s = "";
- }
-
- /* Sign */
- if ((sign=H5Tget_sign(type))>=0) {
- if (H5T_SGN_NONE==sign) {
- sign_s = " unsigned";
- } else if (H5T_SGN_2==sign) {
- sign_s = "";
- } else {
- sign_s = " unknown-sign";
- }
- } else {
- sign_s = " unknown-sign";
- }
-
- /* Print size, order, and sign on first line, precision and padding
- * information on the subsequent lines */
- printf("%lu-bit%s%s integer",
- (unsigned long)(8*H5Tget_size(type)), order_s, sign_s);
- display_precision(type, ind);
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_float_type
- *
- * Purpose: Print info about a floating point data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_float_type(hid_t type, int ind)
-{
- H5T_order_t order; /* byte order value */
- const char *order_s=NULL; /* byte order string */
- size_t spos; /* sign bit position */
- size_t esize, epos; /* exponent size and position */
- size_t msize, mpos; /* significand size and position */
- size_t ebias; /* exponent bias */
- H5T_norm_t norm; /* significand normalization */
- const char *norm_s=NULL; /* normalization string */
- H5T_pad_t pad; /* internal padding value */
- const char *pad_s=NULL; /* internal padding string */
-
- if (H5T_FLOAT!=H5Tget_class(type)) return FALSE;
-
- /* Byte order */
- if (H5Tget_size(type)>1) {
- order = H5Tget_order(type);
- if (H5T_ORDER_LE==order) {
- order_s = " little-endian";
- } else if (H5T_ORDER_BE==order) {
- order_s = " big-endian";
- } else if (H5T_ORDER_VAX==order) {
- order_s = " mixed-endian";
- } else {
- order_s = " unknown-byte-order";
- }
- } else {
- order_s = "";
- }
-
- /* Print size and byte order on first line, precision and padding on
- * subsequent lines. */
- printf("%lu-bit%s floating-point",
- (unsigned long)(8*H5Tget_size(type)), order_s);
- display_precision(type, ind);
-
- /* Print sizes, locations, and other information about each field */
- H5Tget_fields (type, &spos, &epos, &esize, &mpos, &msize);
- ebias = H5Tget_ebias(type);
- norm = H5Tget_norm(type);
- switch (norm) {
- case H5T_NORM_IMPLIED:
- norm_s = ", msb implied";
- break;
- case H5T_NORM_MSBSET:
- norm_s = ", msb always set";
- break;
- case H5T_NORM_NONE:
- norm_s = ", no normalization";
- break;
- case H5T_NORM_ERROR:
- norm_s = ", unknown normalization";
- break;
- default:
- ;
- break;
- }
- printf("\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "",
- (unsigned long)msize, 1==msize?"":"s", (unsigned long)mpos,
- norm_s);
- printf("\n%*s(exponent for %lu bit%s at bit %lu, bias is 0x%lx)",
- ind, "", (unsigned long)esize, 1==esize?"":"s",
- (unsigned long)epos, (unsigned long)ebias);
- printf("\n%*s(sign bit at %lu)", ind, "", (unsigned long)spos);
-
- /* Display internal padding */
- if (1+esize+msize<H5Tget_precision(type)) {
- pad = H5Tget_inpad(type);
- switch (pad) {
- case H5T_PAD_ZERO:
- pad_s = "zero";
- break;
- case H5T_PAD_ONE:
- pad_s = "one";
- break;
- case H5T_PAD_BACKGROUND:
- pad_s = "bkg";
- break;
- case H5T_PAD_ERROR:
- case H5T_NPAD:
- pad_s = "unknown";
- break;
- default:
- ;
- break;
- }
- printf("\n%*s(internal padding bits are %s)", ind, "", pad_s);
- }
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_cmpd_type
- *
- * Purpose: Print info about a compound data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_cmpd_type(hid_t type, int ind)
-{
- char *name=NULL; /* member name */
- size_t size; /* total size of type in bytes */
- hid_t subtype; /* member data type */
- unsigned nmembs; /* number of members */
- int n; /* miscellaneous counters */
- unsigned i; /* miscellaneous counters */
-
- if (H5T_COMPOUND!=H5Tget_class(type)) return FALSE;
- printf("struct {");
- nmembs=H5Tget_nmembers(type);
- for (i=0; i<nmembs; i++) {
-
- /* Name and offset */
- name = H5Tget_member_name(type, i);
- printf("\n%*s\"", ind+4, "");
- n = display_string(stdout, name, FALSE);
- printf("\"%*s +%-4lu ", MAX(0, 16-n), "",
- (unsigned long)H5Tget_member_offset(type, i));
- HDfree(name);
-
- /* Member's type */
- subtype = H5Tget_member_type(type, i);
- display_type(subtype, ind+4);
- H5Tclose(subtype);
- }
- size = H5Tget_size(type);
- printf("\n%*s} %lu byte%s",
- ind, "", (unsigned long)size, 1==size?"":"s");
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_enum_type
- *
- * Purpose: Print info about an enumeration data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Wednesday, December 23, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_enum_type(hid_t type, int ind)
-{
- char **name=NULL; /* member names */
- unsigned char *value=NULL; /* value array */
- unsigned char *copy = NULL; /* a pointer to value array */
- unsigned nmembs; /* number of members */
- int nchars; /* number of output characters */
- hid_t super; /* enum base integer type */
- hid_t native=-1; /* native integer data type */
- size_t dst_size; /* destination value type size */
- unsigned i; /* miscellaneous counters */
- size_t j;
-
- if (H5T_ENUM!=H5Tget_class(type)) return FALSE;
- nmembs = H5Tget_nmembers(type);
- HDassert(nmembs>0);
- super = H5Tget_super(type);
- printf("enum ");
- display_type(super, ind+4);
- printf(" {");
-
- /* Determine what data type to use for the native values. To simplify
- * things we entertain three possibilities:
- * 1. long long -- the largest native signed integer
- * 2. unsigned long long -- the largest native unsigned integer
- * 3. raw format */
- if (H5Tget_size(type)<=sizeof(long long)) {
- dst_size = sizeof(long long);
- if (H5T_SGN_NONE==H5Tget_sign(type)) {
- native = H5T_NATIVE_ULLONG;
- } else {
- native = H5T_NATIVE_LLONG;
- }
- } else {
- dst_size = H5Tget_size(type);
- }
-
- /* Get the names and raw values of all members */
- name = calloc(nmembs, sizeof(char*));
- value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size));
- for (i=0; i<nmembs; i++) {
- name[i] = H5Tget_member_name(type, i);
- H5Tget_member_value(type, i, value+i*H5Tget_size(type));
- }
-
- /* Convert values to native data type */
- if (native>0) H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT);
-
- /* Sort members by increasing value */
- /*not implemented yet*/
-
- /* Print members */
- for (i=0; i<nmembs; i++) {
- printf("\n%*s", ind+4, "");
- nchars = display_string(stdout, name[i], TRUE);
- printf("%*s = ", MAX(0, 16-nchars), "");
-
- if (native<0) {
- printf("0x");
- for (j=0; j<dst_size; j++)
- printf("%02x", value[i*dst_size+j]);
- } else if (H5T_SGN_NONE==H5Tget_sign(native)) {
- /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
- *strangely, unless use another pointer "copy".*/
- copy = value+i*dst_size;
- HDfprintf(stdout,"%"H5_PRINTF_LL_WIDTH"u",
- *((unsigned long long*)((void*)copy)));
- } else {
- /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
- *strangely, unless use another pointer "copy".*/
- copy = value+i*dst_size;
- HDfprintf(stdout,"%"H5_PRINTF_LL_WIDTH"d",
- *((long long*)((void*)copy)));
- }
- }
-
- /* Release resources */
- for (i=0; i<nmembs; i++) HDfree(name[i]);
- HDfree(name);
- HDfree(value);
- H5Tclose(super);
-
- if (0==nmembs) printf("\n%*s <empty>", ind+4, "");
- printf("\n%*s}", ind, "");
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_string_type
- *
- * Purpose: Print information about a string data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_string_type(hid_t type, int UNUSED ind)
-{
- H5T_str_t pad;
- const char *pad_s=NULL;
- H5T_cset_t cset;
- const char *cset_s=NULL;
-
- if (H5T_STRING!=H5Tget_class(type)) return FALSE;
-
- /* Padding */
- pad = H5Tget_strpad(type);
- switch (pad) {
- case H5T_STR_NULLTERM:
- pad_s = "null-terminated";
- break;
- case H5T_STR_NULLPAD:
- pad_s = "null-padded";
- break;
- case H5T_STR_SPACEPAD:
- pad_s = "space-padded";
- break;
- case H5T_STR_RESERVED_3:
- case H5T_STR_RESERVED_4:
- case H5T_STR_RESERVED_5:
- case H5T_STR_RESERVED_6:
- case H5T_STR_RESERVED_7:
- case H5T_STR_RESERVED_8:
- case H5T_STR_RESERVED_9:
- case H5T_STR_RESERVED_10:
- case H5T_STR_RESERVED_11:
- case H5T_STR_RESERVED_12:
- case H5T_STR_RESERVED_13:
- case H5T_STR_RESERVED_14:
- case H5T_STR_RESERVED_15:
- case H5T_STR_ERROR:
- pad_s = "unknown-format";
- break;
- default:
- ;
- break;
- }
-
- /* Character set */
- cset = H5Tget_cset(type);
- switch (cset) {
- case H5T_CSET_ASCII:
- cset_s = "ASCII";
- break;
- case H5T_CSET_UTF8:
- cset_s = "UTF-8";
- 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:
- case H5T_CSET_ERROR:
- cset_s = "unknown-character-set";
- break;
- default:
- ;
- break;
- }
-
- if (H5Tis_variable_str(type)) {
- printf("variable-length");
- } else {
- printf("%lu-byte", (unsigned long)H5Tget_size(type));
- }
- printf(" %s %s string", pad_s, cset_s);
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_reference_type
- *
- * Purpose: Prints information about a reference data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-06-04
- * Knows about object and dataset region references.
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_reference_type(hid_t type, int UNUSED ind)
-{
- if (H5T_REFERENCE!=H5Tget_class(type)) return FALSE;
-
- if (H5Tequal(type, H5T_STD_REF_OBJ)==TRUE) {
- printf("object reference");
- } else if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) {
- printf("dataset region reference");
- } else {
- printf("%lu-byte unknown reference",
- (unsigned long)H5Tget_size(type));
- }
-
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_opaque_type
- *
- * Purpose: Prints information about an opaque data type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Robb Matzke
- * Monday, June 7, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_opaque_type(hid_t type, int ind)
-{
- char *tag;
- size_t size;
-
- if (H5T_OPAQUE!=H5Tget_class(type)) return FALSE;
-
- size = H5Tget_size(type);
- printf("%lu-byte opaque type", (unsigned long)size);
- if ((tag=H5Tget_tag(type))) {
- printf("\n%*s(tag = \"", ind, "");
- display_string(stdout, tag, FALSE);
- printf("\")");
- HDfree(tag);
- }
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_vlen_type
- *
- * Purpose: Print information about a variable-length type
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE
- *
- * Programmer: Robb Matzke
- * Friday, December 1, 2000
- *
- * Modifications:
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_vlen_type(hid_t type, int ind)
-{
- hid_t super;
-
- if (H5T_VLEN!=H5Tget_class(type)) return FALSE;
-
- printf("variable length of\n%*s", ind+4, "");
- super = H5Tget_super(type);
- display_type(super, ind+4);
- H5Tclose(super);
- return TRUE;
-}
-
-
-/*---------------------------------------------------------------------------
- * Purpose: Print information about an array type
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE
- *
- * Programmer: Robb Matzke
- * Thursday, January 31, 2002
- *
- * Modifications:
- *---------------------------------------------------------------------------
- */
-static hbool_t
-display_array_type(hid_t type, int ind)
-{
- hid_t super;
- int ndims, i;
- hsize_t *dims=NULL;
-
- if (H5T_ARRAY!=H5Tget_class(type)) return FALSE;
- ndims = H5Tget_array_ndims(type);
- if (ndims) {
- dims = (hsize_t *)HDmalloc(ndims*sizeof(dims[0]));
- H5Tget_array_dims2(type, dims);
-
- /* Print dimensions */
- for (i=0; i<ndims; i++)
- HDfprintf(stdout, "%s%Hu" , i?",":"[", dims[i]);
- putchar(']');
-
- HDfree(dims);
- } else {
- fputs(" [SCALAR]", stdout);
- }
-
-
- /* Print parent type */
- putchar(' ');
- super = H5Tget_super(type);
- display_type(super, ind+4);
- H5Tclose(super);
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_bitfield_type
- *
- * Purpose: Print information about a bitfield type.
- *
- * Return: Success: TRUE
- *
- * Failure: FALSE, nothing printed
- *
- * Programmer: Pedro Vicente
- * Tuesday, May 20, 2003
- *
- * Modifications:
- * Robb Matzke, LLNL 2003-06-05
- * Generalized Pedro's original if/then/else. Also display
- * precision/offset information.
- *-------------------------------------------------------------------------
- */
-static hbool_t
-display_bitfield_type(hid_t type, int ind)
-{
- H5T_order_t order; /* byte order value */
- const char *order_s=NULL; /* byte order string */
-
- if (H5T_BITFIELD!=H5Tget_class(type)) return FALSE;
- if (H5Tget_size(type)>1) {
- order = H5Tget_order(type);
- if (H5T_ORDER_LE==order) {
- order_s = " little-endian";
- } else if (H5T_ORDER_BE==order) {
- order_s = " big-endian";
- } else if (H5T_ORDER_VAX==order) {
- order_s = " mixed-endian";
- } else {
- order_s = "unknown-byte-order";
- }
- } else {
- order_s = "";
- }
-
- printf("%lu-bit%s bitfield",
- (unsigned long)(8*H5Tget_size(type)), order_s);
- display_precision(type, ind);
- return TRUE;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: display_type
- *
- * Purpose: Prints a data type definition. The definition is printed
- * without any leading space or trailing line-feed (although
- * there might be line-feeds inside the type definition). The
- * first line is assumed to have IND characters before it on
- * the same line (printed by the caller).
- *
- * Return: void
- *
- * Programmer: Robb Matzke
- * Thursday, November 5, 1998
- *
- * Modifications:
- * Robb Matzke, 1999-06-11
- * Prints the OID of shared data types.
- *
- *-------------------------------------------------------------------------
- */
-static void
-display_type(hid_t type, int ind)
-{
- H5T_class_t data_class = H5Tget_class(type);
-
- /* Bad data type */
- if (type<0) {
- printf("<ERROR>");
- return;
- }
-
- /* Shared? If so then print the type's OID */
- if(H5Tcommitted(type)) {
- H5O_info_t oi;
-
- if(H5Oget_info(type, &oi) >= 0)
- printf("shared-%lu:"H5_PRINTF_HADDR_FMT" ",
- oi.fileno, oi.addr);
- else
- printf("shared ");
- } /* end if */
-
- /* Print the type */
- if((!simple_output_g && display_native_type(type, ind)) ||
- display_ieee_type(type, ind) ||
- display_int_type(type, ind) ||
- display_float_type(type, ind) ||
- display_cmpd_type(type, ind) ||
- display_enum_type(type, ind) ||
- display_string_type(type, ind) ||
- display_reference_type(type, ind) ||
- display_vlen_type(type, ind) ||
- display_array_type(type, ind) ||
- display_opaque_type(type, ind) ||
- display_bitfield_type(type, ind))
- return;
-
- /* Unknown type */
- printf("%lu-byte class-%u unknown",
- (unsigned long)H5Tget_size(type), (unsigned)data_class);
-}
-
/*-------------------------------------------------------------------------
* Function: print_string
@@ -1329,49 +264,50 @@ print_string(h5tools_str_t *buffer, const char *s, hbool_t escape_spaces)
for (/*void*/; s && *s; s++) {
switch (*s) {
case '"':
- h5tools_str_append(buffer, "\\\"");
+ if (buffer) h5tools_str_append(buffer, "\\\"");
nprint += 2;
break;
case '\\':
- h5tools_str_append(buffer, "\\\\");
+ if (buffer) h5tools_str_append(buffer, "\\\\");
nprint += 2;
break;
case '\b':
- h5tools_str_append(buffer, "\\b");
+ if (buffer) h5tools_str_append(buffer, "\\b");
nprint += 2;
break;
case '\f':
- h5tools_str_append(buffer, "\\f");
+ if (buffer) h5tools_str_append(buffer, "\\f");
nprint += 2;
break;
case '\n':
- h5tools_str_append(buffer, "\\n");
+ if (buffer) h5tools_str_append(buffer, "\\n");
nprint += 2;
break;
case '\r':
- h5tools_str_append(buffer, "\\r");
+ if (buffer) h5tools_str_append(buffer, "\\r");
nprint += 2;
break;
case '\t':
- h5tools_str_append(buffer, "\\t");
+ if (buffer) h5tools_str_append(buffer, "\\t");
nprint += 2;
break;
case ' ':
if (escape_spaces) {
- h5tools_str_append(buffer, "\\ ");
+ if (buffer) h5tools_str_append(buffer, "\\ ");
nprint += 2;
}
else {
- h5tools_str_append(buffer, " ");
+ if (buffer) h5tools_str_append(buffer, " ");
nprint++;
}
break;
default:
if (isprint((int)*s)) {
- h5tools_str_append(buffer, "%c", *s);
+ if (buffer) h5tools_str_append(buffer, "%c", *s);
nprint++;
- } else {
- h5tools_str_append(buffer, "\\%03o", *((const unsigned char*)s));
+ }
+ else {
+ if (buffer) h5tools_str_append(buffer, "\\%03o", *((const unsigned char*)s));
nprint += 4;
}
break;
@@ -1977,8 +913,8 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
}
/* Get the names and raw values of all members */
- name = calloc(nmembs, sizeof(char*));
- value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size));
+ name = HDcalloc(nmembs, sizeof(char*));
+ value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size));
for (i=0; i<nmembs; i++) {
name[i] = H5Tget_member_name(type, i);
H5Tget_member_value(type, i, value+i*H5Tget_size(type));
@@ -2267,7 +1203,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind)
HDfree(dims);
}
else {
- h5tools_str_append(buffer, " [SCALAR]\n", stdout);
+ h5tools_str_append(buffer, " [SCALAR]\n", rawoutstream);
}
@@ -2504,20 +1440,20 @@ dump_dataset_values(hid_t dset)
/* Print all the values. */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " Data:\n");
- h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
ctx.need_prefix = TRUE;
ctx.cur_column = curr_pos;
- if (h5tools_dump_dset(stdout, info, &ctx, dset, -1, NULL) < 0) {
+ if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, -1, NULL) < 0) {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " Unable to print data.");
- h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
}
H5Tclose(f_type);
-
- fprintf(stdout, "\n");
h5tools_str_close(&buffer);
+
+ HDfprintf(rawoutstream, "\n");
}
@@ -2579,7 +1515,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
case H5S_SCALAR:
/* scalar dataspace */
h5tools_str_append(&buffer, " scalar\n");
- h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
break;
case H5S_SIMPLE:
@@ -2590,19 +1526,19 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
nelmts *= size[i];
}
h5tools_str_append(&buffer, "}\n");
- h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
break;
case H5S_NULL:
/* null dataspace */
h5tools_str_append(&buffer, " null\n");
- h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
break;
default:
/* Unknown dataspace type */
h5tools_str_append(&buffer, " unknown\n");
- h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
break;
} /* end switch */
@@ -2611,7 +1547,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
h5tools_str_append(&buffer, " Type: ");
print_type(&buffer, type, 15);
h5tools_str_append(&buffer, "\n");
- h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
/* Data */
outputformat = *info;
@@ -2627,7 +1563,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
else {
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, " Data:\n");
- h5tools_render_element(stdout, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
outputformat.line_1st = NULL;
outputformat.line_pre = " %s ";
outputformat.line_cont = " %s ";
@@ -2684,7 +1620,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
ctx.need_prefix = TRUE;
ctx.indent_level = 2;
ctx.cur_column = curr_pos;
- h5tools_dump_mem(stdout, info, &ctx, attr, p_type, space, buf);
+ h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf);
}
/* Reclaim any VL memory, if necessary */
@@ -2694,18 +1630,15 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo,
HDfree(buf);
H5Tclose(p_type);
} /* end if */
- fprintf(stdout, "\n");
H5Sclose(space);
H5Tclose(type);
H5Aclose(attr);
}
- else {
- fprintf(stdout, "\n");
- }
-
h5tools_str_close(&buffer);
+ HDfprintf(rawoutstream, "\n");
+
return 0;
}
@@ -2738,26 +1671,41 @@ dataset_list1(hid_t dset)
int ndims; /* dimensionality */
H5S_class_t space_type; /* type of dataspace */
int i;
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tool_link_info_t lnk_info;
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t *info = &ls_dataformat;
+ h5tool_format_t outputformat;
+
+ HDmemset(&ctx, 0, sizeof(ctx));
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+
+ h5tools_str_reset(&buffer);
/* Information that goes on the same row as the name. The name has
* already been printed. */
space = H5Dget_space(dset);
space_type = H5Sget_simple_extent_type(space);
ndims = H5Sget_simple_extent_dims(space, cur_size, max_size);
- printf (" {");
+ h5tools_str_append(&buffer, " {");
for (i=0; i<ndims; i++) {
- HDfprintf (stdout, "%s%Hu", i?", ":"", cur_size[i]);
+ h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", cur_size[i]);
if (max_size[i]==H5S_UNLIMITED) {
- HDfprintf (stdout, "/%s", "Inf");
- } else if (max_size[i]!=cur_size[i] || verbose_g>0) {
- HDfprintf(stdout, "/%Hu", max_size[i]);
+ h5tools_str_append(&buffer, "/%s", "Inf");
+ }
+ else if (max_size[i]!=cur_size[i] || verbose_g>0) {
+ h5tools_str_append(&buffer, "/"HSIZE_T_FORMAT, max_size[i]);
}
}
- if (space_type==H5S_SCALAR) printf("SCALAR");
- else if (space_type==H5S_NULL) printf("NULL");
- putchar('}');
+ if (space_type==H5S_SCALAR) h5tools_str_append(&buffer, "SCALAR");
+ else if (space_type==H5S_NULL) h5tools_str_append(&buffer, "NULL");
+ h5tools_str_append(&buffer, "}");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
H5Sclose (space);
+ h5tools_str_close(&buffer);
+
return 0;
}
@@ -2801,6 +1749,16 @@ dataset_list2(hid_t dset, const char UNUSED *name)
double utilization; /* percent utilization of storage */
H5T_class_t tclass; /* datatype class identifier */
int i;
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t *info = &ls_dataformat;
+ h5tool_format_t outputformat;
+
+ HDmemset(&ctx, 0, sizeof(ctx));
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+
+ h5tools_str_reset(&buffer);
if(verbose_g > 0) {
dcpl = H5Dget_create_plist(dset);
@@ -2812,87 +1770,87 @@ dataset_list2(hid_t dset, const char UNUSED *name)
hsize_t chsize[64]; /* chunk size in elements */
ndims = H5Pget_chunk(dcpl, NELMTS(chsize), chsize/*out*/);
- printf(" %-10s {", "Chunks:");
+ h5tools_str_append(&buffer, " %-10s {", "Chunks:");
total = H5Tget_size(type);
for (i=0; i<ndims; i++) {
- printf("%s%lu", i?", ":"", (unsigned long)(chsize[i]));
+ h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", chsize[i]);
total *= chsize[i];
}
- printf("} %lu bytes\n", (unsigned long)total);
+ h5tools_str_append(&buffer, "} "HSIZE_T_FORMAT" bytes\n", total);
}
/* Print total raw storage size */
total = H5Sget_simple_extent_npoints(space) * H5Tget_size(type);
used = H5Dget_storage_size(dset);
tclass = H5Tget_class(type);
- printf(" %-10s ", "Storage:");
+ h5tools_str_append(&buffer, " %-10s ", "Storage:");
switch (tclass)
{
case H5T_VLEN:
- printf("information not available");
+ h5tools_str_append(&buffer, "information not available");
break;
case H5T_REFERENCE:
if ( H5Tequal(type, H5T_STD_REF_DSETREG))
{
- printf("information not available");
+ h5tools_str_append(&buffer, "information not available");
}
break;
default:
- printf("%lu logical byte%s, %lu allocated byte%s",
- (unsigned long)total, 1==total?"":"s",
- (unsigned long)used, 1==used?"":"s");
+ h5tools_str_append(&buffer, HSIZE_T_FORMAT" logical byte%s, "HSIZE_T_FORMAT" allocated byte%s",
+ total, 1==total?"":"s",
+ used, 1==used?"":"s");
if (used>0)
{
utilization = (total*100.0)/used;
- printf(", %1.2f%% utilization", utilization);
+ h5tools_str_append(&buffer, ", %1.2f%% utilization", utilization);
}
-
}
-
- putchar('\n');
+ h5tools_str_append(&buffer, "\n");
/* Print information about external strorage */
if((nf = H5Pget_external_count(dcpl)) > 0) {
for(i = 0, max_len = 0; i < nf; i++) {
H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL);
- n = display_string(NULL, f_name, TRUE);
+ n = print_string(NULL, f_name, TRUE);
max_len = MAX(max_len, n);
} /* end for */
- printf(" %-10s %d external file%s\n",
+ h5tools_str_append(&buffer, " %-10s %d external file%s\n",
"Extern:", nf, 1==nf?"":"s");
- printf(" %4s %10s %10s %10s %s\n",
+ h5tools_str_append(&buffer, " %4s %10s %10s %10s %s\n",
"ID", "DSet-Addr", "File-Addr", "Bytes", "File");
- printf(" %4s %10s %10s %10s ",
+ h5tools_str_append(&buffer, " %4s %10s %10s %10s ",
"----", "----------", "----------", "----------");
- for (i=0; i<max_len; i++) putchar('-');
- putchar('\n');
+ for (i=0; i<max_len; i++) h5tools_str_append(&buffer, "-");
+ h5tools_str_append(&buffer, "\n");
for (i=0, total=0; i<nf; i++) {
if (H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, &f_offset, &f_size)<0) {
- HDfprintf(stdout,
- " #%03d %10Hu %10s %10s ***ERROR*** %s\n",
+ h5tools_str_append(&buffer,
+ " #%03d %10"HSIZE_T_FORMAT"u %10s %10s ***ERROR*** %s\n",
i, total, "", "",
i+1<nf?"Following addresses are incorrect":"");
- } else if (H5S_UNLIMITED==f_size) {
- HDfprintf(stdout, " #%03d %10Hu %10Hu %10s ",
+ }
+ else if (H5S_UNLIMITED==f_size) {
+ h5tools_str_append(&buffer, " #%03d %10"HSIZE_T_FORMAT"u %10"HSIZE_T_FORMAT"u %10s ",
i, total, (hsize_t)f_offset, "INF");
- display_string(stdout, f_name, TRUE);
- } else {
- HDfprintf(stdout, " #%03d %10Hu %10Hu %10Hu ",
+ print_string(&buffer, f_name, TRUE);
+ }
+ else {
+ h5tools_str_append(&buffer, " #%03d %10"HSIZE_T_FORMAT"u %10"HSIZE_T_FORMAT"u %10"HSIZE_T_FORMAT"u ",
i, total, (hsize_t)f_offset, f_size);
- display_string(stdout, f_name, TRUE);
+ print_string(&buffer, f_name, TRUE);
}
- putchar('\n');
+ h5tools_str_append(&buffer, "\n");
total += f_size;
}
- printf(" %4s %10s %10s %10s ",
+ h5tools_str_append(&buffer, " %4s %10s %10s %10s ",
"----", "----------", "----------", "----------");
for (i=0; i<max_len; i++)
- putchar('-');
- putchar('\n');
+ h5tools_str_append(&buffer, "-");
+ h5tools_str_append(&buffer, "\n");
} /* end if */
/* Print information about raw data filters */
@@ -2903,20 +1861,21 @@ dataset_list2(hid_t dset, const char UNUSED *name)
cd_values, sizeof(f_name), f_name, NULL);
f_name[sizeof(f_name) - 1] = '\0';
sprintf(s, "Filter-%d:", i);
- printf(" %-10s %s-%u %s {", s,
+ h5tools_str_append(&buffer, " %-10s %s-%u %s {", s,
(f_name[0] ? f_name : "method"),
(unsigned)filt_id,
((filt_flags & H5Z_FLAG_OPTIONAL) ? "OPT" : ""));
for(cd_num = 0; cd_num < cd_nelmts; cd_num++)
- printf("%s%u", (cd_num ? ", " : ""), cd_values[cd_num]);
- printf("}\n");
+ h5tools_str_append(&buffer, "%s%u", (cd_num ? ", " : ""), cd_values[cd_num]);
+ h5tools_str_append(&buffer, "}\n");
} /* end for */
} /* end if */
/* Print data type */
- printf(" %-10s ", "Type:");
- display_type(type, 15);
- printf("\n");
+ h5tools_str_append(&buffer, " %-10s ", "Type:");
+ print_type(&buffer, type, 15);
+ h5tools_str_append(&buffer, "\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
/* Print address information */
if(address_g)
@@ -2928,6 +1887,8 @@ dataset_list2(hid_t dset, const char UNUSED *name)
H5Pclose(dcpl);
} /* end if */
+ h5tools_str_close(&buffer);
+
if(data_g)
dump_dataset_values(dset);
@@ -2956,9 +1917,23 @@ static herr_t
datatype_list2(hid_t type, const char UNUSED *name)
{
if (verbose_g>0) {
- printf(" %-10s ", "Type:");
- display_type(type, 15);
- printf("\n");
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t *info = &ls_dataformat;
+ h5tool_format_t outputformat;
+
+ HDmemset(&ctx, 0, sizeof(ctx));
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+
+ h5tools_str_reset(&buffer);
+
+ h5tools_str_append(&buffer, " %-10s ", "Type:");
+ print_type(&buffer, type, 15);
+ h5tools_str_append(&buffer, "\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+
+ h5tools_str_close(&buffer);
}
return 0;
}
@@ -2981,29 +1956,43 @@ datatype_list2(hid_t type, const char UNUSED *name)
static herr_t
list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void *_iter)
{
- H5O_type_t obj_type = oinfo->type; /* Type of the object */
- iter_t *iter = (iter_t*)_iter;
+ H5O_type_t obj_type = oinfo->type; /* Type of the object */
+ iter_t *iter = (iter_t*)_iter;
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t *info = &ls_dataformat;
+ h5tool_format_t outputformat;
+
+ HDmemset(&ctx, 0, sizeof(ctx));
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+
+ h5tools_str_reset(&buffer);
/* Print the link's name, either full name or base name */
if(!iter->symlink_target)
- display_obj_name(stdout, iter, name, "");
+ print_obj_name(&buffer, iter, name, "");
/* Check object information */
if(oinfo->type < 0 || oinfo->type >= H5O_TYPE_NTYPES) {
- printf("Unknown type(%d)", (int)oinfo->type);
+ h5tools_str_append(&buffer, "Unknown type(%d)", (int)oinfo->type);
obj_type = H5O_TYPE_UNKNOWN;
}
if(iter->symlink_target)
- fputc('{', stdout);
+ h5tools_str_append(&buffer, "{");
if(obj_type >= 0 && dispatch_g[obj_type].name)
- fputs(dispatch_g[obj_type].name, stdout);
+ h5tools_str_append(&buffer, "%s", dispatch_g[obj_type].name);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
/* Check if we've seen this object before */
if(first_seen) {
- printf(", same as ");
- display_string(stdout, first_seen, TRUE);
- if(!iter->symlink_target)
- printf("\n");
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, ", same as ");
+ print_string(&buffer, first_seen, TRUE);
+ if(!iter->symlink_target) {
+ h5tools_str_append(&buffer, "\n");
+ }
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
} /* end if */
else {
hid_t obj = (-1); /* ID of object opened */
@@ -3012,15 +2001,20 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
* then return right away.
*/
if(obj_type >= 0 && (obj = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) {
- printf(" *ERROR*\n");
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " *ERROR*\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
goto done;
} /* end if */
/* List the first line of information for the object. */
if(obj_type >= 0 && dispatch_g[obj_type].list1)
(dispatch_g[obj_type].list1)(obj);
- if(!iter->symlink_target || (verbose_g > 0))
- putchar('\n');
+ if(!iter->symlink_target || (verbose_g > 0)) {
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, "\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ }
/* Show detailed information about the object, beginning with information
* which is common to all objects. */
@@ -3034,8 +2028,10 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
H5Aiterate2(obj, H5_INDEX_NAME, H5_ITER_INC, NULL, list_attr, NULL);
/* Object location & reference count */
- printf(" %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr);
- printf(" %-10s %u\n", "Links:", (unsigned)oinfo->rc);
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr);
+ h5tools_str_append(&buffer, " %-10s %u\n", "Links:", (unsigned)oinfo->rc);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
/* Modification time */
if(oinfo->mtime > 0) {
@@ -3048,7 +2044,9 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
tm = HDlocaltime(&(oinfo->mtime));
if(tm) {
HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
- printf(" %-10s %s\n", "Modified:", buf);
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " %-10s %s\n", "Modified:", buf);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
} /* end if */
} /* end if */
@@ -3064,9 +2062,11 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
cmt_bufsize = H5Oget_comment(obj, comment, cmt_bufsize);
if(cmt_bufsize > 0) {
comment[cmt_bufsize] = 0;
- printf(" %-10s \"", "Comment:");
- display_string(stdout, comment, FALSE);
- puts("\"");
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " %-10s \"", "Comment:");
+ print_string(&buffer, comment, FALSE);
+ h5tools_str_append(&buffer, "\"\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
} /* end if */
HDfree(comment);
}
@@ -3084,9 +2084,13 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void
done:
if(iter->symlink_target) {
- fputs("}\n", stdout);
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, "}\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
iter->symlink_target = FALSE;
}
+ h5tools_str_close(&buffer);
+
return 0;
} /* end list_obj() */
@@ -3112,7 +2116,17 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
char *buf=NULL;
iter_t *iter = (iter_t*)_iter;
int ret;
+ hsize_t curr_pos = 0; /* total data element position */
h5tool_link_info_t lnk_info;
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t *info = &ls_dataformat;
+ h5tool_format_t outputformat;
+
+ HDmemset(&ctx, 0, sizeof(ctx));
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+
+ h5tools_str_reset(&buffer);
/* init linkinfo struct */
HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t));
@@ -3122,14 +2136,14 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
lnk_info.opt.msg_mode=1;
/* Print the link's name, either full name or base name */
- display_obj_name(stdout, iter, name, "");
+ print_obj_name(&buffer, iter, name, "");
switch(linfo->type) {
case H5L_TYPE_SOFT:
ret = H5tools_get_symlink_info(iter->fid, name, &lnk_info, follow_symlink_g);
/* lnk_info.trg_path is malloced in H5tools_get_symlink_info()
* so it will be freed via buf later */
- buf = lnk_info.trg_path;
+ buf = (char*)lnk_info.trg_path;
/* error */
if (ret < 0)
goto done;
@@ -3137,20 +2151,24 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
else if (no_dangling_link_g && ret == 0)
iter->symlink_list->dangle_link = TRUE;
- HDfputs("Soft Link {", stdout);
- HDfputs(buf, stdout);
- HDfputc('}', stdout);
+ h5tools_str_append(&buffer, "Soft Link {");
+ h5tools_str_append(&buffer, buf);
+ h5tools_str_append(&buffer, "}");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
if(follow_symlink_g)
{
hbool_t orig_grp_literal = grp_literal_g;
- HDfputc(' ', stdout);
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " ");
/* Check if we have already seen this softlink */
if(symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf))
{
- HDfputs("{Already Visited}\n", stdout);
+ h5tools_str_append(&buffer, "{Already Visited}\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
goto done;
}
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
/* Add this link to the list of seen softlinks */
if(symlink_visit_add(iter->symlink_list, linfo->type, NULL, buf) < 0)
@@ -3173,8 +2191,11 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
grp_literal_g = orig_grp_literal;
}
- else
- HDfputc('\n', stdout);
+ else {
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, "\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ }
break;
@@ -3187,7 +2208,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
ret = H5tools_get_symlink_info(iter->fid, name, &lnk_info, follow_link);
/* lnk_info.trg_path is malloced in H5tools_get_symlink_info()
* so it will be freed via buf later */
- buf = lnk_info.trg_path;
+ buf = (char*)lnk_info.trg_path;
/* error */
if (ret < 0)
goto done;
@@ -3198,27 +2219,31 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0)
goto done;
- HDfputs("External Link {", stdout);
- HDfputs(filename, stdout);
- HDfputc('/', stdout);
+ h5tools_str_append(&buffer, "External Link {");
+ h5tools_str_append(&buffer, filename);
+ h5tools_str_append(&buffer, "/");
if(*path != '/')
- HDfputc('/', stdout);
- HDfputs(path, stdout);
- HDfputc('}', stdout);
+ h5tools_str_append(&buffer, "/");
+ h5tools_str_append(&buffer, path);
+ h5tools_str_append(&buffer, "}");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
/* Recurse through the external link */
/* keep the follow_elink_g for backward compatibility with -E */
if(follow_link)
{
hbool_t orig_grp_literal = grp_literal_g;
- HDfputc(' ', stdout);
+ h5tools_str_reset(&buffer);
+ h5tools_str_append(&buffer, " ");
/* Check if we have already seen this elink */
if(symlink_is_visited(iter->symlink_list, linfo->type, filename, path))
{
- HDfputs("{Already Visited}\n", stdout);
+ h5tools_str_append(&buffer, "{Already Visited}\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
goto done;
}
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
/* Add this link to the list of seen elinks */
if(symlink_visit_add(iter->symlink_list, linfo->type, filename, path) < 0)
@@ -3244,17 +2269,19 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter)
grp_literal_g = orig_grp_literal;
}
else
- HDfputc('\n', stdout);
-
+ HDfprintf(rawoutstream, "\n");
}
break;
default:
- HDfputs("UD Link {cannot follow UD links}\n", stdout);
+ h5tools_str_append(&buffer, "UD Link {cannot follow UD links}\n");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
break;
} /* end switch */
done:
+ h5tools_str_close(&buffer);
+
if (buf)
HDfree(buf);
return 0;
@@ -3279,25 +2306,40 @@ done:
static herr_t
visit_obj(hid_t file, const char *oname, iter_t *iter)
{
+ int retval = 0;
H5O_info_t oi; /* Information for object */
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tool_link_info_t lnk_info;
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t *info = &ls_dataformat;
+ h5tool_format_t outputformat;
+
+ HDmemset(&ctx, 0, sizeof(ctx));
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+
+ h5tools_str_reset(&buffer);
/* Retrieve info for object to list */
if(H5Oget_info_by_name(file, oname, &oi, H5P_DEFAULT) < 0) {
if(iter->symlink_target) {
- HDfputs("{**NOT FOUND**}\n", stdout);
+ h5tools_str_append(&buffer, "{**NOT FOUND**}\n");
iter->symlink_target = FALSE;
}
else
- display_obj_name(stdout, iter, oname, "**NOT FOUND**");
- return -1;
+ print_obj_name(&buffer, iter, oname, "**NOT FOUND**");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ retval = -1;
+ goto done;
} /* end if */
/* Check for group iteration */
if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) {
/* Get ID for group */
if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "%s: unable to open '%s' as group\n", iter->fname, oname);
- return 0; /* Previously "continue", when this code was in main().
+ h5tools_str_append(&buffer, "%s: unable to open '%s' as group\n", iter->fname, oname);
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
+ goto done; /* Previously "continue", when this code was in main().
* We don't "continue" here in order to close the file
* and free the file name properly. */
} /* end if */
@@ -3321,7 +2363,10 @@ visit_obj(hid_t file, const char *oname, iter_t *iter)
list_obj(oname, &oi, NULL, iter);
} /* end else */
- return 0;
+done:
+ h5tools_str_close(&buffer);
+
+ return retval;
}
@@ -3352,8 +2397,8 @@ get_width(void)
/* Try to get it from the COLUMNS environment variable first since it's
* value is sometimes wrong. */
- if ((s=getenv("COLUMNS")) && *s && isdigit((int)*s))
- width = (int)strtol(s, NULL, 0);
+ if ((s=HDgetenv("COLUMNS")) && *s && isdigit((int)*s))
+ width = (int)HDstrtol(s, NULL, 0);
#if defined(H5_HAVE_STRUCT_VIDEOCONFIG) && defined(H5_HAVE__GETVIDEOCONFIG)
{
@@ -3424,14 +2469,14 @@ is_valid_args(void)
if(recursive_g && grp_literal_g)
{
- fprintf(stderr, "Error: 'recursive' option not compatible with 'group info' option!\n\n");
+ HDfprintf(rawerrorstream, "Error: 'recursive' option not compatible with 'group info' option!\n\n");
ret = FALSE;
goto out;
}
if(no_dangling_link_g && !follow_symlink_g)
{
- fprintf(stderr, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n");
+ HDfprintf(rawerrorstream, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n");
ret = FALSE;
goto out;
}
@@ -3460,7 +2505,7 @@ leave(int ret)
{
h5tools_close();
- exit(ret);
+ HDexit(ret);
}
@@ -3712,7 +2757,7 @@ main(int argc, const char *argv[])
if(file >= 0) {
if(verbose_g)
- printf("Opened \"%s\" with %s driver.\n", fname, drivername);
+ HDfprintf(rawoutstream, "Opened \"%s\" with %s driver.\n", fname, drivername);
break; /*success*/
} /* end if */
@@ -3727,7 +2772,7 @@ main(int argc, const char *argv[])
} /* end while */
if(file < 0) {
- fprintf(stderr, "%s: unable to open file\n", argv[argno-1]);
+ HDfprintf(rawerrorstream, "%s: unable to open file\n", argv[argno-1]);
HDfree(fname);
err_exit = 1;
continue;
@@ -3740,7 +2785,7 @@ main(int argc, const char *argv[])
iter.base_len -= oname[iter.base_len-1] == '/';
x = oname;
if(NULL == (oname = HDstrdup(oname))) {
- fprintf(stderr, "memory allocation failed\n");
+ HDfprintf(rawerrorstream, "memory allocation failed\n");
leave(EXIT_FAILURE);
}
*x = '\0';
@@ -3774,7 +2819,19 @@ main(int argc, const char *argv[])
if(HDstrcmp(oname, root_name)) {
/* Check the type of link given */
if(H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) {
- display_obj_name(stdout, &iter, oname, "**NOT FOUND**");
+ hsize_t curr_pos = 0; /* total data element position */
+ h5tool_link_info_t lnk_info;
+ h5tools_str_t buffer; /* string into which to render */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t *info = &ls_dataformat;
+ h5tool_format_t outputformat;
+
+ HDmemset(&ctx, 0, sizeof(ctx));
+ HDmemset(&buffer, 0, sizeof(h5tools_str_t));
+
+ h5tools_str_reset(&buffer);
+ print_obj_name(&buffer, &iter, oname, "**NOT FOUND**");
+ h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0);
leave(EXIT_FAILURE);
} /* end if */
} /* end if */
diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in
index e2c204b..110c651 100644
--- a/tools/h5ls/testh5ls.sh.in
+++ b/tools/h5ls/testh5ls.sh.in
@@ -25,13 +25,13 @@ H5LS_BIN=`pwd`/$H5LS # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
-NLINES=20 # Max. lines of output to display if test fails
+NLINES=20 # Max. lines of output to display if test fails
WORDS_BIGENDIAN="@WORDS_BIGENDIAN@"
nerrors=0
verbose=yes
-h5haveexitcode=yes # default is yes
+h5haveexitcode=yes # default is yes
# The build (current) directory might be different than the source directory.
if test -z "$srcdir"; then
srcdir=.
@@ -131,6 +131,7 @@ $SRC_H5LS_TESTFILES/tgroup-2.ls
$SRC_H5LS_TESTFILES/tgroup-3.ls
$SRC_H5LS_TESTFILES/thlink-1.ls
$SRC_H5LS_TESTFILES/tloop-1.ls
+$SRC_H5LS_TESTFILES/tmultifile.ls
$SRC_H5LS_TESTFILES/tnestcomp-1.ls
$SRC_H5LS_TESTFILES/tnestcomp-2.ls
$SRC_H5LS_TESTFILES/tnestcomp-3.ls
@@ -322,6 +323,11 @@ TOOLTEST tsoftlinks-nodangle-1.ls 1 -w80 --follow-symlinks --no-dangling-links t
# when used file with no dangling links - expected exit code 0
TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thlink.h5
+# test for wildcards in filename (does not work with cmake)
+# this h5ls test script does not pass the filename properly like the h5dump test script???
+#TOOLTEST tstarfile.ls 0 -w80 t*link.h5
+#TOOLTEST tqmarkfile.ls 0 -w80 t?link.h5
+TOOLTEST tmultifile.ls 0 -w80 thlink.h5 tslink.h5
# tests for hard links
TOOLTEST thlink-1.ls 0 -w80 thlink.h5
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index 3b00327..28d66c5 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -493,24 +493,24 @@ int copy_attr(hid_t loc_in,
type_class = H5Tget_class(wtype_id);
is_ref = (type_class == H5T_REFERENCE);
if (type_class == H5T_VLEN ||type_class == H5T_ARRAY ) {
- hid_t base_type = -1;
- base_type = H5Tget_super(ftype_id);
- is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE));
- H5Tclose(base_type);
+ hid_t base_type = -1;
+ base_type = H5Tget_super(ftype_id);
+ is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE));
+ H5Tclose(base_type);
}
if (type_class == H5T_COMPOUND) {
- int nmembers = H5Tget_nmembers(wtype_id) ;
- for (j=0; j<nmembers; j++) {
- hid_t mtid = H5Tget_member_type( wtype_id, j );
- H5T_class_t mtclass = H5Tget_class(mtid);
- H5Tclose(mtid);
-
- if (mtclass==H5T_REFERENCE) {
- is_ref = 1;
- break;
- }
- } /* for (j=0; i<nmembers; j++) */
+ int nmembers = H5Tget_nmembers(wtype_id) ;
+ for (j=0; j<nmembers; j++) {
+ hid_t mtid = H5Tget_member_type( wtype_id, j );
+ H5T_class_t mtclass = H5Tget_class(mtid);
+ H5Tclose(mtid);
+
+ if (mtclass==H5T_REFERENCE) {
+ is_ref = 1;
+ break;
+ }
+ } /* for (j=0; i<nmembers; j++) */
} /* if (type_class == H5T_COMPOUND) */
if(is_ref) {
@@ -1002,7 +1002,7 @@ static const char* get_sfilter(H5Z_filter_t filtn)
return "SOFF";
else {
error_msg("input error in filter type\n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index d96e08b..55cf932 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -53,6 +53,7 @@
* local functions
*-------------------------------------------------------------------------
*/
+static int Get_hyperslab (hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p);
static void print_dataset_info(hid_t dcpl_id,char *objname,double per, int pr);
static int do_copy_objects(hid_t fidin,hid_t fidout,trav_table_t *travt,pack_opt_t *options);
static int copy_user_block(const char *infile, const char *outfile, hsize_t size);
@@ -491,6 +492,184 @@ out:
}
/*-------------------------------------------------------------------------
+* Function: Get_hyperslab
+*
+* Purpose: Calulate a hyperslab from a dataset for higher performance.
+* The size of hyperslab is limitted by H5TOOLS_BUFSIZE.
+* Return the hyperslab dimentions and size in byte.
+*
+* Return: 0 - SUCCEED, -1 FAILED
+*
+* Parameters:
+* dcpl_id : [IN] dataset creation property.
+* rank_dset : [IN] dataset rank
+* dims_dset[] : [IN] dataset dimentions
+* size_datum : [IN] size of a data element in byte
+* dims_hslab[] : [OUT] calculated hyperslab dimentions
+* * hslab_nbytes_p : [OUT] total byte of the hyperslab
+*
+* Programmer: Jonathan Kim
+* Date: Feburary, 2012
+* Update:
+* The hyperslab calucation would be depend on if the dataset is chunked
+* or not.
+*
+* There care 3 conditions to cover:
+* 1. If chunked and a chunk fits in buffer, each chunk would be a unit of
+* collection and the boundary would be dataset's dims.
+* 2. If chunked but a chunk doesn't fit in buffer, each data element would
+* be a unit of collection and the boundary would be the chunk itself.
+* 3. If not chunked, each data element would be a unit of collection and
+* the boundary would be dataset's dims.
+*
+* The calulation starts from the last dimention (h5dump dims output).
+*
+* Note:
+* Added for JIRA HDFFV-7862.
+*-----------------------------------------*/
+
+int Get_hyperslab (hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
+ size_t size_datum,
+ hsize_t dims_hslab[], hsize_t * hslab_nbytes_p)
+{
+ int status = 0;
+ int k;
+ H5D_layout_t dset_layout;
+ int rank_chunk;
+ hsize_t dims_chunk[H5S_MAX_RANK];
+ hsize_t size_chunk=1;
+ hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
+ hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
+ hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimentions */
+ hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */
+ hsize_t hslab_nbytes; /* size of hyperslab in byte */
+
+ /* init to set as size of a data element */
+ hslab_nbytes = size_datum;
+
+ /* get layout of dataset */
+ dset_layout = H5Pget_layout(dcpl_id);
+
+ /* if dataset is chunked */
+ if ( dset_layout == H5D_CHUNKED )
+ {
+ /* get chunk dims */
+ rank_chunk = H5Pget_chunk(dcpl_id, rank_dset, dims_chunk);
+ if (rank_chunk < 0)
+ {
+ status = -1;
+ goto out;
+ }
+
+ for (k = rank_dset; k > 0; --k)
+ size_chunk *= dims_chunk[k-1];
+
+ /* figure out how many chunks can fit in the hyperslab buffer */
+ nchunk_fit = (H5TOOLS_BUFSIZE / size_datum) / size_chunk;
+
+
+ /* 1. if a chunk fit in hyperslab buffer */
+ if (nchunk_fit >= 1)
+ {
+ /* Calulate a hyperslab that contains as many chunks that can fit
+ * in hyperslab buffer. Hyperslab will be increased starting from
+ * the last dimention of the dataset (see h5dump's dims output).
+ * The calculation boundary is dataset dims.
+ * In the loop, used mapping from a datum to a chunk to figure out
+ * chunk based hyperslab.
+ */
+ for (k = rank_dset; k > 0; --k)
+ {
+ /* map dataset dimentions with a chunk dims */
+ chunk_dims_map[k-1]= dims_dset[k-1] / dims_chunk[k-1];
+
+ /* if reminder exist, increse by 1 to cover partial edge chunks */
+ if (dims_dset[k-1] % dims_chunk[k-1] > 0)
+ chunk_dims_map[k-1]++;
+
+ /* get mapped hyperslab dims */
+ hs_dims_map[k-1] = MIN (nchunk_fit, chunk_dims_map[k-1]);
+
+ /* prepare next round */
+ nchunk_fit = nchunk_fit / chunk_dims_map[k-1];
+ /* if a chunk is bigger than the rest of buffer */
+ if (nchunk_fit == 0)
+ nchunk_fit=1;
+
+ /* get hyperslab dimentions as unmapping to actual size */
+ dims_hslab[k-1] = MIN( (hs_dims_map[k-1] * dims_chunk[k-1]), dims_dset[k-1]);
+
+ /* calculate total size for the hyperslab */
+ hslab_nbytes *= dims_hslab[k-1];
+ }
+ }
+ /* 2. if a chunk is bigger than hyperslab buffer */
+ else
+ {
+ /* Calulate a hyperslab that contains as many data elements that
+ * can fit in hyperslab buffer. Hyperslab will be increased
+ * starting from the last dimention of the chunk (see h5dump's dims
+ * output).
+ * The calculation boundary is a chunk dims.
+ */
+ for (k = rank_dset; k > 0; --k)
+ {
+ ndatum_fit = H5TOOLS_BUFSIZE / hslab_nbytes;
+
+ /* if a datum is bigger than rest of buffer */
+ if ( ndatum_fit == 0)
+ ndatum_fit = 1;
+ /* get hyperslab dimentions within a chunk boundary */
+ dims_hslab[k - 1] = MIN (dims_chunk[k-1], ndatum_fit);
+
+ /* calculate total size for the hyperslab */
+ hslab_nbytes *= dims_hslab[k - 1];
+
+ if (hslab_nbytes <= 0)
+ {
+ status = -1;
+ goto out;
+ }
+ }
+ }
+ }
+ /* 3. if dataset is not chunked */
+ else
+ {
+ /* Calulate a hyperslab that contains as many data elements that can
+ * fit in hyperslab buffer. Hyperslab will be increased starting from
+ * the last dimention of the dataset (see h5dump's dims output).
+ * The calculation boundary is dataset dims.
+ */
+ for (k = rank_dset; k > 0; --k)
+ {
+ ndatum_fit = H5TOOLS_BUFSIZE / hslab_nbytes;
+
+ /* if a datum is bigger than rest of buffer */
+ if ( ndatum_fit == 0)
+ ndatum_fit = 1;
+ /* get hyperslab dimentions within dataset boundary */
+ dims_hslab[k - 1] = MIN(dims_dset[k - 1], ndatum_fit);
+
+ /* calculate total size for the hyperslab */
+ hslab_nbytes *= dims_hslab[k - 1];
+
+ if (hslab_nbytes <= 0)
+ {
+ status = -1;
+ goto out;
+ }
+ }
+ }
+
+ /* pass out the hyperslab size*/
+ *hslab_nbytes_p = hslab_nbytes;
+
+out:
+ return status;
+}
+
+/*-------------------------------------------------------------------------
* Function: do_copy_objects
*
* Purpose: duplicate all HDF5 objects in the file
@@ -557,6 +736,30 @@ out:
*
* May, 1, 2008: Add a printing of the compression ratio of old size / new size
*
+* Feburary 2012: improve Read/Write by hyperslabs for big datasets.
+* Programmer: Jonathan Kim
+*
+* A threshold of H5TOOLS_MALLOCSIZE is the limit upon which I/O hyperslab is done
+* i.e., if the memory needed to read a dataset is greater than this limit,
+* then hyperslab I/O is done instead of one operation I/O
+* For each dataset, the memory needed is calculated according to
+*
+* memory needed = number of elements * size of each element
+*
+* if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations
+* are done
+*
+* H5Dread( input_dataset )
+* H5Dwrite( output_dataset )
+*
+* with all elements in the datasets selected. If the memory needed is greater than
+* H5TOOLS_MALLOCSIZE, then the following operations are done instead:
+*
+* 1. figure out a hyperslab (dimentions) and size (refer to Get_hyperslab()).
+* 2. Calculate the hyperslab selections as the selection is moving forward.
+* Selection would be same as the hyperslab except for the remaining edge portion
+* of the dataset. The code take care of the remaining portion if exist.
+*
*-------------------------------------------------------------------------
*/
@@ -573,7 +776,7 @@ int do_copy_objects(hid_t fidin,
hid_t gcpl_out = -1; /* group creation property list */
hid_t type_in = -1; /* named type ID */
hid_t type_out = -1; /* named type ID */
- hid_t dcpl_id = -1; /* dataset creation property list ID */
+ hid_t dcpl_in = -1; /* dataset creation property list ID */
hid_t dcpl_out = -1; /* dataset creation property list ID */
hid_t f_space_id = -1; /* file space ID */
hid_t ftype_id = -1; /* file type ID */
@@ -589,7 +792,7 @@ int do_copy_objects(hid_t fidin,
int apply_s; /* flag for apply filter to small dataset sizes */
int apply_f; /* flag for apply filter to return error on H5Dcreate */
void *buf=NULL; /* buffer for raw data */
- void *sm_buf=NULL; /* buffer for raw data */
+ void *hslab_buf=NULL; /* hyperslab buffer for raw data */
int has_filter; /* current object has a filter */
int req_filter; /* there was a request for a filter */
unsigned crt_order_flags; /* group creation order flag */
@@ -598,6 +801,7 @@ int do_copy_objects(hid_t fidin,
int is_ref=0;
htri_t is_named;
+
/*-------------------------------------------------------------------------
* copy the suppplied object list
*-------------------------------------------------------------------------
@@ -760,9 +964,9 @@ int do_copy_objects(hid_t fidin,
goto error;
if((ftype_id = H5Dget_type(dset_in)) < 0)
goto error;
- if((dcpl_id = H5Dget_create_plist(dset_in)) < 0)
+ if((dcpl_in = H5Dget_create_plist(dset_in)) < 0)
goto error;
- if((dcpl_out = H5Pcopy(dcpl_id)) < 0)
+ if((dcpl_out = H5Pcopy(dcpl_in)) < 0)
goto error;
if((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0)
goto error;
@@ -795,7 +999,7 @@ int do_copy_objects(hid_t fidin,
* 2) the internal filters might be turned off
*-------------------------------------------------------------------------
*/
- if (h5tools_canreadf((travt->objs[i].name),dcpl_id)==1)
+ if (h5tools_canreadf((travt->objs[i].name),dcpl_in)==1)
{
apply_s=1;
apply_f=1;
@@ -855,7 +1059,7 @@ int do_copy_objects(hid_t fidin,
printf(" warning: could not create dataset <%s>. Applying original settings\n",
travt->objs[i].name);
- if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_in, H5P_DEFAULT)) < 0)
goto error;
apply_f = 0;
}
@@ -886,100 +1090,108 @@ int do_copy_objects(hid_t fidin,
else /* possibly not enough memory, read/write by hyperslabs */
{
size_t p_type_nbytes = msize; /*size of memory type */
- hsize_t p_nelmts = nelmts; /*total selected elmts */
+ hsize_t p_nelmts = nelmts; /*total elements */
hsize_t elmtno; /*counter */
int carry; /*counter carry value */
unsigned int vl_data = 0; /*contains VL datatypes */
- /* stripmine info */
- hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */
- hsize_t sm_nbytes; /*bytes per stripmine */
- hsize_t sm_nelmts; /*elements per stripmine*/
- hid_t sm_space; /*stripmine data space */
-
/* hyperslab info */
- hsize_t hs_offset[H5S_MAX_RANK];/*starting offset */
- hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */
- hsize_t hs_nelmts; /*elements in request */
+ hsize_t hslab_dims[H5S_MAX_RANK]; /*hyperslab dims */
+ hsize_t hslab_nbytes; /*bytes per hyperslab */
+ hsize_t hslab_nelmts; /*elements per hyperslab*/
+ hid_t hslab_space; /*hyperslab data space */
+
+ /* hyperslab selection info */
+ hsize_t hs_sel_offset[H5S_MAX_RANK];/* selection offset */
+ hsize_t hs_sel_count[H5S_MAX_RANK]; /* selection count */
+ hsize_t hs_select_nelmts; /* selected elements */
hsize_t zero[8]; /*vector of zeros */
int k;
+ H5D_layout_t dset_layout;
+ hid_t dcpl_tmp = -1; /* dataset creation property list ID */
/* check if we have VL data in the dataset's datatype */
if (H5Tdetect_class(wtype_id, H5T_VLEN) == TRUE)
vl_data = TRUE;
- /*
- * determine the strip mine size and allocate a buffer. The strip mine is
- * a hyperslab whose size is manageable.
- */
- sm_nbytes = p_type_nbytes;
- for (k = rank; k > 0; --k)
+ /* check first if writing dataset is chunked,
+ * if so use its chunk layout for better performance. */
+ dset_layout = H5Pget_layout(dcpl_out);
+ if (dset_layout == H5D_CHUNKED)
+ dcpl_tmp = dcpl_out; /* writing dataset */
+ else /* if reading dataset is chunked */
{
- hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes;
- if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */
- size = 1;
- sm_size[k - 1] = MIN(dims[k - 1], size);
- sm_nbytes *= sm_size[k - 1];
- HDassert(sm_nbytes > 0);
+ dset_layout = H5Pget_layout(dcpl_in);
+ if (dset_layout == H5D_CHUNKED)
+ dcpl_tmp = dcpl_in; /* reading dataset */
}
- sm_buf = HDmalloc((size_t)sm_nbytes);
- sm_nelmts = sm_nbytes / p_type_nbytes;
- sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
+ /* get hyperslab dims and size in byte */
+ if(Get_hyperslab(dcpl_tmp, rank, dims, p_type_nbytes, hslab_dims, &hslab_nbytes) < 0)
+ goto error;
+
+ hslab_buf = HDmalloc((size_t)hslab_nbytes);
+
+ hslab_nelmts = hslab_nbytes / p_type_nbytes;
+ hslab_space = H5Screate_simple(1, &hslab_nelmts, NULL);
- /* the stripmine loop */
- HDmemset(hs_offset, 0, sizeof hs_offset);
+ /* the hyperslab selection loop */
+ HDmemset(hs_sel_offset, 0, sizeof hs_sel_offset);
HDmemset(zero, 0, sizeof zero);
- for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts)
+ for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_select_nelmts)
{
- /* calculate the hyperslab size */
if (rank > 0)
{
- for (k = 0, hs_nelmts = 1; k < rank; k++)
+ /* calculate the hyperslab selections. The selection would be same as the hyperslab except for remaining edge portion of the dataset which is smaller then the hyperslab.
+ */
+ for (k = 0, hs_select_nelmts = 1; k < rank; k++)
{
- hs_size[k] = MIN(dims[k] - hs_offset[k], sm_size[k]);
- hs_nelmts *= hs_size[k];
+ /* MIN() is used to get the remaining edge portion if exist.
+ * "dims[k] - hs_sel_offset[k]" is remaining edge portion that is smaller then the hyperslab.*/
+ hs_sel_count[k] = MIN(dims[k] - hs_sel_offset[k], hslab_dims[k]);
+ hs_select_nelmts *= hs_sel_count[k];
}
- if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
+ if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_sel_offset, NULL, hs_sel_count, NULL) < 0)
goto error;
- if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
+ if (H5Sselect_hyperslab(hslab_space, H5S_SELECT_SET, zero, NULL, &hs_select_nelmts, NULL) < 0)
goto error;
}
else
{
H5Sselect_all(f_space_id);
- H5Sselect_all(sm_space);
- hs_nelmts = 1;
+ H5Sselect_all(hslab_space);
+ hs_select_nelmts = 1;
} /* rank */
/* read/write: use the macro to check error, e.g. memory allocation error inside the library. */
- CHECK_H5DRW_ERROR(H5Dread, dset_in, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf);
- CHECK_H5DRW_ERROR(H5Dwrite, dset_out, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf);
+ CHECK_H5DRW_ERROR(H5Dread, dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf);
+ CHECK_H5DRW_ERROR(H5Dwrite, dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf);
/* reclaim any VL memory, if necessary */
if(vl_data)
- H5Dvlen_reclaim(wtype_id, sm_space, H5P_DEFAULT, sm_buf);
+ H5Dvlen_reclaim(wtype_id, hslab_space, H5P_DEFAULT, hslab_buf);
/* calculate the next hyperslab offset */
for (k = rank, carry = 1; k > 0 && carry; --k)
{
- hs_offset[k - 1] += hs_size[k - 1];
- if (hs_offset[k - 1] == dims[k - 1])
- hs_offset[k - 1] = 0;
+ hs_sel_offset[k - 1] += hs_sel_count[k - 1];
+ /* if reached the end of a dim */
+ if (hs_sel_offset[k - 1] == dims[k - 1])
+ hs_sel_offset[k - 1] = 0;
else
carry = 0;
} /* k */
} /* elmtno */
- H5Sclose(sm_space);
+ H5Sclose(hslab_space);
/* free */
- if (sm_buf!=NULL)
+ if (hslab_buf!=NULL)
{
- HDfree(sm_buf);
- sm_buf=NULL;
+ HDfree(hslab_buf);
+ hslab_buf=NULL;
}
} /* hyperslab read */
} /* if (nelmts>0 && space_status==H5D_SPACE_STATUS_NOT_ALLOCATED) */
@@ -1005,7 +1217,7 @@ int do_copy_objects(hid_t fidin,
print_dataset_info(dcpl_out,travt->objs[i].name,ratio,1);
}
else
- print_dataset_info(dcpl_id,travt->objs[i].name,ratio,0);
+ print_dataset_info(dcpl_in,travt->objs[i].name,ratio,0);
/* print a message that the filter was not applied
(in case there was a filter)
@@ -1044,7 +1256,7 @@ int do_copy_objects(hid_t fidin,
goto error;
if (H5Tclose(wtype_id) < 0)
goto error;
- if (H5Pclose(dcpl_id) < 0)
+ if (H5Pclose(dcpl_in) < 0)
goto error;
if (H5Pclose(dcpl_out) < 0)
goto error;
@@ -1199,7 +1411,7 @@ error:
H5E_BEGIN_TRY {
H5Gclose(grp_in);
H5Gclose(grp_out);
- H5Pclose(dcpl_id);
+ H5Pclose(dcpl_in);
H5Pclose(gcpl_in);
H5Pclose(gcpl_out);
H5Sclose(f_space_id);
@@ -1214,8 +1426,8 @@ error:
/* free */
if (buf!=NULL)
HDfree(buf);
- if (sm_buf!=NULL)
- HDfree(sm_buf);
+ if (hslab_buf!=NULL)
+ HDfree(hslab_buf);
return -1;
}
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index 010d9f2..e1697ab 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -13,6 +13,7 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include "h5tools.h"
#include "h5tools_utils.h"
#include "h5repack.h"
@@ -106,9 +107,12 @@ int main(int argc, const char **argv)
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+ /* Initialize h5tools lib */
+ h5tools_init();
+
/* update hyperslab buffer size from H5TOOLS_BUFSIZE env if exist */
if ( h5tools_getenv_update_hyperslab_bufsize() < 0)
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
/* initialize options */
h5repack_init(&options, 0, 0, (hsize_t)0);
@@ -128,7 +132,7 @@ int main(int argc, const char **argv)
{
error_msg("file names cannot be the same\n");
usage(h5tools_getprogname());
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
@@ -137,7 +141,7 @@ int main(int argc, const char **argv)
{
error_msg("file names missing\n");
usage(h5tools_getprogname());
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
@@ -320,10 +324,10 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'h':
usage(h5tools_getprogname());
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
case 'V':
print_version(h5tools_getprogname());
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
case 'v':
options->verbose = 1;
break;
@@ -333,7 +337,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
if (h5repack_addfilter( opt_arg, options)<0)
{
error_msg("in parsing filter\n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
case 'l':
@@ -342,18 +346,18 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
if (h5repack_addlayout( opt_arg, options)<0)
{
error_msg("in parsing layout\n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
case 'm':
- options->min_comp = atoi( opt_arg );
+ options->min_comp = HDatoi( opt_arg );
if ((int)options->min_comp<=0)
{
error_msg("invalid minimum compress size <%s>\n", opt_arg );
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
@@ -371,7 +375,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'c':
- options->grp_compact = atoi( opt_arg );
+ options->grp_compact = HDatoi( opt_arg );
if (options->grp_compact>0)
options->latest = 1; /* must use latest format */
break;
@@ -379,7 +383,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'd':
- options->grp_indexed = atoi( opt_arg );
+ options->grp_indexed = HDatoi( opt_arg );
if (options->grp_indexed>0)
options->latest = 1; /* must use latest format */
break;
@@ -394,7 +398,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
options->latest = 1; /* must use latest format */
if (msgPtr == NULL)
{
- ssize = atoi( opt_arg );
+ ssize = HDatoi( opt_arg );
for (idx=0; idx<5; idx++)
options->msg_size[idx] = ssize;
}
@@ -403,7 +407,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
char msgType[10];
HDstrcpy(msgType, msgPtr+1);
msgPtr[0] = '\0';
- ssize = atoi( opt_arg );
+ ssize = HDatoi( opt_arg );
if (HDstrncmp(msgType, "dspace",6) == 0) {
options->msg_size[0] = ssize;
}
@@ -432,26 +436,26 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'b':
- options->ublock_size = (hsize_t)atol( opt_arg );
+ options->ublock_size = (hsize_t)HDatol( opt_arg );
break;
case 't':
- options->threshold = (hsize_t)atol( opt_arg );
+ options->threshold = (hsize_t)HDatol( opt_arg );
break;
case 'a':
- options->alignment = atol( opt_arg );
+ options->alignment = HDatol( opt_arg );
if ( options->alignment < 1 )
{
error_msg("invalid alignment size\n", opt_arg );
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
case 'S':
- {
+ {
char strategy[MAX_NC_NAME];
HDstrcpy(strategy, opt_arg);
@@ -465,14 +469,14 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
options->fs_strategy = H5F_FILE_SPACE_VFD;
else {
error_msg("invalid file space management strategy\n", opt_arg );
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
}
case 'T':
- options->fs_threshold = (hsize_t)atol( opt_arg );
+ options->fs_threshold = (hsize_t)HDatol( opt_arg );
break;
} /* switch */
@@ -486,7 +490,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
{
error_msg("missing file names\n");
usage(h5tools_getprogname());
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
@@ -517,9 +521,9 @@ void read_info(const char *filename,
char c;
int i, rc=1;
- if ((fp = fopen(filename, "r")) == (FILE *)NULL) {
+ if ((fp = HDfopen(filename, "r")) == (FILE *)NULL) {
error_msg("cannot open options file %s\n", filename);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
/* cycle until end of file reached */
@@ -540,7 +544,7 @@ void read_info(const char *filename,
while( c!=' ' )
{
fscanf(fp, "%c", &c);
- if (feof(fp)) break;
+ if (HDfeof(fp)) break;
}
c='0';
/* go until end */
@@ -549,14 +553,14 @@ void read_info(const char *filename,
fscanf(fp, "%c", &c);
comp_info[i]=c;
i++;
- if (feof(fp)) break;
+ if (HDfeof(fp)) break;
if (c==10 /*eol*/) break;
}
comp_info[i-1]='\0'; /*cut the last " */
if (h5repack_addfilter(comp_info,options)==-1){
error_msg("could not add compression option\n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
/*-------------------------------------------------------------------------
@@ -570,7 +574,7 @@ void read_info(const char *filename,
while( c!=' ' )
{
fscanf(fp, "%c", &c);
- if (feof(fp)) break;
+ if (HDfeof(fp)) break;
}
c='0';
/* go until end */
@@ -579,14 +583,14 @@ void read_info(const char *filename,
fscanf(fp, "%c", &c);
comp_info[i]=c;
i++;
- if (feof(fp)) break;
+ if (HDfeof(fp)) break;
if (c==10 /*eol*/) break;
}
comp_info[i-1]='\0'; /*cut the last " */
if (h5repack_addlayout(comp_info,options)==-1){
error_msg("could not add chunck option\n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
/*-------------------------------------------------------------------------
@@ -595,10 +599,10 @@ void read_info(const char *filename,
*/
else {
error_msg("bad file format for %s", filename);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
- fclose(fp);
+ HDfclose(fp);
return;
}
diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c
index 01ee018..d0fcff3 100644
--- a/tools/h5repack/h5repack_opttable.c
+++ b/tools/h5repack/h5repack_opttable.c
@@ -14,6 +14,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "h5repack.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
/*-------------------------------------------------------------------------
@@ -120,7 +121,7 @@ static int aux_inctable(pack_opttbl_t *table, int n_objs )
unsigned int i;
table->size += n_objs;
- table->objs = (pack_info_t*)realloc(table->objs, table->size * sizeof(pack_info_t));
+ table->objs = (pack_info_t*)HDrealloc(table->objs, table->size * sizeof(pack_info_t));
if (table->objs==NULL) {
error_msg("not enough memory for options table\n");
return -1;
@@ -147,7 +148,7 @@ int options_table_init( pack_opttbl_t **tbl )
unsigned int i;
pack_opttbl_t *table;
- if(NULL == (table = (pack_opttbl_t *)malloc(sizeof(pack_opttbl_t))))
+ if(NULL == (table = (pack_opttbl_t *)HDmalloc(sizeof(pack_opttbl_t))))
{
error_msg("not enough memory for options table\n");
return -1;
@@ -155,7 +156,7 @@ int options_table_init( pack_opttbl_t **tbl )
table->size = 30;
table->nelems = 0;
- if(NULL == (table->objs = (pack_info_t*)malloc(table->size * sizeof(pack_info_t))))
+ if(NULL == (table->objs = (pack_info_t*)HDmalloc(table->size * sizeof(pack_info_t))))
{
error_msg("not enough memory for options table\n");
HDfree(table);
@@ -229,7 +230,7 @@ int options_add_layout( obj_list_t *obj_list,
if (table->objs[i].chunk.rank>0)
{
error_msg("chunk information already inserted for <%s>\n",obj_list[j].obj);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
/* insert the layout info */
else
diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c
index 5258c4e..70eadd2 100644
--- a/tools/h5repack/h5repack_parse.c
+++ b/tools/h5repack/h5repack_parse.c
@@ -14,6 +14,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "h5repack.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
/*-------------------------------------------------------------------------
@@ -52,7 +53,7 @@ obj_list_t* parse_filter(const char *str,
{
unsigned i, u;
char c;
- size_t len=strlen(str);
+ size_t len=HDstrlen(str);
int j, m, n, k, l, end_obj=-1, no_param=0;
char sobj[MAX_NC_NAME];
char scomp[10];
@@ -88,7 +89,7 @@ obj_list_t* parse_filter(const char *str,
}
n++;
- obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t));
+ obj_list = (obj_list_t*) HDmalloc(n*sizeof(obj_list_t));
if (obj_list==NULL)
{
error_msg("could not allocate object list\n");
@@ -115,7 +116,7 @@ obj_list_t* parse_filter(const char *str,
{
if (obj_list) HDfree(obj_list);
error_msg("input Error: Invalid compression type in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
@@ -153,7 +154,7 @@ obj_list_t* parse_filter(const char *str,
if (!isdigit(c) && l==-1){
if (obj_list) HDfree(obj_list);
error_msg("compression parameter not digit in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (l==-1)
stype[m]=c;
@@ -173,7 +174,7 @@ obj_list_t* parse_filter(const char *str,
else
{
error_msg("szip mask must be 'NN' or 'EC' \n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
@@ -213,7 +214,7 @@ obj_list_t* parse_filter(const char *str,
if (!isdigit(c) && l==-1){
if (obj_list) HDfree(obj_list);
error_msg("compression parameter is not a digit in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (l==-1)
stype[m]=c;
@@ -233,7 +234,7 @@ obj_list_t* parse_filter(const char *str,
else
{
error_msg("scale type must be 'IN' or 'DS' \n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
@@ -257,7 +258,7 @@ obj_list_t* parse_filter(const char *str,
if (!isdigit(c)){
if (obj_list) HDfree(obj_list);
error_msg("compression parameter is not a digit in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
stype[m]=c;
} /* u */
@@ -303,7 +304,7 @@ obj_list_t* parse_filter(const char *str,
{ /*no more parameters, GZIP must have parameter */
if (obj_list) HDfree(obj_list);
error_msg("missing compression parameter in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
@@ -319,7 +320,7 @@ obj_list_t* parse_filter(const char *str,
{ /*no more parameters, SZIP must have parameter */
if (obj_list) HDfree(obj_list);
error_msg("missing compression parameter in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
@@ -335,7 +336,7 @@ obj_list_t* parse_filter(const char *str,
{ /*shuffle does not have parameter */
if (obj_list) HDfree(obj_list);
error_msg("extra parameter in SHUF <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
/*-------------------------------------------------------------------------
@@ -350,7 +351,7 @@ obj_list_t* parse_filter(const char *str,
{ /*shuffle does not have parameter */
if (obj_list) HDfree(obj_list);
error_msg("extra parameter in FLET <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
/*-------------------------------------------------------------------------
@@ -365,7 +366,7 @@ obj_list_t* parse_filter(const char *str,
{ /*nbit does not have parameter */
if (obj_list) HDfree(obj_list);
error_msg("extra parameter in NBIT <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
/*-------------------------------------------------------------------------
@@ -380,13 +381,13 @@ obj_list_t* parse_filter(const char *str,
{ /*no more parameters, SOFF must have parameter */
if (obj_list) HDfree(obj_list);
error_msg("missing compression parameter in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
else {
if (obj_list) HDfree(obj_list);
error_msg("invalid filter type in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
} /*i*/
@@ -409,7 +410,7 @@ obj_list_t* parse_filter(const char *str,
{
if (obj_list) HDfree(obj_list);
error_msg("invalid compression parameter in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
@@ -424,19 +425,19 @@ obj_list_t* parse_filter(const char *str,
{
if (obj_list) HDfree(obj_list);
error_msg("pixels_per_block is not even in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK)
{
if (obj_list) HDfree(obj_list);
error_msg("pixels_per_block is too large in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if ( (HDstrcmp(smask,"NN")!=0) && (HDstrcmp(smask,"EC")!=0) )
{
if (obj_list) HDfree(obj_list);
error_msg("szip mask must be 'NN' or 'EC' \n");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
default:
@@ -479,7 +480,7 @@ obj_list_t* parse_layout(const char *str,
obj_list_t* obj_list=NULL;
unsigned i;
char c;
- size_t len=strlen(str);
+ size_t len=HDstrlen(str);
int j, n, k, end_obj=-1, c_index;
char sobj[MAX_NC_NAME];
char sdim[10];
@@ -509,7 +510,7 @@ obj_list_t* parse_layout(const char *str,
}
n++;
- obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t));
+ obj_list = (obj_list_t*) HDmalloc(n*sizeof(obj_list_t));
if (obj_list==NULL)
{
error_msg("could not allocate object list\n");
@@ -537,7 +538,7 @@ obj_list_t* parse_layout(const char *str,
{
if (obj_list) HDfree(obj_list);
error_msg("in parse layout, no characters after : in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
/* get layout info */
@@ -554,7 +555,7 @@ obj_list_t* parse_layout(const char *str,
pack->layout=H5D_CHUNKED;
else {
error_msg("in parse layout, not a valid layout in <%s>\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
}
else
@@ -578,7 +579,7 @@ obj_list_t* parse_layout(const char *str,
{
if (obj_list) HDfree(obj_list);
error_msg("in parse layout, <%s> Chunk dimensions missing\n",str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
for ( i=j, c_index=0; i<len; i++)
@@ -593,7 +594,7 @@ obj_list_t* parse_layout(const char *str,
if (obj_list) HDfree(obj_list);
error_msg("in parse layout, <%s> Not a valid character in <%s>\n",
sdim,str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if ( c=='x' || i==len-1)
@@ -606,7 +607,7 @@ obj_list_t* parse_layout(const char *str,
if (obj_list) HDfree(obj_list);
error_msg("in parse layout, <%s> conversion to number in <%s>\n",
sdim,str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
c_index++;
}
@@ -624,7 +625,7 @@ obj_list_t* parse_layout(const char *str,
if (obj_list) HDfree(obj_list);
error_msg("in parse layout, <%s> conversion to number in <%s>\n",
sdim,str);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
pack->chunk.rank=c_index+1;
}
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index 915b0e9..7108491 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -28,7 +28,7 @@ static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt);
static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options,
trav_table_t *travt, hid_t fidout);
static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
- hid_t fid_out, void *ref_out, trav_table_t *travt);
+ hid_t fid_out, void *ref_out, trav_table_t *travt);
/*-------------------------------------------------------------------------
* Function: do_copy_refobjs
@@ -432,13 +432,13 @@ error:
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
*
* Modifier: xcao@hdfgroup.org, 9/12/2011
- * Update values of references(object and region) for the following types:
+ * Update values of references(object and region) for the following types:
* 1) References,
* 2) ARRAY of reference,
* 3) VLEN of references.
* 4) COMPOUND of references.
* This function does not handle references in other complicated structures,
- * such as references in nested compound datatypes.
+ * such as references in nested compound datatypes.
*
* Date: October, 28, 2003
*
@@ -479,7 +479,7 @@ static int copy_refs_attr(hid_t loc_in,
for(u = 0; u < (unsigned)oinfo.num_attrs; u++)
{
- is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0;
+ is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0;
/* open attribute */
if((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -500,39 +500,39 @@ static int copy_refs_attr(hid_t loc_in,
is_ref = (type_class == H5T_REFERENCE);
if (type_class == H5T_VLEN ) {
- hid_t base_type = -1;
- base_type = H5Tget_super(ftype_id);
- is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE);
- msize = H5Tget_size(base_type);
- H5Tclose(base_type);
+ hid_t base_type = -1;
+ base_type = H5Tget_super(ftype_id);
+ is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE);
+ msize = H5Tget_size(base_type);
+ H5Tclose(base_type);
}
if (type_class == H5T_ARRAY ) {
- hid_t base_type = -1;
- base_type = H5Tget_super(ftype_id);
- is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE);
- msize = H5Tget_size(base_type);
- H5Tclose(base_type);
+ hid_t base_type = -1;
+ base_type = H5Tget_super(ftype_id);
+ is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE);
+ msize = H5Tget_size(base_type);
+ H5Tclose(base_type);
}
if (type_class == H5T_COMPOUND) {
- int nmembers = H5Tget_nmembers(ftype_id) ;
- if (nmembers < 1)
- goto error;
+ int nmembers = H5Tget_nmembers(ftype_id) ;
+ if (nmembers < 1)
+ goto error;
ref_comp_index = (int *)HDmalloc(nmembers*sizeof (int));
ref_comp_size = (size_t *)HDmalloc(nmembers*sizeof(ref_comp_size));
ref_comp_field_n = 0;
- for (i=0; i<(unsigned)nmembers; i++) {
- hid_t mtid = H5Tget_member_type( ftype_id, i );
- if ((H5Tget_class(mtid)==H5T_REFERENCE)) {
- ref_comp_index[ref_comp_field_n] = i;
- ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid);
- ref_comp_field_n++;
- }
- H5Tclose(mtid);
- }
+ for (i=0; i<(unsigned)nmembers; i++) {
+ hid_t mtid = H5Tget_member_type( ftype_id, i );
+ if ((H5Tget_class(mtid)==H5T_REFERENCE)) {
+ ref_comp_index[ref_comp_field_n] = i;
+ ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid);
+ ref_comp_field_n++;
+ }
+ H5Tclose(mtid);
+ }
/* if compound don't contain reference type member, free the above
* mallocs. Otherwise there can be memory leaks by the 'continue'
@@ -541,14 +541,14 @@ static int copy_refs_attr(hid_t loc_in,
{
if (ref_comp_index)
{
- HDfree(ref_comp_index);
- ref_comp_index = NULL;
+ HDfree(ref_comp_index);
+ ref_comp_index = NULL;
}
if (ref_comp_size)
{
- HDfree(ref_comp_size);
- ref_comp_size = NULL;
+ HDfree(ref_comp_size);
+ ref_comp_size = NULL;
}
}
}
@@ -556,10 +556,10 @@ static int copy_refs_attr(hid_t loc_in,
is_ref_comp = (ref_comp_field_n > 0);
if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) {
- H5Tclose(mtype_id);
- H5Tclose(ftype_id);
- H5Aclose(attr_id);
- continue;
+ H5Tclose(mtype_id);
+ H5Tclose(ftype_id);
+ H5Aclose(attr_id);
+ continue;
}
/* get name */
@@ -584,18 +584,18 @@ static int copy_refs_attr(hid_t loc_in,
nelmts *= dims[j];
if (is_ref_array) {
- unsigned array_rank = 0;
- hsize_t array_size = 1;
- hsize_t array_dims[H5S_MAX_RANK];
- hid_t base_type = -1;
- base_type = H5Tget_super(ftype_id);
- msize = H5Tget_size(base_type);
- H5Tclose(base_type);
-
- array_rank = H5Tget_array_ndims(mtype_id);
- H5Tget_array_dims2(mtype_id, array_dims);
+ unsigned array_rank = 0;
+ hsize_t array_size = 1;
+ hsize_t array_dims[H5S_MAX_RANK];
+ hid_t base_type = -1;
+ base_type = H5Tget_super(ftype_id);
+ msize = H5Tget_size(base_type);
+ H5Tclose(base_type);
+
+ array_rank = H5Tget_array_ndims(mtype_id);
+ H5Tget_array_dims2(mtype_id, array_dims);
for(j = 0; j <array_rank; j++)
- array_size *= array_dims[j];
+ array_size *= array_dims[j];
nelmts *= array_size;
}
@@ -626,7 +626,7 @@ static int copy_refs_attr(hid_t loc_in,
for(i = 0; i < (unsigned)nelmts; i++)
{
if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt)<0)
- continue;
+ continue;
if(options->verbose)
printf("object <%s> reference created to <%s>\n", name, refname);
} /* k */
@@ -657,13 +657,13 @@ static int copy_refs_attr(hid_t loc_in,
for(i = 0; i < (unsigned)nelmts; i++)
{
if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0)
- continue;
+ continue;
if(options->verbose)
printf("object <%s> region reference created to <%s>\n", name, refname);
}
} /* H5T_STD_REF_DSETREG */
else if (is_ref_vlen) {
- /* handle VLEN of references */
+ /* handle VLEN of references */
buf = (hvl_t *)HDmalloc((unsigned)(nelmts * sizeof(hvl_t)));
refbuf = buf; /* reuse the read buffer for write */
@@ -677,31 +677,31 @@ static int copy_refs_attr(hid_t loc_in,
if(H5Aread(attr_id, mtype_id, buf) < 0)
goto error;
- if (H5R_OBJ_REF_BUF_SIZE==msize) {
- hobj_ref_t ref_out;
- for (i=0; i<(unsigned)nelmts; i++) {
- hobj_ref_t *ptr = (hobj_ref_t *)((hvl_t *)buf)[i].p;
- for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
- if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt)<0)
- continue;
- HDmemcpy(&(ptr[j]), &ref_out, msize);
- }
- } /* for (i=0; i<nelems; i++) */
- } else if (H5R_DSET_REG_REF_BUF_SIZE == msize) {
-
- hdset_reg_ref_t ref_out;
- for (i=0; i<(unsigned)nelmts; i++) {
- hdset_reg_ref_t *ptr = (hdset_reg_ref_t *)((hvl_t *)buf)[i].p;
- for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
- if (update_ref_value(attr_id, H5R_DATASET_REGION, &(ptr[j]), fidout, &ref_out, travt)<0)
- continue;
- HDmemcpy(&(ptr[j]), &ref_out, msize);
- }
- } /* for (i=0; i<nelems; i++) */
- }
+ if (H5R_OBJ_REF_BUF_SIZE==msize) {
+ hobj_ref_t ref_out;
+ for (i=0; i<(unsigned)nelmts; i++) {
+ hobj_ref_t *ptr = (hobj_ref_t *)((hvl_t *)buf)[i].p;
+ for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
+ if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt)<0)
+ continue;
+ HDmemcpy(&(ptr[j]), &ref_out, msize);
+ }
+ } /* for (i=0; i<nelems; i++) */
+ } else if (H5R_DSET_REG_REF_BUF_SIZE == msize) {
+
+ hdset_reg_ref_t ref_out;
+ for (i=0; i<(unsigned)nelmts; i++) {
+ hdset_reg_ref_t *ptr = (hdset_reg_ref_t *)((hvl_t *)buf)[i].p;
+ for (j=0; j<((hvl_t *)buf)[i].len; j++ ) {
+ if (update_ref_value(attr_id, H5R_DATASET_REGION, &(ptr[j]), fidout, &ref_out, travt)<0)
+ continue;
+ HDmemcpy(&(ptr[j]), &ref_out, msize);
+ }
+ } /* for (i=0; i<nelems; i++) */
+ }
} /* else if (is_ref_vlen) */
else if (is_ref_comp) {
- /* handle ref fields in a compound */
+ /* handle ref fields in a compound */
buf = HDmalloc((unsigned)(nelmts * msize));
refbuf = buf; /* reuse the read buffer for write */
@@ -716,22 +716,22 @@ static int copy_refs_attr(hid_t loc_in,
goto error;
for (i=0; i<(unsigned)nelmts; i++) {
- for (j=0; j<(unsigned)ref_comp_field_n; j++) {
- if (ref_comp_size[j] == H5R_OBJ_REF_BUF_SIZE) {
- int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
- hobj_ref_t ref_out;
- if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
- continue;
- HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
- } /* if */
- else if (ref_comp_size[j] == H5R_DSET_REG_REF_BUF_SIZE) {
- int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
- hdset_reg_ref_t ref_out;
- if (update_ref_value(attr_id, H5R_DATASET_REGION, (hdset_reg_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
- continue;
- HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
- } /* else if */
- } /* j */
+ for (j=0; j<(unsigned)ref_comp_field_n; j++) {
+ if (ref_comp_size[j] == H5R_OBJ_REF_BUF_SIZE) {
+ int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
+ hobj_ref_t ref_out;
+ if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
+ continue;
+ HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
+ } /* if */
+ else if (ref_comp_size[j] == H5R_DSET_REG_REF_BUF_SIZE) {
+ int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]);
+ hdset_reg_ref_t ref_out;
+ if (update_ref_value(attr_id, H5R_DATASET_REGION, (hdset_reg_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0)
+ continue;
+ HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]);
+ } /* else if */
+ } /* j */
} /* i */
} /* else if (is_ref_comp) */
@@ -739,11 +739,11 @@ static int copy_refs_attr(hid_t loc_in,
goto error;
if (is_ref_vlen && buf)
- H5Dvlen_reclaim (mtype_id, space_id, H5P_DEFAULT, buf);
+ H5Dvlen_reclaim (mtype_id, space_id, H5P_DEFAULT, buf);
} /* if (nelmts) */
if (refbuf == buf)
- refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */
+ refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */
if(buf) {
HDfree(buf);
@@ -756,13 +756,13 @@ static int copy_refs_attr(hid_t loc_in,
}
if (ref_comp_index) {
- HDfree(ref_comp_index);
- ref_comp_index = NULL;
+ HDfree(ref_comp_index);
+ ref_comp_index = NULL;
}
if (ref_comp_size) {
- HDfree(ref_comp_size);
- ref_comp_size = NULL;
+ HDfree(ref_comp_size);
+ ref_comp_size = NULL;
}
if(H5Aclose(attr_out) < 0)
@@ -785,16 +785,16 @@ static int copy_refs_attr(hid_t loc_in,
return 0;
error:
- if(refbuf)
- HDfree(refbuf);
- if(buf)
- HDfree(buf);
+ if(refbuf)
+ HDfree(refbuf);
+ if(buf)
+ HDfree(buf);
if (ref_comp_index)
- HDfree(ref_comp_index);
+ HDfree(ref_comp_index);
if (ref_comp_size)
- HDfree(ref_comp_size);
+ HDfree(ref_comp_size);
H5E_BEGIN_TRY {
H5Tclose(ftype_id);
@@ -808,9 +808,9 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: MapIdToName
+ * Function: MapIdToName
*
- * Purpose: map a ID from a reference to a dataset name
+ * Purpose: map a ID from a reference to a dataset name
*
*-------------------------------------------------------------------------
*/
@@ -843,41 +843,41 @@ out:
}
/*-------------------------------------------------------------------------
- * Function: Update_Ref_value
+ * Function: Update_Ref_value
*
- * Purpose: Update a reference value
+ * Purpose: Update a reference value
*
* Programmer: xcao@hdfgroup.org 9/12/2011
*
*-------------------------------------------------------------------------
*/
static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
- hid_t fid_out, void *ref_out, trav_table_t *travt)
+ hid_t fid_out, void *ref_out, trav_table_t *travt)
{
- herr_t ret = -1;
- const char* ref_obj_name;
- hid_t space_id=-1, ref_obj_id=-1;
+ herr_t ret = -1;
+ const char* ref_obj_name;
+ hid_t space_id=-1, ref_obj_id=-1;
- ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in);
- if (ref_obj_id<0)
- goto done;
+ ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in);
+ if (ref_obj_id<0)
+ goto done;
- ref_obj_name = MapIdToName(ref_obj_id, travt);
- if (ref_obj_name == NULL)
- goto done;
+ ref_obj_name = MapIdToName(ref_obj_id, travt);
+ if (ref_obj_name == NULL)
+ goto done;
- if (ref_type == H5R_DATASET_REGION) {
- space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in);
- if (space_id < 0)
- goto done;
- }
+ if (ref_type == H5R_DATASET_REGION) {
+ space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in);
+ if (space_id < 0)
+ goto done;
+ }
ret = H5Rcreate(ref_out, fid_out, ref_obj_name, ref_type, space_id);
if (ret < 0)
- goto done;
+ goto done;
- ret = 0;
+ ret = 0;
done:
H5E_BEGIN_TRY {
@@ -885,6 +885,6 @@ done:
H5Oclose(ref_obj_id);
} H5E_END_TRY;
- return ret;
+ return ret;
}
diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c
index b0ab1d1..47cba5b 100644
--- a/tools/h5repack/h5repack_verify.c
+++ b/tools/h5repack/h5repack_verify.c
@@ -14,16 +14,17 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "h5repack.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
-static int verify_layout(hid_t pid, pack_info_t *obj);
-static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter);
-
/* number of members in an array */
#ifndef NELMTS
-# define NELMTS(X) (sizeof(X)/sizeof(X[0]))
+# define NELMTS(X) (sizeof(X)/sizeof(X[0]))
#endif
+static int verify_layout(hid_t pid, pack_info_t *obj);
+static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter);
+
/*-------------------------------------------------------------------------
* Function: h5repack_verify
@@ -301,9 +302,9 @@ error:
*
* Purpose: verify which layout is present in the property list DCPL_ID
*
- * H5D_COMPACT = 0
- * H5D_CONTIGUOUS = 1
- * H5D_CHUNKED = 2
+ * H5D_COMPACT = 0
+ * H5D_CONTIGUOUS = 1
+ * H5D_CHUNKED = 2
*
* Return: 1 has, 0 does not, -1 error
*
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index 156038c..17a6190 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -176,6 +176,12 @@ int main (void)
int szip_can_encode = 0;
#endif
+ h5tools_setprogname(PROGRAMNAME);
+ h5tools_setstatus(EXIT_SUCCESS);
+
+ /* Initialize h5tools lib */
+ h5tools_init();
+
/* initialize */
HDmemset(&diff_options, 0, sizeof (diff_opt_t));
HDmemset(&pack_options, 0, sizeof (pack_opt_t));
diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c
index 332fcc5..e91b2f7 100644
--- a/tools/h5repack/testh5repack_detect_szip.c
+++ b/tools/h5repack/testh5repack_detect_szip.c
@@ -16,6 +16,7 @@
#include <stdio.h>
#include "h5repack.h"
#include "h5tools.h"
+#include "h5tools_utils.h"
#include "h5test.h"
@@ -47,6 +48,9 @@ int main(void)
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
+ /* Initialize h5tools lib */
+ h5tools_init();
+
#ifdef H5_HAVE_FILTER_SZIP
if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
printf("yes\n");
diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt
index 5613826..8c621c9 100644
--- a/tools/h5stat/CMakeLists.txt
+++ b/tools/h5stat/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_H5STAT)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
# Add the h5stat executables
@@ -30,7 +29,7 @@ IF (BUILD_TESTING)
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c)
TARGET_NAMING (h5stat_gentest ${LIB_TYPE})
- TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET})
SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>)
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index 2155f95..e206f4f 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -232,28 +232,28 @@ static void
leave(int ret)
{
h5tools_close();
- exit(ret);
+ HDexit(ret);
}
static void usage(const char *prog)
{
- fflush(stdout);
- fprintf(stdout, "Usage: %s [OPTIONS] file\n", prog);
- fprintf(stdout, "\n");
- fprintf(stdout, " OPTIONS\n");
- fprintf(stdout, " -h, --help Print a usage message and exit\n");
- fprintf(stdout, " -V, --version Print version number and exit\n");
- fprintf(stdout, " -f, --file Print file information\n");
- fprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n");
- fprintf(stdout, " -g, --group Print group information\n");
- fprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n");
- fprintf(stdout, " -d, --dset Print dataset information\n");
- fprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n");
- fprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n");
- fprintf(stdout, " -A, --attribute Print attribute information\n");
- fprintf(stdout, " -s, --freespace Print free space information\n");
- fprintf(stdout, " -S, --summary Print summary of file space information\n");
+ HDfflush(stdout);
+ HDfprintf(stdout, "Usage: %s [OPTIONS] file\n", prog);
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " OPTIONS\n");
+ HDfprintf(stdout, " -h, --help Print a usage message and exit\n");
+ HDfprintf(stdout, " -V, --version Print version number and exit\n");
+ HDfprintf(stdout, " -f, --file Print file information\n");
+ HDfprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n");
+ HDfprintf(stdout, " -g, --group Print group information\n");
+ HDfprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n");
+ HDfprintf(stdout, " -d, --dset Print dataset information\n");
+ HDfprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n");
+ HDfprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n");
+ HDfprintf(stdout, " -A, --attribute Print attribute information\n");
+ HDfprintf(stdout, " -s, --freespace Print free space information\n");
+ HDfprintf(stdout, " -S, --summary Print summary of file space information\n");
}
@@ -318,7 +318,7 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi)
/* Add attribute count to proper bin */
bin = ceil_log10((unsigned long)oi->num_attrs);
if((bin + 1) > iter->attr_nbins) {
- iter->attr_bins = (unsigned long *)realloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long));
+ iter->attr_bins = (unsigned long *)HDrealloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long));
HDassert(iter->attr_bins);
/* Initialize counts for intermediate bins */
@@ -390,7 +390,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
bin = ceil_log10((unsigned long)ginfo.nlinks);
if((bin + 1) > iter->group_nbins) {
/* Allocate more storage for info about dataset's datatype */
- iter->group_bins = (unsigned long *)realloc(iter->group_bins, (bin + 1) * sizeof(unsigned long));
+ iter->group_bins = (unsigned long *)HDrealloc(iter->group_bins, (bin + 1) * sizeof(unsigned long));
HDassert(iter->group_bins);
/* Initialize counts for intermediate bins */
@@ -521,7 +521,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
bin = ceil_log10((unsigned long)dims[0]);
if((bin + 1) > iter->dset_dim_nbins) {
/* Allocate more storage for info about dataset's datatype */
- iter->dset_dim_bins = (unsigned long *)realloc(iter->dset_dim_bins, (bin + 1) * sizeof(unsigned long));
+ iter->dset_dim_bins = (unsigned long *)HDrealloc(iter->dset_dim_bins, (bin + 1) * sizeof(unsigned long));
HDassert(iter->dset_dim_bins);
/* Initialize counts for intermediate bins */
@@ -558,7 +558,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi)
iter->dset_ntypes++;
/* Allocate more storage for info about dataset's datatype */
- iter->dset_type_info = (dtype_info_t *)realloc(iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t));
+ iter->dset_type_info = (dtype_info_t *)HDrealloc(iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t));
HDassert(iter->dset_type_info);
/* Initialize information about datatype */
@@ -741,7 +741,7 @@ freespace_stats(hid_t fid, iter_t *iter)
if((nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, 0, NULL)) < 0)
return(FAIL);
else if(nsects) {
- if(NULL == (sect_info = (H5F_sect_info_t *)calloc((size_t)nsects, sizeof(H5F_sect_info_t))))
+ if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t))))
return(FAIL);
nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info);
HDassert(nsects);
@@ -757,7 +757,7 @@ freespace_stats(hid_t fid, iter_t *iter)
bin = ceil_log10((unsigned long)sect_info[u].size);
if(bin >= iter->sect_nbins) {
/* Allocate more storage for section info */
- iter->sect_bins = (unsigned long *)realloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long));
+ iter->sect_bins = (unsigned long *)HDrealloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long));
HDassert(iter->sect_bins);
/* Initialize counts for intermediate bins */
@@ -805,7 +805,7 @@ parse_command_line(int argc, const char *argv[])
struct handler_t *hand = NULL;
/* Allocate space to hold the command line info */
- if((hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t)))==NULL) {
+ if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) {
error_msg("unable to parse command line arguments \n");
goto error;
}
@@ -1631,6 +1631,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
+
if((hand = parse_command_line(argc, argv))==NULL) {
goto done;
}
diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c
index 7384963..a7bb4b0 100644
--- a/tools/h5stat/h5stat_gentest.c
+++ b/tools/h5stat/h5stat_gentest.c
@@ -26,12 +26,12 @@
#include <assert.h>
#include "hdf5.h"
-#define FILE "h5stat_newgrat.h5"
-#define DATASET_NAME "DATASET_NAME"
-#define GROUP_NAME "GROUP"
-#define ATTR_NAME "ATTR"
-#define NUM_GRPS 35000
-#define NUM_ATTRS 100
+#define FILE "h5stat_newgrat.h5"
+#define DATASET_NAME "DATASET_NAME"
+#define GROUP_NAME "GROUP"
+#define ATTR_NAME "ATTR"
+#define NUM_GRPS 35000
+#define NUM_ATTRS 100
/*
* Generate 1.8 HDF5 file
@@ -40,27 +40,27 @@
*/
static void gen_file(void)
{
- hid_t fcpl; /* File creation property */
- hid_t fapl; /* File access property */
- hid_t file; /* File id */
- hid_t gid; /* Group id */
- hid_t type_id; /* Datatype id */
- hid_t space_id; /* Dataspace id */
- hid_t attr_id; /* Attribute id */
- hid_t dset_id; /* Dataset id */
- char name[30]; /* Group name */
- char attrname[30]; /* Attribute name */
- int ret; /* Return value */
- int i; /* Local index variable */
+ hid_t fcpl; /* File creation property */
+ hid_t fapl; /* File access property */
+ hid_t file; /* File id */
+ hid_t gid; /* Group id */
+ hid_t type_id; /* Datatype id */
+ hid_t space_id; /* Dataspace id */
+ hid_t attr_id; /* Attribute id */
+ hid_t dset_id; /* Dataset id */
+ char name[30]; /* Group name */
+ char attrname[30]; /* Attribute name */
+ int ret; /* Return value */
+ int i; /* Local index variable */
fapl = H5Pcreate(H5P_FILE_ACCESS);
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
- HDassert(ret >= 0);
+ assert(ret >= 0);
/* Set file space handling strategy */
fcpl = H5Pcreate(H5P_FILE_CREATE);
ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0);
- HDassert(ret >= 0);
+ assert(ret >= 0);
/* Create dataset */
file = H5Fcreate(FILE, H5F_ACC_TRUNC, fcpl, fapl);
@@ -82,17 +82,17 @@ static void gen_file(void)
sprintf(attrname, "%s%d", ATTR_NAME,i);
attr_id = H5Acreate2(dset_id, attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Aclose(attr_id);
- HDassert(ret >= 0);
+ assert(ret >= 0);
} /* end for */
ret = H5Dclose(dset_id);
- HDassert(ret >= 0);
+ assert(ret >= 0);
ret = H5Sclose(space_id);
- HDassert(ret >= 0);
+ assert(ret >= 0);
ret = H5Tclose(type_id);
- HDassert(ret >= 0);
+ assert(ret >= 0);
ret = H5Fclose(file);
- HDassert(ret >= 0);
+ assert(ret >= 0);
}
int main(void)
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index a75596d..837a14e 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -4,8 +4,6 @@ PROJECT (HDF5_TOOLS_LIB)
#-----------------------------------------------------------------------------
# Define Sources
#-----------------------------------------------------------------------------
-#INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-#INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
SET (H5_TOOLS_LIB_SRCS
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.c
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 4ffee2b..cef30dd 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -25,11 +25,11 @@
* Debug printf macros. The prefix allows output filtering by test scripts.
*/
#ifdef H5DIFF_DEBUG
-#define h5diffdebug(x) fprintf(stderr, "h5diff debug: " x)
-#define h5diffdebug2(x1, x2) fprintf(stderr, "h5diff debug: " x1, x2)
-#define h5diffdebug3(x1, x2, x3) fprintf(stderr, "h5diff debug: " x1, x2, x3)
-#define h5diffdebug4(x1, x2, x3, x4) fprintf(stderr, "h5diff debug: " x1, x2, x3, x4)
-#define h5diffdebug5(x1, x2, x3, x4, x5) fprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5)
+#define h5diffdebug(x) HDfprintf(stderr, "h5diff debug: " x)
+#define h5diffdebug2(x1, x2) HDfprintf(stderr, "h5diff debug: " x1, x2)
+#define h5diffdebug3(x1, x2, x3) HDfprintf(stderr, "h5diff debug: " x1, x2, x3)
+#define h5diffdebug4(x1, x2, x3, x4) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4)
+#define h5diffdebug5(x1, x2, x3, x4, x5) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5)
#else
#define h5diffdebug(x)
#define h5diffdebug2(x1, x2)
@@ -153,13 +153,13 @@ void print_manager_output(void)
overflow_file = NULL;
}
- fflush(stdout);
+ HDfflush(stdout);
HDmemset(outBuff, 0, OUTBUFF_SIZE);
outBuffOffset = 0;
}
else if( (outBuffOffset>0) && !g_Parallel)
{
- fprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n");
+ HDfprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n");
}
}
@@ -270,12 +270,12 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options
/* search objects in exclude list */
while (NULL != exclude_path_ptr)
{
- /* if given object is group, exclude its members as well */
+ /* if exclude path is is group, exclude its members as well */
if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP)
{
ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path,
- strlen(exclude_path_ptr->obj_path));
- if (ret_cmp == 0)
+ HDstrlen(exclude_path_ptr->obj_path));
+ if (ret_cmp == 0) /* found matching members */
{
/* check if given path belong to an excluding group, if so
* exclude it as well.
@@ -295,12 +295,13 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options
else
{
ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path);
- if (ret_cmp == 0)
+ if (ret_cmp == 0) /* found matching object */
{
/* excluded non-group object */
ret = 1;
- /* assign type as scan progress, which is sufficient to
- * determine type for excluding groups from the above if. */
+ /* remember the type of this maching object.
+ * if it's group, it can be used for excluding its member
+ * objects in this while() loop */
exclude_path_ptr->obj_type = type;
break; /* while */
}
@@ -443,9 +444,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch
infile[1] = 0;
while(curr1 < info1->nused)
{
+ path1_lp = (info1->paths[curr1].path) + path1_offset;
+ type1_l = info1->paths[curr1].type;
+
if(!is_exclude_path(path1_lp, type1_l, options))
{
- path1_lp = (info1->paths[curr1].path) + path1_offset;
trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table);
}
curr1++;
@@ -456,9 +459,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch
infile[1] = 1;
while(curr2 < info2->nused)
{
+ path2_lp = (info2->paths[curr2].path) + path2_offset;
+ type2_l = info2->paths[curr2].type;
+
if (!is_exclude_path(path2_lp, type2_l, options))
{
- path2_lp = (info2->paths[curr2].path) + path2_offset;
trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table);
}
curr2++;
@@ -614,7 +619,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo,
done:
if (lnk_info.trg_path)
- HDfree(lnk_info.trg_path);
+ HDfree((char *)lnk_info.trg_path);
return 0;
}
@@ -644,8 +649,8 @@ hsize_t h5diff(const char *fname1,
char filenames[2][MAX_FILENAME];
hsize_t nfound = 0;
int i;
- //int i1, i2;
- int l_ret;
+ int l_ret1 = -1;
+ int l_ret2 = -1;
const char * obj1fullname = NULL;
const char * obj2fullname = NULL;
/* init to group type */
@@ -728,25 +733,25 @@ hsize_t h5diff(const char *fname1,
/* make the given object1 fullpath, start with "/" */
if (HDstrncmp(objname1, "/", 1))
{
- HDstrcpy(obj1fullname, "/");
- HDstrcat(obj1fullname, objname1);
+ HDstrcpy((char *)obj1fullname, "/");
+ HDstrcat((char *)obj1fullname, objname1);
}
else
- HDstrcpy(obj1fullname, objname1);
+ HDstrcpy((char *)obj1fullname, objname1);
/* make the given object2 fullpath, start with "/" */
if (HDstrncmp(objname2, "/", 1))
{
- HDstrcpy(obj2fullname, "/");
- HDstrcat(obj2fullname, objname2);
+ HDstrcpy((char *)obj2fullname, "/");
+ HDstrcat((char *)obj2fullname, objname2);
}
else
- HDstrcpy(obj2fullname, objname2);
+ HDstrcpy((char *)obj2fullname, objname2);
/*----------------------------------------------------------
* check if obj1 is root, group, single object or symlink
*/
- if(!HDstrcmp(obj1fullname, "/"))
+ if(!HDstrcmp((char *)obj1fullname, "/"))
{
obj1type = H5TRAV_TYPE_GROUP;
}
@@ -856,12 +861,16 @@ hsize_t h5diff(const char *fname1,
{
/* set root group */
obj1fullname = (char*)HDcalloc(2, sizeof(char));
- HDstrcat(obj1fullname, "/");
+ HDstrcat((char *)obj1fullname, "/");
obj2fullname = (char*)HDcalloc(2, sizeof(char));
- HDstrcat(obj2fullname, "/");
+ HDstrcat((char *)obj2fullname, "/");
}
+ /* get any symbolic links info */
+ l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, TRUE);
+ l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, TRUE);
+
/*---------------------------------------------
* check for following symlinks
*/
@@ -874,13 +883,12 @@ hsize_t h5diff(const char *fname1,
/*-------------------------------
* check symbolic link (object1)
*/
- l_ret = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, TRUE);
/* dangling link */
- if (l_ret == 0)
+ if (l_ret1 == 0)
{
if (options->no_dangle_links)
{
- /* gangling link is error */
+ /* treat dangling link is error */
if(options->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname);
options->err_stat = 1;
@@ -890,30 +898,33 @@ hsize_t h5diff(const char *fname1,
{
if(options->m_verbose)
parallel_print("obj1 <%s> is a dangling link.\n", obj1fullname);
- nfound++;
- print_found(nfound);
- goto out;
+ if (l_ret1 != 0 || l_ret2 != 0)
+ {
+ nfound++;
+ print_found(nfound);
+ goto out;
+ }
}
}
- else if(l_ret < 0) /* fail */
+ else if(l_ret1 < 0) /* fail */
{
parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1);
options->err_stat = 1;
goto out;
}
- else if(l_ret != 2) /* symbolic link */
+ else if(l_ret1 != 2) /* symbolic link */
obj1type = trg_linfo1.trg_type;
/*-------------------------------
* check symbolic link (object2)
*/
- l_ret = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, TRUE);
+
/* dangling link */
- if (l_ret == 0)
+ if (l_ret2 == 0)
{
if (options->no_dangle_links)
{
- /* gangling link is error */
+ /* treat dangling link is error */
if(options->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname);
options->err_stat = 1;
@@ -923,18 +934,21 @@ hsize_t h5diff(const char *fname1,
{
if(options->m_verbose)
parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname);
- nfound++;
- print_found(nfound);
- goto out;
+ if (l_ret1 != 0 || l_ret2 != 0)
+ {
+ nfound++;
+ print_found(nfound);
+ goto out;
+ }
}
}
- else if(l_ret < 0) /* fail */
+ else if(l_ret2 < 0) /* fail */
{
parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2);
options->err_stat = 1;
goto out;
}
- else if(l_ret != 2) /* symbolic link */
+ else if(l_ret2 != 2) /* symbolic link */
obj2type = trg_linfo2.trg_type;
} /* end of if follow symlinks */
@@ -947,8 +961,10 @@ hsize_t h5diff(const char *fname1,
if(!(options->m_verbose || options->m_report))
{
- if (h5tools_is_obj_same(file1_id,obj1fullname,file2_id,obj2fullname)!=0)
- goto out;
+ /* if no danglink links */
+ if ( l_ret1 > 0 && l_ret2 > 0 )
+ if (h5tools_is_obj_same(file1_id,obj1fullname,file2_id,obj2fullname)!=0)
+ goto out;
}
@@ -995,7 +1011,7 @@ hsize_t h5diff(const char *fname1,
if((HDstrlen(fname1) > MAX_FILENAME) ||
(HDstrlen(fname2) > MAX_FILENAME))
{
- fprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME);
+ HDfprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME);
MPI_Abort(MPI_COMM_WORLD, 0);
} /* end if */
@@ -1045,15 +1061,15 @@ out:
/* free buffers */
if (obj1fullname)
- HDfree(obj1fullname);
+ HDfree((char *)obj1fullname);
if (obj2fullname)
- HDfree(obj2fullname);
+ HDfree((char *)obj2fullname);
/* free link info buffer */
if (trg_linfo1.trg_path)
- HDfree(trg_linfo1.trg_path);
+ HDfree((char *)trg_linfo1.trg_path);
if (trg_linfo2.trg_path)
- HDfree(trg_linfo2.trg_path);
+ HDfree((char *)trg_linfo2.trg_path);
/* close */
H5E_BEGIN_TRY
@@ -1112,9 +1128,9 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
* make full path
*/
if (HDstrcmp (grp1, "/"))
- grp1_path = grp1;
+ grp1_path = (char *)grp1;
if (HDstrcmp (grp2, "/"))
- grp2_path = grp2;
+ grp2_path = (char *)grp2;
/*-------------------------------------------------------------------------
* regarding the return value of h5diff (0, no difference in files, 1 difference )
@@ -1180,12 +1196,12 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
{
objtype = table->objs[i].type;
/* make full path for obj1 */
- obj1_fullpath = (char*)HDcalloc (strlen(grp1_path) + strlen (table->objs[i].name) + 1, sizeof (char));
+ obj1_fullpath = (char*)HDcalloc (HDstrlen(grp1_path) + strlen (table->objs[i].name) + 1, sizeof (char));
HDstrcpy(obj1_fullpath, grp1_path);
HDstrcat(obj1_fullpath, table->objs[i].name);
/* make full path for obj2 */
- obj2_fullpath = (char*)HDcalloc (strlen(grp2_path) + strlen (table->objs[i].name) + 1, sizeof (char));
+ obj2_fullpath = (char*)HDcalloc (HDstrlen(grp2_path) + strlen (table->objs[i].name) + 1, sizeof (char));
HDstrcpy(obj2_fullpath, grp2_path);
HDstrcat(obj2_fullpath, table->objs[i].name);
@@ -1769,9 +1785,9 @@ out:
/* free link info buffer */
if (linkinfo1.trg_path)
- HDfree(linkinfo1.trg_path);
+ HDfree((char *)linkinfo1.trg_path);
if (linkinfo2.trg_path)
- HDfree(linkinfo2.trg_path);
+ HDfree((char *)linkinfo2.trg_path);
return nfound;
}
@@ -2163,9 +2179,9 @@ hsize_t diff(hid_t file1_id,
/* free link info buffer */
if (linkinfo1.trg_path)
- HDfree(linkinfo1.trg_path);
+ HDfree((char *)linkinfo1.trg_path);
if (linkinfo2.trg_path)
- HDfree(linkinfo2.trg_path);
+ HDfree((char *)linkinfo2.trg_path);
return nfound;
@@ -2206,9 +2222,9 @@ out2:
/* free link info buffer */
if (linkinfo1.trg_path)
- HDfree(linkinfo1.trg_path);
+ HDfree((char *)linkinfo1.trg_path);
if (linkinfo2.trg_path)
- HDfree(linkinfo2.trg_path);
+ HDfree((char *)linkinfo2.trg_path);
/* close */
/* disable error reporting */
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 6437809..604a825 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -898,8 +898,8 @@ hsize_t diff_datum(void *_mem1,
char temp1_char;
char temp2_char;
HDassert(type_size==sizeof(char));
- memcpy(&temp1_char, mem1, sizeof(char));
- memcpy(&temp2_char, mem2, sizeof(char));
+ HDmemcpy(&temp1_char, mem1, sizeof(char));
+ HDmemcpy(&temp2_char, mem2, sizeof(char));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -995,8 +995,8 @@ hsize_t diff_datum(void *_mem1,
unsigned char temp2_uchar;
HDassert(type_size==sizeof(unsigned char));
- memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1094,8 +1094,8 @@ hsize_t diff_datum(void *_mem1,
short temp2_short;
HDassert(type_size==sizeof(short));
- memcpy(&temp1_short, mem1, sizeof(short));
- memcpy(&temp2_short, mem2, sizeof(short));
+ HDmemcpy(&temp1_short, mem1, sizeof(short));
+ HDmemcpy(&temp2_short, mem2, sizeof(short));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1193,8 +1193,8 @@ hsize_t diff_datum(void *_mem1,
unsigned short temp2_ushort;
HDassert(type_size==sizeof(short));
- memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
- memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
+ HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
+ HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1293,8 +1293,8 @@ hsize_t diff_datum(void *_mem1,
int temp2_int;
HDassert(type_size==sizeof(int));
- memcpy(&temp1_int, mem1, sizeof(int));
- memcpy(&temp2_int, mem2, sizeof(int));
+ HDmemcpy(&temp1_int, mem1, sizeof(int));
+ HDmemcpy(&temp2_int, mem2, sizeof(int));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1391,8 +1391,8 @@ hsize_t diff_datum(void *_mem1,
unsigned int temp2_uint;
HDassert(type_size==sizeof(int));
- memcpy(&temp1_uint, mem1, sizeof(unsigned int));
- memcpy(&temp2_uint, mem2, sizeof(unsigned int));
+ HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
+ HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1489,8 +1489,8 @@ hsize_t diff_datum(void *_mem1,
long temp2_long;
HDassert(type_size==sizeof(long));
- memcpy(&temp1_long, mem1, sizeof(long));
- memcpy(&temp2_long, mem2, sizeof(long));
+ HDmemcpy(&temp1_long, mem1, sizeof(long));
+ HDmemcpy(&temp2_long, mem2, sizeof(long));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1589,8 +1589,8 @@ hsize_t diff_datum(void *_mem1,
unsigned long temp2_ulong;
HDassert(type_size==sizeof(unsigned long));
- memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
- memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
+ HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
+ HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1688,8 +1688,8 @@ hsize_t diff_datum(void *_mem1,
long long temp2_llong;
HDassert(type_size==sizeof(long long));
- memcpy(&temp1_llong, mem1, sizeof(long long));
- memcpy(&temp2_llong, mem2, sizeof(long long));
+ HDmemcpy(&temp1_llong, mem1, sizeof(long long));
+ HDmemcpy(&temp2_llong, mem2, sizeof(long long));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1786,8 +1786,8 @@ hsize_t diff_datum(void *_mem1,
unsigned long long temp2_ullong;
HDassert(type_size==sizeof(unsigned long long));
- memcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
- memcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
+ HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
+ HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
/* -d and !-p */
if (options->d && !options->p)
{
@@ -1906,8 +1906,8 @@ hsize_t diff_datum(void *_mem1,
HDassert(type_size==sizeof(float));
- memcpy(&temp1_float, mem1, sizeof(float));
- memcpy(&temp2_float, mem2, sizeof(float));
+ HDmemcpy(&temp1_float, mem1, sizeof(float));
+ HDmemcpy(&temp2_float, mem2, sizeof(float));
/* logic for detecting NaNs is different with options -d, -p and no options */
@@ -2119,8 +2119,8 @@ hsize_t diff_datum(void *_mem1,
HDassert(type_size==sizeof(double));
- memcpy(&temp1_double, mem1, sizeof(double));
- memcpy(&temp2_double, mem2, sizeof(double));
+ HDmemcpy(&temp1_double, mem1, sizeof(double));
+ HDmemcpy(&temp2_double, mem2, sizeof(double));
/* logic for detecting NaNs is different with options -d, -p and no options */
@@ -2334,8 +2334,8 @@ hsize_t diff_datum(void *_mem1,
HDassert(type_size==sizeof(long double));
- memcpy(&temp1_double, mem1, sizeof(long double));
- memcpy(&temp2_double, mem2, sizeof(long double));
+ HDmemcpy(&temp1_double, mem1, sizeof(long double));
+ HDmemcpy(&temp2_double, mem2, sizeof(long double));
/* logic for detecting NaNs is different with options -d, -p and no options */
@@ -2820,8 +2820,8 @@ hsize_t character_compare(unsigned char *mem1,
unsigned char temp1_uchar;
unsigned char temp2_uchar;
- memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
if (temp1_uchar != temp2_uchar)
{
@@ -2869,8 +2869,8 @@ hsize_t character_compare_opt(unsigned char *mem1,
double per;
int both_zero;
- memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
/* -d and !-p */
@@ -2975,8 +2975,8 @@ hsize_t diff_float(unsigned char *mem1,
{
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_float, mem1, sizeof(float));
- memcpy(&temp2_float, mem2, sizeof(float));
+ HDmemcpy(&temp1_float, mem1, sizeof(float));
+ HDmemcpy(&temp2_float, mem2, sizeof(float));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3029,8 +3029,8 @@ hsize_t diff_float(unsigned char *mem1,
{
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_float, mem1, sizeof(float));
- memcpy(&temp2_float, mem2, sizeof(float));
+ HDmemcpy(&temp1_float, mem1, sizeof(float));
+ HDmemcpy(&temp2_float, mem2, sizeof(float));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3102,8 +3102,8 @@ hsize_t diff_float(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_float, mem1, sizeof(float));
- memcpy(&temp2_float, mem2, sizeof(float));
+ HDmemcpy(&temp1_float, mem1, sizeof(float));
+ HDmemcpy(&temp2_float, mem2, sizeof(float));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3176,8 +3176,8 @@ hsize_t diff_float(unsigned char *mem1,
{
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_float, mem1, sizeof(float));
- memcpy(&temp2_float, mem2, sizeof(float));
+ HDmemcpy(&temp1_float, mem1, sizeof(float));
+ HDmemcpy(&temp2_float, mem2, sizeof(float));
if (equal_float(temp1_float,temp2_float,options)==FALSE)
{
@@ -3248,8 +3248,8 @@ hsize_t diff_double(unsigned char *mem1,
{
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_double, mem1, sizeof(double));
- memcpy(&temp2_double, mem2, sizeof(double));
+ HDmemcpy(&temp1_double, mem1, sizeof(double));
+ HDmemcpy(&temp2_double, mem2, sizeof(double));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3302,8 +3302,8 @@ hsize_t diff_double(unsigned char *mem1,
{
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_double, mem1, sizeof(double));
- memcpy(&temp2_double, mem2, sizeof(double));
+ HDmemcpy(&temp1_double, mem1, sizeof(double));
+ HDmemcpy(&temp2_double, mem2, sizeof(double));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3375,8 +3375,8 @@ hsize_t diff_double(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_double, mem1, sizeof(double));
- memcpy(&temp2_double, mem2, sizeof(double));
+ HDmemcpy(&temp1_double, mem1, sizeof(double));
+ HDmemcpy(&temp2_double, mem2, sizeof(double));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3452,8 +3452,8 @@ hsize_t diff_double(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_double, mem1, sizeof(double));
- memcpy(&temp2_double, mem2, sizeof(double));
+ HDmemcpy(&temp1_double, mem1, sizeof(double));
+ HDmemcpy(&temp2_double, mem2, sizeof(double));
if (equal_double(temp1_double,temp2_double,options)==FALSE)
@@ -3531,8 +3531,8 @@ hsize_t diff_ldouble(unsigned char *mem1,
{
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_double, mem1, sizeof(long double));
- memcpy(&temp2_double, mem2, sizeof(long double));
+ HDmemcpy(&temp1_double, mem1, sizeof(long double));
+ HDmemcpy(&temp2_double, mem2, sizeof(long double));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3585,8 +3585,8 @@ hsize_t diff_ldouble(unsigned char *mem1,
{
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_double, mem1, sizeof(long double));
- memcpy(&temp2_double, mem2, sizeof(long double));
+ HDmemcpy(&temp1_double, mem1, sizeof(long double));
+ HDmemcpy(&temp2_double, mem2, sizeof(long double));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3658,8 +3658,8 @@ hsize_t diff_ldouble(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_double, mem1, sizeof(long double));
- memcpy(&temp2_double, mem2, sizeof(long double));
+ HDmemcpy(&temp1_double, mem1, sizeof(long double));
+ HDmemcpy(&temp2_double, mem2, sizeof(long double));
/*-------------------------------------------------------------------------
* detect NaNs
@@ -3735,8 +3735,8 @@ hsize_t diff_ldouble(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_double, mem1, sizeof(long double));
- memcpy(&temp2_double, mem2, sizeof(long double));
+ HDmemcpy(&temp1_double, mem1, sizeof(long double));
+ HDmemcpy(&temp2_double, mem2, sizeof(long double));
if (equal_ldouble(temp1_double,temp2_double,options)==FALSE)
@@ -3809,8 +3809,8 @@ hsize_t diff_schar(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_char, mem1, sizeof(char));
- memcpy(&temp2_char, mem2, sizeof(char));
+ HDmemcpy(&temp1_char, mem1, sizeof(char));
+ HDmemcpy(&temp2_char, mem2, sizeof(char));
if (ABS(temp1_char-temp2_char) > options->delta)
{
@@ -3835,8 +3835,8 @@ hsize_t diff_schar(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_char, mem1, sizeof(char));
- memcpy(&temp2_char, mem2, sizeof(char));
+ HDmemcpy(&temp1_char, mem1, sizeof(char));
+ HDmemcpy(&temp2_char, mem2, sizeof(char));
PER(temp1_char,temp2_char);
@@ -3879,8 +3879,8 @@ hsize_t diff_schar(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_char, mem1, sizeof(char));
- memcpy(&temp2_char, mem2, sizeof(char));
+ HDmemcpy(&temp1_char, mem1, sizeof(char));
+ HDmemcpy(&temp2_char, mem2, sizeof(char));
PER(temp1_char,temp2_char);
@@ -3922,8 +3922,8 @@ hsize_t diff_schar(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_char, mem1, sizeof(char));
- memcpy(&temp2_char, mem2, sizeof(char));
+ HDmemcpy(&temp1_char, mem1, sizeof(char));
+ HDmemcpy(&temp2_char, mem2, sizeof(char));
if (temp1_char != temp2_char)
{
@@ -3986,8 +3986,8 @@ hsize_t diff_uchar(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta)
{
@@ -4013,8 +4013,8 @@ hsize_t diff_uchar(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
PER_UNSIGN(signed char,temp1_uchar,temp2_uchar);
@@ -4057,8 +4057,8 @@ hsize_t diff_uchar(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
PER_UNSIGN(signed char,temp1_uchar,temp2_uchar);
@@ -4100,8 +4100,8 @@ hsize_t diff_uchar(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_uchar, mem1, sizeof(unsigned char));
- memcpy(&temp2_uchar, mem2, sizeof(unsigned char));
+ HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
+ HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
if (temp1_uchar != temp2_uchar)
{
@@ -4161,8 +4161,8 @@ hsize_t diff_short(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_short, mem1, sizeof(short));
- memcpy(&temp2_short, mem2, sizeof(short));
+ HDmemcpy(&temp1_short, mem1, sizeof(short));
+ HDmemcpy(&temp2_short, mem2, sizeof(short));
if (ABS(temp1_short-temp2_short) > options->delta)
{
@@ -4188,8 +4188,8 @@ hsize_t diff_short(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_short, mem1, sizeof(short));
- memcpy(&temp2_short, mem2, sizeof(short));
+ HDmemcpy(&temp1_short, mem1, sizeof(short));
+ HDmemcpy(&temp2_short, mem2, sizeof(short));
PER(temp1_short,temp2_short);
@@ -4234,8 +4234,8 @@ hsize_t diff_short(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_short, mem1, sizeof(short));
- memcpy(&temp2_short, mem2, sizeof(short));
+ HDmemcpy(&temp1_short, mem1, sizeof(short));
+ HDmemcpy(&temp2_short, mem2, sizeof(short));
PER(temp1_short,temp2_short);
@@ -4277,8 +4277,8 @@ hsize_t diff_short(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_short, mem1, sizeof(short));
- memcpy(&temp2_short, mem2, sizeof(short));
+ HDmemcpy(&temp1_short, mem1, sizeof(short));
+ HDmemcpy(&temp2_short, mem2, sizeof(short));
if (temp1_short != temp2_short)
{
@@ -4339,8 +4339,8 @@ hsize_t diff_ushort(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
- memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
+ HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
+ HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta)
{
@@ -4366,8 +4366,8 @@ hsize_t diff_ushort(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
- memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
+ HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
+ HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
PER_UNSIGN(signed short,temp1_ushort,temp2_ushort);
@@ -4412,8 +4412,8 @@ hsize_t diff_ushort(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
- memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
+ HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
+ HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
PER_UNSIGN(signed short,temp1_ushort,temp2_ushort);
@@ -4455,8 +4455,8 @@ hsize_t diff_ushort(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ushort, mem1, sizeof(unsigned short));
- memcpy(&temp2_ushort, mem2, sizeof(unsigned short));
+ HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short));
+ HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short));
if (temp1_ushort != temp2_ushort)
{
@@ -4518,8 +4518,8 @@ hsize_t diff_int(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_int, mem1, sizeof(int));
- memcpy(&temp2_int, mem2, sizeof(int));
+ HDmemcpy(&temp1_int, mem1, sizeof(int));
+ HDmemcpy(&temp2_int, mem2, sizeof(int));
if (ABS(temp1_int-temp2_int) > options->delta)
{
@@ -4545,8 +4545,8 @@ hsize_t diff_int(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_int, mem1, sizeof(int));
- memcpy(&temp2_int, mem2, sizeof(int));
+ HDmemcpy(&temp1_int, mem1, sizeof(int));
+ HDmemcpy(&temp2_int, mem2, sizeof(int));
PER(temp1_int,temp2_int);
@@ -4591,8 +4591,8 @@ hsize_t diff_int(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_int, mem1, sizeof(int));
- memcpy(&temp2_int, mem2, sizeof(int));
+ HDmemcpy(&temp1_int, mem1, sizeof(int));
+ HDmemcpy(&temp2_int, mem2, sizeof(int));
PER(temp1_int,temp2_int);
@@ -4634,8 +4634,8 @@ hsize_t diff_int(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_int, mem1, sizeof(int));
- memcpy(&temp2_int, mem2, sizeof(int));
+ HDmemcpy(&temp1_int, mem1, sizeof(int));
+ HDmemcpy(&temp2_int, mem2, sizeof(int));
if (temp1_int != temp2_int)
{
@@ -4697,8 +4697,8 @@ hsize_t diff_uint(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_uint, mem1, sizeof(unsigned int));
- memcpy(&temp2_uint, mem2, sizeof(unsigned int));
+ HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
+ HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
if ( PDIFF(temp1_uint,temp2_uint) > options->delta)
{
@@ -4724,8 +4724,8 @@ hsize_t diff_uint(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_uint, mem1, sizeof(unsigned int));
- memcpy(&temp2_uint, mem2, sizeof(unsigned int));
+ HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
+ HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
PER_UNSIGN(signed int,temp1_uint,temp2_uint);
@@ -4769,8 +4769,8 @@ hsize_t diff_uint(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_uint, mem1, sizeof(unsigned int));
- memcpy(&temp2_uint, mem2, sizeof(unsigned int));
+ HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
+ HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
PER_UNSIGN(signed int,temp1_uint,temp2_uint);
@@ -4811,8 +4811,8 @@ hsize_t diff_uint(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_uint, mem1, sizeof(unsigned int));
- memcpy(&temp2_uint, mem2, sizeof(unsigned int));
+ HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int));
+ HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int));
if (temp1_uint != temp2_uint)
{
@@ -4877,8 +4877,8 @@ hsize_t diff_long(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_long, mem1, sizeof(long));
- memcpy(&temp2_long, mem2, sizeof(long));
+ HDmemcpy(&temp1_long, mem1, sizeof(long));
+ HDmemcpy(&temp2_long, mem2, sizeof(long));
if (ABS(temp1_long-temp2_long) > options->delta)
{
@@ -4904,8 +4904,8 @@ hsize_t diff_long(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_long, mem1, sizeof(long));
- memcpy(&temp2_long, mem2, sizeof(long));
+ HDmemcpy(&temp1_long, mem1, sizeof(long));
+ HDmemcpy(&temp2_long, mem2, sizeof(long));
PER(temp1_long,temp2_long);
@@ -4950,8 +4950,8 @@ hsize_t diff_long(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_long, mem1, sizeof(long));
- memcpy(&temp2_long, mem2, sizeof(long));
+ HDmemcpy(&temp1_long, mem1, sizeof(long));
+ HDmemcpy(&temp2_long, mem2, sizeof(long));
PER(temp1_long,temp2_long);
@@ -4993,8 +4993,8 @@ hsize_t diff_long(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_long, mem1, sizeof(long));
- memcpy(&temp2_long, mem2, sizeof(long));
+ HDmemcpy(&temp1_long, mem1, sizeof(long));
+ HDmemcpy(&temp2_long, mem2, sizeof(long));
if (temp1_long != temp2_long)
{
@@ -5061,8 +5061,8 @@ hsize_t diff_ulong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
- memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
+ HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
+ HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta)
{
@@ -5090,8 +5090,8 @@ hsize_t diff_ulong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
- memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
+ HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
+ HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
PER_UNSIGN(signed long,temp1_ulong,temp2_ulong);
@@ -5135,8 +5135,8 @@ hsize_t diff_ulong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
- memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
+ HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
+ HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
PER_UNSIGN(signed long,temp1_ulong,temp2_ulong);
@@ -5177,8 +5177,8 @@ hsize_t diff_ulong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
- memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
+ HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long));
+ HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long));
if (temp1_ulong != temp2_ulong)
{
@@ -5240,8 +5240,8 @@ hsize_t diff_llong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_llong, mem1, sizeof(long long));
- memcpy(&temp2_llong, mem2, sizeof(long long));
+ HDmemcpy(&temp1_llong, mem1, sizeof(long long));
+ HDmemcpy(&temp2_llong, mem2, sizeof(long long));
if (ABS( temp1_llong-temp2_llong) > options->delta)
{
@@ -5267,8 +5267,8 @@ hsize_t diff_llong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_llong, mem1, sizeof(long long));
- memcpy(&temp2_llong, mem2, sizeof(long long));
+ HDmemcpy(&temp1_llong, mem1, sizeof(long long));
+ HDmemcpy(&temp2_llong, mem2, sizeof(long long));
PER(temp1_llong,temp2_llong);
@@ -5310,8 +5310,8 @@ hsize_t diff_llong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_llong, mem1, sizeof(long long));
- memcpy(&temp2_llong, mem2, sizeof(long long));
+ HDmemcpy(&temp1_llong, mem1, sizeof(long long));
+ HDmemcpy(&temp2_llong, mem2, sizeof(long long));
PER(temp1_llong,temp2_llong);
@@ -5350,8 +5350,8 @@ hsize_t diff_llong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_llong, mem1, sizeof(long long));
- memcpy(&temp2_llong, mem2, sizeof(long long));
+ HDmemcpy(&temp1_llong, mem1, sizeof(long long));
+ HDmemcpy(&temp2_llong, mem2, sizeof(long long));
if (temp1_llong != temp2_llong)
{
@@ -5414,8 +5414,8 @@ hsize_t diff_ullong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
- memcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
+ HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
+ HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta)
{
@@ -5441,8 +5441,8 @@ hsize_t diff_ullong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
- memcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
+ HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
+ HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
ull2float(temp1_ullong,&f1);
ull2float(temp2_ullong,&f2);
@@ -5486,8 +5486,8 @@ hsize_t diff_ullong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
- memcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
+ HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
+ HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
ull2float(temp1_ullong,&f1);
ull2float(temp2_ullong,&f2);
@@ -5528,8 +5528,8 @@ hsize_t diff_ullong(unsigned char *mem1,
for ( i = 0; i < nelmts; i++)
{
- memcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
- memcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
+ HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long));
+ HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long));
if (temp1_ullong != temp2_ullong)
{
@@ -5580,15 +5580,15 @@ int ull2float(unsigned long long ull_value, float *f_value)
src_size = H5Tget_size(H5T_NATIVE_ULLONG);
dst_size = H5Tget_size(H5T_NATIVE_FLOAT);
- buf = (unsigned char*)calloc(1, MAX(src_size, dst_size));
+ buf = (unsigned char*)HDcalloc(1, MAX(src_size, dst_size));
- memcpy(buf, &ull_value, src_size);
+ HDmemcpy(buf, &ull_value, src_size);
/* do conversion */
if(H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, 1, buf, NULL, dxpl_id)<0)
goto error;
- memcpy(f_value, buf, dst_size);
+ HDmemcpy(f_value, buf, dst_size);
if(buf)
HDfree(buf);
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index bfb8429..c1ed429 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -409,7 +409,7 @@ hsize_t diff_datasetid( hid_t did1,
options, name1, name2, m_tid1, did1, did2);
/* reclaim any VL memory, if necessary */
- if(vl_data) {
+ if(vl_data) {
H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1);
H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2);
} /* end if */
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index dfdc8b3..0d476b6 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -183,7 +183,7 @@ diff_basename(const char *name)
return NULL;
/* Find the end of the base name */
- i = strlen(name);
+ i = HDstrlen(name);
while (i>0 && '/'==name[i-1])
--i;
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index ef32cde..17639bc 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -35,11 +35,14 @@
#define ALIGN(A,Z) ((((A) + (Z) - 1) / (Z)) * (Z))
/* global variables */
+hid_t H5tools_ERR_STACK_g = 0;
hid_t H5tools_ERR_CLS_g = -1;
hid_t H5E_tools_g = -1;
hid_t H5E_tools_min_id_g = -1;
int compound_data;
FILE *rawdatastream; /* should initialize to stdout but gcc moans about it */
+FILE *rawoutstream; /* should initialize to stdout but gcc moans about it */
+FILE *rawerrorstream; /* should initialize to stderr but gcc moans about it */
int bin_output; /* binary output */
int bin_form; /* binary form */
int region_output; /* region output */
@@ -113,10 +116,15 @@ h5tools_init(void)
/* register the error class */
HDsnprintf(lib_str, sizeof(lib_str), "%d.%d.%d",H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
+ H5tools_ERR_STACK_g = H5Ecreate_stack();
H5TOOLS_INIT_ERROR()
if (!rawdatastream)
rawdatastream = stdout;
+ if (!rawoutstream)
+ rawoutstream = stdout;
+ if (!rawerrorstream)
+ rawerrorstream = stderr;
h5tools_dump_init();
@@ -143,19 +151,36 @@ h5tools_init(void)
void
h5tools_close(void)
{
+ H5E_auto2_t tools_func;
+ void *tools_edata;
if (h5tools_init_g) {
+ H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata);
+ if(tools_func!=NULL)
+ H5Eprint2(H5tools_ERR_STACK_g, rawerrorstream);
if (rawdatastream && rawdatastream != stdout) {
if (fclose(rawdatastream))
perror("closing rawdatastream");
else
rawdatastream = NULL;
}
+ if (rawoutstream && rawoutstream != stdout) {
+ if (fclose(rawoutstream))
+ perror("closing rawoutstream");
+ else
+ rawoutstream = NULL;
+ }
+ if (rawerrorstream && rawerrorstream != stderr) {
+ if (fclose(rawerrorstream))
+ perror("closing rawerrorstream");
+ else
+ rawerrorstream = NULL;
+ }
/* Clean up the reference path table, if it's been used */
term_ref_path_table();
H5TOOLS_CLOSE_ERROR()
-
+ H5Eclose_stack(H5tools_ERR_STACK_g);
/* Shut down the library */
H5close();
@@ -1047,7 +1072,7 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims)
*-------------------------------------------------------------------------
*/
int
-do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem)
+do_bin_output(FILE *stream, FILE *err_stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem)
{
HERR_INIT(int, SUCCEED)
unsigned char *mem = (unsigned char*)_mem;
@@ -1059,7 +1084,7 @@ do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_m
for (i = 0; i < nelmts; i++) {
if (render_bin_output(stream, container, tid, mem + i * size) < 0) {
- printf("\nError in writing binary stream\n");
+ HDfprintf(err_stream,"\nError in writing binary stream\n");
return FAIL;
}
}
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index a8f43b3..0f4b271 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -525,6 +525,8 @@ H5TOOLS_DLLVAR int packed_data_offset; /* offset of packed bits to display
H5TOOLS_DLLVAR int packed_data_length; /* lengtht of packed bits to display */
H5TOOLS_DLLVAR unsigned long long packed_data_mask; /* mask in which packed bits to display */
H5TOOLS_DLLVAR FILE *rawdatastream; /* output stream for raw data */
+H5TOOLS_DLLVAR FILE *rawoutstream; /* output stream for raw output */
+H5TOOLS_DLLVAR FILE *rawerrorstream; /* output stream for raw error */
H5TOOLS_DLLVAR int bin_output; /* binary output */
H5TOOLS_DLLVAR int bin_form; /* binary form */
H5TOOLS_DLLVAR int region_output; /* region output */
@@ -558,7 +560,7 @@ H5TOOLS_DLL void h5tools_simple_prefix(FILE *stream, const h5tool_format_t *i
H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum);
-H5TOOLS_DLL int do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem);
+H5TOOLS_DLL int do_bin_output(FILE *stream, FILE *err_stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem);
H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem);
H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream,
hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata);
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 98945aa..9188225 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -189,22 +189,6 @@ const h5tools_dump_header_t* h5tools_dump_header_format;
table_t *h5dump_type_table = NULL; /*type table reference for datatype dump */
/* local prototypes */
-
-hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t *info,
- h5tools_context_t *ctx/*in,out*/,
- h5tools_str_t *buffer/*string into which to render */,
- hsize_t *curr_pos/*total data element position*/,
- size_t ncols, hsize_t local_elmt_counter/*element counter*/,
- hsize_t elmt_counter);
-
-hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info,
- h5tools_context_t *ctx/*in,out*/,
- h5tools_str_t *buffer/*string into which to render */,
- hsize_t *curr_pos/*total data element position*/,
- size_t ncols, hsize_t *ptdata,
- hsize_t local_elmt_counter/*element counter*/,
- hsize_t elmt_counter);
-
static int h5tools_print_region_data_blocks(hid_t region_id,
FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx,
h5tools_str_t *buffer/*string into which to render */, size_t ncols,
@@ -248,8 +232,8 @@ h5tools_dump_init(void)
* indicates whether the data supplied in this call falls at the
* beginning or end of the total data to be printed (START_OF_DATA and
* END_OF_DATA).
- * Return:
- * None
+ * Return: Success: SUCCEED
+ * Failure: FAIL
* Programmer:
* Robb Matzke, Monday, April 26, 1999
* Modifications:
@@ -272,11 +256,12 @@ h5tools_dump_init(void)
* new field sm_pos in h5tools_context_t, the current stripmine element position
*-------------------------------------------------------------------------
*/
-void
+int
h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container,
h5tools_context_t *ctx/*in,out*/, unsigned flags,
hsize_t nelmts, hid_t type, void *_mem)
{
+ HERR_INIT(int, SUCCEED)
unsigned char *mem = (unsigned char*) _mem;
hsize_t i; /*element counter */
size_t size; /*size of each datum */
@@ -297,7 +282,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
/* binary dump */
if (bin_output) {
- do_bin_output(rawdatastream, container, nelmts, type, _mem);
+ do_bin_output(rawdatastream, rawoutstream, container, nelmts, type, _mem);
} /* end if */
else {
/* setup */
@@ -373,8 +358,10 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose failed");
} /* if (region_id >= 0) */
- else
- HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference failed");
+ else {
+ /* if (region_id < 0) - could mean that no reference was written do not throw failure */
+ H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference failed");
+ }
ctx->need_prefix = TRUE;
@@ -402,6 +389,9 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
h5tools_str_close(&buffer);
}/* else bin */
+
+CATCH
+ return ret_value;
}
/*-------------------------------------------------------------------------
@@ -1242,7 +1232,8 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
ctx->need_prefix = TRUE;
- h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf);
+ if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf) < 0)
+ HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed");
/* Reclaim any VL memory, if necessary */
if (vl_data)
@@ -1500,7 +1491,8 @@ static int
h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx,
hid_t dset, hid_t p_type)
{
- hid_t f_space; /* file data space */
+ HERR_INIT(herr_t, SUCCEED)
+ hid_t f_space = -1; /* file data space */
hsize_t elmtno; /* counter */
size_t i; /* counter */
int carry; /* counter carry value */
@@ -1517,7 +1509,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
hsize_t sm_nbytes; /* bytes per stripmine */
hsize_t sm_nelmts; /* elements per stripmine*/
unsigned char *sm_buf = NULL; /* buffer for raw data */
- hid_t sm_space; /* stripmine data space */
+ hid_t sm_space = -1; /* stripmine data space */
/* Hyperslab info */
hsize_t hs_offset[H5S_MAX_RANK]; /* starting offset */
@@ -1530,13 +1522,12 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
f_space = H5Dget_space(dset);
if (f_space == FAIL)
- return FAIL;
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
ctx->ndims = H5Sget_simple_extent_ndims(f_space);
if ((size_t)ctx->ndims > NELMTS(sm_size)) {
- H5Sclose(f_space);
- return FAIL;
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(sm_size) failed");
}
/* Assume entire data space to be printed */
@@ -1558,9 +1549,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
ctx->size_last_dim = 0;
if (p_nelmts == 0) {
- /* nothing to print */
- H5Sclose(f_space);
- return SUCCEED;
+ H5_LEAVE(SUCCEED); /* nothing to print */
}
/* Check if we have VL data in the dataset's datatype */
@@ -1622,10 +1611,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
/* Read the data */
if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) {
- H5Sclose(f_space);
- H5Sclose(sm_space);
- HDfree(sm_buf);
- return FAIL;
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed");
}
/* Print the data */
@@ -1636,7 +1622,8 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
indices */
ctx->sm_pos = elmtno;
- h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf);
+ if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf) < 0)
+ HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed");
/* Reclaim any VL memory, if necessary */
if (vl_data)
@@ -1656,13 +1643,17 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
ctx->continuation++;
}
- HDfree(sm_buf);
+CATCH
+ if(sm_buf)
+ HDfree(sm_buf);
done:
- H5Sclose(sm_space);
- H5Sclose(f_space);
+ if(sm_space >= 0 && H5Sclose(sm_space) < 0)
+ H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
+ if(f_space >= 0 && H5Sclose(f_space) < 0)
+ H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
- return SUCCEED;
+ return ret_value;
}
/*-------------------------------------------------------------------------
@@ -1680,13 +1671,14 @@ static int
h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t obj_id,
hid_t type, hid_t space, void *mem)
{
+ HERR_INIT(herr_t, SUCCEED)
int i; /*counters */
hsize_t nelmts; /*total selected elmts */
ctx->ndims = H5Sget_simple_extent_ndims(space);
if ((size_t) ctx->ndims > NELMTS(ctx->p_min_idx))
- return FAIL;
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(ctx->p_min_idx) failed");
/* Assume entire data space to be printed */
for (i = 0; i < ctx->ndims; i++)
@@ -1698,7 +1690,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
nelmts *= ctx->p_max_idx[i] - ctx->p_min_idx[i];
if (nelmts == 0)
- return SUCCEED; /*nothing to print*/
+ H5_LEAVE(SUCCEED); /* nothing to print */
if (ctx->ndims > 0) {
HDassert(ctx->p_max_idx[ctx->ndims - 1] == (hsize_t) ((int) ctx->p_max_idx[ctx->ndims - 1]));
ctx->size_last_dim = (int) (ctx->p_max_idx[ctx->ndims - 1]);
@@ -1709,9 +1701,11 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
if (ctx->ndims > 0)
init_acc_pos(ctx, ctx->p_max_idx);
- h5tools_dump_simple_data(stream, info, obj_id, ctx, START_OF_DATA | END_OF_DATA, nelmts, type, mem);
+ if(h5tools_dump_simple_data(stream, info, obj_id, ctx, START_OF_DATA | END_OF_DATA, nelmts, type, mem) < 0)
+ HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed");
- return SUCCEED;
+CATCH
+ return ret_value;
}
/*-------------------------------------------------------------------------
@@ -1754,7 +1748,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tool_format_t info_dflt;
/* Use default values */
if (!stream)
- stream = stdout;
+ stream = rawoutstream;
if (!info) {
HDmemset(&info_dflt, 0, sizeof info_dflt);
@@ -1826,7 +1820,7 @@ h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
/* Use default values */
if (!stream)
- stream = stdout;
+ stream = rawoutstream;
if (!info) {
HDmemset(&info_dflt, 0, sizeof(info_dflt));
@@ -3069,7 +3063,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info,
h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer,"OFFSET %u", ioffset);
+ h5tools_str_append(&buffer,"OFFSET "H5_PRINTF_HADDR_FMT, ioffset);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0);
ctx->indent_level--;
diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h
index c94d0e1..55e046b 100644
--- a/tools/lib/h5tools_dump.h
+++ b/tools/lib/h5tools_dump.h
@@ -44,10 +44,10 @@ H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info,
H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t obj_id,
hid_t type, hid_t space, void *mem);
-H5TOOLS_DLL void h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container,
+H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container,
h5tools_context_t *ctx/*in,out*/, unsigned flags,
hsize_t nelmts, hid_t type, void *_mem);
-H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info,
+H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t type);
H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info,
h5tools_context_t *ctx/*in,out*/, hid_t space);
diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h
index 207218e..ae549fd 100644
--- a/tools/lib/h5tools_error.h
+++ b/tools/lib/h5tools_error.h
@@ -22,6 +22,7 @@
#include "H5Epublic.h"
/* tools-HDF5 Error variables */
+H5TOOLS_DLLVAR hid_t H5tools_ERR_STACK_g;
H5TOOLS_DLLVAR hid_t H5tools_ERR_CLS_g;
H5TOOLS_DLLVAR hid_t H5E_tools_g;
H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g;
@@ -66,7 +67,11 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g;
* HERROR macro, used to facilitate error reporting . The arguments are the major
* error number, the minor error number, and a description of the error.
*/
-#define HERROR(maj_id, min_id, str) H5Epush2(H5E_DEFAULT, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, str)
+#define HERROR(maj_id, min_id, str) { \
+ H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, str); \
+ ret_value = FAIL; \
+}
+
/* Macro for "catching" flow of control when an error occurs. Note that the
* H5_LEAVE macro won't jump back here once it's past this point.
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index c3fbb1b..0de126d 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -157,7 +157,7 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...)
*/
if (nchars < 0
#ifndef H5_VSNPRINTF_WORKS
- && (strlen(str->s) < str->nalloc)
+ && (HDstrlen(str->s) < str->nalloc)
#endif
) {
/* failure, such as bad format */
@@ -173,7 +173,7 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...)
*/
size_t newsize = MAX(str->len + nchars + 1, 2 * str->nalloc);
HDassert(newsize > str->nalloc); /*overflow*/
- str->s = HDrealloc(str->s, newsize);
+ str->s = (char*)HDrealloc(str->s, newsize);
HDassert(str->s);
str->nalloc = newsize;
}
@@ -209,7 +209,7 @@ h5tools_str_reset(h5tools_str_t *str/*in,out*/)
{
if (!str->s || str->nalloc <= 0) {
str->nalloc = STR_INIT_LEN;
- str->s = HDmalloc(str->nalloc);
+ str->s = (char*)HDmalloc(str->nalloc);
HDassert(str->s);
}
@@ -282,7 +282,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt)
size_t n = sizeof(_temp);
if (str->len - start + 1 > n) {
n = str->len - start + 1;
- temp = HDmalloc(n);
+ temp = (char*)HDmalloc(n);
HDassert(temp);
}
@@ -1114,8 +1114,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
h5tools_str_append(str, "%s", OPT(info->arr_sep, "," OPTIONAL_LINE_BREAK));
if (info->arr_linebreak && i && i % dims[ndims - 1] == 0) {
- int x;
-
h5tools_str_append(str, "%s", "\n");
h5tools_str_indent(str, info, ctx);
@@ -1123,7 +1121,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
else if (i && info->arr_sep) {
/* if next element begin, add next line with indent */
if (is_next_arry_elmt) {
- int x;
is_next_arry_elmt = 0;
h5tools_str_append(str, "%s", "\n ");
@@ -1366,3 +1363,52 @@ h5tools_str_is_zero(const void *_mem, size_t size)
return TRUE;
}
+
+/*-------------------------------------------------------------------------
+ * Function: h5tools_str_replace
+ *
+ * Purpose: replace all occurrences of substring.
+ *
+ * Return: char *
+ *
+ * Programmer: Peter Cao
+ * March 8, 2012
+ *
+ * Notes:
+ * Applications need to call free() to free the memoery allocated for
+ * the return string
+ *
+ *-------------------------------------------------------------------------
+ */
+char *
+h5tools_str_replace ( const char *string, const char *substr, const char *replacement )
+{
+ char *tok = NULL;
+ char *newstr = NULL;
+ char *oldstr = NULL;
+ char *head = NULL;
+
+ if ( substr == NULL || replacement == NULL )
+ return strdup (string);
+
+ newstr = strdup (string);
+ head = newstr;
+ while ( (tok = strstr ( head, substr ))){
+ oldstr = newstr;
+ newstr = HDmalloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 );
+
+ if ( newstr == NULL ){
+ HDfree (oldstr);
+ return NULL;
+ }
+ memcpy ( newstr, oldstr, tok - oldstr );
+ memcpy ( newstr + (tok - oldstr), replacement, strlen ( replacement ) );
+ memcpy ( newstr + (tok - oldstr) + strlen( replacement ), tok + strlen ( substr ), strlen ( oldstr ) - strlen ( substr ) - ( tok - oldstr ) );
+ memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 );
+ /* move back head right after the last replacement */
+ head = newstr + (tok - oldstr) + strlen( replacement );
+ HDfree (oldstr);
+ }
+
+ return newstr;
+}
diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h
index 9527a56..38697c6 100644
--- a/tools/lib/h5tools_str.h
+++ b/tools/lib/h5tools_str.h
@@ -47,5 +47,7 @@ H5TOOLS_DLL void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_
H5TOOLS_DLL char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info,
hid_t container, hid_t type, void *vp,
h5tools_context_t *ctx);
+H5TOOLS_DLL char *h5tools_str_replace ( const char *string, const char *substr,
+ const char *replacement );
#endif /* H5TOOLS_STR_H__ */
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index a1fe7c6..11ab5f3 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include "h5tools.h"
#include "h5tools_utils.h"
#include "H5private.h"
#include "h5trav.h"
@@ -48,9 +49,9 @@ static const char *h5tools_progname = "h5tools";
* largest value suitable for your machine (for testing use a small value).
*/
/* Maximum size used in a call to malloc for a dataset */
-hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024);
+hsize_t H5TOOLS_MALLOCSIZE = (256 * 1024 * 1024); /* 256 MB */
/* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */
-hsize_t H5TOOLS_BUFSIZE = (1024 * 1024);
+hsize_t H5TOOLS_BUFSIZE = ( 32 * 1024 * 1024); /* 32 MB */
/* ``parallel_print'' variables */
@@ -115,7 +116,7 @@ void parallel_print(const char* format, ...)
overflow_file = HDtmpfile();
if(overflow_file == NULL)
- HDfprintf(stderr, "warning: could not create overflow file. Output may be truncated.\n");
+ HDfprintf(rawerrorstream, "warning: could not create overflow file. Output may be truncated.\n");
else
bytes_written = HDvfprintf(overflow_file, format, ap);
}
@@ -151,9 +152,10 @@ error_msg(const char *fmt, ...)
va_list ap;
HDva_start(ap, fmt);
- HDfflush(stdout);
- HDfprintf(stderr, "%s error: ", h5tools_getprogname());
- HDvfprintf(stderr, fmt, ap);
+ HDfflush(rawdatastream);
+ HDfflush(rawoutstream);
+ HDfprintf(rawerrorstream, "%s error: ", h5tools_getprogname());
+ HDvfprintf(rawerrorstream, fmt, ap);
HDva_end(ap);
}
@@ -180,9 +182,10 @@ warn_msg(const char *fmt, ...)
va_list ap;
HDva_start(ap, fmt);
- HDfflush(stdout);
- HDfprintf(stderr, "%s warning: ", h5tools_getprogname());
- HDvfprintf(stderr, fmt, ap);
+ HDfflush(rawdatastream);
+ HDfflush(rawoutstream);
+ HDfprintf(rawerrorstream, "%s warning: ", h5tools_getprogname());
+ HDvfprintf(rawerrorstream, fmt, ap);
HDva_end(ap);
}
@@ -266,7 +269,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
}
else if (l_opts[i].has_arg == require_arg) {
if (opt_err)
- HDfprintf(stderr,
+ HDfprintf(rawerrorstream,
"%s: option required for \"--%s\" flag\n",
argv[0], arg);
@@ -276,7 +279,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
else {
if (arg[len] == '=') {
if (opt_err)
- HDfprintf(stderr,
+ HDfprintf(rawerrorstream,
"%s: no option required for \"%s\" flag\n",
argv[0], arg);
@@ -291,7 +294,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].name == NULL) {
/* exhausted all of the l_opts we have and still didn't match */
if (opt_err)
- HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg);
+ HDfprintf(rawerrorstream, "%s: unknown option \"%s\"\n", argv[0], arg);
opt_opt = '?';
}
@@ -307,7 +310,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (opt_opt == ':' || (cp = HDstrchr(opts, opt_opt)) == 0) {
if (opt_err)
- HDfprintf(stderr, "%s: unknown option \"%c\"\n",
+ HDfprintf(rawerrorstream, "%s: unknown option \"%c\"\n",
argv[0], opt_opt);
/* if no chars left in this token, move to next token */
@@ -326,7 +329,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
}
else if (++opt_ind >= argc) {
if (opt_err)
- HDfprintf(stderr,
+ HDfprintf(rawerrorstream,
"%s: value expected for option \"%c\"\n",
argv[0], opt_opt);
@@ -385,11 +388,11 @@ indentation(int x)
{
if (x < h5tools_nCols) {
while (x-- > 0)
- printf(" ");
+ HDfprintf(rawoutstream, " ");
}
else {
- HDfprintf(stderr, "error: the indentation exceeds the number of cols.\n");
- exit(1);
+ HDfprintf(rawerrorstream, "error: the indentation exceeds the number of cols.\n");
+ HDexit(1);
}
}
@@ -411,7 +414,7 @@ indentation(int x)
void
print_version(const char *progname)
{
- printf("%s: Version %u.%u.%u%s%s\n",
+ HDfprintf(rawoutstream, "%s: Version %u.%u.%u%s%s\n",
progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE,
((char *)H5_VERS_SUBRELEASE)[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
@@ -491,9 +494,9 @@ dump_table(char* tablename, table_t *table)
{
unsigned u;
- printf("%s: # of entries = %d\n", tablename,table->nobjs);
+ HDfprintf(rawoutstream,"%s: # of entries = %d\n", tablename,table->nobjs);
for (u = 0; u < table->nobjs; u++)
- HDfprintf(stdout,"%a %s %d %d\n", table->objs[u].objno,
+ HDfprintf(rawoutstream,"%a %s %d %d\n", table->objs[u].objno,
table->objs[u].objname,
table->objs[u].displayed, table->objs[u].recorded);
}
@@ -914,7 +917,7 @@ int h5tools_getenv_update_hyperslab_bufsize(void)
{
/* TODO: later when pubilshed
- printf("Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str);
+ HDfprintf(rawerrorstream,"Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str);
*/
goto error;
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 3bb8b3f..ad8b9fe 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -151,7 +151,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo,
size_t base_len = HDstrlen(udata->base_grp_name);
size_t add_slash = base_len ? ((udata->base_grp_name)[base_len-1] != '/') : 1;
- if(NULL == (new_name = HDmalloc(base_len + add_slash + HDstrlen(path) + 1)))
+ if(NULL == (new_name = (char*)HDmalloc(base_len + add_slash + HDstrlen(path) + 1)))
return(H5_ITER_ERROR);
HDstrcpy(new_name, udata->base_grp_name);
if (add_slash)
@@ -895,7 +895,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
switch(linfo->type) {
case H5L_TYPE_SOFT:
if(linfo->u.val_size > 0) {
- char *targbuf = HDmalloc(linfo->u.val_size + 1);
+ char *targbuf = (char*)HDmalloc(linfo->u.val_size + 1);
HDassert(targbuf);
H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT);
@@ -912,7 +912,7 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
const char *filename;
const char *objname;
- targbuf = HDmalloc(linfo->u.val_size + 1);
+ targbuf = (char*)HDmalloc(linfo->u.val_size + 1);
HDassert(targbuf);
H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT);
diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt
index 3e70163..72930c9 100644
--- a/tools/misc/CMakeLists.txt
+++ b/tools/misc/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_TOOLS_MISC)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
-INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
# --------------------------------------------------------------------
# Add the misc executables
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index 7b4215a..f24fbba 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -23,34 +23,34 @@
*
*-------------------------------------------------------------------------
*/
-#define H5A_PACKAGE /*suppress error about including H5Apkg */
-#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
-#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
-#define H5EA_PACKAGE /*suppress error about including H5EApkg */
-#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/
-#define H5FA_PACKAGE /*suppress error about including H5FApkg */
-#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/
-#define H5F_PACKAGE /*suppress error about including H5Fpkg */
-#define H5G_PACKAGE /*suppress error about including H5Gpkg */
-#define H5HF_PACKAGE /*suppress error about including H5HFpkg */
-#define H5O_PACKAGE /*suppress error about including H5Opkg */
-#define H5SM_PACKAGE /*suppress error about including H5SMpkg */
-
-#include "H5private.h" /* Generic Functions */
-#include "H5Apkg.h" /* Attributes */
-#include "H5B2pkg.h" /* v2 B-trees */
-#include "H5Dprivate.h" /* Datasets */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5EApkg.h" /* Extensible Arrays */
-#include "H5FApkg.h" /* Fixed Arrays */
-#include "H5Fpkg.h" /* File access */
-#include "H5FSprivate.h" /* Free space manager */
-#include "H5Gpkg.h" /* Groups */
-#include "H5HFpkg.h" /* Fractal heaps */
-#include "H5HGprivate.h" /* Global Heaps */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Opkg.h" /* Object headers */
-#include "H5SMpkg.h" /* Implicitly shared messages */
+#define H5A_PACKAGE /*suppress error about including H5Apkg */
+#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
+#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
+#define H5EA_PACKAGE /*suppress error about including H5EApkg */
+#define H5EA_TESTING /*suppress warning about H5EA testing funcs*/
+#define H5FA_PACKAGE /*suppress error about including H5FApkg */
+#define H5FA_TESTING /*suppress warning about H5FA testing funcs*/
+#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+#define H5G_PACKAGE /*suppress error about including H5Gpkg */
+#define H5HF_PACKAGE /*suppress error about including H5HFpkg */
+#define H5O_PACKAGE /*suppress error about including H5Opkg */
+#define H5SM_PACKAGE /*suppress error about including H5SMpkg */
+
+#include "H5private.h" /* Generic Functions */
+#include "H5Apkg.h" /* Attributes */
+#include "H5B2pkg.h" /* v2 B-trees */
+#include "H5Dprivate.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5EApkg.h" /* Extensible Arrays */
+#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5Fpkg.h" /* File access */
+#include "H5FSprivate.h" /* Free space manager */
+#include "H5Gpkg.h" /* Groups */
+#include "H5HFpkg.h" /* Fractal heaps */
+#include "H5HGprivate.h" /* Global Heaps */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Opkg.h" /* Object headers */
+#include "H5SMpkg.h" /* Implicitly shared messages */
/* File drivers */
#include "H5FDfamily.h"
@@ -61,15 +61,15 @@
/*-------------------------------------------------------------------------
* Function: get_H5B2_class
*
- * Purpose: Determine the v2 B-tree class from the buffer read in.
+ * Purpose: Determine the v2 B-tree class from the buffer read in.
* B-trees are debugged through the B-tree subclass. The subclass
* identifier is two bytes after the B-tree signature.
*
- * Return: Non-NULL on success/NULL on failure
+ * Return: Non-NULL on success/NULL on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 11 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Sep 11 2008
*
*-------------------------------------------------------------------------
*/
@@ -121,7 +121,7 @@ get_H5B2_class(const uint8_t *sig)
break;
default:
- fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
+ HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
HDexit(4);
} /* end switch */
@@ -132,15 +132,15 @@ get_H5B2_class(const uint8_t *sig)
/*-------------------------------------------------------------------------
* Function: get_H5EA_class
*
- * Purpose: Determine the extensible array class from the buffer read in.
+ * Purpose: Determine the extensible array class from the buffer read in.
* Extensible arrays are debugged through the array subclass.
* The subclass identifier is two bytes after the signature.
*
- * Return: Non-NULL on success/NULL on failure
+ * Return: Non-NULL on success/NULL on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 11 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Sep 11 2008
*
*-------------------------------------------------------------------------
*/
@@ -156,7 +156,7 @@ get_H5EA_class(const uint8_t *sig)
break;
default:
- fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid));
+ HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid));
HDexit(4);
} /* end switch */
@@ -167,15 +167,15 @@ get_H5EA_class(const uint8_t *sig)
/*-------------------------------------------------------------------------
* Function: get_H5FA_class
*
- * Purpose: Determine the fixed array class from the buffer read in.
+ * Purpose: Determine the fixed array class from the buffer read in.
* Extensible arrays are debugged through the array subclass.
* The subclass identifier is two bytes after the signature.
*
- * Return: Non-NULL on success/NULL on failure
+ * Return: Non-NULL on success/NULL on failure
*
- * Programmer: Quincey Koziol
- * koziol@hdfgroup.org
- * Sep 11 2008
+ * Programmer: Quincey Koziol
+ * koziol@hdfgroup.org
+ * Sep 11 2008
*
*-------------------------------------------------------------------------
*/
@@ -191,7 +191,7 @@ get_H5FA_class(const uint8_t *sig)
break;
default:
- fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid));
+ HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid));
HDexit(4);
} /* end switch */
@@ -217,7 +217,7 @@ get_H5FA_class(const uint8_t *sig)
int
main(int argc, char *argv[])
{
- hid_t fid, fapl, dxpl;
+ hid_t fid, fapl, dxpl;
H5F_t *f;
haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0;
uint8_t sig[H5F_SIGNATURE_LEN];
@@ -225,13 +225,13 @@ main(int argc, char *argv[])
herr_t status = SUCCEED;
if(argc == 1) {
- fprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]);
- HDexit(1);
+ HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]);
+ HDexit(1);
} /* end if */
/* Initialize the library */
if(H5open() < 0) {
- fprintf(stderr, "cannot initialize the library\n");
+ HDfprintf(stderr, "cannot initialize the library\n");
HDexit(1);
} /* end if */
@@ -239,27 +239,27 @@ main(int argc, char *argv[])
* Open the file and get the file descriptor.
*/
if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) {
- fprintf(stderr, "cannot create dataset transfer property list\n");
+ HDfprintf(stderr, "cannot create dataset transfer property list\n");
HDexit(1);
} /* end if */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
- fprintf(stderr, "cannot create file access property list\n");
+ HDfprintf(stderr, "cannot create file access property list\n");
HDexit(1);
} /* end if */
- if(strchr(argv[1], '%'))
- H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT);
+ if(HDstrchr(argv[1], '%'))
+ H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT);
if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) {
- fprintf(stderr, "cannot open file\n");
+ HDfprintf(stderr, "cannot open file\n");
HDexit(1);
} /* end if */
if(NULL == (f = (H5F_t *)H5I_object(fid))) {
- fprintf(stderr, "cannot obtain H5F_t pointer\n");
+ HDfprintf(stderr, "cannot obtain H5F_t pointer\n");
HDexit(2);
} /* end if */
/* Ignore metadata tags while using h5debug */
if(H5AC_ignore_tags(f) < 0) {
- fprintf(stderr, "cannot ignore metadata tags\n");
+ HDfprintf(stderr, "cannot ignore metadata tags\n");
HDexit(1);
}
@@ -282,7 +282,7 @@ main(int argc, char *argv[])
*/
HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr);
if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig) < 0) {
- fprintf(stderr, "cannot read signature\n");
+ HDfprintf(stderr, "cannot read signature\n");
HDexit(3);
}
if(!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) {
@@ -310,9 +310,9 @@ main(int argc, char *argv[])
/* Check for extra parameters */
if(extra == 0) {
- fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
- fprintf(stderr, "Symbol table node usage:\n");
- fprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n");
+ HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
+ HDfprintf(stderr, "Symbol table node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <Symbol table node address> <address of local heap>\n\n");
} /* end if */
status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
@@ -330,9 +330,9 @@ main(int argc, char *argv[])
case H5B_SNODE_ID:
/* Check for extra parameters */
if(extra == 0) {
- fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
- fprintf(stderr, "B-tree symbol table node usage:\n");
- fprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n");
+ HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n");
+ HDfprintf(stderr, "B-tree symbol table node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <address of local heap>\n\n");
} /* end if */
status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
@@ -341,9 +341,9 @@ main(int argc, char *argv[])
case H5B_CHUNK_ID:
/* Check for extra parameters */
if(extra == 0) {
- fprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n");
- fprintf(stderr, "B-tree chunked storage node usage:\n");
- fprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions>\n");
+ HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n");
+ HDfprintf(stderr, "B-tree chunked storage node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <B-tree node address> <# of dimensions>\n");
HDexit(4);
} /* end if */
@@ -352,7 +352,7 @@ main(int argc, char *argv[])
break;
default:
- fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
+ HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
HDexit(4);
}
@@ -374,10 +374,10 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0 || extra3 == 0) {
- fprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n");
- fprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n");
- fprintf(stderr, "v2 B-tree internal node usage:\n");
- fprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records> <depth>\n");
+ HDfprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n");
+ HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n");
+ HDfprintf(stderr, "v2 B-tree internal node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <internal node address> <v2 B-tree header address> <number of records> <depth>\n");
HDexit(4);
} /* end if */
@@ -392,9 +392,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
- fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n");
- fprintf(stderr, "v2 B-tree leaf node usage:\n");
- fprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n");
+ HDfprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n");
+ HDfprintf(stderr, "v2 B-tree leaf node usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <leaf node address> <v2 B-tree header address> <number of records>\n");
HDexit(4);
} /* end if */
@@ -413,9 +413,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
- fprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n");
- fprintf(stderr, "Fractal heap direct block usage:\n");
- fprintf(stderr, "\th5debug <filename> <direct block address> <heap header address> <size of direct block>\n");
+ HDfprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n");
+ HDfprintf(stderr, "Fractal heap direct block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <direct block address> <heap header address> <size of direct block>\n");
HDexit(4);
} /* end if */
@@ -428,9 +428,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
- fprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n");
- fprintf(stderr, "Fractal heap indirect block usage:\n");
- fprintf(stderr, "\th5debug <filename> <indirect block address> <heap header address> <number of rows>\n");
+ HDfprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n");
+ HDfprintf(stderr, "Fractal heap indirect block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <indirect block address> <heap header address> <number of rows>\n");
HDexit(4);
} /* end if */
@@ -450,9 +450,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
- fprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n");
- fprintf(stderr, "Free space serialized sections usage:\n");
- fprintf(stderr, "\th5debug <filename> <serialized sections address> <free space header address> <client address>\n");
+ HDfprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n");
+ HDfprintf(stderr, "Free space serialized sections usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <serialized sections address> <free space header address> <client address>\n");
HDexit(4);
} /* end if */
@@ -472,9 +472,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra2 == 0) {
- fprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n");
- fprintf(stderr, "Shared message list usage:\n");
- fprintf(stderr, "\th5debug <filename> <shared message list address> <list format version> <number of mesages in list>\n");
+ HDfprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n");
+ HDfprintf(stderr, "Shared message list usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <shared message list address> <list format version> <number of mesages in list>\n");
HDexit(4);
} /* end if */
@@ -487,11 +487,11 @@ main(int argc, char *argv[])
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
- /* Check for enough valid parameters */
+ /* Check for enough valid parameters */
if(extra == 0) {
- fprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n");
- fprintf(stderr, "Extensible array header block usage:\n");
- fprintf(stderr, "\th5debug <filename> <Extensible Array header address> <object header address>\n");
+ HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n");
+ HDfprintf(stderr, "Extensible array header block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <Extensible Array header address> <object header address>\n");
HDexit(4);
} /* end if */
@@ -506,9 +506,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
- fprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n");
- fprintf(stderr, "Extensible array index block usage:\n");
- fprintf(stderr, "\th5debug <filename> <index block address> <array header address> <object header address\n");
+ HDfprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n");
+ HDfprintf(stderr, "Extensible array index block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <index block address> <array header address> <object header address\n");
HDexit(4);
} /* end if */
@@ -523,9 +523,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0 || extra3 == 0) {
- fprintf(stderr, "ERROR: Need extensible array header address, super block index and object header address containing the layout message in order to dump super block\n");
- fprintf(stderr, "Extensible array super block usage:\n");
- fprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super block index> <object header address>\n");
+ HDfprintf(stderr, "ERROR: Need extensible array header address, super block index and object header address containing the layout message in order to dump super block\n");
+ HDfprintf(stderr, "Extensible array super block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <super block address> <array header address> <super block index> <object header address>\n");
HDexit(4);
} /* end if */
@@ -540,9 +540,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0 || extra3 == 0) {
- fprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n");
- fprintf(stderr, "Extensible array data block usage:\n");
- fprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of elements in data block> <object header address\n");
+ HDfprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n");
+ HDfprintf(stderr, "Extensible array data block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <data block address> <array header address> <# of elements in data block> <object header address\n");
HDexit(4);
} /* end if */
@@ -555,11 +555,11 @@ main(int argc, char *argv[])
const H5FA_class_t *cls = get_H5FA_class(sig);
HDassert(cls);
- /* Check for enough valid parameters */
+ /* Check for enough valid parameters */
if(extra == 0) {
- fprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n");
- fprintf(stderr, "Fixed array header block usage:\n");
- fprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\n");
+ HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n");
+ HDfprintf(stderr, "Fixed array header block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <Fixed Array header address> <object header address>\n");
HDexit(4);
} /* end if */
@@ -574,9 +574,9 @@ main(int argc, char *argv[])
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
- fprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n");
- fprintf(stderr, "fixed array data block usage:\n");
- fprintf(stderr, "\th5debug <filename> <data block address> <array header address> <object header address>\n");
+ HDfprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n");
+ HDfprintf(stderr, "fixed array data block usage:\n");
+ HDfprintf(stderr, "\th5debug <filename> <data block address> <array header address> <object header address>\n");
HDexit(4);
} /* end if */
@@ -612,13 +612,13 @@ main(int argc, char *argv[])
}
HDputchar('\n');
- fprintf(stderr, "unknown signature\n");
+ HDfprintf(stderr, "unknown signature\n");
HDexit(4);
} /* end else */
/* Check for an error when dumping information */
if(status < 0) {
- fprintf(stderr, "An error occurred!\n");
+ HDfprintf(stderr, "An error occurred!\n");
H5Eprint2(H5E_DEFAULT, stderr);
HDexit(5);
} /* end if */
diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c
index 09f23ef..b4ac6f6 100644
--- a/tools/misc/h5mkgrp.c
+++ b/tools/misc/h5mkgrp.c
@@ -63,7 +63,7 @@ static void
leave(int ret)
{
h5tools_close();
- exit(ret);
+ HDexit(ret);
} /* end leave() */
@@ -81,7 +81,7 @@ leave(int ret)
static void
usage(void)
{
- fprintf(stdout, "\
+ HDfprintf(stdout, "\
usage: h5mkgrp [OPTIONS] FILE GROUP...\n\
OPTIONS\n\
-h, --help Print a usage message and exit\n\
@@ -97,8 +97,8 @@ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\
*
* Purpose: Parses command line and sets up global variable to control output
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
* Programmer: Quincey Koziol, 2/13/2007
*
diff --git a/tools/testfiles/filter_fail.ddl b/tools/testfiles/filter_fail.ddl
index 9cc2de5..75534e2 100644
--- a/tools/testfiles/filter_fail.ddl
+++ b/tools/testfiles/filter_fail.ddl
@@ -25,3 +25,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
major: Data filters
minor: Read failed
h5dump error: unable to print data
+H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
+ #000: (file name) line (number) in h5tools_dump_simple_dset(): H5Dread failed
+ major: Failure in tools library
+ minor: error in function
diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt
index ca16c42..d8551ca 100644
--- a/tools/testfiles/h5dump-help.txt
+++ b/tools/testfiles/h5dump-help.txt
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] file
-e, --escape Escape non printing characters
-V, --version Print version number and exit
-a P, --attribute=P Print the specified attribute
+ If an attribute name contains a slash (/), escape the
+ slash with a preceding backslash (\).
+ (See example section below.)
-d P, --dataset=P Print the specified dataset
-y, --noindex Do not print array indices with the data
-p, --properties Print dataset filters, storage layout and fill value
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] file
h5dump -a /bar_none/foo quux.h5
+ Attribute "high/low" of the group /bar_none in the file quux.h5
+
+ h5dump -a "/bar_none/high\/low" quux.h5
+
2) Selecting a subset from dataset /foo in file quux.h5
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
@@ -94,3 +101,7 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
diff --git a/tools/testfiles/tarray6.h5 b/tools/testfiles/tarray6.h5
index b4af19b..7eb078c 100644
--- a/tools/testfiles/tarray6.h5
+++ b/tools/testfiles/tarray6.h5
Binary files differ
diff --git a/tools/testfiles/tattr-1.ddl b/tools/testfiles/tattr-1.ddl
index d353577..b58731b 100644
--- a/tools/testfiles/tattr-1.ddl
+++ b/tools/testfiles/tattr-1.ddl
@@ -1,6 +1,6 @@
HDF5 "tattr.h5" {
GROUP "/" {
- ATTRIBUTE "attr1" {
+ ATTRIBUTE "/attr1" {
DATATYPE H5T_STD_I8BE
DATASPACE SIMPLE { ( 24 ) / ( 24 ) }
DATA {
diff --git a/tools/testfiles/tattr-2.ddl b/tools/testfiles/tattr-2.ddl
index 79ba8c3..328b54f 100644
--- a/tools/testfiles/tattr-2.ddl
+++ b/tools/testfiles/tattr-2.ddl
@@ -7,14 +7,14 @@ ATTRIBUTE "/attr1" {
(14): 111, 111, 116, 32, 103, 114, 111, 117, 112, 0
}
}
-ATTRIBUTE "/attr4" {
+ATTRIBUTE "attr4" {
DATATYPE H5T_STD_I32BE
DATASPACE SCALAR
DATA {
(0): 100
}
}
-ATTRIBUTE "/attr5" {
+ATTRIBUTE "attr5" {
DATATYPE H5T_STRING {
STRSIZE 17;
STRPAD H5T_STR_NULLTERM;
diff --git a/tools/testfiles/tattr-3.ddl b/tools/testfiles/tattr-3.ddl
index 4eee317..a19f69a 100644
--- a/tools/testfiles/tattr-3.ddl
+++ b/tools/testfiles/tattr-3.ddl
@@ -1,9 +1,16 @@
HDF5 "tattr.h5" {
-ATTRIBUTE "/attr2" {
+ATTRIBUTE "attr2" {
DATATYPE H5T_STD_I32BE
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
}
-ATTRIBUTE "/attr" {
+ATTRIBUTE "attr" {
}
}
-h5dump error: unable to open attribute "/attr"
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Aopen(): unable to load attribute info from object header for attribute: 'attr'
+ major: Attribute
+ minor: Unable to initialize object
+ #001: (file name) line (number) in H5O_attr_open_by_name(): can't locate attribute: 'attr'
+ major: Attribute
+ minor: Object not found
+h5dump error: unable to open attribute "attr"
diff --git a/tools/testfiles/tattr.h5 b/tools/testfiles/tattr.h5
index fd14b58..d61def5 100644
--- a/tools/testfiles/tattr.h5
+++ b/tools/testfiles/tattr.h5
Binary files differ
diff --git a/tools/testfiles/tattr.h5.xml b/tools/testfiles/tattr.h5.xml
index 57fa276..fceea99 100644
--- a/tools/testfiles/tattr.h5.xml
+++ b/tools/testfiles/tattr.h5.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<hdf5:RootGroup OBJ-XID="xid_928" H5Path="/">
- <hdf5:Attribute Name="attr1">
+ <hdf5:Attribute Name="/attr1">
<hdf5:Dataspace>
<hdf5:SimpleDataspace Ndims="1">
<hdf5:Dimension DimSize="24" MaxDimSize="24"/>
diff --git a/tools/testfiles/tdset-2.ddl b/tools/testfiles/tdset-2.ddl
index def68c3..2034a43 100644
--- a/tools/testfiles/tdset-2.ddl
+++ b/tools/testfiles/tdset-2.ddl
@@ -7,7 +7,37 @@ DATASET "/dset2" {
DATATYPE H5T_IEEE_F64BE
DATASPACE SIMPLE { ( 30, 20 ) / ( 30, 20 ) }
}
-DATASET "dset3" {
- }
}
-h5dump error: unable to open dataset "dset3"
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Dopen2(): not found
+ major: Dataset
+ minor: Object not found
+ #001: (file name) line (number) in H5G_loc_find(): can't find object
+ major: Symbol table
+ minor: Object not found
+ #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
+ major: Symbol table
+ minor: Callback failed
+ #004: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist
+ major: Symbol table
+ minor: Object not found
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ major: Symbol table
+ minor: Object not found
+ #001: (file name) line (number) in H5L_get_info(): name doesn't exist
+ major: Symbol table
+ minor: Object already exists
+ #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
+ major: Symbol table
+ minor: Callback failed
+ #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist
+ major: Symbol table
+ minor: Object not found
+h5dump error: unable to get link info from "dset3"
diff --git a/tools/testfiles/textlink.ddl b/tools/testfiles/textlink.ddl
index 5459b30..4718adb 100644
--- a/tools/testfiles/textlink.ddl
+++ b/tools/testfiles/textlink.ddl
@@ -10,3 +10,53 @@ GROUP "/" {
}
}
}
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Oopen(): unable to open object
+ major: Symbol table
+ minor: Can't open object
+ #001: (file name) line (number) in H5O_open_name(): object not found
+ major: Symbol table
+ minor: Object not found
+ #002: (file name) line (number) in H5G_loc_find(): can't find object
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed
+ major: Links
+ minor: Link traversal failure
+ #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ major: Links
+ minor: Link traversal failure
+ #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID
+ major: Symbol table
+ minor: Unable to find atom information (already closed?)
+ #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename'
+ major: Links
+ minor: Unable to open file
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Oopen(): unable to open object
+ major: Symbol table
+ minor: Can't open object
+ #001: (file name) line (number) in H5O_open_name(): object not found
+ major: Symbol table
+ minor: Object not found
+ #002: (file name) line (number) in H5G_loc_find(): can't find object
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed
+ major: Links
+ minor: Link traversal failure
+ #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ major: Links
+ minor: Link traversal failure
+ #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID
+ major: Symbol table
+ minor: Unable to find atom information (already closed?)
+ #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile'
+ major: Links
+ minor: Unable to open file
diff --git a/tools/testfiles/thyperslab.ddl b/tools/testfiles/thyperslab.ddl
index cfebd14..2f4a118 100644
--- a/tools/testfiles/thyperslab.ddl
+++ b/tools/testfiles/thyperslab.ddl
@@ -6338,212 +6338,212 @@ GROUP "/" {
(30,4025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
(30,4045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
(30,4065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (30,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,8): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,29): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,50): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,71): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,92): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,1993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,2993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,3993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,4013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,4033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,4053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,4073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- (31,4093): 1, 1, 1, 1
+ (30,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,0): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,21): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,42): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,63): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,84): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,1985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,2985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,3985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,4005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,4025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,4045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,4065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ (31,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
}
}
}
diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl
index ca16c42..050a3a3 100644
--- a/tools/testfiles/tnofilename-with-packed-bits.ddl
+++ b/tools/testfiles/tnofilename-with-packed-bits.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] file
-e, --escape Escape non printing characters
-V, --version Print version number and exit
-a P, --attribute=P Print the specified attribute
+ If an attribute name contains a slash (/), escape the
+ slash with a preceding backslash (\).
+ (See example section below.)
-d P, --dataset=P Print the specified dataset
-y, --noindex Do not print array indices with the data
-p, --properties Print dataset filters, storage layout and fill value
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] file
h5dump -a /bar_none/foo quux.h5
+ Attribute "high/low" of the group /bar_none in the file quux.h5
+
+ h5dump -a "/bar_none/high\/low" quux.h5
+
2) Selecting a subset from dataset /foo in file quux.h5
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
@@ -94,3 +101,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
+h5dump error: missing file name
diff --git a/tools/testfiles/tnofilename.ddl b/tools/testfiles/tnofilename.ddl
deleted file mode 100644
index f9bd972..0000000
--- a/tools/testfiles/tnofilename.ddl
+++ /dev/null
@@ -1,86 +0,0 @@
-usage: h5dump [OPTIONS] file
- OPTIONS
- -h, --help Print a usage message and exit
- -n, --contents Print a list of the file contents and exit
- -B, --superblock Print the content of the super block
- -H, --header Print the header only; no data is displayed
- -A, --onlyattr Print the header and value of attributes
- -i, --object-ids Print the object ids
- -r, --string Print 1-byte integer datasets as ASCII
- -e, --escape Escape non printing characters
- -V, --version Print version number and exit
- -a P, --attribute=P Print the specified attribute
- -d P, --dataset=P Print the specified dataset
- -y, --noindex Do not print array indices with the data
- -p, --properties Print dataset filters, storage layout and fill value
- -f D, --filedriver=D Specify which driver to open the file with
- -g P, --group=P Print the specified group and all members
- -l P, --soft-link=P Print the value(s) of the specified soft link
- -o F, --output=F Output raw data into file F
- -b B, --binary=B Binary file output, of form B
- -t P, --datatype=P Print the specified named datatype
- -w N, --width=N Set the number of columns of output. A value of 0 (zero)
- sets the number of columns to the maximum (65535).
- Default width is 80 columns.
- -m T, --format=T Set the floating point output format
- -q Q, --sort_by=Q Sort groups and attributes by index Q
- -z Z, --sort_order=Z Sort groups and attributes by order Z
- -R, --region Print dataset pointed by region references
- -x, --xml Output in XML using Schema
- -u, --use-dtd Output in XML using DTD
- -D U, --xml-dtd=U Use the DTD or schema at U
- -X S, --xml-ns=S (XML Schema) Use qualified names n the XML
- ":": no namespace, default: "hdf5:"
- E.g., to dump a file called `-f', use h5dump -- -f
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur.
- --no-compact-subset Disable compact form of subsetting and allow the use
- of "[" in datset names.
-
- Subsetting is available by using the following options with a dataset
- attribute. Subsetting is done by selecting a hyperslab from the data.
- Thus, the options mirror those for performing a hyperslab selection.
- One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.
- The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
- each dimension. START is optional and will default to 0 in each dimension.
-
- -s START, --start=START Offset of start of subsetting selection
- -S STRIDE, --stride=STRIDE Hyperslab stride
- -c COUNT, --count=COUNT Number of blocks to include in selection
- -k BLOCK, --block=BLOCK Size of block in hyperslab
- START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the
- number of dimensions in the dataspace being queried
-
- D - is the file driver to use in opening the file. Acceptable values
- are "sec2", "family", "split", "multi", "direct", and "stream". Without
- the file driver flag, the file will be opened with each driver in
- turn and in the order specified above until one driver succeeds
- in opening the file.
- F - is a filename.
- P - is the full path from the root group to the object.
- N - is an integer greater than 1.
- T - is a string containing the floating point format, e.g '%.3f'
- U - is a URI reference (as defined in [IETF RFC 2396],
- updated by [IETF RFC 2732])
- B - is the form of binary output: NATIVE for a memory type, FILE for the
- file type, LE or BE for pre-existing little or big endian types.
- Must be used with -o (output file) and it is recommended that
- -d (dataset) is used. B is an optional argument, defaults to NATIVE
- Q - is the sort index type. It can be "creation_order" or "name" (default)
- Z - is the sort order type. It can be "descending" or "ascending" (default)
-
- Examples:
-
- 1) Attribute foo of the group /bar_none in file quux.h5
-
- h5dump -a /bar_none/foo quux.h5
-
- 2) Selecting a subset from dataset /foo in file quux.h5
-
- h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
-
- 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'
- using a little-endian type
-
- h5dump -d /dset -b LE -o out.bin quux.h5
-
diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl
index 88dac0a..5608d2b 100644
--- a/tools/testfiles/tpbitsIncomplete.ddl
+++ b/tools/testfiles/tpbitsIncomplete.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] file
-e, --escape Escape non printing characters
-V, --version Print version number and exit
-a P, --attribute=P Print the specified attribute
+ If an attribute name contains a slash (/), escape the
+ slash with a preceding backslash (\).
+ (See example section below.)
-d P, --dataset=P Print the specified dataset
-y, --noindex Do not print array indices with the data
-p, --properties Print dataset filters, storage layout and fill value
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] file
h5dump -a /bar_none/foo quux.h5
+ Attribute "high/low" of the group /bar_none in the file quux.h5
+
+ h5dump -a "/bar_none/high\/low" quux.h5
+
2) Selecting a subset from dataset /foo in file quux.h5
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
@@ -94,4 +101,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Bad mask list(0,2,2,1,0,2,2,)
diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl
index 35055f4..f89b65f 100644
--- a/tools/testfiles/tpbitsLengthExceeded.ddl
+++ b/tools/testfiles/tpbitsLengthExceeded.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] file
-e, --escape Escape non printing characters
-V, --version Print version number and exit
-a P, --attribute=P Print the specified attribute
+ If an attribute name contains a slash (/), escape the
+ slash with a preceding backslash (\).
+ (See example section below.)
-d P, --dataset=P Print the specified dataset
-y, --noindex Do not print array indices with the data
-p, --properties Print dataset filters, storage layout and fill value
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] file
h5dump -a /bar_none/foo quux.h5
+ Attribute "high/low" of the group /bar_none in the file quux.h5
+
+ h5dump -a "/bar_none/high\/low" quux.h5
+
2) Selecting a subset from dataset /foo in file quux.h5
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
@@ -94,4 +101,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Packed Bit offset+length value(65) too large. Max is 64
diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl
index 3daeab4..ba32aa6 100644
--- a/tools/testfiles/tpbitsLengthPositive.ddl
+++ b/tools/testfiles/tpbitsLengthPositive.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] file
-e, --escape Escape non printing characters
-V, --version Print version number and exit
-a P, --attribute=P Print the specified attribute
+ If an attribute name contains a slash (/), escape the
+ slash with a preceding backslash (\).
+ (See example section below.)
-d P, --dataset=P Print the specified dataset
-y, --noindex Do not print array indices with the data
-p, --properties Print dataset filters, storage layout and fill value
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] file
h5dump -a /bar_none/foo quux.h5
+ Attribute "high/low" of the group /bar_none in the file quux.h5
+
+ h5dump -a "/bar_none/high\/low" quux.h5
+
2) Selecting a subset from dataset /foo in file quux.h5
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
@@ -94,4 +101,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Packed Bit length value(0) must be positive.
diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl
index 2b3b68f..16f953d 100644
--- a/tools/testfiles/tpbitsMaxExceeded.ddl
+++ b/tools/testfiles/tpbitsMaxExceeded.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] file
-e, --escape Escape non printing characters
-V, --version Print version number and exit
-a P, --attribute=P Print the specified attribute
+ If an attribute name contains a slash (/), escape the
+ slash with a preceding backslash (\).
+ (See example section below.)
-d P, --dataset=P Print the specified dataset
-y, --noindex Do not print array indices with the data
-p, --properties Print dataset filters, storage layout and fill value
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] file
h5dump -a /bar_none/foo quux.h5
+ Attribute "high/low" of the group /bar_none in the file quux.h5
+
+ h5dump -a "/bar_none/high\/low" quux.h5
+
2) Selecting a subset from dataset /foo in file quux.h5
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
@@ -94,4 +101,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1)
diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl
index 6ccdc26..446fe2d 100644
--- a/tools/testfiles/tpbitsOffsetExceeded.ddl
+++ b/tools/testfiles/tpbitsOffsetExceeded.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] file
-e, --escape Escape non printing characters
-V, --version Print version number and exit
-a P, --attribute=P Print the specified attribute
+ If an attribute name contains a slash (/), escape the
+ slash with a preceding backslash (\).
+ (See example section below.)
-d P, --dataset=P Print the specified dataset
-y, --noindex Do not print array indices with the data
-p, --properties Print dataset filters, storage layout and fill value
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] file
h5dump -a /bar_none/foo quux.h5
+ Attribute "high/low" of the group /bar_none in the file quux.h5
+
+ h5dump -a "/bar_none/high\/low" quux.h5
+
2) Selecting a subset from dataset /foo in file quux.h5
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
@@ -94,4 +101,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Packed Bit offset value(64) must be between 0 and 63
diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl
index eb41bd7..747cf99 100644
--- a/tools/testfiles/tpbitsOffsetNegative.ddl
+++ b/tools/testfiles/tpbitsOffsetNegative.ddl
@@ -1,4 +1,4 @@
-usage: h5dump [OPTIONS] file
+usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-n, --contents Print a list of the file contents and exit
@@ -10,6 +10,9 @@ usage: h5dump [OPTIONS] file
-e, --escape Escape non printing characters
-V, --version Print version number and exit
-a P, --attribute=P Print the specified attribute
+ If an attribute name contains a slash (/), escape the
+ slash with a preceding backslash (\).
+ (See example section below.)
-d P, --dataset=P Print the specified dataset
-y, --noindex Do not print array indices with the data
-p, --properties Print dataset filters, storage layout and fill value
@@ -81,6 +84,10 @@ usage: h5dump [OPTIONS] file
h5dump -a /bar_none/foo quux.h5
+ Attribute "high/low" of the group /bar_none in the file quux.h5
+
+ h5dump -a "/bar_none/high\/low" quux.h5
+
2) Selecting a subset from dataset /foo in file quux.h5
h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5
@@ -94,4 +101,8 @@ usage: h5dump [OPTIONS] file
h5dump -d /dset -M 0,1,4,3 quux.h5
+ 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5
+
+ h5dump -d /foo multi1.h5 multi2.h5 multi3.h5
+
h5dump error: Bad mask list(-1,1)
diff --git a/tools/testfiles/tperror.ddl b/tools/testfiles/tperror.ddl
index 76988c8..16a7d8e 100644
--- a/tools/testfiles/tperror.ddl
+++ b/tools/testfiles/tperror.ddl
@@ -1,5 +1,35 @@
HDF5 "tfcontents1.h5" {
-DATASET "bogus" {
- }
}
-h5dump error: unable to open dataset "bogus"
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Dopen2(): not found
+ major: Dataset
+ minor: Object not found
+ #001: (file name) line (number) in H5G_loc_find(): can't find object
+ major: Symbol table
+ minor: Object not found
+ #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
+ major: Symbol table
+ minor: Callback failed
+ #004: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist
+ major: Symbol table
+ minor: Object not found
+HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Lget_info(): unable to get link info
+ major: Symbol table
+ minor: Object not found
+ #001: (file name) line (number) in H5L_get_info(): name doesn't exist
+ major: Symbol table
+ minor: Object already exists
+ #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ major: Symbol table
+ minor: Object not found
+ #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed
+ major: Symbol table
+ minor: Callback failed
+ #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist
+ major: Symbol table
+ minor: Object not found
+h5dump error: unable to get link info from "bogus"
diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h
index cef6266..4a2d8c4 100644
--- a/vms/src/h5pubconf.h
+++ b/vms/src/h5pubconf.h
@@ -502,7 +502,7 @@
#define H5_PACKAGE_NAME "HDF5"
/* Define to the full name and version of this package. */
-#define H5_PACKAGE_STRING "HDF5 1.9.109"
+#define H5_PACKAGE_STRING "HDF5 1.9.112"
/* Define to the one symbol short name of this package. */
#define H5_PACKAGE_TARNAME "hdf5"
@@ -511,7 +511,7 @@
#define H5_PACKAGE_URL ""
/* Define to the version of this package. */
-#define H5_PACKAGE_VERSION "1.9.109"
+#define H5_PACKAGE_VERSION "1.9.112"
/* Width for printf() for type `long long' or `__int64', use `ll' */
#define H5_PRINTF_LL_WIDTH "ll"
@@ -674,7 +674,7 @@
/* #undef H5_USING_MEMCHECKER */
/* Version number of package */
-#define H5_VERSION "1.9.109"
+#define H5_VERSION "1.9.112"
/* Define if vsnprintf() returns the correct value for formatted strings that
don't fit into size allowed */
diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h
index 6054e42..ade2790 100644
--- a/windows/src/H5pubconf.h
+++ b/windows/src/H5pubconf.h
@@ -527,7 +527,7 @@
#define H5_PACKAGE_NAME "HDF5"
/* Define to the full name and version of this package. */
-#define H5_PACKAGE_STRING "HDF5 1.9.109"
+#define H5_PACKAGE_STRING "HDF5 1.9.112"
/* Define to the one symbol short name of this package. */
#define H5_PACKAGE_TARNAME "hdf5"
@@ -536,7 +536,7 @@
#define H5_PACKAGE_URL ""
/* Define to the version of this package. */
-#define H5_PACKAGE_VERSION "1.9.109"
+#define H5_PACKAGE_VERSION "1.9.112"
/* Width for printf() for type `long long' or `__int64', use `ll' */
#define H5_PRINTF_LL_WIDTH "I64"
@@ -707,7 +707,7 @@
/* #undef H5_USING_MEMCHECKER */
/* Version number of package */
-#define H5_VERSION "1.9.109"
+#define H5_VERSION "1.9.112"
/* Define if vsnprintf() returns the correct value for formatted strings that
don't fit into size allowed */