summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/CMakeLists.txt2
-rw-r--r--java/Makefile.am2
-rw-r--r--java/Makefile.in64
-rw-r--r--java/examples/CMakeLists.txt2
-rw-r--r--java/examples/Makefile.am2
-rw-r--r--java/examples/Makefile.in64
-rw-r--r--java/examples/datasets/CMakeLists.txt4
-rw-r--r--java/examples/datasets/JavaDatasetExample.sh.in44
-rw-r--r--java/examples/datasets/Makefile.am2
-rw-r--r--java/examples/datasets/Makefile.in62
-rw-r--r--java/examples/datatypes/CMakeLists.txt4
-rw-r--r--java/examples/datatypes/H5Ex_T_Float.java4
-rw-r--r--java/examples/datatypes/H5Ex_T_FloatAttribute.java4
-rw-r--r--java/examples/datatypes/Makefile.am2
-rw-r--r--java/examples/datatypes/Makefile.in62
-rw-r--r--java/examples/groups/CMakeLists.txt4
-rw-r--r--java/examples/groups/Makefile.am2
-rw-r--r--java/examples/groups/Makefile.in62
-rw-r--r--java/examples/intro/CMakeLists.txt4
-rw-r--r--java/examples/intro/Makefile.am2
-rw-r--r--java/examples/intro/Makefile.in62
-rw-r--r--java/src/CMakeLists.txt2
-rw-r--r--java/src/Makefile.am2
-rw-r--r--java/src/Makefile.in35
-rw-r--r--java/src/hdf/CMakeLists.txt2
-rw-r--r--java/src/hdf/hdf5lib/CMakeLists.txt2
-rw-r--r--java/src/hdf/hdf5lib/H5.java63
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java36
-rw-r--r--java/src/hdf/hdf5lib/structs/H5O_info_t.java4
-rw-r--r--java/src/hdf/hdf5lib/structs/H5_ih_info_t.java18
-rw-r--r--java/src/jni/CMakeLists.txt3
-rw-r--r--java/src/jni/Makefile.in94
-rw-r--r--java/src/jni/exceptionImp.c2
-rw-r--r--java/src/jni/h5aImp.c72
-rw-r--r--java/src/jni/h5dImp.c28
-rw-r--r--java/src/jni/h5eImp.c24
-rw-r--r--java/src/jni/h5fImp.c4
-rw-r--r--java/src/jni/h5iImp.c4
-rw-r--r--java/src/jni/h5jni.h425
-rw-r--r--java/src/jni/h5lImp.c37
-rw-r--r--java/src/jni/h5oImp.c57
-rw-r--r--java/src/jni/h5pDAPLImp.c4
-rw-r--r--java/src/jni/h5pDCPLImp.c58
-rw-r--r--java/src/jni/h5pDXPLImp.c4
-rw-r--r--java/src/jni/h5pFAPLImp.c152
-rw-r--r--java/src/jni/h5pFAPLImp.h27
-rw-r--r--java/src/jni/h5pFCPLImp.c10
-rw-r--r--java/src/jni/h5pImp.c2
-rw-r--r--java/src/jni/h5pLAPLImp.c4
-rw-r--r--java/src/jni/h5plImp.c28
-rw-r--r--java/src/jni/h5rImp.c16
-rw-r--r--java/src/jni/h5sImp.c53
-rw-r--r--java/src/jni/h5sImp.h7
-rw-r--r--java/src/jni/h5tImp.c12
-rw-r--r--java/src/jni/h5util.c136
-rw-r--r--java/src/jni/nativeData.c60
-rw-r--r--java/test/CMakeLists.txt74
-rw-r--r--java/test/Makefile.am2
-rw-r--r--java/test/Makefile.in62
-rw-r--r--java/test/TestH5.java147
-rw-r--r--java/test/TestH5E.java4
-rw-r--r--java/test/TestH5Pfapl.java32
-rw-r--r--java/test/TestH5S.java2
-rw-r--r--java/test/junit.sh.in91
-rw-r--r--java/test/testfiles/JUnit-TestH5.txt3
-rw-r--r--java/test/testfiles/JUnit-TestH5Edefault.txt8
-rw-r--r--java/test/testfiles/JUnit-TestH5Pfapl.txt3
67 files changed, 1453 insertions, 922 deletions
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index 56e1695..416e495 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDF5_JAVA C Java)
set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}")
diff --git a/java/Makefile.am b/java/Makefile.am
index 68a6e47..7063d13 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -10,7 +10,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-#
+#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.
diff --git a/java/Makefile.in b/java/Makefile.in
index f4d3304..37fbfc6 100644
--- a/java/Makefile.in
+++ b/java/Makefile.in
@@ -26,7 +26,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-#
+#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.
@@ -424,12 +424,12 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = @AM_JAVACFLAGS@
@@ -449,6 +449,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -465,6 +466,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -501,8 +503,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -525,6 +530,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -561,6 +567,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -620,6 +627,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -655,6 +663,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -711,15 +720,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@@ -759,7 +768,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
-chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
@@ -1337,28 +1346,37 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
echo "============================" > $${log}; \
fi; \
if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\
else \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\
fi; \
else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Testing: $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
fi; \
if test -n "$(REALTIMEOUTPUT)"; then \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \
+ fi; \
+ else \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
echo "============================" | tee -a $${log}; \
else \
echo "============================" >> $${log}; \
diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt
index 828b96a..3412c40 100644
--- a/java/examples/CMakeLists.txt
+++ b/java/examples/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDFJAVA_EXAMPLES Java)
add_subdirectory (datasets)
diff --git a/java/examples/Makefile.am b/java/examples/Makefile.am
index 8ca49f2..054407c 100644
--- a/java/examples/Makefile.am
+++ b/java/examples/Makefile.am
@@ -10,7 +10,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-#
+#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.
diff --git a/java/examples/Makefile.in b/java/examples/Makefile.in
index d6f3f32..d47e843 100644
--- a/java/examples/Makefile.in
+++ b/java/examples/Makefile.in
@@ -26,7 +26,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-#
+#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.
@@ -424,12 +424,12 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = @AM_JAVACFLAGS@
@@ -449,6 +449,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -465,6 +466,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -501,8 +503,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -525,6 +530,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -561,6 +567,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -620,6 +627,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -655,6 +663,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -711,15 +720,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@@ -752,7 +761,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
-chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
@@ -1330,28 +1339,37 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
echo "============================" > $${log}; \
fi; \
if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\
else \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\
fi; \
else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Testing: $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
fi; \
if test -n "$(REALTIMEOUTPUT)"; then \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \
+ fi; \
+ else \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
echo "============================" | tee -a $${log}; \
else \
echo "============================" >> $${log}; \
diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt
index 8849524..fc4acc4 100644
--- a/java/examples/datasets/CMakeLists.txt
+++ b/java/examples/datasets/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDFJAVA_EXAMPLES_DATASETS Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
@@ -71,7 +71,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
endforeach ()
-if (BUILD_TESTING)
+if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in
index f5c63cd..ae79416 100644
--- a/java/examples/datasets/JavaDatasetExample.sh.in
+++ b/java/examples/datasets/JavaDatasetExample.sh.in
@@ -324,16 +324,18 @@ else
nerrors="`expr $nerrors + 1`"
fi
-echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip"
-TESTING examples.datasets.H5Ex_D_Gzip
-(
-$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out
-)
-if diff H5Ex_D_Gzip.out examples.datasets.H5Ex_D_Gzip.txt > /dev/null; then
- echo " PASSED datasets.H5Ex_D_Gzip"
-else
- echo "**FAILED** datasets.H5Ex_D_Gzip"
- nerrors="`expr $nerrors + 1`"
+if test $USE_FILTER_DEFLATE = "yes"; then
+ echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip"
+ TESTING examples.datasets.H5Ex_D_Gzip
+ (
+ $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Gzip > H5Ex_D_Gzip.out
+ )
+ if diff H5Ex_D_Gzip.out examples.datasets.H5Ex_D_Gzip.txt > /dev/null; then
+ echo " PASSED datasets.H5Ex_D_Gzip"
+ else
+ echo "**FAILED** datasets.H5Ex_D_Gzip"
+ nerrors="`expr $nerrors + 1`"
+ fi
fi
echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Hyperslab"
@@ -360,16 +362,18 @@ else
nerrors="`expr $nerrors + 1`"
fi
-echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle"
-TESTING examples.datasets.H5Ex_D_Shuffle
-(
-$RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out
-)
-if diff H5Ex_D_Shuffle.out examples.datasets.H5Ex_D_Shuffle.txt > /dev/null; then
- echo " PASSED datasets.H5Ex_D_Shuffle"
-else
- echo "**FAILED** datasets.H5Ex_D_Shuffle"
- nerrors="`expr $nerrors + 1`"
+if test $USE_FILTER_DEFLATE = "yes"; then
+ echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle"
+ TESTING examples.datasets.H5Ex_D_Shuffle
+ (
+ $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.datasets.H5Ex_D_Shuffle > H5Ex_D_Shuffle.out
+ )
+ if diff H5Ex_D_Shuffle.out examples.datasets.H5Ex_D_Shuffle.txt > /dev/null; then
+ echo " PASSED datasets.H5Ex_D_Shuffle"
+ else
+ echo "**FAILED** datasets.H5Ex_D_Shuffle"
+ nerrors="`expr $nerrors + 1`"
+ fi
fi
if test $USE_FILTER_SZIP = "yes"; then
diff --git a/java/examples/datasets/Makefile.am b/java/examples/datasets/Makefile.am
index b442603..c5b8a5d 100644
--- a/java/examples/datasets/Makefile.am
+++ b/java/examples/datasets/Makefile.am
@@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)datasets.jar
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
-TESTPACKAGE =
+TESTPACKAGE =
noinst_JAVA = \
H5Ex_D_Alloc.java \
diff --git a/java/examples/datasets/Makefile.in b/java/examples/datasets/Makefile.in
index fafd5c4..115218e 100644
--- a/java/examples/datasets/Makefile.in
+++ b/java/examples/datasets/Makefile.in
@@ -364,12 +364,12 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
@@ -389,6 +389,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -405,6 +406,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -441,8 +443,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -465,6 +470,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -501,6 +507,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -560,6 +567,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -595,6 +603,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -651,15 +660,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@@ -724,7 +733,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
-chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
@@ -1211,28 +1220,37 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
echo "============================" > $${log}; \
fi; \
if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\
else \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\
fi; \
else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Testing: $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
fi; \
if test -n "$(REALTIMEOUTPUT)"; then \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \
+ fi; \
+ else \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
echo "============================" | tee -a $${log}; \
else \
echo "============================" >> $${log}; \
diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt
index b83da0e..bd4f483 100644
--- a/java/examples/datatypes/CMakeLists.txt
+++ b/java/examples/datatypes/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDFJAVA_EXAMPLES_DATATYPES Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
@@ -56,7 +56,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
endforeach ()
-if (BUILD_TESTING)
+if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
diff --git a/java/examples/datatypes/H5Ex_T_Float.java b/java/examples/datatypes/H5Ex_T_Float.java
index f677479..f15f774 100644
--- a/java/examples/datatypes/H5Ex_T_Float.java
+++ b/java/examples/datatypes/H5Ex_T_Float.java
@@ -22,6 +22,8 @@
package examples.datatypes;
import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
@@ -173,7 +175,7 @@ public class H5Ex_T_Float {
}
// Output the data to the screen.
- DecimalFormat df = new DecimalFormat("#,##0.0000");
+ DecimalFormat df = new DecimalFormat("#,##0.0000", new DecimalFormatSymbols(Locale.US));
System.out.println(DATASETNAME + ":");
for (int indx = 0; indx < dims[0]; indx++) {
System.out.print(" [");
diff --git a/java/examples/datatypes/H5Ex_T_FloatAttribute.java b/java/examples/datatypes/H5Ex_T_FloatAttribute.java
index 2e706d9..12831bc 100644
--- a/java/examples/datatypes/H5Ex_T_FloatAttribute.java
+++ b/java/examples/datatypes/H5Ex_T_FloatAttribute.java
@@ -22,6 +22,8 @@
package examples.datatypes;
import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
@@ -201,7 +203,7 @@ public class H5Ex_T_FloatAttribute {
}
// Output the data to the screen.
- DecimalFormat df = new DecimalFormat("#,##0.0000");
+ DecimalFormat df = new DecimalFormat("#,##0.0000", new DecimalFormatSymbols(Locale.US));
System.out.println(ATTRIBUTENAME + ":");
for (int indx = 0; indx < dims[0]; indx++) {
System.out.print(" [");
diff --git a/java/examples/datatypes/Makefile.am b/java/examples/datatypes/Makefile.am
index 5e0e971..f695528 100644
--- a/java/examples/datatypes/Makefile.am
+++ b/java/examples/datatypes/Makefile.am
@@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)datatypes.jar
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
-TESTPACKAGE =
+TESTPACKAGE =
noinst_JAVA = \
H5Ex_T_Array.java \
diff --git a/java/examples/datatypes/Makefile.in b/java/examples/datatypes/Makefile.in
index 3ee713e..d44d7e1 100644
--- a/java/examples/datatypes/Makefile.in
+++ b/java/examples/datatypes/Makefile.in
@@ -364,12 +364,12 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
@@ -389,6 +389,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -405,6 +406,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -441,8 +443,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -465,6 +470,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -501,6 +507,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -560,6 +567,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -595,6 +603,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -651,15 +660,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@@ -724,7 +733,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
-chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
@@ -1211,28 +1220,37 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
echo "============================" > $${log}; \
fi; \
if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\
else \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\
fi; \
else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Testing: $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
fi; \
if test -n "$(REALTIMEOUTPUT)"; then \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \
+ fi; \
+ else \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
echo "============================" | tee -a $${log}; \
else \
echo "============================" >> $${log}; \
diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt
index 9e43087..c2c7d0f 100644
--- a/java/examples/groups/CMakeLists.txt
+++ b/java/examples/groups/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDFJAVA_EXAMPLES_GROUPS Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
@@ -55,7 +55,7 @@ foreach (h5_file ${HDF_JAVA_TEST_FILES})
endforeach ()
add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list})
-if (BUILD_TESTING)
+if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
diff --git a/java/examples/groups/Makefile.am b/java/examples/groups/Makefile.am
index 09df743..d5824e8 100644
--- a/java/examples/groups/Makefile.am
+++ b/java/examples/groups/Makefile.am
@@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)groups.jar
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
-TESTPACKAGE =
+TESTPACKAGE =
noinst_JAVA = \
H5Ex_G_Create.java \
diff --git a/java/examples/groups/Makefile.in b/java/examples/groups/Makefile.in
index 115d92a..a9b9820 100644
--- a/java/examples/groups/Makefile.in
+++ b/java/examples/groups/Makefile.in
@@ -364,12 +364,12 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
@@ -389,6 +389,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -405,6 +406,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -441,8 +443,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -465,6 +470,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -501,6 +507,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -560,6 +567,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -595,6 +603,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -651,15 +660,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@@ -713,7 +722,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
-chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
@@ -1200,28 +1209,37 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
echo "============================" > $${log}; \
fi; \
if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\
else \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\
fi; \
else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Testing: $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
fi; \
if test -n "$(REALTIMEOUTPUT)"; then \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \
+ fi; \
+ else \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
echo "============================" | tee -a $${log}; \
else \
echo "============================" >> $${log}; \
diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt
index b56e3ad..6cb1e16 100644
--- a/java/examples/intro/CMakeLists.txt
+++ b/java/examples/intro/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDFJAVA_EXAMPLES_INTRO Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
@@ -45,7 +45,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
endforeach ()
-if (BUILD_TESTING)
+if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL)
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
diff --git a/java/examples/intro/Makefile.am b/java/examples/intro/Makefile.am
index 33f44c2..8c3716a 100644
--- a/java/examples/intro/Makefile.am
+++ b/java/examples/intro/Makefile.am
@@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)intro.jar
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
-TESTPACKAGE =
+TESTPACKAGE =
noinst_JAVA = \
H5_CreateAttribute.java \
diff --git a/java/examples/intro/Makefile.in b/java/examples/intro/Makefile.in
index e4dc0da..2d1f179 100644
--- a/java/examples/intro/Makefile.in
+++ b/java/examples/intro/Makefile.in
@@ -364,12 +364,12 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
@@ -389,6 +389,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -405,6 +406,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -441,8 +443,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -465,6 +470,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -501,6 +507,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -560,6 +567,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -595,6 +603,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -651,15 +660,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@@ -713,7 +722,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
-chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
@@ -1200,28 +1209,37 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
echo "============================" > $${log}; \
fi; \
if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\
else \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\
fi; \
else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Testing: $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
fi; \
if test -n "$(REALTIMEOUTPUT)"; then \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \
+ fi; \
+ else \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
echo "============================" | tee -a $${log}; \
else \
echo "============================" >> $${log}; \
diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt
index 3f80d8f..0bfbaf7 100644
--- a/java/src/CMakeLists.txt
+++ b/java/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDF5_JAVA_SRC C)
#-----------------------------------------------------------------------------
diff --git a/java/src/Makefile.am b/java/src/Makefile.am
index fcdeae9..78dbc9a 100644
--- a/java/src/Makefile.am
+++ b/java/src/Makefile.am
@@ -10,7 +10,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-#
+#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.
diff --git a/java/src/Makefile.in b/java/src/Makefile.in
index fda8e3d..689ca20 100644
--- a/java/src/Makefile.in
+++ b/java/src/Makefile.in
@@ -26,7 +26,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-#
+#
# This makefile mostly just reinvokes make in the various subdirectories
# but does so in the correct order. You can alternatively invoke make from
# each subdirectory manually.
@@ -255,12 +255,12 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
@@ -280,6 +280,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -296,6 +297,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -332,8 +334,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -356,6 +361,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -392,6 +398,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -451,6 +458,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -486,6 +494,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -542,15 +551,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt
index 161ddf1..5660158 100644
--- a/java/src/hdf/CMakeLists.txt
+++ b/java/src/hdf/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDF5_JAVA_HDF C)
add_subdirectory (hdf5lib)
diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt
index be8f60a..e07f210 100644
--- a/java/src/hdf/hdf5lib/CMakeLists.txt
+++ b/java/src/hdf/hdf5lib/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDF5_JAVA_HDF_HDF5 Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 2a76b89..c588431 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -214,7 +214,7 @@ import hdf.hdf5lib.structs.H5O_info_t;
* exception handlers to print out the HDF-5 error stack.
* <hr>
*
- * @version HDF5 1.10.6 <BR>
+ * @version HDF5 1.10.7 <BR>
* <b>See also: <a href ="./hdf.hdf5lib.HDFArray.html"> hdf.hdf5lib.HDFArray</a> </b><BR>
* <a href ="./hdf.hdf5lib.HDF5Constants.html"> hdf.hdf5lib.HDF5Constants</a><BR>
* <a href ="./hdf.hdf5lib.HDF5CDataTypes.html"> hdf.hdf5lib.HDF5CDataTypes</a><BR>
@@ -237,7 +237,7 @@ public class H5 implements java.io.Serializable {
*
* Make sure to update the versions number when a different library is used.
*/
- public final static int LIB_VERSION[] = { 1, 10, 6 };
+ public final static int LIB_VERSION[] = { 1, 10, 7 };
public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib";
@@ -1107,7 +1107,9 @@ public class H5 implements java.io.Serializable {
log.trace("H5Aread_dname_D");
status = H5Aread_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning);
}
- else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && (is1D && (dataClass.getComponentType() == String.class))) || H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
+ else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) &&
+ (is1D && (dataClass.getComponentType() == String.class))) ||
+ H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
log.trace("H5Aread_reg_ref");
status = H5Aread_reg_ref(attr_id, mem_type_id, (String[]) obj);
}
@@ -2005,7 +2007,9 @@ public class H5 implements java.io.Serializable {
status = H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
(double[]) obj, isCriticalPinning);
}
- else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && (is1D && (dataClass.getComponentType() == String.class))) || H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
+ else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) &&
+ (is1D && (dataClass.getComponentType() == String.class))) ||
+ H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
log.trace("H5Dread_reg_ref");
status = H5Dread_reg_ref(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
(String[]) obj);
@@ -3563,7 +3567,7 @@ public class H5 implements java.io.Serializable {
public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype,
int[] ltype, long[] fno, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException {
- return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type, -1);
+ return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, indx_type, -1);
}
public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype,
@@ -6458,6 +6462,55 @@ public class H5 implements java.io.Serializable {
public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close)
throws HDF5LibraryException;
+ /**
+ * H5Pget_use_file_locking retrieves whether we are using file locking.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return indication if file locking is used.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native boolean H5Pget_use_file_locking(long fapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pget_use_file_locking retrieves whether we ignore file locks when they are disabled.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @return indication if file locking is ignored.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native boolean H5Pget_ignore_disabled_file_locking(long fapl_id)
+ throws HDF5LibraryException;
+
+ /**
+ * H5Pset_file_locking sets parameters related to file locking.
+ *
+ * @param fapl_id
+ * IN: File access property list identifier
+ *
+ * @param use_file_locking
+ * IN: Whether the library will use file locking when opening files (mainly for SWMR semantics).
+ *
+ * @param ignore_when_disabled
+ * IN: Whether file locking will be ignored when disabled on a file system (useful for Lustre).
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ *
+ **/
+ public synchronized static native void H5Pset_file_locking(long fapl_id, boolean use_file_locking, boolean ignore_when_disabled)
+ throws HDF5LibraryException;
+
// Dataset creation property list (DCPL) routines //
/**
diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
index a39c1ed..73aaa47 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
@@ -16,7 +16,7 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
// Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
-public class H5O_hdr_info_t implements Serializable{
+public class H5O_hdr_info_t implements Serializable {
private static final long serialVersionUID = 7883826382952577189L;
public int version; /* Version number of header format in file */
public int nmesgs; /* Number of object header messages */
@@ -44,4 +44,38 @@ public class H5O_hdr_info_t implements Serializable{
this.mesg_present = mesg_present;
this.mesg_shared = mesg_shared;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (!(o instanceof H5O_hdr_info_t))
+ return false;
+
+ H5O_hdr_info_t info = (H5O_hdr_info_t) o;
+
+ if (this.version != info.version)
+ return false;
+ if (this.nmesgs != info.nmesgs)
+ return false;
+ if (this.nchunks != info.nchunks)
+ return false;
+ if (this.flags != info.flags)
+ return false;
+ if (this.space_total != info.space_total)
+ return false;
+ if (this.space_meta != info.space_meta)
+ return false;
+ if (this.space_mesg != info.space_mesg)
+ return false;
+ if (this.space_free != info.space_free)
+ return false;
+ if (this.mesg_present != info.mesg_present)
+ return false;
+ if (this.mesg_shared != info.mesg_shared)
+ return false;
+
+ return true;
+ }
}
diff --git a/java/src/hdf/hdf5lib/structs/H5O_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_info_t.java
index ac32f6a..5dd078f 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_info_t.java
@@ -15,8 +15,8 @@ package hdf.hdf5lib.structs;
import java.io.Serializable;
-//Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
-public class H5O_info_t implements Serializable{
+// Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx)
+public class H5O_info_t implements Serializable {
private static final long serialVersionUID = 4691681163544054518L;
public long fileno; /* File number that object is located in */
public long addr; /* Object address in file */
diff --git a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
index ea36d85..7159f02 100644
--- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
@@ -26,4 +26,22 @@ public class H5_ih_info_t implements Serializable {
this.index_size = index_size;
this.heap_size = heap_size;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+
+ if (!(o instanceof H5_ih_info_t))
+ return false;
+
+ H5_ih_info_t info = (H5_ih_info_t) o;
+
+ if (this.index_size != info.index_size)
+ return false;
+ if (this.heap_size != info.heap_size)
+ return false;
+
+ return true;
+ }
}
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt
index 366f091..a5b2d96 100644
--- a/java/src/jni/CMakeLists.txt
+++ b/java/src/jni/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDF5_JAVA_JNI C)
set (HDF5_JAVA_JNI_CSRCS
@@ -77,6 +77,7 @@ add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JA
target_include_directories (${HDF5_JAVA_JNI_LIB_TARGET}
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
+target_compile_options(${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED)
target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni)
diff --git a/java/src/jni/Makefile.in b/java/src/jni/Makefile.in
index 06eb05c..b94f101 100644
--- a/java/src/jni/Makefile.in
+++ b/java/src/jni/Makefile.in
@@ -423,15 +423,15 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
# Include src directory and JNI flags
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \
-I$(top_srcdir)/java/src/jni $(JNIFLAGS)
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = @AM_JAVACFLAGS@
@@ -451,6 +451,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -467,6 +468,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -503,8 +505,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -527,6 +532,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -563,6 +569,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -622,6 +629,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -657,6 +665,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -713,15 +722,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@@ -741,30 +750,30 @@ TRACE = perl $(top_srcdir)/bin/trace
# .chklog files are output from those tests.
# *.clog and *.clog2 are from the MPE option.
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
-LT_VERS_INTERFACE = 105
+LT_VERS_INTERFACE = 106
LT_VERS_REVISION = 0
-LT_VERS_AGE = 2
-LT_CXX_VERS_INTERFACE = 105
+LT_VERS_AGE = 3
+LT_CXX_VERS_INTERFACE = 106
LT_CXX_VERS_REVISION = 0
-LT_CXX_VERS_AGE = 2
-LT_F_VERS_INTERFACE = 102
-LT_F_VERS_REVISION = 1
-LT_F_VERS_AGE = 0
+LT_CXX_VERS_AGE = 3
+LT_F_VERS_INTERFACE = 103
+LT_F_VERS_REVISION = 0
+LT_F_VERS_AGE = 1
LT_HL_VERS_INTERFACE = 101
-LT_HL_VERS_REVISION = 3
+LT_HL_VERS_REVISION = 4
LT_HL_VERS_AGE = 1
LT_HL_CXX_VERS_INTERFACE = 101
-LT_HL_CXX_VERS_REVISION = 4
+LT_HL_CXX_VERS_REVISION = 5
LT_HL_CXX_VERS_AGE = 1
LT_HL_F_VERS_INTERFACE = 100
-LT_HL_F_VERS_REVISION = 5
+LT_HL_F_VERS_REVISION = 6
LT_HL_F_VERS_AGE = 0
-LT_JAVA_VERS_INTERFACE = 104
-LT_JAVA_VERS_REVISION = 1
-LT_JAVA_VERS_AGE = 4
-LT_TOOLS_VERS_INTERFACE = 101
-LT_TOOLS_VERS_REVISION = 3
-LT_TOOLS_VERS_AGE = 1
+LT_JAVA_VERS_INTERFACE = 105
+LT_JAVA_VERS_REVISION = 0
+LT_JAVA_VERS_AGE = 5
+LT_TOOLS_VERS_INTERFACE = 102
+LT_TOOLS_VERS_REVISION = 0
+LT_TOOLS_VERS_AGE = 0
# Mark this directory as part of the JNI API
JAVA_API = yes
@@ -798,7 +807,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
-chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
@@ -1413,28 +1422,37 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
echo "============================" > $${log}; \
fi; \
if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\
else \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\
fi; \
else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Testing: $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
fi; \
if test -n "$(REALTIMEOUTPUT)"; then \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \
+ fi; \
+ else \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
echo "============================" | tee -a $${log}; \
else \
echo "============================" >> $${log}; \
diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c
index 0faa0cc..c08b67b 100644
--- a/java/src/jni/exceptionImp.c
+++ b/java/src/jni/exceptionImp.c
@@ -409,7 +409,7 @@ h5libraryError
if (msg_size > 0) {
if (NULL == (msg_str = (char *) HDcalloc((size_t)msg_size + 1, sizeof(char))))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5libraryerror: failed to allocate buffer for error message");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5libraryerror: failed to allocate buffer for error message");
if ((msg_size = H5Eget_msg(min_num, &error_msg_type, msg_str, (size_t)msg_size + 1)) < 0)
goto done;
diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c
index eaa356e..c1a2631 100644
--- a/java/src/jni/h5aImp.c
+++ b/java/src/jni/h5aImp.c
@@ -94,11 +94,18 @@ JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Aopen_1name
(JNIEnv *env, jclass clss, jlong loc_id, jstring name)
{
+#ifndef H5_NO_DEPRECATED_SYMBOLS
const char *attrName = NULL;
+#endif
hid_t attr_id = H5I_INVALID_HID;
UNUSED(clss);
+#ifdef H5_NO_DEPRECATED_SYMBOLS
+ UNUSED(loc_id);
+ UNUSED(name);
+ H5_UNIMPLEMENTED(ENVONLY, "H5Aopen_name: not implemented");
+#else
if (NULL == name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Aopen_name: attribute name is null");
@@ -106,10 +113,13 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1name
if((attr_id = H5Aopen_name((hid_t)loc_id, attrName)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
+#endif
done:
+#ifndef H5_NO_DEPRECATED_SYMBOLS
if (attrName)
UNPIN_JAVA_STRING(ENVONLY, name, attrName);
+#endif
return (jlong)attr_id;
} /* end Java_hdf_hdf5lib_H5__1H5Aopen_1name */
@@ -127,8 +137,14 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1idx
UNUSED(clss);
+#ifdef H5_NO_DEPRECATED_SYMBOLS
+ UNUSED(loc_id);
+ UNUSED(idx);
+ H5_UNIMPLEMENTED(ENVONLY, "H5Aopen_idx: not implemented");
+#else
if ((attr_id = H5Aopen_idx((hid_t) loc_id, (unsigned int) idx)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
+#endif
done:
return (jlong)attr_id;
@@ -825,10 +841,10 @@ Java_hdf_hdf5lib_H5_H5Aread_1string
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (cstr = (char *) HDmalloc(str_len + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Aread_string: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread_string: memory allocation failed");
if (NULL == (c_buf = (char *) HDmalloc((size_t)n * str_len)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Aread_string: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread_string: memory allocation failed");
if ((status = H5Aread((hid_t)attr_id, (hid_t)mem_type_id, c_buf)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -839,7 +855,7 @@ Java_hdf_hdf5lib_H5_H5Aread_1string
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, cstr))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Aread_string: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread_string: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, j_buf, i, jstr);
@@ -889,7 +905,7 @@ Java_hdf_hdf5lib_H5_H5Awrite_1string
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (c_buf = (char *) HDmalloc((size_t)n * str_len)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Awrite_string: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Awrite_string: memory allocation failed");
for (i = 0; i < (size_t) n; i++) {
if (NULL == (obj = (jstring) ENVPTR->GetObjectArrayElement(ENVONLY, (jobjectArray)j_buf, (jsize) i))) {
@@ -1021,7 +1037,7 @@ H5AreadVL_str
}
if (NULL == (strs = (char **) HDcalloc((size_t)n, sizeof(char *))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AreadVL_str: failed to allocate variable length string read buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AreadVL_str: failed to allocate variable length string read buffer");
if ((status = H5Aread(aid, tid, strs)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1094,7 +1110,7 @@ H5AreadVL_asstr
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (readBuf = HDcalloc((size_t)n, typeSize)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AreadVL_asstr: failed to allocate read buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AreadVL_asstr: failed to allocate read buffer");
if ((status = H5Aread(aid, tid, readBuf)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1103,7 +1119,7 @@ H5AreadVL_asstr
h5str_new(&h5str, 4 * typeSize);
if (!h5str.s)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AreadVL_asstr: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AreadVL_asstr: failed to allocate buffer");
/* Convert each element to a char string */
for (i = 0; i < (size_t) n; i++) {
@@ -1227,7 +1243,7 @@ H5AwriteVL_str
}
if (NULL == (writeBuf = (char **) HDcalloc((size_t)size + 1, sizeof(char *))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AwriteVL_str: failed to allocate variable length string write buffer")
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AwriteVL_str: failed to allocate variable length string write buffer");
for (i = 0; i < size; ++i) {
jsize length;
@@ -1248,7 +1264,7 @@ H5AwriteVL_str
PIN_JAVA_STRING(ENVONLY, obj, utf8, NULL, "H5AwriteVL_str: string not pinned");
if (NULL == (writeBuf[i] = (char *) HDmalloc((size_t)length + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AwriteVL_str: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AwriteVL_str: failed to allocate string buffer");
HDstrncpy(writeBuf[i], utf8, (size_t)length);
writeBuf[i][length] = '\0';
@@ -1288,7 +1304,7 @@ H5AwriteVL_asstr
{
const char *utf8 = NULL;
hsize_t dims[H5S_MAX_RANK];
- jstring jstr;
+ jstring jstr = NULL;
size_t typeSize;
size_t i;
hid_t sid = H5I_INVALID_HID;
@@ -1309,7 +1325,7 @@ H5AwriteVL_asstr
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (writeBuf = HDcalloc((size_t)n, typeSize)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AwriteVL_asstr: failed to allocate write buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AwriteVL_asstr: failed to allocate write buffer");
/*
* When repeatedly writing a dataset with a large number of strs (e.g., 1,000,000 strings),
@@ -1390,7 +1406,7 @@ Java_hdf_hdf5lib_H5_H5Aread_1reg_1ref
}
if (NULL == (ref_data = (hdset_reg_ref_t *) HDcalloc(1, (size_t)n * sizeof(hdset_reg_ref_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Aread_reg_ref: failed to allocate read buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread_reg_ref: failed to allocate read buffer");
if ((status = H5Aread((hid_t)attr_id, (hid_t)mem_type_id, ref_data)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1398,7 +1414,7 @@ Java_hdf_hdf5lib_H5_H5Aread_1reg_1ref
h5str_new(&h5str, 1024);
if (!h5str.s)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Aread_reg_ref: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread_reg_ref: failed to allocate buffer");
for (i = 0; i < n; i++) {
h5str.s[0] = '\0';
@@ -1483,7 +1499,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1name
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (attrName = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Aget_name: failed to allocate attribute name buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aget_name: failed to allocate attribute name buffer");
if (H5Aget_name((hid_t)attr_id, (size_t)buf_size + 1, attrName) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1512,8 +1528,13 @@ Java_hdf_hdf5lib_H5_H5Aget_1num_1attrs
UNUSED(clss);
+#ifdef H5_NO_DEPRECATED_SYMBOLS
+ UNUSED(loc_id);
+ H5_UNIMPLEMENTED(ENVONLY, "H5Aget_num_attrs: not implemented");
+#else
if ((retVal = H5Aget_num_attrs((hid_t)loc_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
+#endif
done:
return (jint)retVal;
@@ -1835,7 +1856,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1name_1by_1idx
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (attrName = (char *) HDmalloc(sizeof(char) * (size_t) status_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Aget_name_by_idx: failed to allocate buffer for attribute name");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aget_name_by_idx: failed to allocate buffer for attribute name");
if ((H5Aget_name_by_idx((hid_t)loc_id, objName, (H5_index_t)idx_type,
(H5_iter_order_t) order, (hsize_t) n, (char *)attrName, (size_t)status_size + 1, (hid_t)lapl_id)) < 0)
@@ -2141,12 +2162,12 @@ static herr_t
H5A_iterate_cb
(hid_t g_id, const char *name, const H5A_info_t *info, void *cb_data) {
cb_wrapper *wrapper = (cb_wrapper *)cb_data;
- jmethodID constructor, mid;
+ jmethodID mid;
jobject cb_info_t = NULL;
jobject visit_callback = wrapper->visit_callback;
jstring str;
JNIEnv *cbenv = NULL;
- jclass cls;
+ jclass cbcls;
jvalue args[4];
void *op_data = (void *)wrapper->op_data;
jint status = -1;
@@ -2156,10 +2177,10 @@ H5A_iterate_cb
H5_JNI_FATAL_ERROR(CBENVONLY, "H5A_iterate_cb: failed to attach current thread to JVM");
}
- if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
+ if (NULL == (cbcls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5A_info_t;Lhdf/hdf5lib/callbacks/H5A_iterate_t;)I")))
+ if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cbcls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5A_info_t;Lhdf/hdf5lib/callbacks/H5A_iterate_t;)I")))
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
if (NULL == (str = CBENVPTR->NewStringUTF(CBENVONLY, name)))
@@ -2170,18 +2191,7 @@ H5A_iterate_cb
args[2].i = info->cset;
args[3].j = (jlong)info->data_size;
- /* Get a reference to your class if you don't have it already */
- if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5A_info_t")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- /* Get a reference to the constructor; the name is <init> */
- if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(ZJIJ)V")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- if (NULL == (cb_info_t = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) {
- HDprintf("FATAL ERROR: hdf/hdf5lib/structs/H5A_info_t: Creation failed\n");
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- }
+ CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5A_info_t", "(ZJIJ)V", args, cb_info_t);
status = CBENVPTR->CallIntMethod(CBENVONLY, visit_callback, mid, g_id, str, cb_info_t, op_data);
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c
index 5500847..5b53460 100644
--- a/java/src/jni/h5dImp.c
+++ b/java/src/jni/h5dImp.c
@@ -963,10 +963,10 @@ Java_hdf_hdf5lib_H5_H5Dread_1string
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (cstr = (char *) HDmalloc(str_len + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Dread_string: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread_string: memory allocation failed");
if (NULL == (c_buf = (char *) HDmalloc((size_t)n * str_len)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Dread_string: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread_string: memory allocation failed");
if ((status = H5Dread((hid_t)dataset_id, (hid_t)mem_type_id, (hid_t)mem_space_id,
(hid_t)file_space_id, (hid_t)xfer_plist_id, c_buf)) < 0)
@@ -978,7 +978,7 @@ Java_hdf_hdf5lib_H5_H5Dread_1string
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, cstr))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Dread_string: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread_string: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, j_buf, i, jstr);
@@ -1029,7 +1029,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1string
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (c_buf = (char *) HDmalloc((size_t)n * str_len)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Dwrite_string: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dwrite_string: memory allocation failed");
for (i = 0; i < (size_t) n; i++) {
if (NULL == (obj = (jstring) ENVPTR->GetObjectArrayElement(ENVONLY, (jobjectArray)j_buf, (jsize) i))) {
@@ -1165,7 +1165,7 @@ H5DreadVL_str
}
if (NULL == (strs = (char **) HDcalloc((size_t)n, sizeof(char *))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5DreadVL_str: failed to allocate variable length string read buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DreadVL_str: failed to allocate variable length string read buffer");
if ((status = H5Dread(did, tid, mem_sid, file_sid, xfer_plist_id, strs)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1251,7 +1251,7 @@ H5DreadVL_asstr
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (readBuf = HDcalloc((size_t)n, typeSize)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5DreadVL_asstr: failed to allocate read buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DreadVL_asstr: failed to allocate read buffer");
if ((status = H5Dread(did, tid, mem_sid, file_sid, xfer_plist_id, readBuf)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1260,7 +1260,7 @@ H5DreadVL_asstr
h5str_new(&h5str, 4 * typeSize);
if (!h5str.s)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5DreadVL_asstr: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DreadVL_asstr: failed to allocate buffer");
if ((tclass = H5Tget_class(tid)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1430,7 +1430,7 @@ H5DwriteVL_str
}
if (NULL == (writeBuf = (char **) HDcalloc((size_t)size + 1, sizeof(char *))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5DwriteVL_str: failed to allocate variable length string write buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DwriteVL_str: failed to allocate variable length string write buffer");
for (i = 0; i < size; ++i) {
jsize length;
@@ -1451,7 +1451,7 @@ H5DwriteVL_str
PIN_JAVA_STRING(ENVONLY, obj, utf8, NULL, "H5DwriteVL_str: string not pinned");
if (NULL == (writeBuf[i] = (char *) HDmalloc((size_t)length + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5DwriteVL_str: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DwriteVL_str: failed to allocate string buffer");
HDstrncpy(writeBuf[i], utf8, (size_t)length + 1);
writeBuf[i][length] = '\0';
@@ -1490,7 +1490,7 @@ H5DwriteVL_asstr
(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf)
{
const char *utf8 = NULL;
- jstring obj;
+ jstring obj = NULL;
hbool_t close_mem_space = FALSE;
size_t typeSize;
size_t i;
@@ -1524,7 +1524,7 @@ H5DwriteVL_asstr
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (writeBuf = HDcalloc((size_t)n, typeSize)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AwriteVL_asstr: failed to allocate write buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AwriteVL_asstr: failed to allocate write buffer");
for (i = 0; i < (size_t) n; ++i) {
if (NULL == (obj = (jstring) ENVPTR->GetObjectArrayElement(ENVONLY, (jobjectArray)buf, (jsize) i))) {
@@ -1634,7 +1634,7 @@ Java_hdf_hdf5lib_H5_H5Dread_1reg_1ref
}
if (NULL == (ref_data = (hdset_reg_ref_t *) HDcalloc(1, (size_t)n * sizeof(hdset_reg_ref_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Dread_reg_ref: failed to allocate read buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread_reg_ref: failed to allocate read buffer");
if ((status = H5Dread((hid_t)dataset_id, (hid_t)mem_type_id, (hid_t)mem_space_id, (hid_t)file_space_id, xfer_plist_id, ref_data)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1642,7 +1642,7 @@ Java_hdf_hdf5lib_H5_H5Dread_1reg_1ref
h5str_new(&h5str, 1024);
if (!h5str.s)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Dread_reg_ref: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread_reg_ref: failed to allocate buffer");
for (i = 0; i < n; i++) {
h5str.s[0] = '\0';
@@ -1897,7 +1897,7 @@ Java_hdf_hdf5lib_H5_H5Dset_1extent
PIN_LONG_ARRAY(ENVONLY, buf, dimsBuf, &isCopy, "H5Dset_extent: buffer not pinned");
if (NULL == (dims = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Dset_extent: failed to allocate dataset dimension buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dset_extent: failed to allocate dataset dimension buffer");
for (i = 0; i < rank; i++)
dims[i] = (hsize_t)dimsBuf[i];
diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c
index 937323e..80e23a1 100644
--- a/java/src/jni/h5eImp.c
+++ b/java/src/jni/h5eImp.c
@@ -309,7 +309,7 @@ Java_hdf_hdf5lib_H5_H5Eget_1class_1name
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_class_name: no class name");
if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Eget_class_name: malloc failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Eget_class_name: malloc failed");
if ((H5Eget_class_name((hid_t)cls_id, (char *)namePtr, (size_t)buf_size + 1)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -464,10 +464,10 @@ Java_hdf_hdf5lib_H5_H5Eget_1msg
H5_LIBRARY_ERROR(ENVONLY);
if (!buf_size)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Eget_msg: invalid message");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_msg: invalid message");
if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Eget_msg: malloc failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Eget_msg: malloc failed");
PIN_INT_ARRAY(ENVONLY, error_msg_type_list, theArray, NULL, "H5Eget_msg: error_msg_type_list not pinned");
@@ -517,14 +517,13 @@ H5E_walk_cb
(int nindx, const H5E_error2_t *info, void *cb_data)
{
cb_wrapper *wrapper = (cb_wrapper *)cb_data;
- jmethodID constructor;
jmethodID mid;
jobject visit_callback = wrapper->visit_callback;
jstring str1, str2, str3;
jobject cb_info_t = NULL;
jvalue args[7];
JNIEnv *cbenv = NULL;
- jclass cls;
+ jclass cbcls;
void *op_data = (void *)wrapper->op_data;
jint status = FAIL;
@@ -533,10 +532,10 @@ H5E_walk_cb
H5_JNI_FATAL_ERROR(CBENVONLY, "H5E_walk_cb: failed to attach current thread to JVM");
}
- if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
+ if (NULL == (cbcls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(ILhdf/hdf5lib/structs/H5E_error2_t;Lhdf/hdf5lib/callbacks/H5E_walk_t;)I")))
+ if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cbcls, "callback", "(ILhdf/hdf5lib/structs/H5E_error2_t;Lhdf/hdf5lib/callbacks/H5E_walk_t;)I")))
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
args[0].j = info->cls_id;
@@ -559,16 +558,7 @@ H5E_walk_cb
args[6].l = str3;
- /* Get a reference to your class if you don't have it already */
- if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5E_error2_t")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- /* get a reference to the constructor; the name is <init> */
- if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(JJJILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- if (NULL == (cb_info_t = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args)))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
+ CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5E_error2_t", "(JJJILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", args, cb_info_t);
status = CBENVPTR->CallIntMethod(CBENVONLY, visit_callback, mid, nindx, cb_info_t, op_data);
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c
index 115e8f4..101443e 100644
--- a/java/src/jni/h5fImp.c
+++ b/java/src/jni/h5fImp.c
@@ -131,7 +131,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1name
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Fget_name: malloc failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Fget_name: malloc failed");
if ((H5Fget_name((hid_t)file_id, namePtr, (size_t)buf_size + 1)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -386,7 +386,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1obj_1ids
}
if (NULL == (id_list = (hid_t *) HDmalloc((size_t)rank * sizeof(hid_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Fget_obj_ids: malloc failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Fget_obj_ids: malloc failed");
if ((ret_val = H5Fget_obj_ids((hid_t)file_id, (unsigned int)types, (size_t)maxObjs, id_list)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
diff --git a/java/src/jni/h5iImp.c b/java/src/jni/h5iImp.c
index a367802..e8030aee 100644
--- a/java/src/jni/h5iImp.c
+++ b/java/src/jni/h5iImp.c
@@ -71,7 +71,7 @@ Java_hdf_hdf5lib_H5_H5Iget_1name_1long
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Iget_name_long: buf_size < 0");
if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Iget_name_long: malloc failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Iget_name_long: malloc failed");
if ((size = H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size + 1)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -111,7 +111,7 @@ Java_hdf_hdf5lib_H5_H5Iget_1name
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Iget_name: malloc failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Iget_name: malloc failed");
if (H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size + 1) < 0)
H5_LIBRARY_ERROR(ENVONLY);
diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h
index 4a94180..f833c71 100644
--- a/java/src/jni/h5jni.h
+++ b/java/src/jni/h5jni.h
@@ -47,195 +47,6 @@
*/
#define UNUSED(o) (void) o
-/* Macros for class access */
-/* Calling code must define ret_obj as jobject */
-#define CALL_CONSTRUCTOR(env, classname, classsig, args, ret_obj) \
-{ \
- jmethodID constructor; \
- jclass cls; \
- \
- if (NULL == (cls = ENVPTR->FindClass(env, (classname)))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, "JNI error: GetObjectClass"); \
- } \
- if (NULL == (constructor = ENVPTR->GetMethodID(ENVONLY, cls, "<init>", (classsig)))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, "JNI error: GetMethodID failed"); \
- } \
- if (NULL == (ret_obj = ENVPTR->NewObjectA(ENVONLY, cls, constructor, (args)))) { \
- CHECK_JNI_EXCEPTION(env, JNI_FALSE); \
- } \
-}
-
-/*
- * Macros for pinning/unpinning objects.
- */
-#define PIN_BYTE_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = ENVPTR->GetByteArrayElements(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define PIN_BYTE_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = (jbyte *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define UNPIN_BYTE_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
-{ \
- ENVPTR->ReleaseByteArrayElements(env, pinnedArray, (jbyte *) bufToRelease, freeMode); \
-}
-
-#define PIN_SHORT_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = ENVPTR->GetShortArrayElements(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define PIN_SHORT_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = (jshort *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define UNPIN_SHORT_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
-{ \
- ENVPTR->ReleaseShortArrayElements(env, pinnedArray, (jshort *) bufToRelease, freeMode); \
-}
-
-#define PIN_INT_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = ENVPTR->GetIntArrayElements(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define PIN_INT_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = (jint *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define UNPIN_INT_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
-{ \
- ENVPTR->ReleaseIntArrayElements(env, pinnedArray, (jint *) bufToRelease, freeMode); \
-}
-
-#define PIN_LONG_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = ENVPTR->GetLongArrayElements(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define PIN_LONG_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = (jlong *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define UNPIN_LONG_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
-{ \
- ENVPTR->ReleaseLongArrayElements(env, pinnedArray, (jlong *) bufToRelease, freeMode); \
-}
-
-#define PIN_FLOAT_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = ENVPTR->GetFloatArrayElements(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define PIN_FLOAT_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = (jfloat *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define UNPIN_FLOAT_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
-{ \
- ENVPTR->ReleaseFloatArrayElements(env, pinnedArray, (jfloat *) bufToRelease, freeMode); \
-}
-
-#define PIN_DOUBLE_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = ENVPTR->GetDoubleArrayElements(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define PIN_DOUBLE_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = (jdouble *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define UNPIN_DOUBLE_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
-{ \
- ENVPTR->ReleaseDoubleArrayElements(env, pinnedArray, (jdouble *) bufToRelease, freeMode); \
-}
-
-#define PIN_BOOL_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = ENVPTR->GetBooleanArrayElements(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define PIN_BOOL_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
-{ \
- if (NULL == (outBuf = (jboolean *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define UNPIN_BOOL_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
-{ \
- ENVPTR->ReleaseBooleanArrayElements(env, pinnedArray, (jboolean *) bufToRelease, freeMode); \
-}
-
-#define UNPIN_ARRAY_CRITICAL(env, pinnedArray, bufToRelease, freeMode) \
-{ \
- ENVPTR->ReleasePrimitiveArrayCritical(env, pinnedArray, bufToRelease, freeMode); \
-}
-
-/* Macros for string access */
-#define PIN_JAVA_STRING(env, stringToPin, outString, isCopy, failErrMsg) \
-{ \
- if (NULL == (outString = ENVPTR->GetStringUTFChars(env, stringToPin, isCopy))) { \
- CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
- H5_JNI_FATAL_ERROR(env, failErrMsg); \
- } \
-}
-
-#define UNPIN_JAVA_STRING(env, pinnedString, stringToRelease) \
-{ \
- ENVPTR->ReleaseStringUTFChars(env, pinnedString, stringToRelease); \
-}
-
/*
* Macro to check for a JNI exception after a JNI method is called.
* If an exception occurred, the value of 'clearException' will determine
@@ -246,15 +57,205 @@
* cleanup+return section of the native method, since at that point
* cleaning up and returning is the only safe thing that can be done.
*/
-#define CHECK_JNI_EXCEPTION(env, clearException) \
-{ \
- if (JNI_TRUE == (*env)->ExceptionCheck(env)) { \
- if (JNI_TRUE == clearException) \
- (*env)->ExceptionClear(env); \
- else \
- goto done; \
- } \
-}
+#define CHECK_JNI_EXCEPTION(envptr, clearException) \
+do { \
+ if (JNI_TRUE == (*envptr)->ExceptionCheck(envptr)) { \
+ if (JNI_TRUE == clearException) \
+ (*envptr)->ExceptionClear(envptr); \
+ else \
+ goto done; \
+ } \
+} while(0)
+
+/* Macros for class access */
+/* Calling code must define ret_obj as jobject */
+#define CALL_CONSTRUCTOR(envptr, classname, classsig, args, ret_obj) \
+do { \
+ jmethodID constructor; \
+ jclass cls; \
+ \
+ if (NULL == (cls = (*envptr)->FindClass(envptr, (classname)))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, "JNI error: GetObjectClass"); \
+ } \
+ if (NULL == (constructor = (*envptr)->GetMethodID(envptr, cls, "<init>", (classsig)))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, "JNI error: GetMethodID failed"); \
+ } \
+ if (NULL == (ret_obj = (*envptr)->NewObjectA(envptr, cls, constructor, (args)))) { \
+ HDprintf("FATAL ERROR: %s: Creation failed\n", classname); \
+ CHECK_JNI_EXCEPTION(envptr, JNI_FALSE); \
+ } \
+} while(0)
+
+/*
+ * Macros for pinning/unpinning objects.
+ */
+#define PIN_BYTE_ARRAY(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (*envptr)->GetByteArrayElements(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define PIN_BYTE_ARRAY_CRITICAL(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (jbyte *) (*envptr)->GetPrimitiveArrayCritical(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define UNPIN_BYTE_ARRAY(envptr, pinnedArray, bufToRelease, freeMode) \
+do { \
+ (*envptr)->ReleaseByteArrayElements(envptr, pinnedArray, (jbyte *) bufToRelease, freeMode); \
+} while(0)
+
+#define PIN_SHORT_ARRAY(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (*envptr)->GetShortArrayElements(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define PIN_SHORT_ARRAY_CRITICAL(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (jshort *) (*envptr)->GetPrimitiveArrayCritical(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define UNPIN_SHORT_ARRAY(envptr, pinnedArray, bufToRelease, freeMode) \
+do { \
+ (*envptr)->ReleaseShortArrayElements(envptr, pinnedArray, (jshort *) bufToRelease, freeMode); \
+} while(0)
+
+#define PIN_INT_ARRAY(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (*envptr)->GetIntArrayElements(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define PIN_INT_ARRAY_CRITICAL(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (jint *) (*envptr)->GetPrimitiveArrayCritical(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define UNPIN_INT_ARRAY(envptr, pinnedArray, bufToRelease, freeMode) \
+do { \
+ (*envptr)->ReleaseIntArrayElements(envptr, pinnedArray, (jint *) bufToRelease, freeMode); \
+} while(0)
+
+#define PIN_LONG_ARRAY(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (*envptr)->GetLongArrayElements(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define PIN_LONG_ARRAY_CRITICAL(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (jlong *) (*envptr)->GetPrimitiveArrayCritical(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define UNPIN_LONG_ARRAY(envptr, pinnedArray, bufToRelease, freeMode) \
+do { \
+ (*envptr)->ReleaseLongArrayElements(envptr, pinnedArray, (jlong *) bufToRelease, freeMode); \
+} while(0)
+
+#define PIN_FLOAT_ARRAY(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (*envptr)->GetFloatArrayElements(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define PIN_FLOAT_ARRAY_CRITICAL(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (jfloat *) (*envptr)->GetPrimitiveArrayCritical(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define UNPIN_FLOAT_ARRAY(envptr, pinnedArray, bufToRelease, freeMode) \
+do { \
+ (*envptr)->ReleaseFloatArrayElements(envptr, pinnedArray, (jfloat *) bufToRelease, freeMode); \
+} while(0)
+
+#define PIN_DOUBLE_ARRAY(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (*envptr)->GetDoubleArrayElements(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define PIN_DOUBLE_ARRAY_CRITICAL(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (jdouble *) (*envptr)->GetPrimitiveArrayCritical(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define UNPIN_DOUBLE_ARRAY(envptr, pinnedArray, bufToRelease, freeMode) \
+do { \
+ (*envptr)->ReleaseDoubleArrayElements(envptr, pinnedArray, (jdouble *) bufToRelease, freeMode); \
+} while(0)
+
+#define PIN_BOOL_ARRAY(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (*envptr)->GetBooleanArrayElements(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define PIN_BOOL_ARRAY_CRITICAL(envptr, arrayToPin, outBuf, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outBuf = (jboolean *) (*envptr)->GetPrimitiveArrayCritical(envptr, arrayToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define UNPIN_BOOL_ARRAY(envptr, pinnedArray, bufToRelease, freeMode) \
+do { \
+ (*envptr)->ReleaseBooleanArrayElements(envptr, pinnedArray, (jboolean *) bufToRelease, freeMode); \
+} while(0)
+
+#define UNPIN_ARRAY_CRITICAL(envptr, pinnedArray, bufToRelease, freeMode) \
+do { \
+ (*envptr)->ReleasePrimitiveArrayCritical(envptr, pinnedArray, bufToRelease, freeMode); \
+} while(0)
+
+/* Macros for string access */
+#define PIN_JAVA_STRING(envptr, stringToPin, outString, isCopy, failErrMsg) \
+do { \
+ if (NULL == (outString = (*envptr)->GetStringUTFChars(envptr, stringToPin, isCopy))) { \
+ CHECK_JNI_EXCEPTION(envptr, JNI_TRUE); \
+ H5_JNI_FATAL_ERROR(envptr, failErrMsg); \
+ } \
+} while(0)
+
+#define UNPIN_JAVA_STRING(envptr, pinnedString, stringToRelease) \
+do { \
+ (*envptr)->ReleaseStringUTFChars(envptr, pinnedString, stringToRelease); \
+} while(0)
#ifdef __cplusplus
extern "C" {
@@ -279,46 +280,46 @@ extern jboolean h5unimplemented( JNIEnv *env, const char *functName);
* then do its own error handling, but we instead opt to immediately return.
*/
#define H5_JNI_FATAL_ERROR(env, message) \
-{ \
+do { \
h5JNIFatalError(env, message); \
goto done; \
-}
+} while(0)
#define H5_NULL_ARGUMENT_ERROR(env, message) \
-{ \
+do { \
h5nullArgument(env, message); \
goto done; \
-}
+} while(0)
#define H5_BAD_ARGUMENT_ERROR(env, message) \
-{ \
+do { \
h5badArgument(env, message); \
goto done; \
-}
+} while(0)
#define H5_OUT_OF_MEMORY_ERROR(env, message) \
-{ \
+do { \
h5outOfMemory(env, message); \
goto done; \
-}
+} while(0)
#define H5_LIBRARY_ERROR(env) \
-{ \
+do { \
h5libraryError(env); \
goto done; \
-}
+} while(0)
#define H5_RAISE_EXCEPTION(env, message, exception) \
-{ \
+do { \
h5raiseException(env, message, exception); \
goto done; \
-}
+} while(0)
#define H5_UNIMPLEMENTED(env, message) \
-{ \
+do { \
h5unimplemented(env, message); \
goto done; \
-}
+} while(0)
/* implemented at H5.c */
extern jint get_enum_value(JNIEnv *env, jobject enum_obj);
diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c
index 7eee3d4..ade53a3 100644
--- a/java/src/jni/h5lImp.c
+++ b/java/src/jni/h5lImp.c
@@ -381,7 +381,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx
/* add extra space for the null terminator */
if (NULL == (linkName = (char *) HDmalloc(sizeof(char) * (size_t)status_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Lget_name_by_idx: failed to allocate buffer for link name");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_name_by_idx: failed to allocate buffer for link name");
if ((H5Lget_name_by_idx((hid_t)loc_id, groupName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (char *)linkName, (size_t)status_size + 1, (hid_t)access_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -430,10 +430,10 @@ Java_hdf_hdf5lib_H5_H5Lget_1value
H5_LIBRARY_ERROR(ENVONLY);
if (H5L_TYPE_HARD == infobuf.type)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Lget_val: hard links are unsupported");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Lget_val: hard links are unsupported");
if (NULL == (linkValue = (char *) HDmalloc(sizeof(char) * infobuf.u.val_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Lget_val: failed to allocate buffer for link value");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_val: failed to allocate buffer for link value");
if ((status = H5Lget_val((hid_t)loc_id, linkName, (void *)linkValue, infobuf.u.val_size + 1, (hid_t)access_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -475,7 +475,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value
case H5L_TYPE_MAX:
case H5L_TYPE_HARD:
default:
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Lget_val: invalid link type");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Lget_val: invalid link type");
break;
}
@@ -520,13 +520,13 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx
H5_LIBRARY_ERROR(ENVONLY);
if (H5L_TYPE_HARD == infobuf.type)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Lget_val_by_idx: hard links are unsupported")
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Lget_val_by_idx: hard links are unsupported");
if (!infobuf.u.val_size)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (linkValue = (void *) HDmalloc(infobuf.u.val_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Lget_val_by_idx: failed to allocate buffer for link value");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_val_by_idx: failed to allocate buffer for link value");
if ((status = H5Lget_val_by_idx((hid_t)loc_id, grpName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (void *)linkValue, infobuf.u.val_size + 1, (hid_t)access_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -568,7 +568,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx
case H5L_TYPE_MAX:
case H5L_TYPE_HARD:
default:
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Lget_val_by_idx: invalid link type");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Lget_val_by_idx: invalid link type");
break;
}
@@ -620,12 +620,12 @@ H5L_iterate_cb
(hid_t g_id, const char *name, const H5L_info_t *info, void *cb_data)
{
cb_wrapper *wrapper = (cb_wrapper *)cb_data;
- jmethodID constructor, mid;
+ jmethodID mid;
jobject cb_info_t = NULL;
jobject visit_callback = wrapper->visit_callback;
jstring str;
JNIEnv *cbenv = NULL;
- jclass cls;
+ jclass cbcls;
jvalue args[5];
void *op_data = (void *)wrapper->op_data;
jint status = -1;
@@ -635,10 +635,11 @@ H5L_iterate_cb
H5_JNI_FATAL_ERROR(CBENVONLY, "H5L_iterate_cb: failed to attach current thread to JVM");
}
- if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
+ /* Get the Method ID for the "callback" function of the H5L_iterate_t class */
+ if (NULL == (cbcls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5L_info_t;Lhdf/hdf5lib/callbacks/H5L_iterate_t;)I")))
+ if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cbcls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5L_info_t;Lhdf/hdf5lib/callbacks/H5L_iterate_t;)I")))
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
if (NULL == (str = CBENVPTR->NewStringUTF(CBENVONLY, name)))
@@ -649,19 +650,7 @@ H5L_iterate_cb
args[2].j = info->corder;
args[3].i = info->cset;
args[4].j = (info->type == H5L_TYPE_HARD) ? (jlong)info->u.address : (jlong)info->u.val_size;
-
- /* Get a reference to your class if you don't have it already */
- if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5L_info_t")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- /* Get a reference to the constructor; the name is <init> */
- if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(IZJIJ)V")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- if (NULL == (cb_info_t = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) {
- HDprintf("FATAL ERROR: hdf/hdf5lib/structs/H5L_info_t: Creation failed\n");
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- }
+ CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5L_info_t", "(IZJIJ)V", args, cb_info_t);
status = CBENVPTR->CallIntMethod(CBENVONLY, visit_callback, mid, g_id, str, cb_info_t, op_data);
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index b49a3e9..a52a905 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -378,15 +378,16 @@ H5O_iterate_cb
(hid_t g_id, const char *name, const H5O_info_t *info, void *cb_data)
{
cb_wrapper *wrapper = (cb_wrapper *)cb_data;
- jmethodID constructor, mid;
+ jmethodID mid;
jobject cb_info_t = NULL;
jobject visit_callback = wrapper->visit_callback;
+ jobject ret_obj = NULL;
jobject hdrinfobuf;
jobject ihinfobuf1;
jobject ihinfobuf2;
jstring str;
JNIEnv *cbenv = NULL;
- jclass cls;
+ jclass cbcls;
jvalue args[12];
void *op_data = (void *)wrapper->op_data;
jint status = FAIL;
@@ -396,10 +397,10 @@ H5O_iterate_cb
H5_JNI_FATAL_ERROR(CBENVONLY, "H5O_iterate_cb: failed to attach current thread to JVM");
}
- if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
+ if (NULL == (cbcls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5O_info_t;Lhdf/hdf5lib/callbacks/H5O_iterate_t;)I")))
+ if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cbcls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5O_info_t;Lhdf/hdf5lib/callbacks/H5O_iterate_t;)I")))
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
if (NULL == (str = CBENVPTR->NewStringUTF(CBENVONLY, name)))
@@ -417,41 +418,21 @@ H5O_iterate_cb
args[9].j = (jlong)info->hdr.mesg.shared;
/* Get a reference to the H5_hdr_info_t class */
- if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5O_hdr_info_t")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- /* Get a reference to the constructor; the name is <init> */
- if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(IIIIJJJJJJ)V")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- if (NULL == (hdrinfobuf = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) {
- HDprintf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5O_hdr_info_t: Creation failed\n");
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- }
+ CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5O_hdr_info_t", "(IIIIJJJJJJ)V", args, ret_obj);
+ hdrinfobuf = ret_obj;
args[0].j = (jlong)info->meta_size.obj.index_size;
args[1].j = (jlong)info->meta_size.obj.heap_size;
/* Get a reference to the H5_ih_info_t class */
- if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5_ih_info_t")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- /* Get a reference to the constructor; the name is <init> */
- if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(JJ)V")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- if (NULL == (ihinfobuf1 = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) {
- HDprintf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n");
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- }
+ CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args, ret_obj);
+ ihinfobuf1 = ret_obj;
args[0].j = (jlong)info->meta_size.attr.index_size;
args[1].j = (jlong)info->meta_size.attr.heap_size;
- if (NULL == (ihinfobuf2 = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) {
- HDprintf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n");
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- }
+ CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args, ret_obj);
+ ihinfobuf2 = ret_obj;
args[0].j = (jlong)info->fileno;
args[1].j = (jlong)info->addr;
@@ -467,17 +448,7 @@ H5O_iterate_cb
args[11].l = ihinfobuf2;
/* Get a reference to the H5O_info_t class */
- if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5O_info_t")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- /* Get a reference to the constructor; the name is <init> */
- if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V")))
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
-
- if (NULL == (cb_info_t = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args))) {
- HDprintf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5O_info_t: Creation failed\n");
- CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
- }
+ CALL_CONSTRUCTOR(CBENVONLY, "hdf/hdf5lib/structs/H5O_info_t", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V", args, cb_info_t) ;
status = CBENVPTR->CallIntMethod(CBENVONLY, visit_callback, mid, g_id, str, cb_info_t, op_data);
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
@@ -639,7 +610,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1comment
if (buf_size) {
if (NULL == (oComment = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Oget_comment: failed to allocate object comment buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Oget_comment: failed to allocate object comment buffer");
if ((status = H5Oget_comment((hid_t)loc_id, oComment, (size_t)buf_size + 1)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -684,7 +655,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1comment_1by_1name
if (buf_size) {
if (NULL == (objComment = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Oget_comment_by_name: failed to allocate buffer for object comment");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Oget_comment_by_name: failed to allocate buffer for object comment");
if ((status = H5Oget_comment_by_name((hid_t)loc_id, objName, objComment, (size_t)buf_size + 1, (hid_t)access_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
diff --git a/java/src/jni/h5pDAPLImp.c b/java/src/jni/h5pDAPLImp.c
index fb39b84..2386df1 100644
--- a/java/src/jni/h5pDAPLImp.c
+++ b/java/src/jni/h5pDAPLImp.c
@@ -151,7 +151,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (pre = (char *) HDmalloc(sizeof(char) * (size_t)prefix_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_efile_prefix: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_efile_prefix: memory allocation failed");
if (H5Pget_efile_prefix((hid_t)dapl_id, (char *)pre, (size_t)prefix_size + 1) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -159,7 +159,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, pre))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_efile_prefix: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_efile_prefix: out of memory - unable to construct string from UTF characters");
}
done:
diff --git a/java/src/jni/h5pDCPLImp.c b/java/src/jni/h5pDCPLImp.c
index 7559c3b..f5bbcb1 100644
--- a/java/src/jni/h5pDCPLImp.c
+++ b/java/src/jni/h5pDCPLImp.c
@@ -109,7 +109,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1chunk
PIN_BYTE_ARRAY(ENVONLY, dim, theArray, &isCopy, "H5Pset_chunk: dim array not pinned");
if (NULL == (da = lp = (hsize_t *) HDmalloc(rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pset_chunk: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pset_chunk: memory allocation failed");
jlp = (jlong *)theArray;
for (i = 0; i < rank; i++) {
@@ -161,7 +161,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1chunk
PIN_LONG_ARRAY(ENVONLY, dims, theArray, &isCopy, "H5Pget_chunk: input dims not pinned");
if (NULL == (da = (hsize_t *) HDmalloc((size_t)max_ndims * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_chunk: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_chunk: memory allocation failed");
if ((status = H5Pget_chunk((hid_t)plist, (int)max_ndims, da)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -595,7 +595,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_filter: cd_values is NULL");
if (NULL == (filter = (char *) HDmalloc(sizeof(char) * (size_t)namelen)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_filter: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter: memory allocation failed");
PIN_INT_ARRAY(ENVONLY, flags, flagsArray, &isCopy, "H5Pget_filter: flags array not pinned");
PIN_LONG_ARRAY(ENVONLY, cd_nelmts, cd_nelmtsArray, &isCopy, "H5Pget_filter: nelmts array not pinned");
@@ -620,7 +620,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, filter))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_filter: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, name, 0, (jobject)str);
@@ -632,7 +632,7 @@ done:
if (cd_nelmtsArray)
UNPIN_LONG_ARRAY(ENVONLY, cd_nelmts, cd_nelmtsArray, (status < 0) ? JNI_ABORT : 0);
if (flagsArray)
- UNPIN_INT_ARRAY(ENVONLY, flags, flagsArray, (status < 0) ? JNI_ABORT : 0)
+ UNPIN_INT_ARRAY(ENVONLY, flags, flagsArray, (status < 0) ? JNI_ABORT : 0);
if (filter)
HDfree(filter);
@@ -671,7 +671,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter2
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_filter2: filter_config is NULL");
if (NULL == (filter = (char *) HDmalloc(sizeof(char) * (size_t)namelen)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_filter2: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter2: memory allocation failed");
PIN_INT_ARRAY(ENVONLY, flags, flagsArray, &isCopy, "H5Pget_filter2: flags array not pinned");
PIN_LONG_ARRAY(ENVONLY, cd_nelmts, cd_nelmtsArray, &isCopy, "H5Pget_filter2: nelmts array not pinned");
@@ -715,7 +715,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter2
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, filter))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_filter2: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter2: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, name, 0, (jobject)str);
@@ -772,7 +772,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_filter_by_id: name is NULL");
if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)bs)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_filter_by_id: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter_by_id: memory allocation failed");
PIN_INT_ARRAY(ENVONLY, flags, flagsArray, &isCopy, "H5Pget_filter_by_id: flags not pinned");
PIN_LONG_ARRAY(ENVONLY, cd_nelmts, cd_nelmtsArray, &isCopy, "H5Pget_filter_by_id: cd_nelms not pinned");
@@ -801,7 +801,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, aName))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_filter_by_id: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter_by_id: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, name, 0, (jobject)str);
@@ -858,7 +858,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id2
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_filter_by_id2: filter_config is NULL");
if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)bs)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_filter_by_id2: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter_by_id2: memory allocation failed");
PIN_INT_ARRAY(ENVONLY, flags, flagsArray, &isCopy, "H5Pget_filter_by_id2: flags not pinned");
PIN_LONG_ARRAY(ENVONLY, cd_nelmts, cd_nelmtsArray, &isCopy, "H5Pget_filter_by_id2: cd_nelms not pinned");
@@ -882,7 +882,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id2
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, aName))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_filter_by_id2: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter_by_id2: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, name, 0, (jobject)str);
@@ -1122,7 +1122,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1external
if (name_size > 0)
if (NULL == (file = (char *) HDmalloc(sizeof(char) * (size_t)name_size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_external: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_external: memory allocation failed");
if ((status = H5Pget_external((hid_t) plist, (unsigned)idx, (size_t)name_size,
file, (off_t *)&o, (hsize_t *)&s)) < 0)
@@ -1140,7 +1140,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1external
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, file))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_external: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_external: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, name, 0, (jobject)str);
@@ -1237,7 +1237,7 @@ done:
*/
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1dsetname
- (JNIEnv *env, jclass clss, jlong dcpl_id, jlong index)
+ (JNIEnv *env, jclass clss, jlong dcpl_id, jlong idx)
{
ssize_t buf_size;
char *dname = NULL;
@@ -1246,19 +1246,19 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1dsetname
UNUSED(clss);
/* get the length of the filename */
- if ((buf_size = H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t)index, NULL, 0)) < 0)
+ if ((buf_size = H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t) idx, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (dname = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_virtual_dsetname: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_dsetname: memory allocation failed");
- if (H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t)index, dname, (size_t)buf_size + 1) < 0)
+ if (H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t) idx, dname, (size_t)buf_size + 1) < 0)
H5_LIBRARY_ERROR(ENVONLY);
dname[buf_size] = '\0';
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, dname))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_virtual_dsetname: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_dsetname: out of memory - unable to construct string from UTF characters");
}
done:
@@ -1275,7 +1275,7 @@ done:
*/
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1filename
- (JNIEnv *env, jclass clss, jlong dcpl_id, jlong index)
+ (JNIEnv *env, jclass clss, jlong dcpl_id, jlong idx)
{
ssize_t buf_size;
char *fname = NULL;
@@ -1284,19 +1284,19 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1filename
UNUSED(clss);
/* get the length of the filename */
- if ((buf_size = H5Pget_virtual_filename((hid_t)dcpl_id, (size_t)index, NULL, 0)) < 0)
+ if ((buf_size = H5Pget_virtual_filename((hid_t)dcpl_id, (size_t) idx, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (fname = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_virtual_filename: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_filename: memory allocation failed");
- if (H5Pget_virtual_filename((hid_t)dcpl_id, (size_t)index, fname, (size_t)buf_size + 1) < 0)
+ if (H5Pget_virtual_filename((hid_t)dcpl_id, (size_t) idx, fname, (size_t)buf_size + 1) < 0)
H5_LIBRARY_ERROR(ENVONLY);
fname[buf_size] = '\0';
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, fname))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_virtual_filename: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_filename: out of memory - unable to construct string from UTF characters");
}
done:
@@ -1313,13 +1313,13 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1srcspace
- (JNIEnv *env, jclass clss, jlong dcpl_id, jlong index)
+ (JNIEnv *env, jclass clss, jlong dcpl_id, jlong idx)
{
hid_t space_id = H5I_INVALID_HID;
UNUSED(clss);
- if ((space_id = H5Pget_virtual_srcspace((hid_t)dcpl_id, (size_t)index)) < 0)
+ if ((space_id = H5Pget_virtual_srcspace((hid_t)dcpl_id, (size_t) idx)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
done:
@@ -1333,13 +1333,13 @@ done:
*/
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1vspace
- (JNIEnv *env, jclass clss, jlong dcpl_id, jlong index)
+ (JNIEnv *env, jclass clss, jlong dcpl_id, jlong idx)
{
hid_t space_id = H5I_INVALID_HID;
UNUSED(clss);
- if ((space_id = H5Pget_virtual_vspace((hid_t)dcpl_id, (size_t)index)) < 0)
+ if ((space_id = H5Pget_virtual_vspace((hid_t)dcpl_id, (size_t) idx)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
done:
@@ -1392,7 +1392,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (pre = (char *) HDmalloc(sizeof(char) * (size_t) prefix_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_virtual_prefix: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_prefix: memory allocation failed");
if (H5Pget_virtual_prefix((hid_t)dapl_id, (char *)pre, (size_t) prefix_size + 1) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1400,7 +1400,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, pre))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_virtual_prefix: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_prefix: out of memory - unable to construct string from UTF characters");
}
done:
diff --git a/java/src/jni/h5pDXPLImp.c b/java/src/jni/h5pDXPLImp.c
index 323fa8c..12e3367 100644
--- a/java/src/jni/h5pDXPLImp.c
+++ b/java/src/jni/h5pDXPLImp.c
@@ -310,7 +310,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1data_1transform
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (express = (char *) HDmalloc(sizeof(char) * (size_t)express_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_data_transform: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_data_transform: memory allocation failed");
if (H5Pget_data_transform((hid_t)plist_id, express, (size_t)express_size + 1) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -318,7 +318,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1data_1transform
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, express))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_data_transform: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_data_transform: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, expression, 0, str);
diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c
index 006707a..dbfbb5a 100644
--- a/java/src/jni/h5pFAPLImp.c
+++ b/java/src/jni/h5pFAPLImp.c
@@ -308,7 +308,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1family
}
if (NULL == (sa = (hsize_t *) HDmalloc((size_t) rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_family: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_family: memory allocation failed");
PIN_LONG_ARRAY(ENVONLY, memb_plist, plistArray, &isCopy, "H5Pget_family: plistArray not pinned");
@@ -395,29 +395,23 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs
if (H5Pget_fapl_hdfs((hid_t)fapl_id, &fa) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- if (NULL != fa.namenode_name) {
- if (NULL == (j_namenode_name = ENVPTR->NewStringUTF(ENVONLY, fa.namenode_name))) {
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create namenode_name string");
- }
+ if (NULL == (j_namenode_name = ENVPTR->NewStringUTF(ENVONLY, fa.namenode_name))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create namenode_name string");
}
args[0].l = j_namenode_name;
args[1].i = (jint)fa.namenode_port;
- if (NULL != fa.user_name) {
- if (NULL == (j_user_name = ENVPTR->NewStringUTF(ENVONLY, fa.user_name))) {
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create user_name string");
- }
+ if (NULL == (j_user_name = ENVPTR->NewStringUTF(ENVONLY, fa.user_name))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create user_name string");
}
args[2].l = j_user_name;
- if (NULL != fa.kerberos_ticket_cache) {
- if (NULL == (j_kerb_cache_path = ENVPTR->NewStringUTF(ENVONLY, fa.kerberos_ticket_cache))) {
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create kerberos_ticket_cache string");
- }
+ if (NULL == (j_kerb_cache_path = ENVPTR->NewStringUTF(ENVONLY, fa.kerberos_ticket_cache))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_hdfs: out of memory - can't create kerberos_ticket_cache string");
}
args[3].l = j_kerb_cache_path;
@@ -425,6 +419,8 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs
CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5FD_hdfs_fapl_t", "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;I)V", args, ret_obj);
#else
+ UNUSED(fapl_id);
+
H5_UNIMPLEMENTED(ENVONLY, "H5Pget_fapl_hdfs: not implemented");
#endif /* H5_HAVE_LIBHDFS */
@@ -532,6 +528,9 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs
if (H5Pset_fapl_hdfs((hid_t)fapl_id, &instance) < 0)
H5_LIBRARY_ERROR(ENVONLY);
#else
+ UNUSED(fapl_id);
+ UNUSED(fapl_config);
+
H5_UNIMPLEMENTED(ENVONLY, "H5Pset_fapl_hdfs: not implemented");
#endif /* H5_HAVE_LIBHDFS */
@@ -646,7 +645,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi
str_len = HDstrlen(utf8);
if (NULL == (member_name[i] = (char *) HDmalloc(str_len + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pset_fapl_multi: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pset_fapl_multi: memory allocation failed");
HDstrncpy(member_name[i], utf8, str_len + 1);
(member_name[i])[str_len] = '\0';
@@ -673,7 +672,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi
if (NULL == (rstring = ENVPTR->NewStringUTF(ENVONLY, member_name[i]))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pset_fapl_multi: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pset_fapl_multi: out of memory - unable to construct string from UTF characters");
}
if (NULL == (o = ENVPTR->GetObjectArrayElement(ENVONLY, memb_name, (jsize) i))) {
@@ -745,7 +744,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1multi
PIN_LONG_ARRAY(ENVONLY, memb_addr, theaddrArray, &isCopy, "H5Pget_fapl_multi: memb_addr not pinned");
if (memb_name)
if (NULL == (mName = (char **) HDcalloc(H5FD_MEM_NTYPES, sizeof(*mName))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_multi: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_multi: memory allocation failed");
if ((status = H5Pget_fapl_multi((hid_t)tid, (H5FD_mem_t *)themapArray, (hid_t *)thefaplArray,
mName, (haddr_t *)theaddrArray, (hbool_t *)&relax)) < 0)
@@ -756,7 +755,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1multi
if (mName[i]) {
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, mName[i]))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_multi: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_multi: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, memb_name, (jsize) i, (jobject)str);
@@ -815,32 +814,28 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1ros3
if (H5Pget_fapl_ros3((hid_t)fapl_id, &fa) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- if (NULL != fa.aws_region) {
- if (NULL == (j_aws = ENVPTR->NewStringUTF(ENVONLY, fa.aws_region))) {
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create aws_region string");
- }
+ if (NULL == (j_aws = ENVPTR->NewStringUTF(ENVONLY, fa.aws_region))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create aws_region string");
}
args[0].l = j_aws;
- if (NULL != fa.secret_id) {
- if (NULL == (j_id = ENVPTR->NewStringUTF(ENVONLY, fa.secret_id))) {
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create secret_id string");
- }
+ if (NULL == (j_id = ENVPTR->NewStringUTF(ENVONLY, fa.secret_id))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create secret_id string");
}
args[1].l = j_id;
- if (NULL != fa.secret_key) {
- if (NULL == (j_key = ENVPTR->NewStringUTF(ENVONLY, fa.secret_key))) {
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create secret_key string");
- }
+ if (NULL == (j_key = ENVPTR->NewStringUTF(ENVONLY, fa.secret_key))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_ros3: out of memory - can't create secret_key string");
}
args[2].l = j_key;
CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5FD_ros3_fapl_t", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", args, ret_obj);
#else
+ UNUSED(fapl_id);
+
H5_UNIMPLEMENTED(ENVONLY, "H5Pget_fapl_ros3: not implemented");
#endif /* H5_HAVE_ROS3_VFD */
@@ -939,6 +934,9 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3
if (H5Pset_fapl_ros3((hid_t)fapl_id, &instance) < 0)
H5_LIBRARY_ERROR(ENVONLY);
#else
+ UNUSED(fapl_id);
+ UNUSED(fapl_config);
+
H5_UNIMPLEMENTED(ENVONLY, "H5Pset_fapl_ros3: not implemented");
#endif /* H5_HAVE_ROS3_VFD */
@@ -1379,6 +1377,78 @@ done:
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pset_file_locking
+ * Signature: (JZZ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1file_1locking
+ (JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking, jboolean ignore_when_disabled)
+{
+ hbool_t use_file_locking_val = TRUE;
+ hbool_t ignore_when_disabled_val = TRUE;
+
+ UNUSED(clss);
+
+ use_file_locking_val = (use_file_locking == JNI_TRUE) ? TRUE : FALSE;
+ ignore_when_disabled_val = (ignore_when_disabled == JNI_TRUE) ? TRUE : FALSE;
+
+ if (H5Pset_file_locking((hid_t)fapl_id, use_file_locking_val, ignore_when_disabled_val) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_use_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+ hbool_t use_file_locking_val = TRUE;
+ hbool_t unused = TRUE;
+ jboolean bval = JNI_FALSE;
+
+ UNUSED(clss);
+
+ if (H5Pget_file_locking((hid_t)fapl_id, &use_file_locking_val, &unused) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (use_file_locking_val == TRUE) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_ignore_disabled_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking
+ (JNIEnv *env, jclass clss, jlong fapl_id)
+{
+ hbool_t ignore_when_disabled_val = TRUE;
+ hbool_t unused = TRUE;
+ jboolean bval = JNI_FALSE;
+
+ UNUSED(clss);
+
+ if (H5Pget_file_locking((hid_t)fapl_id, &unused, &ignore_when_disabled_val) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (ignore_when_disabled_val == TRUE) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ return bval;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking */
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_metadata_read_attempts
* Signature: (JJ)V
*/
@@ -1675,11 +1745,9 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1config
args[2].z = cacheinfo.open_trace_file;
args[3].z = cacheinfo.close_trace_file;
- if (NULL != cacheinfo.trace_file_name) {
- if (NULL == (j_str = ENVPTR->NewStringUTF(ENVONLY, cacheinfo.trace_file_name))) {
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_mdc_config: out of memory - unable to construct string from UTF characters");
- }
+ if (NULL == (j_str = ENVPTR->NewStringUTF(ENVONLY, cacheinfo.trace_file_name))) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_mdc_config: out of memory - unable to construct string from UTF characters");
}
args[4].l = j_str;
@@ -1792,7 +1860,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options
location_size++; /* add extra space for the null terminator */
if (NULL == (lname = (char *) HDmalloc(sizeof(char) * location_size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_mdc_log_options: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_mdc_log_options: memory allocation failed");
if ((status = H5Pget_mdc_log_options((hid_t)fapl_id, &is_enabled, lname, &location_size, &start_on_access)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1800,7 +1868,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, lname))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_mdc_log_options: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_mdc_log_options: out of memory - unable to construct string from UTF characters");
}
mdc_log_options_ptr[0] = (jboolean)is_enabled;
diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h
index 9b353e6..b9b4556 100644
--- a/java/src/jni/h5pFAPLImp.h
+++ b/java/src/jni/h5pFAPLImp.h
@@ -392,6 +392,33 @@ Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5Pset_file_locking
+ * Signature: (JZZ)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1file_1locking
+(JNIEnv *env, jclass clss, jlong fapl_id, jboolean use_file_locking, jboolean ignore_when_disabled);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_use_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1use_1file_1locking
+(JNIEnv *env, jclass clss, jlong fapl_id);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_ignore_disabled_file_locking
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1ignore_1disabled_1file_1locking
+(JNIEnv *env, jclass clss, jlong fapl_id);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5Pset_metadata_read_attempts
* Signature: (JJ)V
*/
diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c
index cc7c264..304623b 100644
--- a/java/src/jni/h5pFCPLImp.c
+++ b/java/src/jni/h5pFCPLImp.c
@@ -40,13 +40,20 @@ JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Pget_1version
(JNIEnv *env, jclass clss, jlong plist, jintArray version_info)
{
+#ifndef H5_NO_DEPRECATED_SYMBOLS
jboolean isCopy;
jsize arrLen;
jint *theArray = NULL;
+#endif
herr_t status = FAIL;
UNUSED(clss);
+#ifdef H5_NO_DEPRECATED_SYMBOLS
+ UNUSED(plist);
+ UNUSED(version_info);
+ H5_UNIMPLEMENTED(ENVONLY, "H5Pget_version: not implemented");
+#else
if (NULL == version_info)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_version: version_info input array is NULL");
@@ -62,10 +69,13 @@ Java_hdf_hdf5lib_H5_H5Pget_1version
if ((status = H5Pget_version((hid_t)plist, (unsigned *)&(theArray[0]),
(unsigned *)&(theArray[1]), (unsigned *)&(theArray[2]), (unsigned *)&(theArray[3]))) < 0)
H5_LIBRARY_ERROR(ENVONLY);
+#endif
done:
+#ifndef H5_NO_DEPRECATED_SYMBOLS
if (theArray)
UNPIN_INT_ARRAY(ENVONLY, version_info, theArray, (status < 0) ? JNI_ABORT : 0);
+#endif
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1version */
diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c
index 726e08c..9e5b004 100644
--- a/java/src/jni/h5pImp.c
+++ b/java/src/jni/h5pImp.c
@@ -503,7 +503,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1class_1name
if (NULL == (j_str = ENVPTR->NewStringUTF(ENVONLY, c_str))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_class_name: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_class_name: out of memory - unable to construct string from UTF characters");
}
done:
diff --git a/java/src/jni/h5pLAPLImp.c b/java/src/jni/h5pLAPLImp.c
index f2cb80a..754bece 100644
--- a/java/src/jni/h5pLAPLImp.c
+++ b/java/src/jni/h5pLAPLImp.c
@@ -134,7 +134,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1elink_1prefix
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (pre = (char *) HDmalloc(sizeof(char) * (size_t) prefix_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_elink_prefix: memory allocation failed");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_elink_prefix: memory allocation failed");
if (H5Pget_elink_prefix((hid_t)lapl_id, (char *)pre, (size_t) prefix_size + 1) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -142,7 +142,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1elink_1prefix
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, pre))) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_elink_prefix: out of memory - unable to construct string from UTF characters");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_elink_prefix: out of memory - unable to construct string from UTF characters");
}
ENVPTR->SetObjectArrayElement(ENVONLY, prefix, 0, str);
diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c
index 90d78fe..ce42842 100644
--- a/java/src/jni/h5plImp.c
+++ b/java/src/jni/h5plImp.c
@@ -129,7 +129,7 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5PLreplace
- (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index)
+ (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint idx)
{
const char *newPath = NULL;
herr_t retVal = FAIL;
@@ -139,12 +139,12 @@ Java_hdf_hdf5lib_H5_H5PLreplace
if (NULL == plugin_path)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5PLreplace: new path is NULL");
- if (index < 0)
+ if (idx < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5PLreplace: index < 0");
PIN_JAVA_STRING(ENVONLY, plugin_path, newPath, NULL, "H5PLreplace: new path not pinned");
- if ((retVal = H5PLreplace(newPath, (unsigned) index)) < 0)
+ if ((retVal = H5PLreplace(newPath, (unsigned) idx)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
done:
@@ -159,7 +159,7 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5PLinsert
- (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index)
+ (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint idx)
{
const char *newPath = NULL;
herr_t retVal = FAIL;
@@ -169,12 +169,12 @@ Java_hdf_hdf5lib_H5_H5PLinsert
if (NULL == plugin_path)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5PLinsert: new path is NULL");
- if (index < 0)
+ if (idx < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5PLinsert: index < 0");
PIN_JAVA_STRING(ENVONLY, plugin_path, newPath, NULL, "H5PLinsert: new path not pinned");
- if ((retVal = H5PLinsert(newPath, (unsigned) index)) < 0)
+ if ((retVal = H5PLinsert(newPath, (unsigned) idx)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
done:
@@ -189,14 +189,14 @@ done:
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5PLremove
- (JNIEnv *env, jclass clss, jint index)
+ (JNIEnv *env, jclass clss, jint idx)
{
UNUSED(clss);
- if (index < 0)
+ if (idx < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5PLremove: index < 0");
- if (H5PLremove((unsigned) index) < 0)
+ if (H5PLremove((unsigned) idx) < 0)
H5_LIBRARY_ERROR(ENVONLY);
done:
@@ -210,7 +210,7 @@ done:
*/
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5PLget
- (JNIEnv *env, jclass clss, jint index)
+ (JNIEnv *env, jclass clss, jint idx)
{
jstring str = NULL;
ssize_t buf_size;
@@ -218,17 +218,17 @@ Java_hdf_hdf5lib_H5_H5PLget
UNUSED(clss);
- if (index < 0)
+ if (idx < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5PLget: index < 0");
/* Get the length of the name */
- if ((buf_size = H5PLget((unsigned) index, NULL, 0)) < 0)
+ if ((buf_size = H5PLget((unsigned) idx, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5PLget: failed to allocate plugin name buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5PLget: failed to allocate plugin name buffer");
- if ((H5PLget((unsigned) index, aName, (size_t)buf_size + 1)) < 0)
+ if ((H5PLget((unsigned) idx, aName, (size_t)buf_size + 1)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
aName[buf_size] = '\0';
diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c
index 1a77fd3..e76fccb 100644
--- a/java/src/jni/h5rImp.c
+++ b/java/src/jni/h5rImp.c
@@ -59,9 +59,9 @@ Java_hdf_hdf5lib_H5_H5Rcreate
}
if ((H5R_OBJECT == ref_type) && (refBufLen != H5R_OBJ_REF_BUF_SIZE))
- H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rcreate: reference input array length != H5R_OBJ_REF_BUF_SIZE")
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rcreate: reference input array length != H5R_OBJ_REF_BUF_SIZE");
else if ((H5R_DATASET_REGION == ref_type) && (refBufLen != H5R_DSET_REG_REF_BUF_SIZE))
- H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rcreate: region reference input array length != H5R_DSET_REG_REF_BUF_SIZE")
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rcreate: region reference input array length != H5R_DSET_REG_REF_BUF_SIZE");
else if ((H5R_OBJECT != ref_type) && (H5R_DATASET_REGION != ref_type))
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rcreate: unknown reference type");
@@ -106,9 +106,9 @@ Java_hdf_hdf5lib_H5__1H5Rdereference
}
if ((H5R_OBJECT == ref_type) && (refBufLen != H5R_OBJ_REF_BUF_SIZE))
- H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rdereference: reference input array length != H5R_OBJ_REF_BUF_SIZE")
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rdereference: reference input array length != H5R_OBJ_REF_BUF_SIZE");
else if ((H5R_DATASET_REGION == ref_type) && (refBufLen != H5R_DSET_REG_REF_BUF_SIZE))
- H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rdereference: region reference input array length != H5R_DSET_REG_REF_BUF_SIZE")
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rdereference: region reference input array length != H5R_DSET_REG_REF_BUF_SIZE");
else if ((H5R_OBJECT != ref_type) && (H5R_DATASET_REGION != ref_type))
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rdereference: unknown reference type");
@@ -268,16 +268,16 @@ Java_hdf_hdf5lib_H5_H5Rget_1name
}
if ((H5R_OBJECT == ref_type) && (refBufLen != H5R_OBJ_REF_BUF_SIZE))
- H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rget_name: reference input array length != H5R_OBJ_REF_BUF_SIZE")
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rget_name: reference input array length != H5R_OBJ_REF_BUF_SIZE");
else if ((H5R_DATASET_REGION == ref_type) && (refBufLen != H5R_DSET_REG_REF_BUF_SIZE))
- H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rget_name: region reference input array length != H5R_DSET_REG_REF_BUF_SIZE")
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rget_name: region reference input array length != H5R_DSET_REG_REF_BUF_SIZE");
else if ((H5R_OBJECT != ref_type) && (H5R_DATASET_REGION != ref_type))
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rget_name: unknown reference type");
PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_name: reference buffer not pinned");
- if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)size + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Rget_name: failed to allocate referenced object name buffer");
+ if (NULL == (aName = HDmalloc(sizeof(char) * (size_t)size + 1)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_name: failed to allocate referenced object name buffer");
if ((ret_val = (jlong)H5Rget_name((hid_t)loc_id, (H5R_type_t)ref_type, refBuf, aName, (size_t)size + 1)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c
index 3c675b8..4dfa225 100644
--- a/java/src/jni/h5sImp.c
+++ b/java/src/jni/h5sImp.c
@@ -98,7 +98,7 @@ Java_hdf_hdf5lib_H5__1H5Screate_1simple
PIN_LONG_ARRAY(ENVONLY, dims, dimsP, &isCopy, "H5Screate_simple: dims not pinned");
if (NULL == (sa = lp = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Screate_simple: failed to allocate dims buffer")
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Screate_simple: failed to allocate dims buffer");
jlp = (jlong *) dimsP;
for (i = 0; i < rank; i++) {
@@ -115,7 +115,7 @@ Java_hdf_hdf5lib_H5__1H5Screate_1simple
PIN_LONG_ARRAY(ENVONLY, maxdims, maxdimsP, &isCopy, "H5Screate_simple: maxdims not pinned");
if (NULL == (msa = lp = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Screate_simple: failed to allocate maxdims buffer")
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Screate_simple: failed to allocate maxdims buffer");
jlp = (jlong *) maxdimsP;
for (i = 0; i < mrank; i++) {
@@ -162,9 +162,10 @@ done:
} /* end Java_hdf_hdf5lib_H5__1H5Scopy */
#ifdef notdef
-// 10/28/99 -- added code to copy the array -- this is not used,
-// but serves as a reminder in case we try to implement this in
-// the future....
+/* 10/28/99 -- added code to copy the array -- this is not used,
+ * but serves as a reminder in case we try to implement this in
+ * the future....
+ */
/*
* Note: the argument coord is actually long coord[][], which has been
* flattened by the caller.
@@ -194,7 +195,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1elements
PIN_LONG_ARRAY(ENVONLY, coords, P, &isCopy, "H5Sselect_elements: coords not pinned");
if (NULL == (sa = (hssize_t *) HDmalloc( (size_t)num_elemn * 2 * sizeof(hssize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sselect_elements: failed to allocate coordinate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_elements: failed to allocate coordinate buffer");
for (i = 0; i < (num_elemn * 2); i++) {
sa[i] = P[i];
@@ -247,7 +248,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1elements
nlongs = (int)((size_t)size / sizeof(jlong));
if (NULL == (lp = (hsize_t *) HDmalloc((size_t)nlongs * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sselect_elements: failed to allocate coordinate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_elements: failed to allocate coordinate buffer");
jlp = (jlong *) P;
llp = lp;
@@ -444,7 +445,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1simple_1extent_1dims
}
if (NULL == (sa = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_simple_extent_dims: failed to allocate dimension buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_simple_extent_dims: failed to allocate dimension buffer");
}
if (NULL == maxdims) {
@@ -462,10 +463,10 @@ Java_hdf_hdf5lib_H5_H5Sget_1simple_1extent_1dims
if (rank < 0)
rank = mrank;
else if (mrank != rank)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_simple_extent_dims: maxdims rank not same as dims");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sget_simple_extent_dims: maxdims rank not same as dims");
if (NULL == (msa = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_simple_extent_dims: failed to allocate maximum dimension buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_simple_extent_dims: failed to allocate maximum dimension buffer");
}
if ((status = H5Sget_simple_extent_dims(space_id, (hsize_t *)sa, (hsize_t *)msa)) < 0)
@@ -564,7 +565,7 @@ Java_hdf_hdf5lib_H5_H5Sset_1extent_1simple
PIN_LONG_ARRAY(ENVONLY, dims, dimsP, &isCopy, "H5Sset_extent_simple: dims not pinned");
if (NULL == (sa = lp = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sset_extent_simple: failed to allocate dimension buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sset_extent_simple: failed to allocate dimension buffer");
jlp = (jlong *) dimsP;
for (i = 0; i < rank; i++) {
@@ -581,7 +582,7 @@ Java_hdf_hdf5lib_H5_H5Sset_1extent_1simple
PIN_LONG_ARRAY(ENVONLY, maxdims, maxdimsP, &isCopy, "H5Sset_extent_simple: maxdims not pinned");
if (NULL == (msa = lp = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sset_extent_simple: failed to allocate maximum dimension buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sset_extent_simple: failed to allocate maximum dimension buffer");
jlp = (jlong *) maxdimsP;
for (i = 0; i < rank; i++) {
@@ -660,7 +661,7 @@ Java_hdf_hdf5lib_H5_H5Soffset_1simple
rank = (size_t) i / sizeof(jlong);
if (NULL == (sa = lp = (hssize_t *) HDmalloc((size_t)rank * sizeof(hssize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Soffset_simple: failed to allocate offset buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Soffset_simple: failed to allocate offset buffer");
jlp = (jlong *) P;
for (i = 0; (size_t) i < rank; i++) {
@@ -788,7 +789,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab
PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sselect_hyperslab: start not pinned");
if (NULL == (strt = lp = (hsize_t *) HDmalloc((size_t)start_rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate start buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate start buffer");
jlp = (jlong *) startP;
for (i = 0; i < start_rank; i++) {
@@ -800,7 +801,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab
PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Sselect_hyperslab: count not pinned");
if (NULL == (cnt = lp = (hsize_t *) HDmalloc((size_t)count_rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate count buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate count buffer");
jlp = (jlong *) countP;
for (i = 0; i < count_rank; i++) {
@@ -825,7 +826,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab
PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Sselect_hyperslab: stride not pinned");
if (NULL == (strd = lp = (hsize_t *) HDmalloc((size_t)stride_rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate stride buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate stride buffer");
jlp = (jlong *) strideP;
for (i = 0; i < stride_rank; i++) {
@@ -851,7 +852,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab
PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Sselect_hyperslab: block not pinned");
if (NULL == (blk = lp = (hsize_t *) HDmalloc((size_t)block_rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate block buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate block buffer");
jlp = (jlong *) blockP;
for (i = 0; i < block_rank; i++) {
@@ -988,7 +989,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1hyper_1blocklist
buf_size = (size_t) numblocks * (size_t) 2 * (size_t) rank * sizeof(hsize_t);
if (NULL == (ba = (hsize_t *) HDmalloc(buf_size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_select_hyper_blocklist: failed to allocate block list buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_select_hyper_blocklist: failed to allocate block list buffer");
if ((status = H5Sget_select_hyper_blocklist((hid_t)spaceid, (hsize_t) startblock, (hsize_t) numblocks, (hsize_t *)ba)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1044,7 +1045,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1elem_1pointlist
PIN_LONG_ARRAY(ENVONLY, buf, bufP, &isCopy, "H5Sget_select_elem_pointlist: buffer not pinned");
if (NULL == (ba = (hsize_t *) HDmalloc(((size_t)numpoints * (size_t)rank) * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_select_elem_pointlist: failed to allocate point list buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_select_elem_pointlist: failed to allocate point list buffer");
if ((status = H5Sget_select_elem_pointlist((hid_t)spaceid, (hsize_t)startpoint, (hsize_t)numpoints, (hsize_t *)ba)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1094,12 +1095,12 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1bounds
}
if (NULL == (strt = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_select_bounds: failed to allocate start buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_select_bounds: failed to allocate start buffer");
PIN_LONG_ARRAY(ENVONLY, end, endP, &isCopy, "H5Sget_select_bounds: end not pinned");
if (NULL == (en = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_select_bounds: failed to allocate end buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_select_bounds: failed to allocate end buffer");
if ((status = H5Sget_select_bounds((hid_t) spaceid, (hsize_t *) strt, (hsize_t *) en)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1148,7 +1149,7 @@ Java_hdf_hdf5lib_H5_H5Sencode
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sencode: buf_size = 0");
if (NULL == (bufPtr = (unsigned char *) HDcalloc((size_t) 1, buf_size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sencode: failed to allocate encoding buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sencode: failed to allocate encoding buffer");
if ((status = H5Sencode((hid_t) obj_id, bufPtr, &buf_size)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1258,7 +1259,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab
PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sget_regular_hyperslab: start not pinned");
if (NULL == (strt = (hsize_t *) HDmalloc((size_t)start_rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate start buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate start buffer");
}
if (NULL == stride) {
@@ -1277,7 +1278,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab
PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Sget_regular_hyperslab: stride not pinned");
if (NULL == (strd = (hsize_t *) HDmalloc((size_t)stride_rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate stride buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate stride buffer");
}
if (NULL == count) {
@@ -1296,7 +1297,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab
PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Sget_regular_hyperslab: count not pinned");
if (NULL == (cnt = (hsize_t *) HDmalloc((size_t)count_rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate count buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate count buffer");
}
if (NULL == block) {
@@ -1315,7 +1316,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab
PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Sget_regular_hyperslab: block not pinned");
if (NULL == (blk = (hsize_t *) HDmalloc((size_t)block_rank * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate block buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate block buffer");
}
if ((status = H5Sget_regular_hyperslab(space_id, (hsize_t *) strt, (hsize_t *) strd, (hsize_t *) cnt, (hsize_t *) blk)) < 0)
diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h
index 141e504..cea2ebf 100644
--- a/java/src/jni/h5sImp.h
+++ b/java/src/jni/h5sImp.h
@@ -49,9 +49,10 @@ Java_hdf_hdf5lib_H5__1H5Scopy
(JNIEnv *, jclass, jlong);
#ifdef notdef
-// 10/28/99 -- added code to copy the array -- this is not used,
-// but serves as a reminder in case we try to implement this in
-// the future....
+/* 10/28/99 -- added code to copy the array -- this is not used,
+ * but serves as a reminder in case we try to implement this in
+ * the future....
+ */
/*
* Note: the argument coord is actually long coord[][], which has been
* flattened by the caller.
diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c
index 460f12e..5ef0c3d 100644
--- a/java/src/jni/h5tImp.c
+++ b/java/src/jni/h5tImp.c
@@ -1210,7 +1210,7 @@ Java_hdf_hdf5lib_H5_H5Tenum_1nameof_1int
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Tenum_nameof_int: name size < 0");
if (NULL == (nameP = (char *) HDmalloc(sizeof(char) * (size_t)size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Tenum_nameof_int: failed to allocate name buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tenum_nameof_int: failed to allocate name buffer");
PIN_INT_ARRAY(ENVONLY, value, intP, &isCopy, "H5Tenum_nameof_int: value not pinned");
@@ -1256,7 +1256,7 @@ Java_hdf_hdf5lib_H5_H5Tenum_1nameof
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Tenum_nameof: value is NULL");
if (NULL == (nameP = (char *) HDmalloc(sizeof(char) * (size_t)size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Tenum_nameof: failed to allocate name buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tenum_nameof: failed to allocate name buffer");
PIN_BYTE_ARRAY(ENVONLY, value, byteP, &isCopy, "H5Tenum_nameof: value not pinned");
@@ -1456,7 +1456,7 @@ Java_hdf_hdf5lib_H5_H5Tget_1array_1dims
}
if (NULL == (cdims = (hsize_t *) HDmalloc((size_t)dlen * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Tget_array_dims: failed to allocate dimension buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tget_array_dims: failed to allocate dimension buffer");
if ((ndims = H5Tget_array_dims2((hid_t)type_id, cdims)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1597,10 +1597,10 @@ Java_hdf_hdf5lib_H5__1H5Tarray_1create2
}
if (dlen != rank)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Tarray_create: dimension array length != array rank");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Tarray_create: dimension array length != array rank");
if (NULL == (cdims = (hsize_t *) HDmalloc((size_t)dlen * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Tarray_create: failed to allocate dimension buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tarray_create: failed to allocate dimension buffer");
for (i = 0; i < (size_t) dlen; i++) {
cdims[i] = (hsize_t)dimsP[i];
@@ -1647,7 +1647,7 @@ Java_hdf_hdf5lib_H5_H5Tget_1array_1dims2
}
if (NULL == (cdims = (hsize_t *) HDmalloc((size_t)dlen * sizeof(hsize_t))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Tarray_get_dims2: failed to allocate dimension buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tarray_get_dims2: failed to allocate dimension buffer");
if ((ndims = H5Tget_array_dims2((hid_t)type_id, (hsize_t*)cdims)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index af83caa..e8bfab2 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -71,6 +71,12 @@ static int render_bin_output_region_data_points(FILE *stream, hid_t region_s
static int render_bin_output_region_points(FILE *stream, hid_t region_space,
hid_t region_id, hid_t container);
+/* Strings for output */
+#define H5_TOOLS_GROUP "GROUP"
+#define H5_TOOLS_DATASET "DATASET"
+#define H5_TOOLS_DATATYPE "DATATYPE"
+#define H5_TOOLS_ATTRIBUTE "ATTRIBUTE"
+
/** frees memory held by array of strings */
void
h5str_array_free
@@ -217,7 +223,7 @@ h5str_convert
switch (typeSize) {
case sizeof(float):
{
- float tmp_float = 0.0;
+ float tmp_float = 0.0f;
sscanf(token, "%f", &tmp_float);
HDmemcpy(cptr, &tmp_float, sizeof(float));
@@ -509,7 +515,7 @@ h5str_convert
total_elmts *= dims[i];
if (NULL == (cptr = (char *) HDcalloc((size_t)total_elmts, baseTypeSize)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_convert: failed to allocate array buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_convert: failed to allocate array buffer");
for (i = 0; i < total_elmts; i++) {
if (!(h5str_convert(ENVONLY, &this_str, container, mtid, out_buf, i * baseTypeSize))) {
@@ -550,7 +556,7 @@ h5str_convert
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (vl_buf->p = HDmalloc(baseTypeSize)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_convert: failed to allocate vlen buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_convert: failed to allocate vlen buffer");
vl_buf->len = 1;
/* Skip whitespace and vlen indicators */
@@ -564,7 +570,7 @@ h5str_convert
char *tmp_realloc;
if (NULL == (tmp_realloc = (char *) HDrealloc(vl_buf->p, vl_buf->len * 2 * baseTypeSize)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_convert: failed to reallocate vlen buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_convert: failed to reallocate vlen buffer");
vl_buf->len *= 2;
vl_buf->p = tmp_realloc;
}
@@ -640,6 +646,7 @@ h5str_sprintf
static char fmt_llong[8], fmt_ullong[8];
H5T_class_t tclass = H5T_NO_CLASS;
size_t typeSize = 0;
+ H5T_sign_t nsign = H5T_SGN_ERROR;
hid_t mtid = H5I_INVALID_HID;
char *cptr = (char *) in_buf;
char *this_str = NULL;
@@ -655,13 +662,15 @@ h5str_sprintf
H5_LIBRARY_ERROR(ENVONLY);
if (!(typeSize = H5Tget_size(tid)))
H5_LIBRARY_ERROR(ENVONLY);
+ if (!(nsign = H5Tget_sign(tid)))
+ H5_LIBRARY_ERROR(ENVONLY);
/* Build default formats for long long types */
if (!fmt_llong[0]) {
- if (HDsprintf(fmt_llong, "%%%sd", H5_PRINTF_LL_WIDTH) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: sprintf failure");
- if (HDsprintf(fmt_ullong, "%%%su", H5_PRINTF_LL_WIDTH) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: sprintf failure");
+ if (HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH) < 0)
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsnprintf failure");
+ if (HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH) < 0)
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsnprintf failure");
} /* end if */
switch (tclass) {
@@ -670,12 +679,12 @@ h5str_sprintf
switch (typeSize) {
case sizeof(float):
{
- float tmp_float = 0.0;
+ float tmp_float = 0.0f;
HDmemcpy(&tmp_float, cptr, sizeof(float));
if (NULL == (this_str = (char *) HDmalloc(25)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, "%g", tmp_float) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -690,7 +699,7 @@ h5str_sprintf
HDmemcpy(&tmp_double, cptr, sizeof(double));
if (NULL == (this_str = (char *) HDmalloc(25)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, "%g", tmp_double) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -705,7 +714,7 @@ h5str_sprintf
HDmemcpy(&tmp_ldouble, cptr, sizeof(long double));
if (NULL == (this_str = (char *) HDmalloc(27)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, "%Lf", tmp_ldouble) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -733,7 +742,10 @@ h5str_sprintf
H5_LIBRARY_ERROR(ENVONLY);
if (is_variable) {
- if (NULL != (tmp_str = *(char **) in_buf))
+ /* cp_vp is the pointer into the struct where a `char*' is stored. So we have
+ * to dereference the pointer to get the `char*' to pass to HDstrlen(). */
+ tmp_str = *(char **)in_buf;
+ if (NULL != tmp_str)
typeSize = HDstrlen(tmp_str);
}
else {
@@ -743,14 +755,13 @@ h5str_sprintf
/* Check for NULL pointer for string */
if (!tmp_str) {
if (NULL == (this_str = (char *) HDmalloc(5)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
-
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
HDstrncpy(this_str, "NULL", 5);
}
else {
if (typeSize > 0) {
if (NULL == (this_str = (char *) HDmalloc(typeSize + 1)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
HDstrncpy(this_str, tmp_str, typeSize);
this_str[typeSize] = '\0';
@@ -762,7 +773,6 @@ h5str_sprintf
case H5T_INTEGER:
{
- H5T_sign_t nsign = H5T_SGN_ERROR;
if (H5T_SGN_ERROR == (nsign = H5Tget_sign(tid)))
H5_LIBRARY_ERROR(ENVONLY);
@@ -777,16 +787,16 @@ h5str_sprintf
HDmemcpy(&tmp_uchar, cptr, sizeof(unsigned char));
if (NULL == (this_str = (char *) HDmalloc(7)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%u", tmp_uchar) < 0)
+ if (HDsprintf(this_str, "%hhu", tmp_uchar) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
}
else {
HDmemcpy(&tmp_char, cptr, sizeof(char));
if (NULL == (this_str = (char *) HDmalloc(7)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, "%hhd", tmp_char) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -804,18 +814,18 @@ h5str_sprintf
HDmemcpy(&tmp_ushort, cptr, sizeof(unsigned short));
if (NULL == (this_str = (char *) HDmalloc(9)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%u", tmp_ushort) < 0)
+ if (HDsprintf(this_str, "%hu", tmp_ushort) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
}
else {
HDmemcpy(&tmp_short, cptr, sizeof(short));
if (NULL == (this_str = (char *) HDmalloc(9)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%d", tmp_short) < 0)
+ if (HDsprintf(this_str, "%hd", tmp_short) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
}
@@ -831,7 +841,7 @@ h5str_sprintf
HDmemcpy(&tmp_uint, cptr, sizeof(unsigned int));
if (NULL == (this_str = (char *) HDmalloc(14)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, "%u", tmp_uint) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -840,7 +850,7 @@ h5str_sprintf
HDmemcpy(&tmp_int, cptr, sizeof(int));
if (NULL == (this_str = (char *) HDmalloc(14)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, "%d", tmp_int) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -858,7 +868,7 @@ h5str_sprintf
HDmemcpy(&tmp_ulong, cptr, sizeof(unsigned long));
if (NULL == (this_str = (char *) HDmalloc(23)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, "%lu", tmp_ulong) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -867,7 +877,7 @@ h5str_sprintf
HDmemcpy(&tmp_long, cptr, sizeof(long));
if (NULL == (this_str = (char *) HDmalloc(23)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, "%ld", tmp_long) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -886,7 +896,7 @@ h5str_sprintf
HDmemcpy(&tmp_ullong, cptr, sizeof(unsigned long long));
if (NULL == (this_str = (char *) HDmalloc(25)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, fmt_ullong, tmp_ullong) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -895,7 +905,7 @@ h5str_sprintf
HDmemcpy(&tmp_llong, cptr, sizeof(long long));
if (NULL == (this_str = (char *) HDmalloc(25)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (HDsprintf(this_str, fmt_llong, tmp_llong) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
@@ -960,7 +970,7 @@ h5str_sprintf
size_t i;
if (NULL == (this_str = (char *) HDmalloc(4 * (typeSize + 1))))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (1 == typeSize) {
if (HDsprintf(this_str, "%#02x", ucptr[0]) < 0)
@@ -1173,7 +1183,7 @@ h5str_sprintf
/* All other types get printed as hexadecimal */
if (NULL == (this_str = (char *) HDmalloc(4 * (typeSize + 1))))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
if (1 == typeSize) {
if (HDsprintf(this_str, "%#02x", ucptr[0]) < 0)
@@ -1246,7 +1256,7 @@ h5str_print_region_data_blocks
/* Allocate space for the dimension array */
if (NULL == (dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * (size_t)ndims)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_print_region_data_blocks: failed to allocate dimension array buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_print_region_data_blocks: failed to allocate dimension array buffer");
/* Find the dimensions of each data space from the block coordinates */
for (jndx = 0, numelem = 1; jndx < (size_t) ndims; jndx++) {
@@ -1262,15 +1272,15 @@ h5str_print_region_data_blocks
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (region_buf = HDmalloc(type_size * (size_t)numelem)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_print_region_data_blocks: failed to allocate region buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_print_region_data_blocks: failed to allocate region buffer");
/* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */
/* 1 2 n 1 2 n */
if (NULL == (start = (hsize_t *) HDmalloc(sizeof(hsize_t) * (size_t)ndims)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_print_region_data_blocks: failed to allocate hyperslab start buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_print_region_data_blocks: failed to allocate hyperslab start buffer");
if (NULL == (count = (hsize_t *) HDmalloc(sizeof(hsize_t) * (size_t)ndims)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_print_region_data_blocks: failed to allocate hyperslab count buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_print_region_data_blocks: failed to allocate hyperslab count buffer");
for (blkndx = 0; blkndx < (hsize_t) nblocks; blkndx++) {
for (indx = 0; indx < (unsigned) ndims; indx++) {
@@ -1345,7 +1355,7 @@ h5str_dump_region_blocks_data
alloc_size = (hsize_t)nblocks * (hsize_t)ndims * 2 * (hsize_t)sizeof(ptdata[0]);
if (alloc_size == (hsize_t)((size_t) alloc_size)) {
if (NULL == (ptdata = (hsize_t *) HDmalloc((size_t) alloc_size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_blocks_data: failed to allocate region block buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_region_blocks_data: failed to allocate region block buffer");
if (H5Sget_select_hyper_blocklist(region, (hsize_t) 0, (hsize_t) nblocks, ptdata) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1405,7 +1415,7 @@ h5str_dump_region_blocks
int i;
if (NULL == (ptdata = (hsize_t *) HDmalloc((size_t) alloc_size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_blocks: failed to allocate region block buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_region_blocks: failed to allocate region block buffer");
if (H5Sget_select_hyper_blocklist(region, (hsize_t) 0, (hsize_t) nblocks, ptdata) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1490,7 +1500,7 @@ h5str_print_region_data_points
/* Allocate space for the dimension array */
if (NULL == (dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * (size_t)ndims)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_print_region_data_points: failed to allocate dimension array buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_print_region_data_points: failed to allocate dimension array buffer");
dims1[0] = (hsize_t)npoints;
@@ -1502,7 +1512,7 @@ h5str_print_region_data_points
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (region_buf = HDmalloc(type_size * (size_t)npoints)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_print_region_data_points: failed to allocate region buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_print_region_data_points: failed to allocate region buffer");
if (H5Dread(region_id, type_id, mem_space, region_space, H5P_DEFAULT, region_buf) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1562,7 +1572,7 @@ h5str_dump_region_points_data
alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
if (alloc_size == (hsize_t)((size_t) alloc_size)) {
if (NULL == (ptdata = (hsize_t *) HDmalloc((size_t) alloc_size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_points_data: failed to allocate region point data buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_region_points_data: failed to allocate region point data buffer");
if (H5Sget_select_elem_pointlist(region, (hsize_t) 0, (hsize_t) npoints, ptdata) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1625,7 +1635,7 @@ h5str_dump_region_points
alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
if (alloc_size == (hsize_t)((size_t) alloc_size)) {
if (NULL == (ptdata = (hsize_t *) HDmalloc((size_t) alloc_size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_points: failed to allocate region point buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_region_points: failed to allocate region point buffer");
if (H5Sget_select_elem_pointlist(region, (hsize_t) 0, (hsize_t) npoints, ptdata) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -2731,7 +2741,7 @@ h5str_dump_simple_dset
if (sm_nbytes > 0) {
if (NULL == (sm_buf = (unsigned char *) HDmalloc((size_t)sm_nbytes)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_dset: failed to allocate sm_buf");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_dset: failed to allocate sm_buf");
sm_nelmts = sm_nbytes / p_type_nbytes;
@@ -2862,7 +2872,7 @@ h5tools_dump_simple_data
h5str_new(&buffer, 32 * size);
if (!buffer.s)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5tools_dump_simple_data: failed to allocate buffer");
if (!(bytes_in = h5str_sprintf(ENVONLY, &buffer, container, type, memref, 0, 1)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@@ -2933,7 +2943,7 @@ Java_hdf_hdf5lib_H5_H5AreadComplex
}
if (NULL == (readBuf = (char *) HDmalloc((size_t)n * size)))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AreadComplex: failed to allocate read buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AreadComplex: failed to allocate read buffer");
if ((status = H5Aread(attr_id, mem_type_id, readBuf)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -2941,7 +2951,7 @@ Java_hdf_hdf5lib_H5_H5AreadComplex
h5str_new(&h5str, 4 * size);
if (!h5str.s)
- H5_JNI_FATAL_ERROR(ENVONLY, "H5AreadComplex: failed to allocate string buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AreadComplex: failed to allocate string buffer");
for (i = 0; i < (size_t) n; i++) {
h5str.s[0] = '\0';
@@ -3002,7 +3012,7 @@ Java_hdf_hdf5lib_H5_H5Acopy
total_size = (hsize_t)npoints * (hsize_t)type_size;
if (NULL == (buf = (jbyte *) HDmalloc((size_t)total_size * sizeof(jbyte))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Acopy: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Acopy: failed to allocate buffer");
if ((retVal = H5Aread((hid_t)src_id, tid, buf)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -3049,7 +3059,7 @@ Java_hdf_hdf5lib_H5_H5Dcopy
UNUSED(clss);
if (!(total_allocated_size = H5Dget_storage_size((hid_t)src_id)))
- return 0; // nothing to write
+ return 0; /* nothing to write */
if ((sid = H5Dget_space((hid_t)src_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -3064,7 +3074,7 @@ Java_hdf_hdf5lib_H5_H5Dcopy
total_size = (hsize_t)npoints * (hsize_t)type_size;
if (NULL == (buf = (jbyte *) HDmalloc((size_t)total_size * sizeof(jbyte))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Dcopy: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dcopy: failed to allocate buffer");
if ((retVal = H5Dread((hid_t)src_id, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -3091,15 +3101,15 @@ done:
} /* end Java_hdf_hdf5lib_H5_H5Dcopy */
/*
-/////////////////////////////////////////////////////////////////////////////////
-//
-//
-// Add these methods so that we don't need to call H5Gget_objtype_by_idx
-// in a loop to get information for all the objects in a group, which takes
-// a lot of time to finish if the number of objects is more than 10,000
-//
-/////////////////////////////////////////////////////////////////////////////////
-*/
+ * /////////////////////////////////////////////////////////////////////////////////
+ * //
+ * //
+ * // Add these methods so that we don't need to call H5Gget_objtype_by_idx
+ * // in a loop to get information for all the objects in a group, which takes
+ * // a lot of time to finish if the number of objects is more than 10,000
+ * //
+ * /////////////////////////////////////////////////////////////////////////////////
+ */
#ifdef __cplusplus
herr_t obj_info_all(hid_t g_id, const char *name, const H5L_info_t *linfo, void *op_data);
@@ -3174,13 +3184,13 @@ Java_hdf_hdf5lib_H5_H5Gget_1obj_1info_1full
PIN_LONG_ARRAY(ENVONLY, fNo, fnoP, &isCopy, "H5Gget_obj_info_full: fNo not pinned");
if (NULL == (oName = (char **) HDcalloc((size_t)n, sizeof(*oName))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_obj_info_full: failed to allocate buffer for object name");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Gget_obj_info_full: failed to allocate buffer for object name");
if (NULL == (refs = (unsigned long *) HDcalloc((size_t)n, sizeof(unsigned long))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_obj_info_full: failed to allocate buffer for ref. info");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Gget_obj_info_full: failed to allocate buffer for ref. info");
if (NULL == (fnos = (unsigned long *) HDcalloc((size_t)n, sizeof(unsigned long))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_obj_info_full: failed to allocate buffer for file number info");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Gget_obj_info_full: failed to allocate buffer for file number info");
if (group_name) {
PIN_JAVA_STRING(ENVONLY, group_name, gName, &isCopy, "H5Gget_obj_info_full: group_name not pinned");
@@ -3269,10 +3279,10 @@ Java_hdf_hdf5lib_H5_H5Gget_1obj_1info_1max
PIN_LONG_ARRAY(ENVONLY, oRef, refP, &isCopy, "H5Gget_obj_info_max: oRef not pinned");
if (NULL == (oName = (char **) HDcalloc((size_t)n, sizeof(*oName))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_obj_info_max: failed to allocate buffer for object name");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Gget_obj_info_max: failed to allocate buffer for object name");
if (NULL == (refs = (unsigned long *) HDcalloc((size_t)n, sizeof(unsigned long))))
- H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_obj_info_max: failed to allocate buffer for ref. info");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Gget_obj_info_max: failed to allocate buffer for ref. info");
if ((ret_val = H5Gget_obj_info_max((hid_t)loc_id, oName, (int *)otarr, (int *)ltarr, refs, maxnum)) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_obj_info_max: retrieval of object info failed");
diff --git a/java/src/jni/nativeData.c b/java/src/jni/nativeData.c
index 947f843..3c3d3d5 100644
--- a/java/src/jni/nativeData.c
+++ b/java/src/jni/nativeData.c
@@ -101,7 +101,7 @@ JNIEXPORT jfloatArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToFloat___3B
(JNIEnv *env, jclass clss, jbyteArray bdata) /* IN: array of bytes */
{
- jfloatArray rarray;
+ jfloatArray rarray = NULL;
jboolean bb;
jfloat *farray = NULL;
jfloat *iap = NULL;
@@ -152,7 +152,7 @@ JNIEXPORT jshortArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToShort___3B
(JNIEnv *env, jclass clss, jbyteArray bdata) /* IN: array of bytes */
{
- jshortArray rarray;
+ jshortArray rarray = NULL;
jboolean bb;
jshort *sarray = NULL;
jshort *iap = NULL;
@@ -203,7 +203,7 @@ JNIEXPORT jlongArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToLong___3B
(JNIEnv *env, jclass clss, jbyteArray bdata) /* IN: array of bytes */
{
- jlongArray rarray;
+ jlongArray rarray = NULL;
jboolean bb;
jlong *larray = NULL;
jlong *iap = NULL;
@@ -254,7 +254,7 @@ JNIEXPORT jdoubleArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToDouble___3B
(JNIEnv *env, jclass clss, jbyteArray bdata) /* IN: array of bytes */
{
- jdoubleArray rarray;
+ jdoubleArray rarray = NULL;
jboolean bb;
jdouble *darray = NULL;
jdouble *iap = NULL;
@@ -305,7 +305,7 @@ JNIEXPORT jintArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToInt__II_3B
(JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */
{
- jintArray rarray;
+ jintArray rarray = NULL;
jboolean bb;
jint *iarray = NULL;
jint *iap = NULL;
@@ -327,7 +327,7 @@ Java_hdf_hdf5lib_HDFNativeData_byteToInt__II_3B
}
if ((start < 0) || ((int)(start + (len * (int)sizeof(jint))) > blen))
- H5_JNI_FATAL_ERROR(ENVONLY, "byteToInt: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "byteToInt: start < 0 or len exceeded buffer length");
bp = (char *)barr + start;
@@ -357,7 +357,7 @@ JNIEXPORT jshortArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToShort__II_3B
(JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */
{
- jshortArray rarray;
+ jshortArray rarray = NULL;
jboolean bb;
jshort *sarray = NULL;
jshort *iap = NULL;
@@ -379,7 +379,7 @@ Java_hdf_hdf5lib_HDFNativeData_byteToShort__II_3B
}
if ((start < 0) || ((int)(start + (len * (int)sizeof(jshort))) > blen))
- H5_JNI_FATAL_ERROR(ENVONLY, "byteToShort: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "byteToShort: start < 0 or len exceeded buffer length");
bp = (char *)barr + start;
@@ -409,7 +409,7 @@ JNIEXPORT jfloatArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToFloat__II_3B
(JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */
{
- jfloatArray rarray;
+ jfloatArray rarray = NULL;
jboolean bb;
jfloat *farray = NULL;
jfloat *iap = NULL;
@@ -431,7 +431,7 @@ Java_hdf_hdf5lib_HDFNativeData_byteToFloat__II_3B
}
if ((start < 0) || ((int)(start + (len * (int)sizeof(jfloat))) > blen))
- H5_JNI_FATAL_ERROR(ENVONLY, "byteToFloat: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "byteToFloat: start < 0 or len exceeded buffer length");
bp = (char *)barr + start;
@@ -461,7 +461,7 @@ JNIEXPORT jlongArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToLong__II_3B
(JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */
{
- jlongArray rarray;
+ jlongArray rarray = NULL;
jboolean bb;
jlong *larray = NULL;
jlong *iap = NULL;
@@ -483,7 +483,7 @@ Java_hdf_hdf5lib_HDFNativeData_byteToLong__II_3B
}
if ((start < 0) || ((int)(start + (len * (int)sizeof(jlong))) > blen))
- H5_JNI_FATAL_ERROR(ENVONLY, "byteToLong: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "byteToLong: start < 0 or len exceeded buffer length");
bp = (char *)barr + start;
@@ -513,7 +513,7 @@ JNIEXPORT jdoubleArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToDouble__II_3B
(JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */
{
- jdoubleArray rarray;
+ jdoubleArray rarray = NULL;
jboolean bb;
jdouble *darray = NULL;
jdouble *iap = NULL;
@@ -535,7 +535,7 @@ Java_hdf_hdf5lib_HDFNativeData_byteToDouble__II_3B
}
if ((start < 0) || ((int)(start + (len * (int)sizeof(jdouble))) > blen))
- H5_JNI_FATAL_ERROR(ENVONLY, "byteToDouble: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "byteToDouble: start < 0 or len exceeded buffer length");
bp = (char *)barr + start;
@@ -565,7 +565,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_intToByte__II_3I
(JNIEnv *env, jclass clss, jint start, jint len, jintArray idata) /* IN: array of int */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jbyte *barray = NULL;
jbyte *bap = NULL;
@@ -593,7 +593,7 @@ Java_hdf_hdf5lib_HDFNativeData_intToByte__II_3I
}
if ((start < 0) || (((start + len)) > ilen))
- H5_JNI_FATAL_ERROR(ENVONLY, "intToByte: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "intToByte: start < 0 or len exceeded buffer length");
ip = iarr + start;
@@ -627,7 +627,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_shortToByte__II_3S
(JNIEnv *env, jclass clss, jint start, jint len, jshortArray sdata) /* IN: array of short */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jshort *ip = NULL;
jshort *sarr = NULL;
@@ -655,7 +655,7 @@ Java_hdf_hdf5lib_HDFNativeData_shortToByte__II_3S
}
if ((start < 0) || (((start + len)) > ilen))
- H5_JNI_FATAL_ERROR(ENVONLY, "shortToByte: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "shortToByte: start < 0 or len exceeded buffer length");
ip = sarr + start;
@@ -689,7 +689,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_floatToByte__II_3F
(JNIEnv *env, jclass clss, jint start, jint len, jfloatArray fdata) /* IN: array of float */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jfloat *ip = NULL;
jfloat *farr = NULL;
@@ -717,7 +717,7 @@ Java_hdf_hdf5lib_HDFNativeData_floatToByte__II_3F
}
if ((start < 0) || (((start + len)) > ilen))
- H5_JNI_FATAL_ERROR(ENVONLY, "floatToByte: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "floatToByte: start < 0 or len exceeded buffer length");
ip = farr + start;
@@ -751,7 +751,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_doubleToByte__II_3D
(JNIEnv *env, jclass clss, jint start, jint len, jdoubleArray ddata) /* IN: array of double */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jdouble *ip = NULL;
jdouble *darr = NULL;
@@ -779,7 +779,7 @@ Java_hdf_hdf5lib_HDFNativeData_doubleToByte__II_3D
}
if ((start < 0) || (((start + len)) > ilen))
- H5_JNI_FATAL_ERROR(ENVONLY, "doubleToByte: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "doubleToByte: start < 0 or len exceeded buffer length");
ip = darr + start;
@@ -813,7 +813,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_longToByte__II_3J
(JNIEnv *env, jclass clss, jint start, jint len, jlongArray ldata) /* IN: array of long */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jlong *ip = NULL;
jlong *larr = NULL;
@@ -841,7 +841,7 @@ Java_hdf_hdf5lib_HDFNativeData_longToByte__II_3J
}
if ((start < 0) || (((start + len)) > ilen))
- H5_JNI_FATAL_ERROR(ENVONLY, "longToByte: start < 0 or len exceeded buffer length");
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "longToByte: start < 0 or len exceeded buffer length");
ip = larr + start;
@@ -875,7 +875,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_intToByte__I
(JNIEnv *env, jclass clss, jint idata) /* IN: int */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jbyte *barray = NULL;
jbyte *bap = NULL;
@@ -911,7 +911,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_floatToByte__F
(JNIEnv *env, jclass clss, jfloat fdata) /* IN: float */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jbyte *barray = NULL;
jbyte *bap = NULL;
@@ -947,7 +947,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_shortToByte__S
(JNIEnv *env, jclass clss, jshort sdata) /* IN: short */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jbyte *barray = NULL;
jbyte *bap = NULL;
@@ -983,7 +983,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_doubleToByte__D
(JNIEnv *env, jclass clss, jdouble ddata) /* IN: double */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jbyte *barray = NULL;
jbyte *bap = NULL;
@@ -1019,7 +1019,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_longToByte__J
(JNIEnv *env, jclass clss, jlong ldata) /* IN: long */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jbyte *barray = NULL;
jbyte *bap = NULL;
@@ -1055,7 +1055,7 @@ JNIEXPORT jbyteArray JNICALL
Java_hdf_hdf5lib_HDFNativeData_byteToByte__B
(JNIEnv *env, jclass clss, jbyte bdata) /* IN: byte */
{
- jbyteArray rarray;
+ jbyteArray rarray = NULL;
jboolean bb;
jbyte *barray = NULL;
jbyte *bap = NULL;
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt
index d44bc2f..f10fa50 100644
--- a/java/test/CMakeLists.txt
+++ b/java/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDF5_JAVA_TEST Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
@@ -104,39 +104,41 @@ endif ()
get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>;")
-foreach (test_file ${HDF5_JAVA_TEST_SOURCES})
- set (CMAKE_JAVA_CLASSPATH ".")
- foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH})
- set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}")
+if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL)
+ foreach (test_file ${HDF5_JAVA_TEST_SOURCES})
+ set (CMAKE_JAVA_CLASSPATH ".")
+ foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH})
+ set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}")
+ endforeach ()
+ set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_${test_file}_JAR_FILE}")
+
+ add_test (
+ NAME JUnit-${test_file}-clearall-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ JUnit-${test_file}.out
+ JUnit-${test_file}.out.err
+ )
+ add_test (
+ NAME JUnit-${test_file}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
+ -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}"
+ -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore"
+ -D "TEST_PROGRAM=test.${test_file}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
+ -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test"
+ -D "TEST_OUTPUT=JUnit-${test_file}.out"
+# -D "TEST_LOG_LEVEL=trace"
+ -D "TEST_EXPECT=0"
+ -D "SKIP_APPEND=1"
+ -D "TEST_MASK_ERROR=TRUE"
+# -D "TEST_FILTER:STRING=${testfilter}"
+ -D "TEST_REFERENCE=JUnit-${test_file}.txt"
+ -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
+ )
+ set_tests_properties (JUnit-${test_file} PROPERTIES
+ ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2"
+ DEPENDS "JUnit-${test_file}-clearall-objects"
+ )
endforeach ()
- set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_${test_file}_JAR_FILE}")
-
- add_test (
- NAME JUnit-${test_file}-clearall-objects
- COMMAND ${CMAKE_COMMAND} -E remove
- JUnit-${test_file}.out
- JUnit-${test_file}.out.err
- )
- add_test (
- NAME JUnit-${test_file}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
- -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}"
- -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore"
- -D "TEST_PROGRAM=test.${test_file}"
- -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
- -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test"
- -D "TEST_OUTPUT=JUnit-${test_file}.out"
-# -D "TEST_LOG_LEVEL=trace"
- -D "TEST_EXPECT=0"
- -D "SKIP_APPEND=1"
- -D "TEST_MASK_ERROR=TRUE"
-# -D "TEST_FILTER:STRING=${testfilter}"
- -D "TEST_REFERENCE=JUnit-${test_file}.txt"
- -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
- )
- set_tests_properties (JUnit-${test_file} PROPERTIES
- ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2"
- DEPENDS "JUnit-${test_file}-clearall-objects"
- )
-endforeach ()
+endif ()
diff --git a/java/test/Makefile.am b/java/test/Makefile.am
index e6c9b16..1abe5dc 100644
--- a/java/test/Makefile.am
+++ b/java/test/Makefile.am
@@ -34,7 +34,7 @@ jarfile = jar$(PACKAGE_TARNAME)test.jar
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
-TESTPACKAGE =
+TESTPACKAGE =
noinst_JAVA = \
TestH5.java \
diff --git a/java/test/Makefile.in b/java/test/Makefile.in
index 092a3e8..7cf443d 100644
--- a/java/test/Makefile.in
+++ b/java/test/Makefile.in
@@ -363,12 +363,12 @@ AMTAR = @AMTAR@
# H5_CFLAGS holds flags that should be used when building hdf5,
# but which should not be exported to h5cc for building other programs.
-# AM_CFLAGS is an automake construct which should be used by Makefiles
+# AM_CFLAGS is an automake construct which should be used by Makefiles
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
-AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
+AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ @H5_ECFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
-AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ @H5_ECXXFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
@@ -388,6 +388,7 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_VERSION = @CC_VERSION@
CFLAGS = @CFLAGS@
+CLANG_SANITIZE_CHECKS = @CLANG_SANITIZE_CHECKS@
CODESTACK = @CODESTACK@
CONFIG_DATE = @CONFIG_DATE@
CONFIG_MODE = @CONFIG_MODE@
@@ -404,6 +405,7 @@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
+DESIRED_FILE_LOCKING = @DESIRED_FILE_LOCKING@
DEV_WARNINGS = @DEV_WARNINGS@
DIRECT_VFD = @DIRECT_VFD@
DLLTOOL = @DLLTOOL@
@@ -440,8 +442,11 @@ H5_CFLAGS = @H5_CFLAGS@
H5_CLASSPATH = @H5_CLASSPATH@
H5_CPPFLAGS = @H5_CPPFLAGS@
H5_CXXFLAGS = @H5_CXXFLAGS@
+H5_ECFLAGS = @H5_ECFLAGS@
+H5_ECXXFLAGS = @H5_ECXXFLAGS@
H5_FCFLAGS = @H5_FCFLAGS@
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
+H5_IS_DARWIN = @H5_IS_DARWIN@
H5_JAVACFLAGS = @H5_JAVACFLAGS@
H5_JAVAFLAGS = @H5_JAVAFLAGS@
H5_JNIFLAGS = @H5_JNIFLAGS@
@@ -464,6 +469,7 @@ HL = @HL@
HL_FOR = @HL_FOR@
HSIZE_T = @HSIZE_T@
HSSIZE_T = @HSSIZE_T@
+IGNORE_DISABLED_FILE_LOCKS = @IGNORE_DISABLED_FILE_LOCKS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -500,6 +506,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
+MIRROR_VFD = @MIRROR_VFD@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -559,6 +566,7 @@ TIME = @TIME@
TR = @TR@
TRACE_API = @TRACE_API@
UNAME_INFO = @UNAME_INFO@
+USE_FILE_LOCKING = @USE_FILE_LOCKING@
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
USE_FILTER_SZIP = @USE_FILTER_SZIP@
USINGMEMCHECKER = @USINGMEMCHECKER@
@@ -594,6 +602,7 @@ docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
+examplesdir = @examplesdir@
exec_prefix = @exec_prefix@
fortran_linux_linker_option = @fortran_linux_linker_option@
host = @host@
@@ -650,15 +659,15 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
-# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
-# has been removed. According to the official description of DESTDIR by Gnu at
-# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
-# prepended to the normal and complete install path that it precedes for the
-# purpose of installing in a temporary directory which is useful for building
-# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
-# '/' at the beginning of the normal install path. When DESTDIR is empty the
-# path then begins with '//', which is incorrect and causes problems at least for
-# Cygwin.
+# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
+# has been removed. According to the official description of DESTDIR by Gnu at
+# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
+# prepended to the normal and complete install path that it precedes for the
+# purpose of installing in a temporary directory which is useful for building
+# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
+# '/' at the beginning of the normal install path. When DESTDIR is empty the
+# path then begins with '//', which is incorrect and causes problems at least for
+# Cygwin.
# Scripts used to build examples
# If only shared libraries have been installed, have h5cc build examples with
@@ -743,7 +752,7 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
$(EXTRA_PROG)
-chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
+chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = $(SHELL)
AM_SH_LOG_FLAGS =
@@ -1230,28 +1239,37 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
echo "============================" > $${log}; \
fi; \
if test "X$(FORTRAN_API)" = "Xyes"; then \
- echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Fortran API: Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
elif test "X$(CXX_API)" = "Xyes"; then \
- echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log};\
else \
- echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ echo "C++ API: Test log for $${tname} $(TEST_FLAGS)" >> $${log};\
fi; \
else \
- echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Testing: $${tname} $(TEST_FLAGS)"; \
if test -n "$(REALTIMEOUTPUT)"; then \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" | tee -a $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" | tee -a $${log}; \
else \
- echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ echo "Test log for $${tname} $(TEST_FLAGS)" >> $${log}; \
fi; \
fi; \
if test -n "$(REALTIMEOUTPUT)"; then \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" | tee -a $${log}; \
+ fi; \
+ else \
+ if test -n "$(HDF5_DRIVER)"; then \
+ echo "Virtual file driver (VFD): $(HDF5_DRIVER)" >> $${log}; \
+ fi; \
+ fi; \
+ if test -n "$(REALTIMEOUTPUT)"; then \
echo "============================" | tee -a $${log}; \
else \
echo "============================" >> $${log}; \
diff --git a/java/test/TestH5.java b/java/test/TestH5.java
index bcca910..e4f2f9d 100644
--- a/java/test/TestH5.java
+++ b/java/test/TestH5.java
@@ -22,12 +22,17 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.Reader;
+import java.io.StreamTokenizer;
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
import org.junit.Before;
@@ -50,6 +55,81 @@ public class TestH5 {
public void nextTestName() {
System.out.println();
}
+ private static final String H5_FILE = "testData.h5";
+ private static final String EXPORT_FILE = "testExport.txt";
+ private static final int DIM_X = 4;
+ private static final int DIM_Y = 6;
+ private static final int RANK = 2;
+ long H5fid = -1;
+ long H5dsid = -1;
+ long H5did = -1;
+ long[] H5dims = { DIM_X, DIM_Y };
+
+ private final void _deleteFile(String filename) {
+ File file = null;
+ try {
+ file = new File(filename);
+ }
+ catch (Throwable err) {}
+
+ if (file.exists()) {
+ try {file.delete();} catch (SecurityException e) {}
+ }
+ }
+
+ private final long _createDataset(long fid, long dsid, String name, long dapl) {
+ long did = -1;
+ try {
+ did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32LE, dsid,
+ HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Dcreate: " + err);
+ }
+ assertTrue("TestH5._createDataset: ", did > 0);
+
+ return did;
+ }
+
+ private final void _createH5File() {
+ try {
+ H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC,
+ HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ H5dsid = H5.H5Screate_simple(2, H5dims, null);
+ H5did = _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5Pfapl.createH5file: " + err);
+ }
+ assertTrue("TestH5.createH5file: H5.H5Fcreate: ", H5fid > 0);
+ assertTrue("TestH5.createH5file: H5.H5Screate_simple: ", H5dsid > 0);
+ assertTrue("TestH5.createH5file: _createDataset: ", H5did > 0);
+
+ try {
+ H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ }
+ }
+
+ public final void _closeH5File() throws HDF5LibraryException {
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5dsid > 0)
+ try {H5.H5Sclose(H5dsid);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ H5fid = -1;
+ H5dsid = -1;
+ H5did = -1;
+ }
+
+ public final void _deleteH5file() {
+ _deleteFile(H5_FILE);
+ }
/**
* Test method for {@link hdf.hdf5lib.H5#J2C(int)}.
@@ -161,7 +241,7 @@ public class TestH5 {
*/
@Test
public void testH5get_libversion() {
- int libversion[] = { 1, 10, 6 };
+ int libversion[] = { 1, 10, 7 };
try {
H5.H5get_libversion(libversion);
@@ -200,7 +280,7 @@ public class TestH5 {
*/
@Test
public void testH5check_version() {
- int majnum = 1, minnum = 10, relnum = 6;
+ int majnum = 1, minnum = 10, relnum = 7;
try {
H5.H5check_version(majnum, minnum, relnum);
@@ -268,4 +348,67 @@ public class TestH5 {
fail("Exception thrown during test: " + ex.toString());
}
}
+
+ @Test
+ public void testH5export_dataset() {
+ int[][] dset_data = new int[DIM_X][DIM_Y];
+ int[][] dset_indata = new int[DIM_X][DIM_Y];
+ int FILLVAL = 99;
+
+ _createH5File();
+
+ // Initialize the dataset.
+ for (int indx = 0; indx < DIM_X; indx++)
+ for (int jndx = 0; jndx < DIM_Y; jndx++)
+ dset_data[indx][jndx] = FILLVAL;
+
+ try {
+ if (H5did >= 0)
+ H5.H5Dwrite(H5did, HDF5Constants.H5T_STD_I32LE,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, dset_data);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ _closeH5File();
+
+ try {
+ H5.H5export_dataset(EXPORT_FILE, H5_FILE, "/dset", 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_dataset failed: " + err);
+ }
+
+ File file = new File(EXPORT_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ int jndx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx][jndx] = (int)streamTokenizer.nval;
+ jndx++;
+ if (jndx >= DIM_Y) {
+ jndx = 0;
+ indx++;
+ }
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ for(int col = 0; col < DIM_Y; col++) {
+ assertTrue("H5export_dataset: <"+row+","+col+">"+dset_indata[row][col]+"=99", dset_indata[row][col]==99);
+ }
+ _deleteH5file();
+ }
}
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java
index 1f4e658..ad50d62 100644
--- a/java/test/TestH5E.java
+++ b/java/test/TestH5E.java
@@ -85,6 +85,7 @@ public class TestH5E {
long errnum = hdferr.getMajorErrorNumber();
int[] error_msg_type = { HDF5Constants.H5E_MAJOR };
String msg = null;
+
try {
msg = H5.H5Eget_msg(errnum, error_msg_type);
}
@@ -111,6 +112,7 @@ public class TestH5E {
long errnum = hdferr.getMinorErrorNumber();
int[] error_msg_type = { HDF5Constants.H5E_MINOR };
String msg = null;
+
try {
msg = H5.H5Eget_msg(errnum, error_msg_type);
}
@@ -144,7 +146,7 @@ public class TestH5E {
catch (Throwable err) {
}
- // save current stack contents
+ // Save current stack contents
try {
current_stackid = H5.H5Eget_current_stack();
}
diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java
index 10a79dd..4233580 100644
--- a/java/test/TestH5Pfapl.java
+++ b/java/test/TestH5Pfapl.java
@@ -1398,4 +1398,36 @@ public class TestH5Pfapl {
fail("H5P_evict_on_close: " + err);
}
}
+
+ @Test
+ public void testH5P_file_locking() {
+ boolean use_file_locking = false;
+ boolean ignore_disabled_file_locking = false;
+ try {
+ // false values (usually not the default)
+ H5.H5Pset_file_locking(fapl_id, false, false);
+ use_file_locking = H5.H5Pget_use_file_locking(fapl_id);
+ ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id);
+ assertFalse("H5P_file_locking", use_file_locking);
+ assertFalse("H5P_file_locking", ignore_disabled_file_locking);
+
+ // true values (typically the default)
+ H5.H5Pset_file_locking(fapl_id, true, true);
+ use_file_locking = H5.H5Pget_use_file_locking(fapl_id);
+ ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id);
+ assertTrue("H5P_file_locking", use_file_locking);
+ assertTrue("H5P_file_locking", ignore_disabled_file_locking);
+ }
+ catch (HDF5PropertyListInterfaceException err) {
+ // parallel is not supported
+ if (err.getMinorErrorNumber() != HDF5Constants.H5E_UNSUPPORTED) {
+ err.printStackTrace();
+ fail("H5P_test_file_locking: " + err);
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5P_test_file_locking: " + err);
+ }
+ }
}
diff --git a/java/test/TestH5S.java b/java/test/TestH5S.java
index 985342b..97c0b68 100644
--- a/java/test/TestH5S.java
+++ b/java/test/TestH5S.java
@@ -171,7 +171,7 @@ public class TestH5S {
try {
H5.H5Sset_extent_none(H5sid);
read_type = H5.H5Sget_simple_extent_type(H5sid);
- assertTrue("H5.H5Sget_simple_extent_type: "+read_type, HDF5Constants.H5S_NO_CLASS == read_type);
+ assertTrue("H5.H5Sget_simple_extent_type: "+read_type, HDF5Constants.H5S_NULL == read_type);
}
catch (Throwable err) {
err.printStackTrace();
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 32f17cb..a074e30 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -20,6 +20,7 @@ USE_FILTER_SZIP="@USE_FILTER_SZIP@"
USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@"
USE_ROS3_VFD="@HAVE_ROS3_VFD@"
USE_HDFS_VFD="@HAVE_LIBHDFS@"
+IS_DARWIN="@H5_IS_DARWIN@"
TESTNAME=JUnitInterface
EXIT_SUCCESS=0
@@ -42,8 +43,8 @@ myos=`uname -s`
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
-BLDLIBDIR="$top_builddir/hdf5/lib"
BLDDIR="."
+BLDLIBDIR="$BLDDIR/testlibs"
HDFTEST_HOME="$top_srcdir/java/test"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@test.jar
@@ -144,6 +145,13 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ if [ "$IS_DARWIN" = "yes" ]; then
+ (cd testlibs; \
+ install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
+ exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
+ echo $exist_path; \
+ install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib)
+ fi
# copy jar files. Used -f to make sure get a new copy
for tstfile in $COPY_JARTESTFILES
do
@@ -202,10 +210,7 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- for tstfile in $COPY_JARTESTFILES
- do
- $RM $BLDLIBDIR/tstfile
- done
+ $RM -rf $BLDLIBDIR
fi
}
@@ -328,7 +333,7 @@ TESTING JUnit-TestH5
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5.ext > JUnit-TestH5.out
@@ -349,7 +354,7 @@ TESTING JUnit-TestH5Eparams
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Eparams.ext > JUnit-TestH5Eparams.out
@@ -370,7 +375,7 @@ TESTING JUnit-TestH5Eregister
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Eregister.ext > JUnit-TestH5Eregister.out
@@ -391,7 +396,7 @@ TESTING JUnit-TestH5Fparams
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Fparams.ext > JUnit-TestH5Fparams.out
@@ -412,7 +417,7 @@ TESTING JUnit-TestH5Fbasic
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Fbasic.ext > JUnit-TestH5Fbasic.out
@@ -433,7 +438,7 @@ TESTING JUnit-TestH5F
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5F.ext > JUnit-TestH5F.out
@@ -454,7 +459,7 @@ TESTING JUnit-TestH5Fswmr
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Fswmr.ext > JUnit-TestH5Fswmr.out
@@ -475,7 +480,7 @@ TESTING JUnit-TestH5Gbasic
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Gbasic.ext > JUnit-TestH5Gbasic.out
@@ -496,7 +501,7 @@ TESTING JUnit-TestH5G
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5G.ext > JUnit-TestH5G.out
@@ -517,7 +522,7 @@ TESTING JUnit-TestH5Sbasic
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Sbasic.ext > JUnit-TestH5Sbasic.out
@@ -538,7 +543,7 @@ TESTING JUnit-TestH5S
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5S.ext > JUnit-TestH5S.out
@@ -559,7 +564,7 @@ TESTING JUnit-TestH5Tparams
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Tparams.ext > JUnit-TestH5Tparams.out
@@ -580,7 +585,7 @@ TESTING JUnit-TestH5Tbasic
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Tbasic.ext > JUnit-TestH5Tbasic.out
@@ -601,7 +606,7 @@ TESTING JUnit-TestH5T
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5T.ext > JUnit-TestH5T.out
@@ -622,7 +627,7 @@ TESTING JUnit-TestH5Dparams
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Dparams.ext > JUnit-TestH5Dparams.out
@@ -643,7 +648,7 @@ TESTING JUnit-TestH5D
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5D.ext > JUnit-TestH5D.out
@@ -664,7 +669,7 @@ TESTING JUnit-TestH5Dplist
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Dplist.ext > JUnit-TestH5Dplist.out
@@ -685,7 +690,7 @@ TESTING JUnit-TestH5Lparams
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Lparams.ext > JUnit-TestH5Lparams.out
@@ -706,7 +711,7 @@ TESTING JUnit-TestH5Lbasic
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Lbasic.ext > JUnit-TestH5Lbasic.out
@@ -727,7 +732,7 @@ TESTING JUnit-TestH5Lcreate
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Lcreate.ext > JUnit-TestH5Lcreate.out
@@ -748,7 +753,7 @@ TESTING JUnit-TestH5R
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5R.ext > JUnit-TestH5R.out
@@ -769,7 +774,7 @@ TESTING JUnit-TestH5P
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5P.ext > JUnit-TestH5P.out
@@ -790,7 +795,7 @@ TESTING JUnit-TestH5PData
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5PData.ext > JUnit-TestH5PData.out
@@ -811,7 +816,7 @@ TESTING JUnit-TestH5Pfapl
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Pfapl.ext > JUnit-TestH5Pfapl.out
@@ -832,7 +837,7 @@ TESTING JUnit-TestH5Pvirtual
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Pvirtual.ext > JUnit-TestH5Pvirtual.out
@@ -853,7 +858,7 @@ TESTING JUnit-TestH5Plist
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Plist.ext > JUnit-TestH5Plist.out
@@ -874,7 +879,7 @@ TESTING JUnit-TestH5A
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5A.ext > JUnit-TestH5A.out
@@ -895,7 +900,7 @@ TESTING JUnit-TestH5Oparams
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Oparams.ext > JUnit-TestH5Oparams.out
@@ -916,7 +921,7 @@ TESTING JUnit-TestH5Obasic
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Obasic.ext > JUnit-TestH5Obasic.out
@@ -937,7 +942,7 @@ TESTING JUnit-TestH5Ocreate
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Ocreate.ext > JUnit-TestH5Ocreate.out
@@ -958,7 +963,7 @@ TESTING JUnit-TestH5Ocopy
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Ocopy.ext > JUnit-TestH5Ocopy.out
@@ -979,7 +984,7 @@ TESTING JUnit-TestH5PL
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5PL.ext > JUnit-TestH5PL.out
@@ -1000,7 +1005,7 @@ TESTING JUnit-TestH5Z
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Z.ext > JUnit-TestH5Z.out
@@ -1023,7 +1028,7 @@ if test "X-$BUILD_MODE" = "X-production" ; then
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5E.ext > JUnit-TestH5E.out
@@ -1046,7 +1051,7 @@ if test "X-$BUILD_MODE" = "X-production" ; then
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Edefault.ext > JUnit-TestH5Edefault.out
@@ -1070,7 +1075,7 @@ if test $USE_FILTER_SZIP = "yes"; then
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Giterate.ext > JUnit-TestH5Giterate.out
@@ -1092,7 +1097,7 @@ if test "X$ROS3_VFD" = "Xyes"; then
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*\.[0-9]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*\.,[0-9]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Pfapls3.ext > JUnit-TestH5Pfapls3.out
@@ -1114,7 +1119,7 @@ if test "X$HAVE_LIBHDFS" = "Xyes"; then
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
-e 's/line [0-9]*/line (number)/' \
- -e 's/Time: [0-9]*\.[0-9]*/Time: XXXX/' \
+ -e 's/Time: [0-9]*\.,[0-9]*/Time: XXXX/' \
-e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
-e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
JUnit-TestH5Pfaplhdfs.ext > JUnit-TestH5Pfaplhdfs.out
diff --git a/java/test/testfiles/JUnit-TestH5.txt b/java/test/testfiles/JUnit-TestH5.txt
index b282a91..4bab633 100644
--- a/java/test/testfiles/JUnit-TestH5.txt
+++ b/java/test/testfiles/JUnit-TestH5.txt
@@ -1,6 +1,7 @@
JUnit version 4.11
.testH5get_libversion_null_param
.testJ2C
+.testH5export_dataset
.testIsSerializable
.testH5garbage_collect
.testH5error_off
@@ -12,5 +13,5 @@ JUnit version 4.11
Time: XXXX
-OK (10 tests)
+OK (11 tests)
diff --git a/java/test/testfiles/JUnit-TestH5Edefault.txt b/java/test/testfiles/JUnit-TestH5Edefault.txt
index b39dbef..1ca5934 100644
--- a/java/test/testfiles/JUnit-TestH5Edefault.txt
+++ b/java/test/testfiles/JUnit-TestH5Edefault.txt
@@ -34,20 +34,20 @@ OK (28 tests)
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Fopen(): unable to open file
- major: File accessibilty
+ major: File accessibility
minor: Unable to open file
#001: (file name) line (number) in H5F_open(): unable to retrieve VFL class
- major: File accessibilty
+ major: File accessibility
minor: Can't get value
#002: (file name) line (number) in H5FD_get_class(): can't find object for ID
major: Object atom
minor: Unable to find atom information (already closed?)
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Fopen(): unable to open file
- major: File accessibilty
+ major: File accessibility
minor: Unable to open file
#001: (file name) line (number) in H5F_open(): unable to retrieve VFL class
- major: File accessibilty
+ major: File accessibility
minor: Can't get value
#002: (file name) line (number) in H5FD_get_class(): can't find object for ID
major: Object atom
diff --git a/java/test/testfiles/JUnit-TestH5Pfapl.txt b/java/test/testfiles/JUnit-TestH5Pfapl.txt
index c4f37d0..c34ac1c 100644
--- a/java/test/testfiles/JUnit-TestH5Pfapl.txt
+++ b/java/test/testfiles/JUnit-TestH5Pfapl.txt
@@ -28,6 +28,7 @@ JUnit version 4.11
.testH5Pset_elink_fapl
.testH5P_hyper_vector_size
.testH5P_gc_references
+.testH5P_file_locking
.testH5P_family_offset
.testH5P_fapl_core
.testH5P_fapl_muti
@@ -37,5 +38,5 @@ JUnit version 4.11
Time: XXXX
-OK (35 tests)
+OK (36 tests)