From f2cb86499efa2fe6f44ca2f4e93ea62e952d0fb0 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 6 May 2021 14:07:08 -0700 Subject: Brings java wrapper updates from develop The wrappers compile but fail tests due to some missing develop functionality --- MANIFEST | 10 +- config/cmake/HDF5_Process_Flex_Files.cmake | 95 - config/cmake/libhdf5.pc.in | 14 - java/examples/datasets/H5Ex_D_Alloc.java | 11 +- java/examples/datasets/H5Ex_D_Checksum.java | 15 +- java/examples/datasets/H5Ex_D_Chunk.java | 17 +- java/examples/datasets/H5Ex_D_Compact.java | 17 +- java/examples/datasets/H5Ex_D_External.java | 15 +- java/examples/datasets/H5Ex_D_FillValue.java | 9 +- java/examples/datasets/H5Ex_D_Gzip.java | 15 +- java/examples/datasets/H5Ex_D_Hyperslab.java | 15 +- java/examples/datasets/H5Ex_D_Nbit.java | 17 +- java/examples/datasets/H5Ex_D_ReadWrite.java | 11 +- java/examples/datasets/H5Ex_D_Shuffle.java | 15 +- java/examples/datasets/H5Ex_D_Sofloat.java | 15 +- java/examples/datasets/H5Ex_D_Soint.java | 15 +- java/examples/datasets/H5Ex_D_Szip.java | 15 +- java/examples/datasets/H5Ex_D_Transform.java | 15 +- java/examples/datasets/H5Ex_D_UnlimitedAdd.java | 21 +- java/examples/datasets/H5Ex_D_UnlimitedGzip.java | 23 +- java/examples/datasets/H5Ex_D_UnlimitedMod.java | 21 +- java/examples/datasets/JavaDatasetExample.sh.in | 11 +- java/examples/datatypes/H5Ex_T_Array.java | 19 +- java/examples/datatypes/H5Ex_T_ArrayAttribute.java | 25 +- java/examples/datatypes/H5Ex_T_Bit.java | 13 +- java/examples/datatypes/H5Ex_T_BitAttribute.java | 19 +- java/examples/datatypes/H5Ex_T_Commit.java | 13 +- java/examples/datatypes/H5Ex_T_Compound.java | 23 +- .../datatypes/H5Ex_T_CompoundAttribute.java | 29 +- java/examples/datatypes/H5Ex_T_Float.java | 13 +- java/examples/datatypes/H5Ex_T_FloatAttribute.java | 19 +- java/examples/datatypes/H5Ex_T_Integer.java | 13 +- .../datatypes/H5Ex_T_IntegerAttribute.java | 19 +- .../examples/datatypes/H5Ex_T_ObjectReference.java | 25 +- .../datatypes/H5Ex_T_ObjectReferenceAttribute.java | 29 +- java/examples/datatypes/H5Ex_T_Opaque.java | 19 +- .../examples/datatypes/H5Ex_T_OpaqueAttribute.java | 23 +- java/examples/datatypes/H5Ex_T_String.java | 21 +- .../examples/datatypes/H5Ex_T_StringAttribute.java | 27 +- java/examples/datatypes/H5Ex_T_VLString.java | 15 +- java/examples/datatypes/JavaDatatypeExample.sh.in | 11 +- java/examples/groups/H5Ex_G_Compact.java | 7 +- java/examples/groups/H5Ex_G_Corder.java | 9 +- java/examples/groups/H5Ex_G_Create.java | 5 +- java/examples/groups/H5Ex_G_Intermediate.java | 7 +- java/examples/groups/H5Ex_G_Iterate.java | 3 +- java/examples/groups/H5Ex_G_Phase.java | 11 +- java/examples/groups/H5Ex_G_Traverse.java | 3 +- java/examples/groups/H5Ex_G_Visit.java | 3 +- java/examples/groups/JavaGroupExample.sh.in | 12 +- java/examples/intro/H5_CreateAttribute.java | 9 +- java/examples/intro/H5_CreateDataset.java | 7 +- java/examples/intro/H5_CreateFile.java | 3 +- java/examples/intro/H5_CreateGroup.java | 5 +- .../intro/H5_CreateGroupAbsoluteRelative.java | 9 +- java/examples/intro/H5_CreateGroupDataset.java | 17 +- java/examples/intro/H5_ReadWrite.java | 7 +- java/examples/intro/JavaIntroExample.sh.in | 11 +- java/src/Makefile.am | 2 +- java/src/hdf/hdf5lib/CMakeLists.txt | 2 +- java/src/hdf/hdf5lib/H5.java | 4526 ++++++++++++++++---- java/src/hdf/hdf5lib/HDF5Constants.java | 957 ++++- java/src/hdf/hdf5lib/HDF5GroupInfo.java | 21 +- java/src/hdf/hdf5lib/HDFArray.java | 681 ++- java/src/hdf/hdf5lib/callbacks/Callbacks.java | 1 - java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java | 26 +- java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java | 5 +- java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java | 23 +- java/src/hdf/hdf5lib/callbacks/H5D_append_t.java | 5 +- java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java | 25 +- java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java | 5 +- java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java | 23 +- java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java | 5 +- .../hdf5lib/callbacks/H5L_iterate_opdata_t.java | 5 +- java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java | 26 +- .../hdf5lib/callbacks/H5O_iterate_opdata_t.java | 5 +- java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java | 26 +- .../hdf5lib/callbacks/H5P_cls_close_func_cb.java | 22 +- .../hdf5lib/callbacks/H5P_cls_close_func_t.java | 5 +- .../hdf5lib/callbacks/H5P_cls_copy_func_cb.java | 23 +- .../hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java | 5 +- .../hdf5lib/callbacks/H5P_cls_create_func_cb.java | 22 +- .../hdf5lib/callbacks/H5P_cls_create_func_t.java | 5 +- java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java | 23 +- java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java | 5 +- .../hdf5lib/callbacks/H5P_prp_close_func_cb.java | 23 +- .../hdf5lib/callbacks/H5P_prp_compare_func_cb.java | 23 +- .../hdf5lib/callbacks/H5P_prp_copy_func_cb.java | 23 +- .../hdf5lib/callbacks/H5P_prp_create_func_cb.java | 23 +- .../hdf5lib/callbacks/H5P_prp_delete_func_cb.java | 24 +- .../hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java | 24 +- .../hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java | 24 +- .../hdf/hdf5lib/exceptions/HDF5AtomException.java | 42 - java/src/hdf/hdf5lib/exceptions/HDF5Exception.java | 3 + .../hdf/hdf5lib/exceptions/HDF5IdException.java | 42 + .../hdf5lib/exceptions/HDF5LibraryException.java | 8 +- .../hdf5lib/exceptions/HDF5ReferenceException.java | 6 + .../hdf/hdf5lib/structs/H5AC_cache_config_t.java | 249 +- java/src/hdf/hdf5lib/structs/H5A_info_t.java | 18 +- java/src/hdf/hdf5lib/structs/H5E_error2_t.java | 28 +- java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java | 20 +- java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java | 7 +- java/src/hdf/hdf5lib/structs/H5F_info2_t.java | 45 +- java/src/hdf/hdf5lib/structs/H5G_info_t.java | 18 +- java/src/hdf/hdf5lib/structs/H5L_info_t.java | 16 +- java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java | 56 +- java/src/hdf/hdf5lib/structs/H5O_info_t.java | 45 +- .../src/hdf/hdf5lib/structs/H5O_native_info_t.java | 18 +- java/src/hdf/hdf5lib/structs/H5O_token_t.java | 15 +- java/src/hdf/hdf5lib/structs/H5_ih_info_t.java | 14 +- java/src/jni/CMakeLists.txt | 1 + java/src/jni/exceptionImp.c | 33 +- java/src/jni/exceptionImp.h | 7 +- java/src/jni/h5Constants.c | 379 +- java/src/jni/h5Imp.h | 7 +- java/src/jni/h5aImp.c | 4 +- java/src/jni/h5aImp.h | 7 +- java/src/jni/h5dImp.c | 5 +- java/src/jni/h5dImp.h | 7 +- java/src/jni/h5eImp.c | 1 - java/src/jni/h5eImp.h | 7 +- java/src/jni/h5fImp.h | 7 +- java/src/jni/h5gImp.h | 7 +- java/src/jni/h5iImp.h | 7 +- java/src/jni/h5jni.h | 28 +- java/src/jni/h5lImp.c | 1 - java/src/jni/h5lImp.h | 7 +- java/src/jni/h5oImp.c | 1 - java/src/jni/h5oImp.h | 7 +- java/src/jni/h5pACPLImp.c | 1 - java/src/jni/h5pACPLImp.h | 7 +- java/src/jni/h5pDAPLImp.c | 1 - java/src/jni/h5pDAPLImp.h | 7 +- java/src/jni/h5pDCPLImp.c | 1 - java/src/jni/h5pDCPLImp.h | 7 +- java/src/jni/h5pDXPLImp.c | 1 - java/src/jni/h5pDXPLImp.h | 7 +- java/src/jni/h5pFAPLImp.c | 71 +- java/src/jni/h5pFAPLImp.h | 33 +- java/src/jni/h5pFCPLImp.c | 1 - java/src/jni/h5pFCPLImp.h | 7 +- java/src/jni/h5pGAPLImp.c | 1 - java/src/jni/h5pGAPLImp.h | 7 +- java/src/jni/h5pGCPLImp.c | 1 - java/src/jni/h5pGCPLImp.h | 7 +- java/src/jni/h5pImp.h | 7 +- java/src/jni/h5pLAPLImp.c | 1 - java/src/jni/h5pLAPLImp.h | 7 +- java/src/jni/h5pLCPLImp.c | 1 - java/src/jni/h5pLCPLImp.h | 7 +- java/src/jni/h5pOCPLImp.c | 1 - java/src/jni/h5pOCPLImp.h | 7 +- java/src/jni/h5pOCpyPLImp.c | 1 - java/src/jni/h5pOCpyPLImp.h | 7 +- java/src/jni/h5pStrCPLImp.c | 1 - java/src/jni/h5pStrCPLImp.h | 7 +- java/src/jni/h5plImp.c | 1 - java/src/jni/h5plImp.h | 7 +- java/src/jni/h5rImp.h | 7 +- java/src/jni/h5sImp.c | 383 ++ java/src/jni/h5sImp.h | 66 +- java/src/jni/h5tImp.h | 7 +- java/src/jni/h5util.c | 1254 +++--- java/src/jni/h5util.h | 20 +- java/src/jni/h5vlImp.c | 1 - java/src/jni/h5vlImp.h | 7 +- java/src/jni/h5zImp.h | 7 +- java/src/jni/nativeData.h | 7 +- java/test/CMakeLists.txt | 15 + java/test/Makefile.am | 3 + java/test/TestAll.java | 7 +- java/test/TestH5.java | 248 +- java/test/TestH5A.java | 115 +- java/test/TestH5Arw.java | 449 ++ java/test/TestH5D.java | 43 +- java/test/TestH5Dparams.java | 1 - java/test/TestH5Dplist.java | 9 +- java/test/TestH5Drw.java | 378 ++ java/test/TestH5E.java | 1 - java/test/TestH5Edefault.java | 85 +- java/test/TestH5Eparams.java | 1 - java/test/TestH5Eregister.java | 1 - java/test/TestH5F.java | 19 +- java/test/TestH5Fbasic.java | 17 +- java/test/TestH5Fparams.java | 13 +- java/test/TestH5Fswmr.java | 13 +- java/test/TestH5G.java | 31 +- java/test/TestH5Gbasic.java | 17 +- java/test/TestH5Giterate.java | 7 +- java/test/TestH5Lbasic.java | 3 +- java/test/TestH5Lcreate.java | 19 +- java/test/TestH5Lparams.java | 1 - java/test/TestH5Obasic.java | 55 +- java/test/TestH5Ocopy.java | 41 +- java/test/TestH5Ocreate.java | 27 +- java/test/TestH5Oparams.java | 1 - java/test/TestH5P.java | 31 +- java/test/TestH5PData.java | 11 +- java/test/TestH5PL.java | 11 +- java/test/TestH5Pfapl.java | 61 +- java/test/TestH5Pfaplhdfs.java | 11 +- java/test/TestH5Pfapls3.java | 11 +- java/test/TestH5Plist.java | 33 +- java/test/TestH5Pvirtual.java | 27 +- java/test/TestH5R.java | 118 +- java/test/TestH5Rref.java | 561 +++ java/test/TestH5S.java | 21 +- java/test/TestH5Sbasic.java | 153 +- java/test/TestH5T.java | 23 +- java/test/TestH5Tbasic.java | 13 +- java/test/TestH5Tparams.java | 1 - java/test/TestH5VL.java | 53 +- java/test/TestH5Z.java | 1 - java/test/junit.sh.in | 76 +- java/test/testfiles/JUnit-TestH5.txt | 6 +- java/test/testfiles/JUnit-TestH5Arw.txt | 13 + java/test/testfiles/JUnit-TestH5Drw.txt | 13 + java/test/testfiles/JUnit-TestH5Pfapl.txt | 3 +- java/test/testfiles/JUnit-TestH5Rref.txt | 10 + java/test/testfiles/JUnit-TestH5Sbasic.txt | 16 +- 220 files changed, 10266 insertions(+), 3336 deletions(-) delete mode 100644 config/cmake/HDF5_Process_Flex_Files.cmake delete mode 100644 config/cmake/libhdf5.pc.in delete mode 100644 java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java create mode 100644 java/src/hdf/hdf5lib/exceptions/HDF5IdException.java create mode 100644 java/test/TestH5Arw.java create mode 100644 java/test/TestH5Drw.java create mode 100644 java/test/TestH5Rref.java create mode 100644 java/test/testfiles/JUnit-TestH5Arw.txt create mode 100644 java/test/testfiles/JUnit-TestH5Drw.txt create mode 100644 java/test/testfiles/JUnit-TestH5Rref.txt diff --git a/MANIFEST b/MANIFEST index cba2237..1e1891a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3260,7 +3260,6 @@ ./java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java ./java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java -./java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java ./java/src/hdf/hdf5lib/exceptions/HDF5AttributeException.java ./java/src/hdf/hdf5lib/exceptions/HDF5BtreeException.java ./java/src/hdf/hdf5lib/exceptions/HDF5DataFiltersException.java @@ -3274,6 +3273,7 @@ ./java/src/hdf/hdf5lib/exceptions/HDF5FunctionArgumentException.java ./java/src/hdf/hdf5lib/exceptions/HDF5FunctionEntryExitException.java ./java/src/hdf/hdf5lib/exceptions/HDF5HeapException.java +./java/src/hdf/hdf5lib/exceptions/HDF5IdException.java ./java/src/hdf/hdf5lib/exceptions/HDF5InternalErrorException.java ./java/src/hdf/hdf5lib/exceptions/HDF5JavaException.java ./java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -3433,9 +3433,11 @@ ./java/test/junit.sh.in ./java/test/testfiles/JUnit-TestH5.txt ./java/test/testfiles/JUnit-TestH5A.txt +./java/test/testfiles/JUnit-TestH5Arw.txt ./java/test/testfiles/JUnit-TestH5Dparams.txt ./java/test/testfiles/JUnit-TestH5D.txt ./java/test/testfiles/JUnit-TestH5Dplist.txt +./java/test/testfiles/JUnit-TestH5Drw.txt ./java/test/testfiles/JUnit-TestH5E.txt ./java/test/testfiles/JUnit-TestH5Edefault.txt ./java/test/testfiles/JUnit-TestH5Eparams.txt @@ -3463,6 +3465,7 @@ ./java/test/testfiles/JUnit-TestH5Pvirtual.txt ./java/test/testfiles/JUnit-TestH5PL.txt ./java/test/testfiles/JUnit-TestH5R.txt +./java/test/testfiles/JUnit-TestH5Rref.txt ./java/test/testfiles/JUnit-TestH5Sbasic.txt ./java/test/testfiles/JUnit-TestH5S.txt ./java/test/testfiles/JUnit-TestH5Tparams.txt @@ -3473,9 +3476,11 @@ ./java/test/h5ex_g_iterate.orig ./java/test/TestH5.java ./java/test/TestH5A.java +./java/test/TestH5Arw.java ./java/test/TestH5Dparams.java ./java/test/TestH5D.java ./java/test/TestH5Dplist.java +./java/test/TestH5Drw.java ./java/test/TestH5E.java ./java/test/TestH5Edefault.java ./java/test/TestH5Eparams.java @@ -3503,6 +3508,7 @@ ./java/test/TestH5Pvirtual.java ./java/test/TestH5PL.java ./java/test/TestH5R.java +./java/test/TestH5Rref.java ./java/test/TestH5Sbasic.java ./java/test/TestH5S.java ./java/test/TestH5Tparams.java @@ -3543,7 +3549,6 @@ ./config/cmake/HDFCompilerFlags.cmake ./config/cmake/HDFCXXCompilerFlags.cmake ./config/cmake/HDFFortranCompilerFlags.cmake -./config/cmake/HDF5_Process_Flex_Files.cmake ./config/cmake/HDF5Macros.cmake ./config/cmake/HDF5PluginMacros.cmake ./config/cmake/HDF5PluginCache.cmake @@ -3551,7 +3556,6 @@ ./config/cmake/jrunTest.cmake ./config/cmake/jvolTest.cmake ./config/cmake/libh5cc.in -./config/cmake/libhdf5.pc.in ./config/cmake/libhdf5.settings.cmake.in ./config/cmake/mccacheinit.cmake ./config/cmake/patch.xml diff --git a/config/cmake/HDF5_Process_Flex_Files.cmake b/config/cmake/HDF5_Process_Flex_Files.cmake deleted file mode 100644 index ca5ace7..0000000 --- a/config/cmake/HDF5_Process_Flex_Files.cmake +++ /dev/null @@ -1,95 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# post process flex/bison files - -message (STATUS "File: ${GEN_DIR} ${FILE_PARSE} ${FILE_ANALYZE}") - -if (FILE_PARSE) - # fix H5LTparse.c to declare H5LTyyparse return type as an hid_t - # instead of int. Currently the generated function H5LTyyparse is - # generated with a return value of type int, which is a mapping to the - # flex yyparse function. The return value in the HL library should be - # an hid_t. - # I propose to not use flex to generate this function, but for now I am - # adding a perl command to find and replace this function declaration in - # H5LTparse.c. - file (READ ${GEN_DIR}/${FILE_PARSE}.c TEST_STREAM) - string (REGEX REPLACE "int yyparse" "hid_t yyparse" TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE "int\nyyparse" "hid_t\nyyparse" TEST_STREAM "${TEST_STREAM}") - string (REGEX REPLACE "int H5LTyyparse" "hid_t H5LTyyparse" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${FILE_PARSE}.c "${TEST_STREAM}") - message (STATUS "replacing signature in H5LTparse.c") - - # Add code that disables warnings in the flex/bison-generated code. - # - # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions - # will simply ignore them, but we want to avoid those warnings. - file (READ ${FILE_PARSE}.c TEST_STREAM) - file (WRITE ${FILE_PARSE}.c " -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n -#pragma GCC diagnostic ignored \"-Wconversion\"\n -#pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n -#pragma GCC diagnostic ignored \"-Wlarger-than=\"\n -#pragma GCC diagnostic ignored \"-Wmissing-prototypes\"\n -#pragma GCC diagnostic ignored \"-Wnested-externs\"\n -#pragma GCC diagnostic ignored \"-Wold-style-definition\"\n -#pragma GCC diagnostic ignored \"-Wsign-compare\"\n -#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"\n -#pragma GCC diagnostic ignored \"-Wswitch-default\"\n -#pragma GCC diagnostic ignored \"-Wunused-function\"\n -#pragma GCC diagnostic ignored \"-Wunused-macros\"\n -#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n -#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n -#elif defined __SUNPRO_CC\n -#pragma disable_warn\n -#elif defined _MSC_VER\n -#pragma warning(push, 1)\n -#endif\n - ") - file (APPEND ${FILE_PARSE}.c "${TEST_STREAM}") - message (STATUS "processed pragma in ${FILE_PARSE}") - file (READ ${GEN_DIR}/${FILE_PARSE}.h TEST_STREAM) - file (WRITE ${FILE_PARSE}.h "${TEST_STREAM}") -endif () - -if (FILE_ANALYZE) - # Add code that disables warnings in the flex/bison-generated code. - # - # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions - # will simply ignore them, but we want to avoid those warnings. - file (READ ${GEN_DIR}/${FILE_ANALYZE} TEST_STREAM) - file (WRITE ${FILE_ANALYZE} " -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n -#pragma GCC diagnostic ignored \"-Wconversion\"\n -#pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n -#pragma GCC diagnostic ignored \"-Wlarger-than=\"\n -#pragma GCC diagnostic ignored \"-Wmissing-prototypes\"\n -#pragma GCC diagnostic ignored \"-Wnested-externs\"\n -#pragma GCC diagnostic ignored \"-Wold-style-definition\"\n -#pragma GCC diagnostic ignored \"-Wsign-compare\"\n -#pragma GCC diagnostic ignored \"-Wsign-conversion\"\n -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"\n -#pragma GCC diagnostic ignored \"-Wswitch-default\"\n -#pragma GCC diagnostic ignored \"-Wunused-function\"\n -#pragma GCC diagnostic ignored \"-Wunused-macros\"\n -#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n -#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n -#elif defined __SUNPRO_CC\n -#pragma disable_warn\n -#elif defined _MSC_VER\n -#pragma warning(push, 1)\n -#endif\n - ") - file (APPEND ${FILE_ANALYZE} "${TEST_STREAM}") - message (STATUS "processed pragma in ${FILE_ANALYZE}") -endif () diff --git a/config/cmake/libhdf5.pc.in b/config/cmake/libhdf5.pc.in deleted file mode 100644 index 4a2ebaa..0000000 --- a/config/cmake/libhdf5.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -prefix=@_PKG_CONFIG_PREFIX@ -exec_prefix=@_PKG_CONFIG_EXEC_PREFIX@ -libdir=@_PKG_CONFIG_LIBDIR@ -includedir=@_PKG_CONFIG_INCLUDEDIR@ - -Name: @_PKG_CONFIG_LIBNAME@ -Description: HDF5 (Hierarchical Data Format 5) Software Library -Version: @_PKG_CONFIG_VERSION@ - -Cflags: -I${includedir} -Libs: -L${libdir} @_PKG_CONFIG_SH_LIBS@ -Requires: @_PKG_CONFIG_REQUIRES@ -Libs.private: @_PKG_CONFIG_LIBS_PRIVATE@ @_PKG_CONFIG_LIBS@ -Requires.private: @_PKG_CONFIG_REQUIRES_PRIVATE@ diff --git a/java/examples/datasets/H5Ex_D_Alloc.java b/java/examples/datasets/H5Ex_D_Alloc.java index dd7e7ae..4e10c23 100644 --- a/java/examples/datasets/H5Ex_D_Alloc.java +++ b/java/examples/datasets/H5Ex_D_Alloc.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -65,11 +64,11 @@ public class H5Ex_D_Alloc { } private static void allocation() { - long file_id = -1; - long filespace_id = -1; - long dataset_id1 = -1; - long dataset_id2 = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id1 = HDF5Constants.H5I_INVALID_HID; + long dataset_id2 = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; int space_status = 0; diff --git a/java/examples/datasets/H5Ex_D_Checksum.java b/java/examples/datasets/H5Ex_D_Checksum.java index 9dcfdb3..781dd68 100644 --- a/java/examples/datasets/H5Ex_D_Checksum.java +++ b/java/examples/datasets/H5Ex_D_Checksum.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -93,10 +92,10 @@ public class H5Ex_D_Checksum { } private static void writeChecksum() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -193,9 +192,9 @@ public class H5Ex_D_Checksum { } private static void readChecksum() { - long file_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open an existing file. diff --git a/java/examples/datasets/H5Ex_D_Chunk.java b/java/examples/datasets/H5Ex_D_Chunk.java index 3afa53c..2ddf293 100644 --- a/java/examples/datasets/H5Ex_D_Chunk.java +++ b/java/examples/datasets/H5Ex_D_Chunk.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -66,10 +65,10 @@ public class H5Ex_D_Chunk { } private static void writeChunk() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -201,10 +200,10 @@ public class H5Ex_D_Chunk { } private static void readChunk() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open an existing file. diff --git a/java/examples/datasets/H5Ex_D_Compact.java b/java/examples/datasets/H5Ex_D_Compact.java index 347c05c..0abf8da 100644 --- a/java/examples/datasets/H5Ex_D_Compact.java +++ b/java/examples/datasets/H5Ex_D_Compact.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -60,10 +59,10 @@ public class H5Ex_D_Compact { } private static void writeCompact() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -163,10 +162,10 @@ public class H5Ex_D_Compact { } private static void readCompact() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open file and dataset using the default properties. diff --git a/java/examples/datasets/H5Ex_D_External.java b/java/examples/datasets/H5Ex_D_External.java index 5cf03af..9c3787f 100644 --- a/java/examples/datasets/H5Ex_D_External.java +++ b/java/examples/datasets/H5Ex_D_External.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -34,10 +33,10 @@ public class H5Ex_D_External { private static final int NAME_BUF_SIZE = 32; private static void writeExternal() { - long file_id = -1; - long dcpl_id = -1; - long filespace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -138,9 +137,9 @@ public class H5Ex_D_External { } private static void readExternal() { - long file_id = -1; - long dcpl_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; String[] Xname = new String[1]; diff --git a/java/examples/datasets/H5Ex_D_FillValue.java b/java/examples/datasets/H5Ex_D_FillValue.java index a19c026..3526993 100644 --- a/java/examples/datasets/H5Ex_D_FillValue.java +++ b/java/examples/datasets/H5Ex_D_FillValue.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -40,10 +39,10 @@ public class H5Ex_D_FillValue { private static final int FILLVAL = 99; private static void fillValue() { - long file_id = -1; - long dcpl_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] extdims = { EDIM_X, EDIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; diff --git a/java/examples/datasets/H5Ex_D_Gzip.java b/java/examples/datasets/H5Ex_D_Gzip.java index 67d15bb..404ff05 100644 --- a/java/examples/datasets/H5Ex_D_Gzip.java +++ b/java/examples/datasets/H5Ex_D_Gzip.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -95,10 +94,10 @@ public class H5Ex_D_Gzip { } private static void writeGzip() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -196,9 +195,9 @@ public class H5Ex_D_Gzip { } private static void readGzip() { - long file_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open an existing file. diff --git a/java/examples/datasets/H5Ex_D_Hyperslab.java b/java/examples/datasets/H5Ex_D_Hyperslab.java index 57dfa6a..fa3473f 100644 --- a/java/examples/datasets/H5Ex_D_Hyperslab.java +++ b/java/examples/datasets/H5Ex_D_Hyperslab.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -34,9 +33,9 @@ public class H5Ex_D_Hyperslab { private static final int RANK = 2; private static void writeHyperslab() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -142,10 +141,10 @@ public class H5Ex_D_Hyperslab { } private static void readHyperslab() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open an existing file. diff --git a/java/examples/datasets/H5Ex_D_Nbit.java b/java/examples/datasets/H5Ex_D_Nbit.java index d995a02..35d23a9 100644 --- a/java/examples/datasets/H5Ex_D_Nbit.java +++ b/java/examples/datasets/H5Ex_D_Nbit.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -96,11 +95,11 @@ public class H5Ex_D_Nbit { } private static void writeData() throws Exception { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dtype_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dtype_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -157,9 +156,9 @@ public class H5Ex_D_Nbit { } private static void readData() throws Exception { - long file_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open an existing file. diff --git a/java/examples/datasets/H5Ex_D_ReadWrite.java b/java/examples/datasets/H5Ex_D_ReadWrite.java index 3f6e9ac..db930d3 100644 --- a/java/examples/datasets/H5Ex_D_ReadWrite.java +++ b/java/examples/datasets/H5Ex_D_ReadWrite.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -32,9 +31,9 @@ public class H5Ex_D_ReadWrite { private static final int RANK = 2; private static void WriteDataset() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -109,8 +108,8 @@ public class H5Ex_D_ReadWrite { } private static void ReadDataset() { - long file_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open file using the default properties. diff --git a/java/examples/datasets/H5Ex_D_Shuffle.java b/java/examples/datasets/H5Ex_D_Shuffle.java index 9677e75..1dd7c6a 100644 --- a/java/examples/datasets/H5Ex_D_Shuffle.java +++ b/java/examples/datasets/H5Ex_D_Shuffle.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -122,10 +121,10 @@ public class H5Ex_D_Shuffle { } private static void writeShuffle() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -229,9 +228,9 @@ public class H5Ex_D_Shuffle { } private static void readShuffle() { - long file_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open an existing file. diff --git a/java/examples/datasets/H5Ex_D_Sofloat.java b/java/examples/datasets/H5Ex_D_Sofloat.java index 5818371..a42aba4 100644 --- a/java/examples/datasets/H5Ex_D_Sofloat.java +++ b/java/examples/datasets/H5Ex_D_Sofloat.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -96,10 +95,10 @@ public class H5Ex_D_Sofloat { } private static void writeData() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; double[][] dset_data = new double[DIM_X][DIM_Y]; @@ -213,9 +212,9 @@ public class H5Ex_D_Sofloat { } private static void readData() { - long file_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; double[][] dset_data = new double[DIM_X][DIM_Y]; // Open file using the default properties. diff --git a/java/examples/datasets/H5Ex_D_Soint.java b/java/examples/datasets/H5Ex_D_Soint.java index 3f5f170..dd7664f 100644 --- a/java/examples/datasets/H5Ex_D_Soint.java +++ b/java/examples/datasets/H5Ex_D_Soint.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -96,10 +95,10 @@ public class H5Ex_D_Soint { } private static void writeData() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -195,9 +194,9 @@ public class H5Ex_D_Soint { } private static void readData() { - long file_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open file using the default properties. diff --git a/java/examples/datasets/H5Ex_D_Szip.java b/java/examples/datasets/H5Ex_D_Szip.java index 57ba873..3fdc712 100644 --- a/java/examples/datasets/H5Ex_D_Szip.java +++ b/java/examples/datasets/H5Ex_D_Szip.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -95,10 +94,10 @@ public class H5Ex_D_Szip { } private static void writeSzip() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -196,9 +195,9 @@ public class H5Ex_D_Szip { } private static void readSzip() { - long file_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open an existing file. diff --git a/java/examples/datasets/H5Ex_D_Transform.java b/java/examples/datasets/H5Ex_D_Transform.java index 04bfa2e..069e80b 100644 --- a/java/examples/datasets/H5Ex_D_Transform.java +++ b/java/examples/datasets/H5Ex_D_Transform.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -36,10 +35,10 @@ public class H5Ex_D_Transform { private static String RTRANSFORM = "x-1"; private static void writeData() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long dxpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dxpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; @@ -144,9 +143,9 @@ public class H5Ex_D_Transform { private static void readData() { - long file_id = -1; - long dataset_id = -1; - long dxpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dxpl_id = HDF5Constants.H5I_INVALID_HID; int[][] dset_data = new int[DIM_X][DIM_Y]; // Open an existing file using the default properties. diff --git a/java/examples/datasets/H5Ex_D_UnlimitedAdd.java b/java/examples/datasets/H5Ex_D_UnlimitedAdd.java index 925023a..c82b2d6 100644 --- a/java/examples/datasets/H5Ex_D_UnlimitedAdd.java +++ b/java/examples/datasets/H5Ex_D_UnlimitedAdd.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -39,10 +38,10 @@ public class H5Ex_D_UnlimitedAdd { private static final int NDIMS = 2; private static void writeUnlimited() { - long file_id = -1; - long dcpl_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; long[] maxdims = { HDF5Constants.H5S_UNLIMITED, HDF5Constants.H5S_UNLIMITED }; @@ -143,9 +142,9 @@ public class H5Ex_D_UnlimitedAdd { } private static void extendUnlimited() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] extdims = { EDIM_X, EDIM_Y }; long[] start = { 0, 0 }; @@ -293,9 +292,9 @@ public class H5Ex_D_UnlimitedAdd { } private static void readUnlimited() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data; diff --git a/java/examples/datasets/H5Ex_D_UnlimitedGzip.java b/java/examples/datasets/H5Ex_D_UnlimitedGzip.java index 40ddc60..675b1ba 100644 --- a/java/examples/datasets/H5Ex_D_UnlimitedGzip.java +++ b/java/examples/datasets/H5Ex_D_UnlimitedGzip.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -99,10 +98,10 @@ public class H5Ex_D_UnlimitedGzip { } private static void writeUnlimited() { - long file_id = -1; - long dcpl_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; long[] maxdims = { HDF5Constants.H5S_UNLIMITED, HDF5Constants.H5S_UNLIMITED }; @@ -200,9 +199,9 @@ public class H5Ex_D_UnlimitedGzip { } private static void extendUnlimited() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] extdims = { EDIM_X, EDIM_Y }; long[] start = { 0, 0 }; @@ -350,10 +349,10 @@ public class H5Ex_D_UnlimitedGzip { } private static void readUnlimited() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data; diff --git a/java/examples/datasets/H5Ex_D_UnlimitedMod.java b/java/examples/datasets/H5Ex_D_UnlimitedMod.java index 0476bc1..273ac3e 100644 --- a/java/examples/datasets/H5Ex_D_UnlimitedMod.java +++ b/java/examples/datasets/H5Ex_D_UnlimitedMod.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -39,10 +38,10 @@ public class H5Ex_D_UnlimitedMod { private static final int NDIMS = 2; private static void writeUnlimited() { - long file_id = -1; - long dcpl_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] chunk_dims = { CHUNK_X, CHUNK_Y }; long[] maxdims = { HDF5Constants.H5S_UNLIMITED, HDF5Constants.H5S_UNLIMITED }; @@ -143,9 +142,9 @@ public class H5Ex_D_UnlimitedMod { } private static void extendUnlimited() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; long[] extdims = { EDIM_X, EDIM_Y }; int[][] dset_data; @@ -279,9 +278,9 @@ public class H5Ex_D_UnlimitedMod { } private static void readUnlimited() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data; diff --git a/java/examples/datasets/JavaDatasetExample.sh.in b/java/examples/datasets/JavaDatasetExample.sh.in index 0aa3da5..f29739a 100644 --- a/java/examples/datasets/JavaDatasetExample.sh.in +++ b/java/examples/datasets/JavaDatasetExample.sh.in @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including @@ -15,6 +14,7 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ +IS_DARWIN="@H5_IS_DARWIN@" USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" @@ -36,8 +36,8 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" HDFTEST_HOME="$top_srcdir/java/examples/datasets" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@datasets.jar @@ -113,6 +113,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd $BLDLIBDIR; \ + 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 diff --git a/java/examples/datatypes/H5Ex_T_Array.java b/java/examples/datatypes/H5Ex_T_Array.java index 30eb360..3939b38 100644 --- a/java/examples/datatypes/H5Ex_T_Array.java +++ b/java/examples/datatypes/H5Ex_T_Array.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -34,11 +33,11 @@ public class H5Ex_T_Array { private static final int NDIMS = 2; private static void CreateDataset() { - long file_id = -1; - long filetype_id = -1; - long memtype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; long[] adims = { ADIM0, ADIM1 }; int[][][] dset_data = new int[DIM0][ADIM0][ADIM1]; @@ -152,10 +151,10 @@ public class H5Ex_T_Array { } private static void ReadDataset() { - long file_id = -1; - long filetype_id = -1; - long memtype_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; long[] adims = { ADIM0, ADIM1 }; int[][][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_ArrayAttribute.java b/java/examples/datatypes/H5Ex_T_ArrayAttribute.java index 26d7fb6..c4c4bc4 100644 --- a/java/examples/datatypes/H5Ex_T_ArrayAttribute.java +++ b/java/examples/datatypes/H5Ex_T_ArrayAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -35,12 +34,12 @@ public class H5Ex_T_ArrayAttribute { private static final int NDIMS = 2; private static void CreateDataset() { - long file_id = -1; - long filetype_id = -1; - long memtype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; long[] adims = { ADIM0, ADIM1 }; int[][][] dset_data = new int[DIM0][ADIM0][ADIM1]; @@ -84,7 +83,7 @@ public class H5Ex_T_ArrayAttribute { dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -175,11 +174,11 @@ public class H5Ex_T_ArrayAttribute { } private static void ReadDataset() { - long file_id = -1; - long filetype_id = -1; - long memtype_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; long[] adims = { ADIM0, ADIM1 }; int[][][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_Bit.java b/java/examples/datatypes/H5Ex_T_Bit.java index 30acda4..45d4e8a 100644 --- a/java/examples/datatypes/H5Ex_T_Bit.java +++ b/java/examples/datatypes/H5Ex_T_Bit.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -32,9 +31,9 @@ public class H5Ex_T_Bit { private static final int RANK = 2; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; int[][] dset_data = new int[DIM0][DIM1]; @@ -116,9 +115,9 @@ public class H5Ex_T_Bit { } private static void ReadDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; int[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_BitAttribute.java b/java/examples/datatypes/H5Ex_T_BitAttribute.java index 2059dd5..9b33ca5 100644 --- a/java/examples/datatypes/H5Ex_T_BitAttribute.java +++ b/java/examples/datatypes/H5Ex_T_BitAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -33,10 +32,10 @@ public class H5Ex_T_BitAttribute { private static final int RANK = 2; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; int[][] dset_data = new int[DIM0][DIM1]; @@ -66,7 +65,7 @@ public class H5Ex_T_BitAttribute { dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -139,10 +138,10 @@ public class H5Ex_T_BitAttribute { } private static void ReadDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; int[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_Commit.java b/java/examples/datatypes/H5Ex_T_Commit.java index 35caa6b..62db5ea 100644 --- a/java/examples/datatypes/H5Ex_T_Commit.java +++ b/java/examples/datatypes/H5Ex_T_Commit.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -101,9 +100,9 @@ public class H5Ex_T_Commit { } private static void CreateDataType() { - long file_id = -1; - long strtype_id = -1; - long filetype_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long strtype_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; Sensor_Datatype datatypes = new Sensor_Datatype(); // Create a new file using default properties. try { @@ -183,9 +182,9 @@ public class H5Ex_T_Commit { } private static void ReadDataType() { - long file_id = -1; - long typeclass_id = -1; - long filetype_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long typeclass_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; // Open an existing file. try { diff --git a/java/examples/datatypes/H5Ex_T_Compound.java b/java/examples/datatypes/H5Ex_T_Compound.java index 61e79c7..8c83ebb 100644 --- a/java/examples/datatypes/H5Ex_T_Compound.java +++ b/java/examples/datatypes/H5Ex_T_Compound.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -122,12 +121,12 @@ public class H5Ex_T_Compound { } private static void CreateDataset() { - long file_id = -1; - long strtype_id = -1; - long memtype_id = -1; - long filetype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long strtype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; Sensor[] object_data = new Sensor[DIM0]; byte[] dset_data = null; @@ -286,11 +285,11 @@ public class H5Ex_T_Compound { } private static void ReadDataset() { - long file_id = -1; - long strtype_id = -1; - long memtype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long strtype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; Sensor[] object_data2; byte[] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_CompoundAttribute.java b/java/examples/datatypes/H5Ex_T_CompoundAttribute.java index 4294b4a..58d2fb7 100644 --- a/java/examples/datatypes/H5Ex_T_CompoundAttribute.java +++ b/java/examples/datatypes/H5Ex_T_CompoundAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -125,13 +124,13 @@ public class H5Ex_T_CompoundAttribute { } private static void CreateDataset() { - long file_id = -1; - long strtype_id = -1; - long memtype_id = -1; - long filetype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long strtype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; Sensor[] object_data = new Sensor[DIM0]; byte[] dset_data = null; @@ -205,7 +204,7 @@ public class H5Ex_T_CompoundAttribute { dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -310,12 +309,12 @@ public class H5Ex_T_CompoundAttribute { } private static void ReadDataset() { - long file_id = -1; - long strtype_id = -1; - long memtype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long strtype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; Sensor[] object_data2; byte[] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_Float.java b/java/examples/datatypes/H5Ex_T_Float.java index e469d63..e8da7f6 100644 --- a/java/examples/datatypes/H5Ex_T_Float.java +++ b/java/examples/datatypes/H5Ex_T_Float.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -36,9 +35,9 @@ public class H5Ex_T_Float { private static final int RANK = 2; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; double[][] dset_data = new double[DIM0][DIM1]; @@ -120,9 +119,9 @@ public class H5Ex_T_Float { } private static void ReadDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; double[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_FloatAttribute.java b/java/examples/datatypes/H5Ex_T_FloatAttribute.java index b6c92be..eb8e1f8 100644 --- a/java/examples/datatypes/H5Ex_T_FloatAttribute.java +++ b/java/examples/datatypes/H5Ex_T_FloatAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -37,10 +36,10 @@ public class H5Ex_T_FloatAttribute { private static final int RANK = 2; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; double[][] dset_data = new double[DIM0][DIM1]; @@ -66,7 +65,7 @@ public class H5Ex_T_FloatAttribute { dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -139,10 +138,10 @@ public class H5Ex_T_FloatAttribute { } private static void ReadDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; double[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_Integer.java b/java/examples/datatypes/H5Ex_T_Integer.java index f0b3755..bb8e0cb 100644 --- a/java/examples/datatypes/H5Ex_T_Integer.java +++ b/java/examples/datatypes/H5Ex_T_Integer.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -34,9 +33,9 @@ public class H5Ex_T_Integer { private static final int RANK = 2; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; int[][] dset_data = new int[DIM0][DIM1]; @@ -117,9 +116,9 @@ public class H5Ex_T_Integer { } private static void ReadDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; int[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_IntegerAttribute.java b/java/examples/datatypes/H5Ex_T_IntegerAttribute.java index 8c85c63..b0df5e4 100644 --- a/java/examples/datatypes/H5Ex_T_IntegerAttribute.java +++ b/java/examples/datatypes/H5Ex_T_IntegerAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -35,10 +34,10 @@ public class H5Ex_T_IntegerAttribute { private static final int RANK = 2; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; int[][] dset_data = new int[DIM0][DIM1]; @@ -64,7 +63,7 @@ public class H5Ex_T_IntegerAttribute { dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -137,10 +136,10 @@ public class H5Ex_T_IntegerAttribute { } private static void ReadDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0, DIM1 }; int[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_ObjectReference.java b/java/examples/datatypes/H5Ex_T_ObjectReference.java index 97f02af..38536b8 100644 --- a/java/examples/datatypes/H5Ex_T_ObjectReference.java +++ b/java/examples/datatypes/H5Ex_T_ObjectReference.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -65,11 +64,11 @@ public class H5Ex_T_ObjectReference { } private static void writeObjRef() { - long file_id = -1; - long dataspace_id = -1; - long filespace_id = -1; - long group_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[][] dset_data = new byte[DIM0][8]; @@ -90,9 +89,9 @@ public class H5Ex_T_ObjectReference { HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); if (dataset_id >= 0) H5.H5Dclose(dataset_id); - dataset_id = -1; + dataset_id = HDF5Constants.H5I_INVALID_HID; H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -106,7 +105,7 @@ public class H5Ex_T_ObjectReference { HDF5Constants.H5P_DEFAULT); if (group_id >= 0) H5.H5Gclose(group_id); - group_id = -1; + group_id = HDF5Constants.H5I_INVALID_HID; } catch (Exception e) { e.printStackTrace(); @@ -187,11 +186,11 @@ public class H5Ex_T_ObjectReference { } private static void readObjRef() { - long file_id = -1; - long dataset_id = -1; - long dataspace_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; int object_type = -1; - long object_id = -1; + long object_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java b/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java index b1cab7c..b38b0a0 100644 --- a/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java +++ b/java/examples/datatypes/H5Ex_T_ObjectReferenceAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -67,11 +66,11 @@ public class H5Ex_T_ObjectReferenceAttribute { } private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long group_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[][] dset_data = new byte[DIM0][8]; @@ -92,9 +91,9 @@ public class H5Ex_T_ObjectReferenceAttribute { HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); if (dataset_id >= 0) H5.H5Dclose(dataset_id); - dataset_id = -1; + dataset_id = HDF5Constants.H5I_INVALID_HID; H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -108,7 +107,7 @@ public class H5Ex_T_ObjectReferenceAttribute { HDF5Constants.H5P_DEFAULT); if (group_id >= 0) H5.H5Gclose(group_id); - group_id = -1; + group_id = HDF5Constants.H5I_INVALID_HID; } catch (Exception e) { e.printStackTrace(); @@ -139,7 +138,7 @@ public class H5Ex_T_ObjectReferenceAttribute { dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -212,12 +211,12 @@ public class H5Ex_T_ObjectReferenceAttribute { } private static void ReadDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; int object_type = -1; - long object_id = -1; + long object_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_Opaque.java b/java/examples/datatypes/H5Ex_T_Opaque.java index 1d9ab1b..e851fb2 100644 --- a/java/examples/datatypes/H5Ex_T_Opaque.java +++ b/java/examples/datatypes/H5Ex_T_Opaque.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -32,10 +31,10 @@ public class H5Ex_T_Opaque { private static final int RANK = 1; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long datatype_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long datatype_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[] dset_data = new byte[DIM0 * LEN]; byte[] str_data = { 'O', 'P', 'A', 'Q', 'U', 'E' }; @@ -138,11 +137,11 @@ public class H5Ex_T_Opaque { } private static void ReadDataset() { - long file_id = -1; - long datatype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long type_len = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long datatype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long type_len = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[] dset_data; String tag_name = null; diff --git a/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java b/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java index 8955d77..3e16ab4 100644 --- a/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java +++ b/java/examples/datatypes/H5Ex_T_OpaqueAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -33,11 +32,11 @@ public class H5Ex_T_OpaqueAttribute { private static final int RANK = 1; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long datatype_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long datatype_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[] dset_data = new byte[DIM0 * LEN]; byte[] str_data = { 'O', 'P', 'A', 'Q', 'U', 'E' }; @@ -65,7 +64,7 @@ public class H5Ex_T_OpaqueAttribute { dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -158,11 +157,11 @@ public class H5Ex_T_OpaqueAttribute { } private static void ReadDataset() { - long file_id = -1; - long datatype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long datatype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long type_len = -1; long[] dims = { DIM0 }; byte[] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_String.java b/java/examples/datatypes/H5Ex_T_String.java index f91d866..e497bd8 100644 --- a/java/examples/datatypes/H5Ex_T_String.java +++ b/java/examples/datatypes/H5Ex_T_String.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -32,11 +31,11 @@ public class H5Ex_T_String { private static final int RANK = 1; private static void CreateDataset() { - long file_id = -1; - long memtype_id = -1; - long filetype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[][] dset_data = new byte[DIM0][SDIM]; StringBuffer[] str_data = { new StringBuffer("Parting"), new StringBuffer("is such"), @@ -156,11 +155,11 @@ public class H5Ex_T_String { } private static void ReadDataset() { - long file_id = -1; - long filetype_id = -1; - long memtype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long sdim = 0; long[] dims = { DIM0 }; byte[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_StringAttribute.java b/java/examples/datatypes/H5Ex_T_StringAttribute.java index 7fe46c8..700f6a9 100644 --- a/java/examples/datatypes/H5Ex_T_StringAttribute.java +++ b/java/examples/datatypes/H5Ex_T_StringAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -33,12 +32,12 @@ public class H5Ex_T_StringAttribute { private static final int RANK = 1; private static void CreateDataset() { - long file_id = -1; - long memtype_id = -1; - long filetype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM0 }; byte[][] dset_data = new byte[DIM0][SDIM]; StringBuffer[] str_data = { new StringBuffer("Parting"), new StringBuffer("is such"), @@ -80,7 +79,7 @@ public class H5Ex_T_StringAttribute { dataset_id = H5.H5Dcreate(file_id, DATASETNAME, HDF5Constants.H5T_STD_I32LE, dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } } catch (Exception e) { @@ -179,12 +178,12 @@ public class H5Ex_T_StringAttribute { } private static void ReadDataset() { - long file_id = -1; - long filetype_id = -1; - long memtype_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filetype_id = HDF5Constants.H5I_INVALID_HID; + long memtype_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long sdim = 0; long[] dims = { DIM0 }; byte[][] dset_data; diff --git a/java/examples/datatypes/H5Ex_T_VLString.java b/java/examples/datatypes/H5Ex_T_VLString.java index e1c9bd5..8a29e60 100644 --- a/java/examples/datatypes/H5Ex_T_VLString.java +++ b/java/examples/datatypes/H5Ex_T_VLString.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -26,10 +25,10 @@ public class H5Ex_T_VLString private static String DATASETNAME = "DS1"; private static void createDataset() { - long file_id = -1; - long type_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long type_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; int rank = 1; String[] str_data = { "Parting", "is such", "sweet", "sorrow." }; long[] dims = { str_data.length }; @@ -93,9 +92,9 @@ public class H5Ex_T_VLString } private static void readDataset() { - long file_id = -1; - long type_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long type_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; String[] str_data = { "", "", "", "" }; try { diff --git a/java/examples/datatypes/JavaDatatypeExample.sh.in b/java/examples/datatypes/JavaDatatypeExample.sh.in index 481d6e7..e26d8c0 100644 --- a/java/examples/datatypes/JavaDatatypeExample.sh.in +++ b/java/examples/datatypes/JavaDatatypeExample.sh.in @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including @@ -15,6 +14,7 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ +IS_DARWIN="@H5_IS_DARWIN@" TESTNAME=EX_Datatypes EXIT_SUCCESS=0 @@ -33,8 +33,8 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" HDFTEST_HOME="$top_srcdir/java/examples/datatypes" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@datatypes.jar @@ -110,6 +110,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd $BLDLIBDIR; \ + 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 diff --git a/java/examples/groups/H5Ex_G_Compact.java b/java/examples/groups/H5Ex_G_Compact.java index 6078c6c..313c9c7 100644 --- a/java/examples/groups/H5Ex_G_Compact.java +++ b/java/examples/groups/H5Ex_G_Compact.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -60,9 +59,9 @@ public class H5Ex_G_Compact { } public static void CreateGroup() { - long file_id = -1; - long group_id = -1; - long fapl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; + long fapl_id = HDF5Constants.H5I_INVALID_HID; H5G_info_t ginfo; long size; diff --git a/java/examples/groups/H5Ex_G_Corder.java b/java/examples/groups/H5Ex_G_Corder.java index 74f70ba..5df850e 100644 --- a/java/examples/groups/H5Ex_G_Corder.java +++ b/java/examples/groups/H5Ex_G_Corder.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -25,10 +24,10 @@ public class H5Ex_G_Corder { private static String FILE = "H5Ex_G_Corder.h5"; private static void CreateGroup() throws Exception { - long file_id = -1; - long group_id = -1; - long subgroup_id = -1; - long gcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; + long subgroup_id = HDF5Constants.H5I_INVALID_HID; + long gcpl_id = HDF5Constants.H5I_INVALID_HID; int status; H5G_info_t ginfo; int i; diff --git a/java/examples/groups/H5Ex_G_Create.java b/java/examples/groups/H5Ex_G_Create.java index f653987..9304538 100644 --- a/java/examples/groups/H5Ex_G_Create.java +++ b/java/examples/groups/H5Ex_G_Create.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -25,8 +24,8 @@ public class H5Ex_G_Create { private static String GROUPNAME = "G1"; private static void CreateGroup() { - long file_id = -1; - long group_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; // Create a new file using default properties. try { diff --git a/java/examples/groups/H5Ex_G_Intermediate.java b/java/examples/groups/H5Ex_G_Intermediate.java index 6109e9a..ad0290c 100644 --- a/java/examples/groups/H5Ex_G_Intermediate.java +++ b/java/examples/groups/H5Ex_G_Intermediate.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -31,9 +30,9 @@ public class H5Ex_G_Intermediate { private void CreateGroup() throws Exception { - long file_id = -1; - long group_id = -1; - long gcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; + long gcpl_id = HDF5Constants.H5I_INVALID_HID; try { // Create a new file_id using the default properties. diff --git a/java/examples/groups/H5Ex_G_Iterate.java b/java/examples/groups/H5Ex_G_Iterate.java index 71361f8..6caecac 100644 --- a/java/examples/groups/H5Ex_G_Iterate.java +++ b/java/examples/groups/H5Ex_G_Iterate.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -58,7 +57,7 @@ public class H5Ex_G_Iterate { } private static void do_iterate() { - long file_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; // Open a file using default properties. try { diff --git a/java/examples/groups/H5Ex_G_Phase.java b/java/examples/groups/H5Ex_G_Phase.java index 7824123..67a2f53 100644 --- a/java/examples/groups/H5Ex_G_Phase.java +++ b/java/examples/groups/H5Ex_G_Phase.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -60,11 +59,11 @@ public class H5Ex_G_Phase { } private static void CreateGroup() { - long file_id = -1; - long group_id = -1; - long subgroup_id = -1; - long fapl_id = -1; - long gcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; + long subgroup_id = HDF5Constants.H5I_INVALID_HID; + long fapl_id = HDF5Constants.H5I_INVALID_HID; + long gcpl_id = HDF5Constants.H5I_INVALID_HID; H5G_info_t ginfo; String name = "G0"; // Name of subgroup_id int i; diff --git a/java/examples/groups/H5Ex_G_Traverse.java b/java/examples/groups/H5Ex_G_Traverse.java index 76ed6c8..c5b6373 100644 --- a/java/examples/groups/H5Ex_G_Traverse.java +++ b/java/examples/groups/H5Ex_G_Traverse.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -43,7 +42,7 @@ public class H5Ex_G_Traverse { public static H5L_iterate_t iter_cb = new H5L_iter_callbackT(); private static void OpenGroup() { - long file_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; H5O_info_t infobuf; opdata od = new opdata(); diff --git a/java/examples/groups/H5Ex_G_Visit.java b/java/examples/groups/H5Ex_G_Visit.java index c479259..790be80 100644 --- a/java/examples/groups/H5Ex_G_Visit.java +++ b/java/examples/groups/H5Ex_G_Visit.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -47,7 +46,7 @@ public class H5Ex_G_Visit { private void VisitGroup() throws Exception { - long file_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; try { // Open file diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in index 34cf643..3b0e9d1 100644 --- a/java/examples/groups/JavaGroupExample.sh.in +++ b/java/examples/groups/JavaGroupExample.sh.in @@ -14,6 +14,7 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ +IS_DARWIN="@H5_IS_DARWIN@" TESTNAME=EX_Groups EXIT_SUCCESS=0 @@ -32,9 +33,9 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" -BLDITERDIR="./groups" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" +BLDITERDIR="./groups" HDFTEST_HOME="$top_srcdir/java/examples/groups" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar @@ -104,6 +105,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd $BLDLIBDIR; \ + 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 diff --git a/java/examples/intro/H5_CreateAttribute.java b/java/examples/intro/H5_CreateAttribute.java index 22b03ad..949a770 100644 --- a/java/examples/intro/H5_CreateAttribute.java +++ b/java/examples/intro/H5_CreateAttribute.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -28,10 +27,10 @@ public class H5_CreateAttribute { private static String DATASETATTRIBUTE = "Units"; private static void CreateDatasetAttribute() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long attribute_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; long[] dims1 = { DIM_X, DIM_Y }; long[] dims = { 2 }; int[] attr_data = { 100, 200 }; diff --git a/java/examples/intro/H5_CreateDataset.java b/java/examples/intro/H5_CreateDataset.java index 7b56e83..f938be2 100644 --- a/java/examples/intro/H5_CreateDataset.java +++ b/java/examples/intro/H5_CreateDataset.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -27,9 +26,9 @@ public class H5_CreateDataset { private static final int DIM_Y = 6; private static void CreateDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; // Create a new file using default properties. diff --git a/java/examples/intro/H5_CreateFile.java b/java/examples/intro/H5_CreateFile.java index 367e61f..d48ba6c 100644 --- a/java/examples/intro/H5_CreateFile.java +++ b/java/examples/intro/H5_CreateFile.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -24,7 +23,7 @@ public class H5_CreateFile { static final String FILENAME = "H5_CreateFile.h5"; private static void CreateFile() { - long file_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; // Create a new file using default properties. try { diff --git a/java/examples/intro/H5_CreateGroup.java b/java/examples/intro/H5_CreateGroup.java index 54f6252..c0bb954 100644 --- a/java/examples/intro/H5_CreateGroup.java +++ b/java/examples/intro/H5_CreateGroup.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -25,8 +24,8 @@ public class H5_CreateGroup { private static String GROUPNAME = "MyGroup"; private static void CreateGroup() { - long file_id = -1; - long group_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; // Create a new file using default properties. try { diff --git a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java index b9c35d7..f2c6168 100644 --- a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java +++ b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -27,10 +26,10 @@ public class H5_CreateGroupAbsoluteRelative { private static String GROUPNAME_B = "GroupB"; private static void CreateGroupAbsoluteAndRelative() { - long file_id = -1; - long group1_id = -1; - long group2_id = -1; - long group3_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long group1_id = HDF5Constants.H5I_INVALID_HID; + long group2_id = HDF5Constants.H5I_INVALID_HID; + long group3_id = HDF5Constants.H5I_INVALID_HID; // Create a new file using default properties. try { diff --git a/java/examples/intro/H5_CreateGroupDataset.java b/java/examples/intro/H5_CreateGroupDataset.java index 191a21a..f1d1cba 100644 --- a/java/examples/intro/H5_CreateGroupDataset.java +++ b/java/examples/intro/H5_CreateGroupDataset.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -32,12 +31,12 @@ public class H5_CreateGroupDataset { private static final int DIM2_Y = 10; private static void h5_crtgrpd() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; - long group_id = -1; - long group1_id = -1; - long group2_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long group_id = HDF5Constants.H5I_INVALID_HID; + long group1_id = HDF5Constants.H5I_INVALID_HID; + long group2_id = HDF5Constants.H5I_INVALID_HID; int[][] dset1_data = new int[DIM1_X][DIM1_Y]; int[][] dset2_data = new int[DIM2_X][DIM2_Y]; long[] dims1 = { DIM1_X, DIM1_Y }; @@ -108,7 +107,7 @@ public class H5_CreateGroupDataset { try { if (dataspace_id >= 0) H5.H5Sclose(dataspace_id); - dataspace_id = -1; + dataspace_id = HDF5Constants.H5I_INVALID_HID; } catch (Exception e) { e.printStackTrace(); @@ -118,7 +117,7 @@ public class H5_CreateGroupDataset { try { if (dataset_id >= 0) H5.H5Dclose(dataset_id); - dataset_id = -1; + dataset_id = HDF5Constants.H5I_INVALID_HID; } catch (Exception e) { e.printStackTrace(); diff --git a/java/examples/intro/H5_ReadWrite.java b/java/examples/intro/H5_ReadWrite.java index 812ac77..67e1ac5 100644 --- a/java/examples/intro/H5_ReadWrite.java +++ b/java/examples/intro/H5_ReadWrite.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -27,9 +26,9 @@ public class H5_ReadWrite { private static final int DIM_Y = 6; private static void ReadWriteDataset() { - long file_id = -1; - long dataspace_id = -1; - long dataset_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; long[] dims = { DIM_X, DIM_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; diff --git a/java/examples/intro/JavaIntroExample.sh.in b/java/examples/intro/JavaIntroExample.sh.in index 4eac31d..db741e5 100644 --- a/java/examples/intro/JavaIntroExample.sh.in +++ b/java/examples/intro/JavaIntroExample.sh.in @@ -1,7 +1,6 @@ #! /bin/sh # # Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. # All rights reserved. # # This file is part of HDF5. The full HDF5 copyright notice, including @@ -15,6 +14,7 @@ top_builddir=@top_builddir@ top_srcdir=@top_srcdir@ srcdir=@srcdir@ +IS_DARWIN="@H5_IS_DARWIN@" TESTNAME=EX_Intro EXIT_SUCCESS=0 @@ -33,8 +33,8 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" -BLDLIBDIR="$top_builddir/hdf5/lib" BLDDIR="." +BLDLIBDIR="$BLDDIR/testlibs" HDFTEST_HOME="$top_srcdir/java/examples/intro" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@intro.jar @@ -99,6 +99,13 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done + if [ "$IS_DARWIN" = "yes" ]; then + (cd $BLDLIBDIR; \ + 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 diff --git a/java/src/Makefile.am b/java/src/Makefile.am index 98630e6..a0abb32 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -69,7 +69,7 @@ hdf5_java_JAVA = \ ${pkgpath}/callbacks/H5P_prp_set_func_cb.java \ ${pkgpath}/callbacks/H5P_iterate_cb.java \ ${pkgpath}/callbacks/H5P_iterate_t.java \ - ${pkgpath}/exceptions/HDF5AtomException.java \ + ${pkgpath}/exceptions/HDF5IdException.java \ ${pkgpath}/exceptions/HDF5AttributeException.java \ ${pkgpath}/exceptions/HDF5BtreeException.java \ ${pkgpath}/exceptions/HDF5DataFiltersException.java \ diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index f3d9b8d..5651031 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -42,7 +42,7 @@ set (HDF5_JAVA_HDF_HDF5_CALLBACKS_SOURCES set (HDF5_JAVA_HDF_HDF5_EXCEPTIONS_SOURCES exceptions/HDF5Exception.java - exceptions/HDF5AtomException.java + exceptions/HDF5IdException.java exceptions/HDF5AttributeException.java exceptions/HDF5BtreeException.java exceptions/HDF5DataFiltersException.java diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 3d0b308..aef0ba1 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -241,10 +241,14 @@ public class H5 implements java.io.Serializable { */ public final static int LIB_VERSION[] = { 1, 13, 0 }; + /** + * add system property to load library by path + */ public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; - // add system property to load library by name from library path, via - // System.loadLibrary() + /** + * add system property to load library by name from library path, via System.loadLibrary() + */ public final static String H5_LIBRARY_NAME_PROPERTY_KEY = "hdf.hdf5lib.H5.loadLibraryName"; private static String s_libraryName; private static boolean isLibraryLoaded = false; @@ -257,6 +261,9 @@ public class H5 implements java.io.Serializable { loadH5Lib(); } + /** + * load native library + */ public static void loadH5Lib() { // Make sure that the library is loaded only once if (isLibraryLoaded) @@ -468,6 +475,35 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5get_libversion(int[] libversion) throws HDF5LibraryException; + /** + * H5set_free_list_limits + * Sets limits on the different kinds of free lists. Setting a value + * of -1 for a limit means no limit of that type. These limits are global + * for the entire library. Each "global" limit only applies to free lists + * of that type, so if an application sets a limit of 1 MB on each of the + * global lists, up to 3 MB of total storage might be allocated (1MB on + * each of regular, array and block type lists). + * + * The settings for block free lists are duplicated to factory free lists. + * Factory free list limits cannot be set independently currently. + * + * @param reg_global_lim + * The limit on all "regular" free list memory used + * @param reg_list_lim + * The limit on memory used in each "regular" free list + * @param arr_global_lim + * The limit on all "array" free list memory used + * @param arr_list_lim + * The limit on memory used in each "array" free list + * @param blk_global_lim + * The limit on all "block" free list memory used + * @param blk_list_lim + * The limit on memory used in each "block" free list + * @return a non-negative value if successful, along with the version information. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + */ public synchronized static native int H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) throws HDF5LibraryException; @@ -476,8 +512,8 @@ public class H5 implements java.io.Serializable { * * @param file_export_name * The file name to export data into. - * @param file_name - * The name of the HDF5 file containing the dataset. + * @param file_id + * The identifier of the HDF5 file containing the dataset. * @param object_path * The full path of the dataset to be exported. * @param binary_order @@ -489,10 +525,31 @@ public class H5 implements java.io.Serializable { * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native void H5export_dataset(String file_export_name, String file_name, + public synchronized static native void H5export_dataset(String file_export_name, long file_id, String object_path, int binary_order) throws HDF5LibraryException; /** + * H5export_attribute is a utility function to save data in a file. + * + * @param file_export_name + * The file name to export data into. + * @param dataset_id + * The identifier of the dataset containing the attribute. + * @param attribute_name + * The attribute to be exported. + * @param binary_order + * 99 - export data as text. + * 1 - export data as binary Native Order. + * 2 - export data as binary Little Endian. + * 3 - export data as binary Big Endian. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5export_attribute(String file_export_name, long dataset_id, + String attribute_name, int binary_order) throws HDF5LibraryException; + + /** * H5is_library_threadsafe Checks to see if the library was built with thread-safety enabled. * * @return true if hdf5 library implements threadsafe @@ -1016,7 +1073,7 @@ public class H5 implements java.io.Serializable { /** * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with - * mem_type_id. The entire attribute is read into buf from the file. + * mem_type_id. The entire attribute is read into buffer from the file. * * @param attr_id * IN: Identifier of an attribute to read. @@ -1037,11 +1094,47 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Aread(long attr_id, long mem_type_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread(long attr_id, long mem_type_id, byte[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread(attr_id, mem_type_id, buf, true); } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param obj + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread(long attr_id, long mem_type_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException { return H5Aread(attr_id, mem_type_id, obj, true); @@ -1141,397 +1234,939 @@ public class H5 implements java.io.Serializable { return status; } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of double from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of double to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of double from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of double to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread_double(long attr_id, long mem_type_id, double[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread_double(attr_id, mem_type_id, buf, true); } + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of float from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of float to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of float from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of float to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Aread_float(long attr_id, long mem_type_id, float[] buf) throws HDF5LibraryException, NullPointerException { return H5Aread_float(attr_id, mem_type_id, buf, true); } - public synchronized static native int H5Aread_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Aread_int(long attr_id, long mem_type_id, int[] buf) - throws HDF5LibraryException, NullPointerException - { - return H5Aread_int(attr_id, mem_type_id, buf, true); - } - - public synchronized static native int H5Aread_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Aread_long(long attr_id, long mem_type_id, long[] buf) - throws HDF5LibraryException, NullPointerException - { - return H5Aread_long(attr_id, mem_type_id, buf, true); - } - - public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf) - throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Aread_short(long attr_id, long mem_type_id, short[] buf) - throws HDF5LibraryException, NullPointerException - { - return H5Aread_short(attr_id, mem_type_id, buf, true); - } - - public synchronized static native int H5AreadVL(long attr_id, long mem_type_id, Object[] buf) - throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5Aread_string(long attr_id, long mem_type_id, String[] buf) - throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5Aread_VLStrings(long attr_id, long mem_type_id, Object[] buf) - throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5AreadComplex(long attr_id, long mem_type_id, String[] buf) - throws HDF5LibraryException, NullPointerException; - /** - * H5Arename changes the name of attribute that is attached to the object specified by loc_id. The attribute named - * old_attr_name is renamed new_attr_name. + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of int from the file. * - * @param loc_id - * IN: Location or object identifier; may be dataset or group - * @param old_attr_name - * IN: Prior attribute name - * @param new_attr_name - * IN: New attribute name + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of int to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return A non-negative value if successful; otherwise returns a negative value. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - Name is null. + * - data buffer is null. **/ - public synchronized static native int H5Arename(long loc_id, String old_attr_name, String new_attr_name) + public synchronized static native int H5Aread_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; /** - * H5Arename_by_name changes the name of attribute that is attached to the object specified by loc_id and obj_name. - * The attribute named old_attr_name is renamed new_attr_name. + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of int from the file. * - * @param loc_id - * IN: Location or object identifier; may be dataset or group - * @param obj_name - * IN: Name of object, relative to location, whose attribute is to be renamed - * @param old_attr_name - * IN: Prior attribute name - * @param new_attr_name - * IN: New attribute name - * @param lapl_id - * IN: Link access property list + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of int to store data read from the file. * - * @return A non-negative value if successful; otherwise returns a negative value. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - Name is null. + * - data buffer is null. **/ - public synchronized static native int H5Arename_by_name(long loc_id, String obj_name, String old_attr_name, - String new_attr_name, long lapl_id) throws HDF5LibraryException, NullPointerException; + public synchronized static int H5Aread_int(long attr_id, long mem_type_id, int[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Aread_int(attr_id, mem_type_id, buf, true); + } /** - * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with - * mem_type_id. The entire attribute is written from buf to the file. + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of long from the file. * * @param attr_id - * IN: Identifier of an attribute to write. + * IN: Identifier of an attribute to read. * @param mem_type_id * IN: Identifier of the attribute datatype (in memory). * @param buf - * IN: Buffer with data to be written to the file. + * Buffer of long to store data read from the file. * @param isCriticalPinning - * IN: request lock on data reference. + * request lock on data reference. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - data is null. + * - data buffer is null. **/ - public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning) + public synchronized static native int H5Aread_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; - public synchronized static int H5Awrite(long attr_id, long mem_type_id, byte[] buf) - throws HDF5LibraryException, NullPointerException - { - return H5Awrite(attr_id, mem_type_id, buf, true); - } - - public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj) - throws HDF5Exception, HDF5LibraryException, NullPointerException - { - return H5Awrite(attr_id, mem_type_id, obj, true); - } - /** - * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with - * mem_type_id. The entire attribute is written from data object to the file. + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of long from the file. * * @param attr_id - * IN: Identifier of an attribute to write. + * IN: Identifier of an attribute to read. * @param mem_type_id * IN: Identifier of the attribute datatype (in memory). - * @param obj - * IN: Data object to be written. - * @param isCriticalPinning - * request lock on data reference. + * @param buf + * Buffer of long to store data read from the file. * * @return a non-negative value if successful * - * @exception HDF5Exception - * - Failure in the data conversion. * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - data object is null + * - data buffer is null. **/ - public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning) - throws HDF5Exception, HDF5LibraryException, NullPointerException - { - int status = -1; - boolean is1D = false; - - Class dataClass = obj.getClass(); - if (!dataClass.isArray()) { - throw (new HDF5JavaException("H5Dwrite: data is not an array")); - } - - String cname = dataClass.getName(); - is1D = (cname.lastIndexOf('[') == cname.indexOf('[')); - char dname = cname.charAt(cname.lastIndexOf("[") + 1); - - if (is1D && (dname == 'B')) { - status = H5Awrite(attr_id, mem_type_id, (byte[]) obj, isCriticalPinning); - } - else if (is1D && (dname == 'S')) { - status = H5Awrite_short(attr_id, mem_type_id, (short[]) obj, isCriticalPinning); - } - else if (is1D && (dname == 'I')) { - status = H5Awrite_int(attr_id, mem_type_id, (int[]) obj, isCriticalPinning); - } - else if (is1D && (dname == 'J')) { - status = H5Awrite_long(attr_id, mem_type_id, (long[]) obj, isCriticalPinning); - } - else if (is1D && (dname == 'F')) { - status = H5Awrite_float(attr_id, mem_type_id, (float[]) obj, isCriticalPinning); - } - else if (is1D && (dname == 'D')) { - status = H5Awrite_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning); - } - else if (is1D && (dataClass.getComponentType() == String.class)) { - log.trace("H5Dwrite_string type"); - status = H5Awrite_string(attr_id, mem_type_id, (String[]) obj); - } - else { - HDFArray theArray = new HDFArray(obj); - byte[] buf = theArray.byteify(); - - status = H5Awrite(attr_id, mem_type_id, buf); - buf = null; - theArray = null; - } - - return status; - } - - public synchronized static native int H5Awrite_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Awrite_double(long attr_id, long mem_type_id, double[] buf) - throws HDF5LibraryException, NullPointerException - { - return H5Awrite_double(attr_id, mem_type_id, buf, true); - } - - public synchronized static native int H5Awrite_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Awrite_float(long attr_id, long mem_type_id, float[] buf) - throws HDF5LibraryException, NullPointerException - { - return H5Awrite_float(attr_id, mem_type_id, buf, true); - } - - public synchronized static native int H5Awrite_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Awrite_int(long attr_id, long mem_type_id, int[] buf) - throws HDF5LibraryException, NullPointerException - { - return H5Awrite_int(attr_id, mem_type_id, buf, true); - } - - public synchronized static native int H5Awrite_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Awrite_long(long attr_id, long mem_type_id, long[] buf) - throws HDF5LibraryException, NullPointerException - { - return H5Awrite_long(attr_id, mem_type_id, buf, true); - } - - public synchronized static native int H5Awrite_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Awrite_short(long attr_id, long mem_type_id, short[] buf) + public synchronized static int H5Aread_long(long attr_id, long mem_type_id, long[] buf) throws HDF5LibraryException, NullPointerException { - return H5Awrite_short(attr_id, mem_type_id, buf, true); + return H5Aread_long(attr_id, mem_type_id, buf, true); } - public synchronized static native int H5Awrite_string(long attr_id, long mem_type_id, String[] buf) - throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5AwriteVL(long attr_id, long mem_type_id, Object[] buf) + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of String from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of String to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf) throws HDF5LibraryException, NullPointerException; /** - * H5Awrite_VLStrings writes a variable length String dataset, specified by its identifier attr_id, from - * the application memory buffer buf into the file. - * - * ---- contributed by Rosetta Biosoftware + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of short from the file. * * @param attr_id - * Identifier of the attribute read from. + * IN: Identifier of an attribute to read. * @param mem_type_id - * Identifier of the memory datatype. + * IN: Identifier of the attribute datatype (in memory). * @param buf - * Buffer with data to be written to the file. + * Buffer of short to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - name is null. + * - data buffer is null. **/ - - public synchronized static native int H5Awrite_VLStrings(long attr_id, long mem_type_id, Object[] buf) + public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; /** - * H5Aget_create_plist retrieves a copy of the attribute creation property list identifier. + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of shortfrom the file. * * @param attr_id - * IN: Identifier of an attribute. + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of short to store data read from the file. * - * @return identifier for the attribute's creation property list if successful + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Aget_create_plist(long attr_id) - throws HDF5LibraryException + public synchronized static int H5Aread_short(long attr_id, long mem_type_id, short[] buf) + throws HDF5LibraryException, NullPointerException { - long id = _H5Aget_create_plist(attr_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Aget_create_plist add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + return H5Aread_short(attr_id, mem_type_id, buf, true); } - private synchronized static native long _H5Aget_create_plist(long attr_id) throws HDF5LibraryException; + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of variable-lenght from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of variable-lenght to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5AreadVL(long attr_id, long mem_type_id, Object[] buf) + throws HDF5LibraryException, NullPointerException; /** - * H5Aiterate2 iterates over the attributes attached to a dataset, named datatype, or group, as - * specified by obj_id. For each attribute, user-provided data, op_data, with additional information - * as defined below, is passed to a user-defined function, op, which operates on that attribute. + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of String from the file. * - * @param loc_id - * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. - * @param idx_type - * IN: The type of index specified by idx_type can be one of the following: - * H5_INDEX_NAME An alpha-numeric index by attribute name. - * H5_INDEX_CRT_ORDER An index by creation order. - * @param order - * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: - * H5_ITER_INC Iteration is from beginning to end, i.e., a top-down iteration - * incrementing the index position at each step. - * H5_ITER_DEC Iteration starts at the end of the index, i.e., a bottom-up iteration - * decrementing the index position at each step. - * H5_ITER_NATIVE HDF5 iterates in the fastest-available order. No information is provided - * as to the order, but HDF5 ensures that each element in the index will be - * visited if the iteration completes successfully. - * @param idx - * IN/OUT: Initial and returned offset within index. - * @param op - * IN: Callback function to operate on each value. - * @param op_data - * IN/OUT: Pointer to any user-efined data for use by operator function. + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of String to store data read from the file. * - * @return returns the return value of the first operator that returns a positive value, or zero if all members were - * processed with no operator returning non-zero. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - buf is null. + * - data buffer is null. **/ - public synchronized static native int H5Aiterate(long loc_id, int idx_type, int order, long idx, - H5A_iterate_cb op, H5A_iterate_t op_data) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Aread_string(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; /** - * H5Aiterate_by_name iterates over the attributes attached to the dataset or group specified with loc_id - * and obj_name. For each attribute, user-provided data, op_data, with additional information as defined - * below, is passed to a user-defined function, op, which operates on that attribute. + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of variable-lenght strings from the file. * - * @param loc_id - * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. - * @param obj_name - * IN: Name of object, relative to location. - * @param idx_type - * IN: The type of index specified by idx_type can be one of the following: - * H5_INDEX_NAME An alpha-numeric index by attribute name. - * H5_INDEX_CRT_ORDER An index by creation order. - * @param order - * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: - * H5_ITER_INC Iteration is from beginning to end, i.e., a top-down iteration - * incrementing the index position at each step. - * H5_ITER_DEC Iteration starts at the end of the index, i.e., a bottom-up iteration - * decrementing the index position at each step. - * H5_ITER_NATIVE HDF5 iterates in the fastest-available order. No information is provided - * as to the order, but HDF5 ensures that each element in the index will be - * visited if the iteration completes successfully. - * @param idx - * IN/OUT: Initial and returned offset within index. - * @param op - * IN: Callback function to operate on each value. - * @param op_data - * IN/OUT: Pointer to any user-efined data for use by operator function. - * @param lapl_id - * IN: Link access property list + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of variable-lenght strings to store data read from the file. * - * @return returns the return value of the first operator that returns a positive value, or zero if all members were - * processed with no operator returning non-zero. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - buf is null. + * - data buffer is null. **/ - public synchronized static native int H5Aiterate_by_name(long loc_id, String obj_name, int idx_type, - int order, long idx, H5A_iterate_cb op, H5A_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Aread_VLStrings(long attr_id, long mem_type_id, Object[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is read into buffer of string from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of string to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5AreadComplex(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Arename changes the name of attribute that is attached to the object specified by loc_id. The attribute named + * old_attr_name is renamed new_attr_name. + * + * @param loc_id + * IN: Location or object identifier; may be dataset or group + * @param old_attr_name + * IN: Prior attribute name + * @param new_attr_name + * IN: New attribute name + * + * @return A non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - Name is null. + **/ + public synchronized static native int H5Arename(long loc_id, String old_attr_name, String new_attr_name) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Arename_by_name changes the name of attribute that is attached to the object specified by loc_id and obj_name. + * The attribute named old_attr_name is renamed new_attr_name. + * + * @param loc_id + * IN: Location or object identifier; may be dataset or group + * @param obj_name + * IN: Name of object, relative to location, whose attribute is to be renamed + * @param old_attr_name + * IN: Prior attribute name + * @param new_attr_name + * IN: New attribute name + * @param lapl_id + * IN: Link access property list + * + * @return A non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - Name is null. + **/ + public synchronized static native int H5Arename_by_name(long loc_id, String obj_name, String old_attr_name, + String new_attr_name, long lapl_id) throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buf to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buf to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static int H5Awrite(long attr_id, long mem_type_id, byte[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite(attr_id, mem_type_id, buf, true); + } + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buf to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param obj + * IN: Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj) + throws HDF5Exception, HDF5LibraryException, NullPointerException + { + return H5Awrite(attr_id, mem_type_id, obj, true); + } + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from data object to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param obj + * IN: Data object to be written. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5Exception + * - Failure in the data conversion. + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data object is null + **/ + public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning) + throws HDF5Exception, HDF5LibraryException, NullPointerException + { + int status = -1; + boolean is1D = false; + + Class dataClass = obj.getClass(); + if (!dataClass.isArray()) { + throw (new HDF5JavaException("H5Dwrite: data is not an array")); + } + + String cname = dataClass.getName(); + is1D = (cname.lastIndexOf('[') == cname.indexOf('[')); + char dname = cname.charAt(cname.lastIndexOf("[") + 1); + + if (is1D && (dname == 'B')) { + status = H5Awrite(attr_id, mem_type_id, (byte[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'S')) { + status = H5Awrite_short(attr_id, mem_type_id, (short[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'I')) { + status = H5Awrite_int(attr_id, mem_type_id, (int[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'J')) { + status = H5Awrite_long(attr_id, mem_type_id, (long[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'F')) { + status = H5Awrite_float(attr_id, mem_type_id, (float[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'D')) { + status = H5Awrite_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning); + } + else if (is1D && (dataClass.getComponentType() == String.class)) { + log.trace("H5Dwrite_string type"); + status = H5Awrite_string(attr_id, mem_type_id, (String[]) obj); + } + else { + HDFArray theArray = new HDFArray(obj); + byte[] buf = theArray.byteify(); + + status = H5Awrite(attr_id, mem_type_id, buf); + buf = null; + theArray = null; + } + + return status; + } + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of double to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of double with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of double to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of double with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static int H5Awrite_double(long attr_id, long mem_type_id, double[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_double(attr_id, mem_type_id, buf, true); + } + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of float to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of float with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of float to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of float with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static int H5Awrite_float(long attr_id, long mem_type_id, float[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_float(attr_id, mem_type_id, buf, true); + } + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of int to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of int with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of int to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of int with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static int H5Awrite_int(long attr_id, long mem_type_id, int[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_int(attr_id, mem_type_id, buf, true); + } + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of long to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of long with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of long to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of long with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static int H5Awrite_long(long attr_id, long mem_type_id, long[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_long(attr_id, mem_type_id, buf, true); + } + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of short to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of short with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of short to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of short with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static int H5Awrite_short(long attr_id, long mem_type_id, short[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_short(attr_id, mem_type_id, buf, true); + } + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of string to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of string with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_string(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with + * mem_type_id. The entire attribute is written from buffer of variable-lenght to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of variable-lenght with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5AwriteVL(long attr_id, long mem_type_id, Object[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite_VLStrings writes a variable length String dataset, specified by its identifier attr_id, from + * the application memory buffer buffer of variable-lenght strings into the file. + * + * ---- contributed by Rosetta Biosoftware + * + * @param attr_id + * Identifier of the attribute read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param buf + * Buffer of variable-lenght strings with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + + public synchronized static native int H5Awrite_VLStrings(long attr_id, long mem_type_id, Object[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Aget_create_plist retrieves a copy of the attribute creation property list identifier. + * + * @param attr_id + * IN: Identifier of an attribute. + * + * @return identifier for the attribute's creation property list if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Aget_create_plist(long attr_id) + throws HDF5LibraryException + { + long id = _H5Aget_create_plist(attr_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Aget_create_plist add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Aget_create_plist(long attr_id) throws HDF5LibraryException; + + /** + * H5Aiterate2 iterates over the attributes attached to a dataset, named datatype, or group, as + * specified by obj_id. For each attribute, user-provided data, op_data, with additional information + * as defined below, is passed to a user-defined function, op, which operates on that attribute. + * + * @param loc_id + * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. + * @param idx_type + * IN: The type of index specified by idx_type can be one of the following: + * H5_INDEX_NAME An alpha-numeric index by attribute name. + * H5_INDEX_CRT_ORDER An index by creation order. + * @param order + * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: + * H5_ITER_INC Iteration is from beginning to end, i.e., a top-down iteration + * incrementing the index position at each step. + * H5_ITER_DEC Iteration starts at the end of the index, i.e., a bottom-up iteration + * decrementing the index position at each step. + * H5_ITER_NATIVE HDF5 iterates in the fastest-available order. No information is provided + * as to the order, but HDF5 ensures that each element in the index will be + * visited if the iteration completes successfully. + * @param idx + * IN/OUT: Initial and returned offset within index. + * @param op + * IN: Callback function to operate on each value. + * @param op_data + * IN/OUT: Pointer to any user-efined data for use by operator function. + * + * @return returns the return value of the first operator that returns a positive value, or zero if all members were + * processed with no operator returning non-zero. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Aiterate(long loc_id, int idx_type, int order, long idx, + H5A_iterate_cb op, H5A_iterate_t op_data) throws HDF5LibraryException, NullPointerException; + + /** + * H5Aiterate_by_name iterates over the attributes attached to the dataset or group specified with loc_id + * and obj_name. For each attribute, user-provided data, op_data, with additional information as defined + * below, is passed to a user-defined function, op, which operates on that attribute. + * + * @param loc_id + * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. + * @param obj_name + * IN: Name of object, relative to location. + * @param idx_type + * IN: The type of index specified by idx_type can be one of the following: + * H5_INDEX_NAME An alpha-numeric index by attribute name. + * H5_INDEX_CRT_ORDER An index by creation order. + * @param order + * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: + * H5_ITER_INC Iteration is from beginning to end, i.e., a top-down iteration + * incrementing the index position at each step. + * H5_ITER_DEC Iteration starts at the end of the index, i.e., a bottom-up iteration + * decrementing the index position at each step. + * H5_ITER_NATIVE HDF5 iterates in the fastest-available order. No information is provided + * as to the order, but HDF5 ensures that each element in the index will be + * visited if the iteration completes successfully. + * @param idx + * IN/OUT: Initial and returned offset within index. + * @param op + * IN: Callback function to operate on each value. + * @param op_data + * IN/OUT: Pointer to any user-efined data for use by operator function. + * @param lapl_id + * IN: Link access property list + * + * @return returns the return value of the first operator that returns a positive value, or zero if all members were + * processed with no operator returning non-zero. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Aiterate_by_name(long loc_id, String obj_name, int idx_type, + int order, long idx, H5A_iterate_cb op, H5A_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException; // //////////////////////////////////////////////////////////// // // @@ -1592,53 +2227,292 @@ public class H5 implements java.io.Serializable { * @param dataset_id * Identifier of the dataset to finish access to. * - * @return a non-negative value if successful + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static int H5Dclose(long dataset_id) throws HDF5LibraryException { + if (dataset_id < 0) + return 0; // throw new HDF5LibraryException("Negative ID"); + + log.trace("OPEN_IDS: H5Dclose remove {}", dataset_id); + OPEN_IDS.remove(dataset_id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + return _H5Dclose(dataset_id); + } + + private synchronized static native int _H5Dclose(long dataset_id) throws HDF5LibraryException; + + /** + * H5Dcreate creates a new dataset named name at the location specified by loc_id. + * + * @param loc_id + * IN: Location identifier + * @param name + * IN: Dataset name + * @param type_id + * IN: Datatype identifier + * @param space_id + * IN: Dataspace identifier + * @param lcpl_id + * IN: Identifier of link creation property list. + * @param dcpl_id + * IN: Identifier of dataset creation property list. + * @param dapl_id + * IN: Identifier of dataset access property list. + * + * @return a dataset identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public static long H5Dcreate(long loc_id, String name, long type_id, long space_id, long lcpl_id, long dcpl_id, + long dapl_id) throws HDF5LibraryException, NullPointerException { + long id = _H5Dcreate2(loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dcreate add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + /** + * H5Dcreate2 creates a new dataset named name at the location specified by loc_id. + * + * @see public static int H5Dcreate(int loc_id, String name, int type_id, int space_id, int lcpl_id, int dcpl_id, + * int dapl_id) + **/ + private synchronized static native long _H5Dcreate2(long loc_id, String name, long type_id, long space_id, + long lcpl_id, long dcpl_id, long dapl_id) throws HDF5LibraryException, NullPointerException; + + /** + * H5Dcreate_anon creates a dataset in the file specified by loc_id. + * + * @param loc_id + * IN: Location identifier + * @param type_id + * IN: Datatype identifier + * @param space_id + * IN: Dataspace identifier + * @param dcpl_id + * IN: Identifier of dataset creation property list. + * @param dapl_id + * IN: Identifier of dataset access property list. + * + * @return a dataset identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, long dapl_id) + throws HDF5LibraryException { + long id = _H5Dcreate_anon(loc_id, type_id, space_id, dcpl_id, dapl_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dcreate_anon add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, + long dapl_id) throws HDF5LibraryException; + + /** + * H5Dfill explicitly fills the dataspace selection in memory, space_id, with the fill value specified in fill. + * + * @param fill + * IN: Pointer to the fill value to be used. + * @param fill_type + * IN: Fill value datatype identifier. + * @param buf + * IN/OUT: Pointer to the memory buffer containing the selection to be filled. + * @param buf_type + * IN: Datatype of dataspace elements to be filled. + * @param space_id + * IN: Dataspace describing memory buffer and containing the selection to be filled. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native void H5Dfill(byte[] fill, long fill_type, byte[] buf, long buf_type, long space_id) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Dget_access_plist returns an identifier for a copy of the dataset access property list for a dataset. + * + * @param dset_id + * IN: Identifier of the dataset to query. + * + * @return a dataset access property list identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Dget_access_plist(long dset_id) throws HDF5LibraryException; + + /** + * H5Dget_create_plist returns an identifier for a copy of the dataset creation property list for a dataset. + * + * @param dataset_id + * Identifier of the dataset to query. + * @return a dataset creation property list identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Dget_create_plist(long dataset_id) throws HDF5LibraryException { + long id = _H5Dget_create_plist(dataset_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dget_create_plist add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Dget_create_plist(long dataset_id) throws HDF5LibraryException; + + /** + * H5Dget_offset returns the address in the file of the dataset dset_id. + * + * @param dset_id + * IN: Identifier of the dataset in question + * + * @return the offset in bytes. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Dget_offset(long dset_id) throws HDF5LibraryException; + + /** + * H5Dget_space returns an identifier for a copy of the dataspace for a dataset. + * + * @param dataset_id + * Identifier of the dataset to query. + * + * @return a dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Dget_space(long dataset_id) throws HDF5LibraryException { + long id = _H5Dget_space(dataset_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dget_space add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Dget_space(long dataset_id) throws HDF5LibraryException; + + /** + * H5Dget_space_status determines whether space has been allocated for the dataset dset_id. + * + * @param dset_id + * IN: Identifier of the dataset to query. + * + * @return the space allocation status + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Dget_space_status(long dset_id) throws HDF5LibraryException; + + /** + * H5Dget_storage_size returns the amount of storage that is required for the dataset. + * + * @param dataset_id + * Identifier of the dataset in question + * + * @return he amount of storage space allocated for the dataset. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Dget_storage_size(long dataset_id) throws HDF5LibraryException, + IllegalArgumentException; + + /** + * H5Dget_type returns an identifier for a copy of the datatype for a dataset. + * + * @param dataset_id + * Identifier of the dataset to query. + * + * @return a datatype identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Dget_type(long dataset_id) throws HDF5LibraryException { + long id = _H5Dget_type(dataset_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dget_type add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Dget_type(long dataset_id) throws HDF5LibraryException; + + /** + * H5Diterate iterates over all the data elements in the memory buffer buf, executing the callback function operator + * once for each such data element. + * + * @param buf + * IN/OUT: Pointer to the memory containing the elements to iterate over. + * @param buf_type + * IN: Buffer datatype identifier. + * @param space_id + * IN: Dataspace describing memory buffer. + * @param op + * IN: Callback function to operate on each value. + * @param op_data + * IN/OUT: Pointer to any user-efined data for use by operator function. + * + * @return returns the return value of the first operator that returns a positive value, or zero if all members were + * processed with no operator returning non-zero. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. **/ - public static int H5Dclose(long dataset_id) throws HDF5LibraryException { - if (dataset_id < 0) - return 0; // throw new HDF5LibraryException("Negative ID"); - - log.trace("OPEN_IDS: H5Dclose remove {}", dataset_id); - OPEN_IDS.remove(dataset_id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - return _H5Dclose(dataset_id); - } - - private synchronized static native int _H5Dclose(long dataset_id) throws HDF5LibraryException; + public synchronized static native int H5Diterate(byte[] buf, long buf_type, long space_id, H5D_iterate_cb op, + H5D_iterate_t op_data) throws HDF5LibraryException, NullPointerException; /** - * H5Dcreate creates a new dataset named name at the location specified by loc_id. + * H5Dopen opens the existing dataset specified by a location identifier and name, loc_id and name, respectively. * * @param loc_id * IN: Location identifier * @param name * IN: Dataset name - * @param type_id - * IN: Datatype identifier - * @param space_id - * IN: Dataspace identifier - * @param lcpl_id - * IN: Identifier of link creation property list. - * @param dcpl_id - * IN: Identifier of dataset creation property list. * @param dapl_id * IN: Identifier of dataset access property list. * - * @return a dataset identifier + * @return a dataset identifier if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException * - name is null. **/ - public static long H5Dcreate(long loc_id, String name, long type_id, long space_id, long lcpl_id, long dcpl_id, - long dapl_id) throws HDF5LibraryException, NullPointerException { - long id = _H5Dcreate2(loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id); + public static long H5Dopen(long loc_id, String name, long dapl_id) throws HDF5LibraryException, NullPointerException + { + long id = _H5Dopen2(loc_id, name, dapl_id); if (id > 0) { - log.trace("OPEN_IDS: H5Dcreate add {}", id); + log.trace("OPEN_IDS: H5Dopen add {}", id); OPEN_IDS.add(id); log.trace("OPEN_IDS: {}", OPEN_IDS.size()); } @@ -1646,255 +2520,455 @@ public class H5 implements java.io.Serializable { } /** - * H5Dcreate2 creates a new dataset named name at the location specified by loc_id. + * H5Dopen2 opens the existing dataset specified by a location identifier and name, loc_id and name, respectively. * - * @see public static int H5Dcreate(int loc_id, String name, int type_id, int space_id, int lcpl_id, int dcpl_id, - * int dapl_id) + * @see public static int H5Dopen(int loc_id, String name, int dapl_id) **/ - private synchronized static native long _H5Dcreate2(long loc_id, String name, long type_id, long space_id, - long lcpl_id, long dcpl_id, long dapl_id) throws HDF5LibraryException, NullPointerException; + private synchronized static native long _H5Dopen2(long loc_id, String name, long dapl_id) + throws HDF5LibraryException, NullPointerException; /** - * H5Dcreate_anon creates a dataset in the file specified by loc_id. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer buf. * - * @param loc_id - * IN: Location identifier - * @param type_id - * IN: Datatype identifier - * @param space_id - * IN: Dataspace identifier - * @param dcpl_id - * IN: Identifier of dataset creation property list. - * @param dapl_id - * IN: Identifier of dataset access property list. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Buffer to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return a dataset identifier + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, long dapl_id) - throws HDF5LibraryException { - long id = _H5Dcreate_anon(loc_id, type_id, space_id, dcpl_id, dapl_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dcreate_anon add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + public synchronized static native int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; + + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer buf. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, + long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException + { + return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); + } + + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer buf. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, + long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException + { + return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true); + } + + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * data object. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Object to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5Exception + * - Failure in the data conversion. + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data object is null. + **/ + public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, + long xfer_plist_id, Object obj, boolean isCriticalPinning) throws HDF5Exception, HDF5LibraryException, + NullPointerException + { + int status = -1; + boolean is1D = false; + + Class dataClass = obj.getClass(); + if (!dataClass.isArray()) { + throw (new HDF5JavaException("H5Dread: data is not an array")); + } + + String cname = dataClass.getName(); + is1D = (cname.lastIndexOf('[') == cname.indexOf('[')); + char dname = cname.charAt(cname.lastIndexOf("[") + 1); + log.trace("H5Dread: cname={} is1D={} dname={}", cname, is1D, dname); + + if (is1D && (dname == 'B')) { + log.trace("H5Dread_dname_B"); + status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (byte[]) obj, + isCriticalPinning); + } + else if (is1D && (dname == 'S')) { + log.trace("H5Dread_dname_S"); + status = H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (short[]) obj, + isCriticalPinning); + } + else if (is1D && (dname == 'I')) { + log.trace("H5Dread_dname_I"); + status = H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (int[]) obj, + isCriticalPinning); + } + else if (is1D && (dname == 'J')) { + log.trace("H5Dread_dname_J"); + status = H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj, + isCriticalPinning); + } + else if (is1D && (dname == 'F')) { + log.trace("H5Dread_dname_F"); + status = H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj, + isCriticalPinning); + } + else if (is1D && (dname == 'D')) { + log.trace("H5Dread_dname_D"); + 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)) { + 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); + } + else if (is1D && (dataClass.getComponentType() == String.class)) { + log.trace("H5Dread_string type"); + status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, + (String[]) obj); + } + else { + // Create a data buffer to hold the data into a Java Array + HDFArray theArray = new HDFArray(obj); + byte[] buf = theArray.emptyBytes(); + log.trace("H5Dread_else"); + + // will raise exception if read fails + status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, + isCriticalPinning); + if (status >= 0) { + // convert the data into a Java Array + obj = theArray.arrayify(buf); + } + + // clean up these: assign 'null' as hint to gc() + buf = null; + theArray = null; } - return id; - } - private synchronized static native long _H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, - long dapl_id) throws HDF5LibraryException; + return status; + } /** - * H5Dfill explicitly fills the dataspace selection in memory, space_id, with the fill value specified in fill. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of type double. * - * @param fill - * IN: Pointer to the fill value to be used. - * @param fill_type - * IN: Fill value datatype identifier. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. * @param buf - * IN/OUT: Pointer to the memory buffer containing the selection to be filled. - * @param buf_type - * IN: Datatype of dataspace elements to be filled. - * @param space_id - * IN: Dataspace describing memory buffer and containing the selection to be filled. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. - **/ - public synchronized static native void H5Dfill(byte[] fill, long fill_type, byte[] buf, long buf_type, long space_id) - throws HDF5LibraryException, NullPointerException; - - /** - * H5Dget_access_plist returns an identifier for a copy of the dataset access property list for a dataset. - * - * @param dset_id - * IN: Identifier of the dataset to query. + * Buffer of type double to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return a dataset access property list identifier + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public synchronized static native long H5Dget_access_plist(long dset_id) throws HDF5LibraryException; + public synchronized static native int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; /** - * H5Dget_create_plist returns an identifier for a copy of the dataset creation property list for a dataset. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of type double. * * @param dataset_id - * Identifier of the dataset to query. - * @return a dataset creation property list identifier if successful + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double to store data read from the file. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Dget_create_plist(long dataset_id) throws HDF5LibraryException { - long id = _H5Dget_create_plist(dataset_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dget_create_plist add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + public synchronized static int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException + { + return H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } - private synchronized static native long _H5Dget_create_plist(long dataset_id) throws HDF5LibraryException; - /** - * H5Dget_offset returns the address in the file of the dataset dset_id. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of float. * - * @param dset_id - * IN: Identifier of the dataset in question + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return the offset in bytes. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public synchronized static native long H5Dget_offset(long dset_id) throws HDF5LibraryException; + public synchronized static native int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; /** - * H5Dget_space returns an identifier for a copy of the dataspace for a dataset. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of float. * * @param dataset_id - * Identifier of the dataset to query. + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float to store data read from the file. * - * @return a dataspace identifier if successful + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Dget_space(long dataset_id) throws HDF5LibraryException { - long id = _H5Dget_space(dataset_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dget_space add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + public synchronized static int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException + { + return H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } - private synchronized static native long _H5Dget_space(long dataset_id) throws HDF5LibraryException; - - /** - * H5Dget_space_status determines whether space has been allocated for the dataset dset_id. - * - * @param dset_id - * IN: Identifier of the dataset to query. - * - * @return the space allocation status - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - **/ - public synchronized static native int H5Dget_space_status(long dset_id) throws HDF5LibraryException; - /** - * H5Dget_storage_size returns the amount of storage that is required for the dataset. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of int. * * @param dataset_id - * Identifier of the dataset in question + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return he amount of storage space allocated for the dataset. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public synchronized static native long H5Dget_storage_size(long dataset_id) throws HDF5LibraryException, - IllegalArgumentException; + public synchronized static native int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; /** - * H5Dget_type returns an identifier for a copy of the datatype for a dataset. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of int. * * @param dataset_id - * Identifier of the dataset to query. + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int to store data read from the file. * - * @return a datatype identifier if successful + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Dget_type(long dataset_id) throws HDF5LibraryException { - long id = _H5Dget_type(dataset_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dget_type add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + public synchronized static int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException + { + return H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } - private synchronized static native long _H5Dget_type(long dataset_id) throws HDF5LibraryException; - /** - * H5Diterate iterates over all the data elements in the memory buffer buf, executing the callback function operator - * once for each such data element. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of long. * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. * @param buf - * IN/OUT: Pointer to the memory containing the elements to iterate over. - * @param buf_type - * IN: Buffer datatype identifier. - * @param space_id - * IN: Dataspace describing memory buffer. - * @param op - * IN: Callback function to operate on each value. - * @param op_data - * IN/OUT: Pointer to any user-efined data for use by operator function. + * Buffer of long to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return returns the return value of the first operator that returns a positive value, or zero if all members were - * processed with no operator returning non-zero. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - buf is null. + * - data buffer is null. **/ - public synchronized static native int H5Diterate(byte[] buf, long buf_type, long space_id, H5D_iterate_cb op, - H5D_iterate_t op_data) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; /** - * H5Dopen opens the existing dataset specified by a location identifier and name, loc_id and name, respectively. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of long. * - * @param loc_id - * IN: Location identifier - * @param name - * IN: Dataset name - * @param dapl_id - * IN: Identifier of dataset access property list. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long to store data read from the file. * - * @return a dataset identifier if successful + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - name is null. + * - data buffer is null. **/ - public static long H5Dopen(long loc_id, String name, long dapl_id) throws HDF5LibraryException, NullPointerException + public synchronized static int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException { - long id = _H5Dopen2(loc_id, name, dapl_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dopen add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + return H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } /** - * H5Dopen2 opens the existing dataset specified by a location identifier and name, loc_id and name, respectively. - * - * @see public static int H5Dopen(int loc_id, String name, int dapl_id) - **/ - private synchronized static native long _H5Dopen2(long loc_id, String name, long dapl_id) - throws HDF5LibraryException, NullPointerException; - - /** * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application - * memory buffer buf. + * memory buffer of string. * * @param dataset_id * Identifier of the dataset read from. @@ -1906,10 +2980,8 @@ public class H5 implements java.io.Serializable { * Identifier of the dataset's dataspace in the file. * @param xfer_plist_id * Identifier of a transfer property list for this I/O operation. - * @param obj - * Buffer to store data read from the file. - * @param isCriticalPinning - * request lock on data reference. + * @param buf + * Buffer of string to store data read from the file. * * @return a non-negative value if successful * @@ -1918,25 +2990,12 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - data buffer is null. **/ - public synchronized static native int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, - NullPointerException; - - public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, - long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException - { - return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, - long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException - { - return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true); - } + public synchronized static native int H5Dread_reg_ref(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; /** * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application - * data object. + * memory buffer of short. * * @param dataset_id * Identifier of the dataset read from. @@ -1948,160 +3007,130 @@ public class H5 implements java.io.Serializable { * Identifier of the dataset's dataspace in the file. * @param xfer_plist_id * Identifier of a transfer property list for this I/O operation. - * @param obj - * Object to store data read from the file. + * @param buf + * Buffer of short to store data read from the file. * @param isCriticalPinning * request lock on data reference. * * @return a non-negative value if successful * - * @exception HDF5Exception - * - Failure in the data conversion. * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - data object is null. + * - data buffer is null. **/ - public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, - long xfer_plist_id, Object obj, boolean isCriticalPinning) throws HDF5Exception, HDF5LibraryException, - NullPointerException - { - int status = -1; - boolean is1D = false; - - Class dataClass = obj.getClass(); - if (!dataClass.isArray()) { - throw (new HDF5JavaException("H5Dread: data is not an array")); - } - - String cname = dataClass.getName(); - is1D = (cname.lastIndexOf('[') == cname.indexOf('[')); - char dname = cname.charAt(cname.lastIndexOf("[") + 1); - log.trace("H5Dread: cname={} is1D={} dname={}", cname, is1D, dname); - - if (is1D && (dname == 'B')) { - log.trace("H5Dread_dname_B"); - status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (byte[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'S')) { - log.trace("H5Dread_dname_S"); - status = H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (short[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'I')) { - log.trace("H5Dread_dname_I"); - status = H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (int[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'J')) { - log.trace("H5Dread_dname_J"); - status = H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'F')) { - log.trace("H5Dread_dname_F"); - status = H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'D')) { - log.trace("H5Dread_dname_D"); - 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)) { - 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); - } - else if (is1D && (dataClass.getComponentType() == String.class)) { - log.trace("H5Dread_string type"); - status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, - (String[]) obj); - } - else { - // Create a data buffer to hold the data into a Java Array - HDFArray theArray = new HDFArray(obj); - byte[] buf = theArray.emptyBytes(); - log.trace("H5Dread_else"); - - // will raise exception if read fails - status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, - isCriticalPinning); - if (status >= 0) { - // convert the data into a Java Array - obj = theArray.arrayify(buf); - } - - // clean up these: assign 'null' as hint to gc() - buf = null; - theArray = null; - } - - return status; - } - - public synchronized static native int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException - { - return H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning) - throws HDF5LibraryException, NullPointerException; - - public synchronized static int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException - { - return H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, - NullPointerException; - - public synchronized static int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException - { - return H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, - NullPointerException; - - public synchronized static int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException - { - return H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dread_reg_ref(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of short. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException { return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of variable-lenght. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-lenght to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of string. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of string to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of variable-lenght strings. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-lenght strings to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Dread_VLStrings(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; @@ -2170,7 +3199,7 @@ public class H5 implements java.io.Serializable { /** * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer - * buf into the file. + * into the file. * * @param dataset_id * Identifier of the dataset read from. @@ -2198,12 +3227,60 @@ public class H5 implements java.io.Serializable { long file_space_id, long xfer_plist_id, byte[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException { @@ -2299,59 +3376,357 @@ public class H5 implements java.io.Serializable { return status; } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException { return H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of string with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5Dwrite_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-length with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public synchronized static native int H5DwriteVL(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; @@ -2628,7 +4003,7 @@ public class H5 implements java.io.Serializable { /** - * H5Epush2 pushes a new error record onto the error stack specified by estack_id. + * H5Epush pushes a new error record onto the error stack specified by estack_id. * * @param stack_id * IN: Error stack identifier. @@ -2657,6 +4032,31 @@ public class H5 implements java.io.Serializable { { H5Epush2(stack_id, file, func, line, cls_id, maj_id, min_id, msg); } + /** + * H5Epush2 pushes a new error record onto the error stack specified by estack_id. + * + * @param stack_id + * IN: Error stack identifier. + * @param file + * IN: Name of the file in which the error was detected. + * @param func + * IN: Name of the function in which the error was detected. + * @param line + * IN: Line number within the file at which the error was detected. + * @param cls_id + * IN: Error class identifier. + * @param maj_id + * IN: Major error identifier. + * @param min_id + * IN: Minor error identifier. + * @param msg + * IN: Error description string. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - file, func, or msg is null. + **/ public synchronized static native void H5Epush2(long stack_id, String file, String func, int line, long cls_id, long maj_id, long min_id, String msg) throws HDF5LibraryException, NullPointerException; @@ -2714,6 +4114,24 @@ public class H5 implements java.io.Serializable { { H5Ewalk2(stack_id, direction, func, client_data); } + /** + * H5Ewalk2 walks the error stack specified by estack_id for the current thread and calls the + * function specified in func for each error along the way. + * + * @param stack_id + * IN: Error stack identifier. + * @param direction + * IN: Direction in which the error stack is to be walked. + * @param func + * IN: Function to be called for each error encountered. + * @param client_data + * IN: Data to be passed with func. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - func is null. + **/ public synchronized static native void H5Ewalk2(long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data) throws HDF5LibraryException, NullPointerException; @@ -2950,6 +4368,19 @@ public class H5 implements java.io.Serializable { private synchronized static native long _H5Fget_create_plist(long file_id) throws HDF5LibraryException; + /** + * H5Fget_filesize retrieves the file size of the HDF5 file. This function + * is called after an existing file is opened in order + * to learn the true size of the underlying file. + * + * @param file_id + * IN: File identifier for a currently-open HDF5 file + * + * @return the file size of the HDF5 file + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Fget_filesize(long file_id) throws HDF5LibraryException; /** @@ -3598,37 +5029,118 @@ public class H5 implements java.io.Serializable { return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, tokens, HDF5Constants.H5_INDEX_NAME); } - public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype, + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param tokens + * OUT: Object token of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes, int[] ltype, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException { - return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, tokens, indx_type, -1); + return H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, null, tokens, indx_type, -1); } - public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype, + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param fno + * OUT: File number + * @param tokens + * OUT: Object token of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes, int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException { - return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, indx_type, -1); + return H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, fno, tokens, indx_type, -1); } - public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype, + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param fno + * OUT: File number + * @param tokens + * OUT: Object token of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * @param indx_order + * IN: Index order for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] objNames, int[] objTypes, int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type, int indx_order) throws HDF5LibraryException, NullPointerException { - if (oname == null) { + if (objNames == null) { throw new NullPointerException("H5Gget_obj_info_full(): name array is null"); } - if (otype == null) { + if (objTypes == null) { throw new NullPointerException("H5Gget_obj_info_full(): object type array is null"); } - if (oname.length == 0) { + if (objNames.length == 0) { throw new HDF5LibraryException("H5Gget_obj_info_full(): array size is zero"); } - if (oname.length != otype.length) { + if (objNames.length != objTypes.length) { throw new HDF5LibraryException("H5Gget_obj_info_full(): name and type array sizes are different"); } if (ltype == null) - ltype = new int[otype.length]; + ltype = new int[objTypes.length]; if (fno == null) fno = new long[tokens.length]; @@ -3639,15 +5151,15 @@ public class H5 implements java.io.Serializable { if (indx_order < 0) indx_order = HDF5Constants.H5_ITER_INC; - log.trace("H5Gget_obj_info_full: oname_len={}", oname.length); - int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, oname.length, indx_type, + log.trace("H5Gget_obj_info_full: objNames_len={}", objNames.length); + int status = H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, fno, tokens, objNames.length, indx_type, indx_order); - for (int indx = 0; indx < oname.length; indx++) - log.trace("H5Gget_obj_info_full: oname={}", oname[indx]); + for (int indx = 0; indx < objNames.length; indx++) + log.trace("H5Gget_obj_info_full: objNames={}", objNames[indx]); return status; } - private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype, + private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] objNames, int[] objTypes, int[] ltype, long[] fno, H5O_token_t[] tokens, int n, int indx_type, int indx_order) throws HDF5LibraryException, NullPointerException; @@ -3663,9 +5175,9 @@ public class H5 implements java.io.Serializable { * @param idx * IN: the index of the object to iterate. * @param oname - * the name of the object [OUT] + * OUT: the name of the object * @param type - * the type of the object [OUT] + * OUT: the type of the object * * @return non-negative if successful, -1 if not. * @@ -3866,29 +5378,90 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// + /** + * H5Iget_file_id obtains the file ID specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the file ID. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Iget_file_id(long obj_id) throws HDF5LibraryException; + /** + * H5Iget_name_long retrieves the name of an object specified by the identifier, obj_id. + * @deprecated + * + * @param obj_id + * IN: Identifier of the object. + * @param name + * OUT: Attribute name buffer. + * @param size + * IN: Maximum length of the name to retrieve. + * + * @return the length of the name retrieved. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ @Deprecated public synchronized static native long H5Iget_name_long(long obj_id, String[] name, long size) throws HDF5LibraryException, NullPointerException; /** - * H5Iget_name_str retrieves the name of an object specified by the identifier, obj_id. + * H5Iget_name retrieves the name of an object specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return String for Attribute name. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native String H5Iget_name(long obj_id) + throws HDF5LibraryException; + + /** + * H5Iget_ref obtains the number of references outstanding specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the reference count. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Iget_ref(long obj_id) throws HDF5LibraryException, NullPointerException; + + /** + * H5Idec_ref decrements the reference count specified by the identifier, obj_id. + * If the reference count for an ID reaches zero, the object will be closed. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the reference count. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Idec_ref(long obj_id) throws HDF5LibraryException, NullPointerException; + + /** + * H5Iinc_ref increments the reference count specified by the identifier, obj_id. * * @param obj_id * IN: Identifier of the object. * - * @return String for Attribute name. + * @return the reference count. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native String H5Iget_name(long obj_id) - throws HDF5LibraryException; - - public synchronized static native int H5Iget_ref(long obj_id) throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5Idec_ref(long obj_id) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Iinc_ref(long obj_id) throws HDF5LibraryException, NullPointerException; /** @@ -5179,7 +6752,7 @@ public class H5 implements java.io.Serializable { return id; } - public synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name, + private synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -5210,8 +6783,30 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException; + /** + * H5Odisable_mdc_flushes corks an object, keeping dirty entries associated with the object in the metadata cache. + * + * @param object_id + * IN: Identifier of the object to be corked. + **/ public synchronized static native void H5Odisable_mdc_flushes(long object_id); + /** + * H5Oenable_mdc_flushes uncorks an object, keeping dirty entries associated with the object in the metadata cache. + * + * @param object_id + * IN: Identifier of the object to be uncorked. + **/ public synchronized static native void H5Oenable_mdc_flushes(long object_id); + /** + * H5Oare_mdc_flushes_disabled retrieve the object's "cork" status. + * + * @param object_id + * IN: Identifier of the object to be flushed. + * + * @return the cork status + * TRUE if mdc flushes for the object is disabled + * FALSE if mdc flushes for the object is not disabled + **/ public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id); // /////// unimplemented //////// @@ -5364,6 +6959,7 @@ public class H5 implements java.io.Serializable { * IN: First property object to be compared * @param plid2 * IN: Second property object to be compared + * * @return positive value if equal; zero if unequal, a negative value if failed * * @exception HDF5LibraryException @@ -5371,6 +6967,19 @@ public class H5 implements java.io.Serializable { */ public synchronized static native int H5Pequal(long plid1, long plid2) throws HDF5LibraryException; + /** + * H5Pequal determines if two property lists or classes are equal + * + * @param plid1 + * IN: First property object to be compared + * @param plid2 + * IN: Second property object to be compared + * + * @return TRUE if equal, FALSE if unequal + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + */ public static boolean H5P_equal(long plid1, long plid2) throws HDF5LibraryException { if (H5Pequal(plid1, plid2) == 1) return true; @@ -5456,7 +7065,7 @@ public class H5 implements java.io.Serializable { return _H5Pclose_class(plid); } - public synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException; + private synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException; /** * H5Pclose terminates access to a property list. @@ -5524,6 +7133,19 @@ public class H5 implements java.io.Serializable { // Define property list iteration function type // typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); + /** + * H5Pcreate_class_nocb creates an new property class with no callback functions. + * + * @param parent_class + * IN: Identifier of the parent property class. + * @param name + * IN: Name of the property class. + * + * @return a property list identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public static long H5Pcreate_class_nocb(long parent_class, String name) throws HDF5LibraryException { long id = _H5Pcreate_class_nocb(parent_class, name); if (id > 0) { @@ -5550,17 +7172,69 @@ public class H5 implements java.io.Serializable { // private synchronized static native long _H5Pcreate_class(long parent_class, String name, H5P_cls_create_func_cb create_op, H5P_cls_create_func_t create_data, // H5P_cls_copy_func_cb copy_op, H5P_cls_copy_func_t copy_data, H5P_cls_close_func_cb close_op, H5P_cls_close_func_t close_data) throws HDF5LibraryException; + /** + * H5Pregister2_nocb registers a property list with no callback functions. + * + * @param plist_class + * IN: Identifier of the property list. + * @param name + * IN: Name of the property. + * @param size + * IN: Size the property value. + * @param def_value + * IN: Defaul value of the property + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pregister2_nocb(long plist_class, String name, long size, byte[] def_value) throws HDF5LibraryException; // public synchronized static native void H5Pregister2(long plist_class, String name, long size, byte[] def_value, H5P_prp_create_func_cb prp_create, H5P_prp_set_func_cb prp_set, // H5P_prp_get_func_cb prp_get, H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException; + /** + * H5Pinsert2_nocb inserts a property list with no callback functions. + * + * @param plist + * IN: Identifier of the property list. + * @param name + * IN: Name of the property. + * @param size + * IN: Size the property value. + * @param value + * IN: Defaul value of the property + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pinsert2_nocb(long plist, String name, long size, byte[] value) throws HDF5LibraryException; // public synchronized static native void H5Pinsert2(long plist, String name, long size, byte[] value, H5P_prp_set_func_cb prp_set, H5P_prp_get_func_cb prp_get, // H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException; + /** + * H5Piterate iterates over the properties in a property list or class + * + * @param plist + * IN: ID of property object to iterate over + * @param idx + * IN/OUT: index of the property to begin with + * @param op + * IN: function to be called with each property iterated over. + * @param op_data + * IN: iteration data from user + * + * @return + * the return value of the last call to op if it was non-zero, + * zero if all properties have been processed + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - size is null. + * + **/ public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; // /////// Object creation property list (OCPL) routines /////// @@ -5573,7 +7247,7 @@ public class H5 implements java.io.Serializable { * @param attributes * The maximun and minimum no. of attributes to be stored. * - *
+     * 
      *      attributes[0] =  The maximum number of attributes to be stored in compact storage
      *      attributes[1] =  The minimum number of attributes to be stored in dense storage
      * 
@@ -5673,6 +7347,51 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_obj_track_times(long ocpl_id, boolean track_times) throws HDF5LibraryException; + /** + * H5Pmodify_filter modifies the specified FILTER in the transient or permanent output filter pipeline + * depending on whether PLIST is a dataset creation or dataset + * transfer property list. The FLAGS argument specifies certain + * general properties of the filter and is documented below. + * The CD_VALUES is an array of CD_NELMTS integers which are + * auxiliary data for the filter. The integer vlues will be + * stored in the dataset object header as part of the filter + * information. + *

+ * The FLAGS argument is a bit vector of the following fields: + *

+ * H5Z_FLAG_OPTIONAL(0x0001) + * If this bit is set then the filter is optional. If the + * filter fails during an H5Dwrite() operation then the filter + * is just excluded from the pipeline for the chunk for which it + * failed; the filter will not participate in the pipeline + * during an H5Dread() of the chunk. If this bit is clear and + * the filter fails then the entire I/O operation fails. + * If this bit is set but encoding is disabled for a filter, + * attempting to write will generate an error. + *

+ * Note: This function currently supports only the permanent filter + * pipeline. That is, PLIST_ID must be a dataset creation + * property list. + * + * @param plist + * IN: Property list identifier. + * @param filter + * IN: Filter to be modified to the pipeline. + * @param flags + * IN: Bit vector specifying certain general properties of the filter. + * @param cd_nelmts + * IN: Number of elements in cd_values + * @param cd_values + * IN: Auxiliary data for the filter. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name or an array is null. + * + **/ public synchronized static native int H5Pmodify_filter(long plist, long filter, int flags, long cd_nelmts, int[] cd_values) throws HDF5LibraryException, NullPointerException; @@ -5844,9 +7563,37 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; + /** + * H5Pall_filters_avail query to verify that all the filters set + * in the dataset creation property list are available currently. + * + * @param dcpl_id + * IN: Property list identifier. + * + * @return + * TRUE if all filters available + * FALSE if one or more filters not currently available. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native boolean H5Pall_filters_avail(long dcpl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Premove_filter deletes a filter from the dataset creation property list; + * deletes all filters if filter is H5Z_FILTER_NONE + * + * @param obj_id + * IN: Property list identifier. + * @param filter + * IN: Filter identifier. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Premove_filter(long obj_id, long filter) throws HDF5LibraryException; /** @@ -5864,6 +7611,18 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Pset_deflate(long plist, int level) throws HDF5LibraryException; + /** + * H5Pset_fletcher32 sets Fletcher32 checksum of EDC for a dataset creation + * property list or group creation property list. + * + * @param plist + * IN: Property list identifier. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; @@ -6334,11 +8093,35 @@ public class H5 implements java.io.Serializable { */ public synchronized static native long H5Pget_driver(long plid) throws HDF5LibraryException; - public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pget_family_offset gets offset for family driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return the offset. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException; - public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_family_offset sets the offset for family driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param offset + * IN: the offset value + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException; /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6389,9 +8172,8 @@ public class H5 implements java.io.Serializable { double rdcc_w0) throws HDF5LibraryException; /** - * H5Pget_mdc_config gets the initial metadata cache configuration contained in a file access property list and - * loads it into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter. This configuration is - * used when the file is opened. + * H5Pget_mdc_config gets the initial metadata cache configuration contained in a file access property list. + * This configuration is used when the file is opened. * * @param plist_id * IN: Identifier of the file access property list. @@ -6403,6 +8185,19 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native H5AC_cache_config_t H5Pget_mdc_config(long plist_id) throws HDF5LibraryException; + /** + * H5Pset_mdc_config sets the initial metadata cache configuration contained in a file access property list and + * loads it into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter. This configuration is + * used when the file is opened. + * + * @param plist_id + * IN: Identifier of the file access property list. + * @param config_ptr + * IN: H5AC_cache_config_t, the initial metadata cache configuration. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pset_mdc_config(long plist_id, H5AC_cache_config_t config_ptr) throws HDF5LibraryException; @@ -6437,10 +8232,35 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_gc_references(long fapl_id, boolean gc_ref) throws HDF5LibraryException; - public synchronized static native int H5Pget_fclose_degree(long plist_id) throws HDF5LibraryException, + /** + * H5Pget_fclose_degree returns the degree for the file close behavior for a file access + * property list. + * + * @param fapl_id + * IN File access property list + * + * @return the degree for the file close behavior + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pget_fclose_degree(long fapl_id) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Pset_fclose_degree(long plist, int degree) throws HDF5LibraryException, + /** + * H5Pset_fclose_degree sets the degree for the file close behavior. + * + * @param fapl_id + * IN File access property list + * @param degree + * IN the degree for the file close behavior + * + * @return non-negative if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pset_fclose_degree(long fapl_id, int degree) throws HDF5LibraryException, NullPointerException; /** @@ -6471,8 +8291,40 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Pset_meta_block_size(long fapl_id, long size) throws HDF5LibraryException; + /** + * H5Pget_sieve_buf_size retrieves the current settings for the data sieve buffer size + * property from a file access property list. + * + * @param fapl_id + * IN: Identifier for property list to query. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Pget_sieve_buf_size(long fapl_id) throws HDF5LibraryException; + /** + * H5Pset_sieve_buf_size Sets the maximum size of the data seive buffer used for file + * drivers which are capable of using data sieving. The data sieve + * buffer is used when performing I/O on datasets in the file. Using a + * buffer which is large anough to hold several pieces of the dataset + * being read in for hyperslab selections boosts performance by quite a + * bit. + *

+ * The default value is set to 64KB, indicating that file I/O for raw data + * reads and writes will occur in at least 64KB blocks. Setting the value to 0 + * with this function will turn off the data sieving + * + * @param fapl_id + * IN: Identifier of property list to modify. + * @param size + * IN: maximum size of the data seive buffer. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pset_sieve_buf_size(long fapl_id, long size) throws HDF5LibraryException; /** @@ -6687,6 +8539,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; + // ///// unimplemented ///// // herr_t H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info); // herr_t H5Pget_vol_id(hid_t plist_id, hid_t *vol_id); @@ -6733,17 +8634,39 @@ public class H5 implements java.io.Serializable { * @param dims * OUT: Array to store the chunk dimensions. * - * @return chunk dimensionality successful + * @return chunk dimensionality successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - dims array is null. + * @exception IllegalArgumentException + * - max_ndims <=0 + **/ + public synchronized static native int H5Pget_chunk(long plist, int max_ndims, long[] dims) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Pset_chunk sets the size of the chunks used to store a chunked layout dataset. + * + * @param plist + * IN: Identifier for property list to query. + * @param ndims + * IN: The number of dimensions of each chunk. + * @param dim + * IN: An array containing the size of each chunk. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException * - dims array is null. * @exception IllegalArgumentException - * - max_ndims <=0 + * - dims <=0 **/ - public synchronized static native int H5Pget_chunk(long plist, int max_ndims, long[] dims) - throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + public synchronized static native int H5Pset_chunk(long plist, int ndims, byte[] dim) throws HDF5LibraryException, + NullPointerException, IllegalArgumentException; /** * H5Pset_chunk sets the size of the chunks used to store a chunked layout dataset. @@ -6757,16 +8680,13 @@ public class H5 implements java.io.Serializable { * * @return a non-negative value if successful * - * @exception HDF5LibraryException + * @exception HDF5Exception * - Error from the HDF-5 Library. * @exception NullPointerException * - dims array is null. * @exception IllegalArgumentException * - dims <=0 **/ - public synchronized static native int H5Pset_chunk(long plist, int ndims, byte[] dim) throws HDF5LibraryException, - NullPointerException, IllegalArgumentException; - public synchronized static int H5Pset_chunk(long plist, int ndims, long[] dim) throws HDF5Exception, NullPointerException, IllegalArgumentException { if (dim == null) { @@ -7002,9 +8922,37 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Pget_external_count(long plist) throws HDF5LibraryException; + /** + * H5Pset_szip Sets up the use of the szip filter. + * + * @param plist + * IN: Dataset creation property list identifier. + * @param options_mask + * IN: Bit vector specifying certain general properties of the filter. + * @param pixels_per_block + * IN: Number of pixels in blocks + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_szip(long plist, int options_mask, int pixels_per_block) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_shuffle Sets up the use of the shuffle filter. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_shuffle(long plist_id) throws HDF5LibraryException, NullPointerException; @@ -7132,20 +9080,91 @@ public class H5 implements java.io.Serializable { return retVal; } + /** + * H5Pset_fill_value checks if the fill value is defined for a dataset creation property list. + * + * @param plist_id + * IN: Property list identifier. + * @param status + * IN: The fill value setting: + * H5D_FILL_VALUE_UNDEFINED + * H5D_FILL_VALUE_DEFAULT + * H5D_FILL_VALUE_USER_DEFINED + * H5D_FILL_VALUE_ERROR + * + * @return a non-negative value if successful + * + * @exception HDF5Exception + * - Error converting data array + **/ public synchronized static native int H5Pfill_value_defined(long plist_id, int[] status) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_alloc_time Gets space allocation time for dataset during creation. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param alloc_time + * OUT: allocation time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_alloc_time(long plist_id, int[] alloc_time) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_alloc_time Sets space allocation time for dataset during creation. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param alloc_time + * IN: allocation time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_alloc_time(long plist_id, int alloc_time) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_fill_time Gets fill value writing time. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param fill_time + * OUT: fill time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException; - public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_fill_time Sets the fill value writing time. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param fill_time + * IN: fill time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException; /** * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. @@ -7445,6 +9464,20 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_buffer(long plist, byte[] tconv, byte[] bkg) throws HDF5LibraryException, IllegalArgumentException; + /** + * H5Pget_buffer_size gets type conversion and background buffer size, in bytes, if successful; + * otherwise 0 on failure. + * + * @param plist + * Identifier for the dataset transfer property list. + * + * @return buffer size, in bytes, if successful; otherwise 0 on failure + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception IllegalArgumentException + * - plist is invalid. + **/ public synchronized static native long H5Pget_buffer_size(long plist) throws HDF5LibraryException, IllegalArgumentException; @@ -7475,11 +9508,33 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_buffer_size(long plist, long size) throws HDF5LibraryException, IllegalArgumentException; - public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pget_edc_check gets the error-detecting algorithm in use. + * + * @param plist + * Identifier for the dataset transfer property list. + * + * @return the error-detecting algorithm + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException; - public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_edc_check sets the error-detecting algorithm. + * + * @param plist + * Identifier for the dataset transfer property list. + * @param check + * the error-detecting algorithm to use. + * + * @return non-negative if succeed + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException; /** * H5Pget_btree_ratio Get the B-tree split ratios for a dataset transfer property list. @@ -7524,9 +9579,46 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_btree_ratios(long plist_id, double left, double middle, double right) throws HDF5LibraryException; + /** + * H5Pget_hyper_vector_size reads values previously set with H5Pset_hyper_vector_size. + * + * @param dxpl_id + * IN: Dataset transfer property list identifier. + * @param vector_size + * OUT: hyper vector size. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_hyper_vector_size(long dxpl_id, long[] vector_size) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_hyper_vector_size sets the number of + * "I/O vectors" (offset and length pairs) which are to be + * accumulated in memory before being issued to the lower levels + * of the library for reading or writing the actual data. + * Increasing the number should give better performance, but use + * more memory during hyperslab I/O. The vector size must be + * greater than 1. + *,p. + * The default is to use 1024 vectors for I/O during hyperslab + * reading/writing. + * + * @param dxpl_id + * IN: Dataset transfer property list identifier. + * @param vector_size + * IN: hyper vestor size. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; @@ -7724,8 +9816,32 @@ public class H5 implements java.io.Serializable { // /////// String creation property list (STRCPL) routines /////// + /** + * H5Pget_char_encoding gets the character encoding of the string. + * + * @param plist_id + * IN: the property list identifier + * + * @return Returns the character encoding of the string. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; + /** + * H5Pset_char_encoding sets the character encoding of the string. + * + * @param plist_id + * IN: the property list identifier + * @param encoding + * IN: the character encoding of the string + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; @@ -7910,25 +10026,131 @@ public class H5 implements java.io.Serializable { * - Error from the HDF-5 Library. * **/ - public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) - throws HDF5LibraryException; - - // /////// file drivers property list routines /////// - - public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) - throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5Pset_fapl_core(long fapl_id, long increment, boolean backing_store) + public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) + throws HDF5LibraryException; + + // /////// file drivers property list routines /////// + + /** + * H5Pget_fapl_core retrieve H5FD_CORE I/O settings. + * + * @param fapl_id + * IN: File access property list identifier + * @param increment + * OUT: how much to grow the memory each time + * @param backing_store + * OUT: write to file name on flush setting + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Pset_fapl_core modifies the file access property list to use the H5FD_CORE driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param increment + * IN: how much to grow the memory each time + * @param backing_store + * IN: write to file name on flush setting + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_fapl_core(long fapl_id, long increment, boolean backing_store) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Pget_fapl_direct queries properties set by the H5Pset_fapl_direct. + * + * @param fapl_id + * IN: File access property list identifier + * @param info + * OUT: Returned property list information + * info[0] = increment -how much to grow the memory each time + * info[1] = backing_store - write to file name on flush setting + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pget_fapl_direct(long fapl_id, long[] info) throws HDF5LibraryException; + + /** + * H5Pset_fapl_direct Sets up use of the direct I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param alignment + * IN: Required memory alignment boundary + * @param block_size + * IN: File system block size + * @param cbuf_size + * IN: Copy buffer size + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_fapl_direct(long fapl_id, long alignment, long block_size, + long cbuf_size) throws HDF5LibraryException; + + /** + * H5Pget_fapl_family Returns information about the family file access property list. + * + * @param fapl_id + * IN: File access property list identifier + * @param memb_size + * OUT: the size in bytes of each file member (used only when creating a new file) + * @param memb_fapl_id + * OUT: the file access property list to be used for each family member + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pget_fapl_family(long fapl_id, long[] memb_size, long[] memb_fapl_id) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Pset_fapl_family Sets up use of the direct I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param memb_size + * IN: the size in bytes of each file member (used only when creating a new file) + * @param memb_fapl_id + * IN: the file access property list to be used for each family member + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id) throws HDF5LibraryException, NullPointerException; /** - * H5Pget_fapl_direct Retrieve direct I/O settings. + * H5Pset_fapl_hdfs Modify the file access property list to use the H5FD_HDFS driver. * * @param fapl_id * IN: File access property list identifier - * @param info - * OUT: Returned property list information info[0] = alignment Required memory alignment boundary info[1] - * = block_size File system block size info[2] = cbuf_size Copy buffer size + * @param fapl_conf + * IN: the properties of the hdfs driver * * @return a non-negative value if successful; otherwise returns a negative value. * @@ -7936,37 +10158,20 @@ public class H5 implements java.io.Serializable { * - Error from the HDF-5 Library. * **/ - public synchronized static native int H5Pget_fapl_direct(long fapl_id, long[] info) throws HDF5LibraryException; + public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; /** - * H5Pset_fapl_direct Sets up use of the direct I/O driver. + * H5Pget_fapl_hdfs gets the properties hdfs I/O driver. * * @param fapl_id * IN: File access property list identifier - * @param alignment - * IN: Required memory alignment boundary - * @param block_size - * IN: File system block size - * @param cbuf_size - * IN: Copy buffer size * - * @return a non-negative value if successful; otherwise returns a negative value. + * @return the properties of the hdfs driver. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * **/ - public synchronized static native int H5Pset_fapl_direct(long fapl_id, long alignment, long block_size, - long cbuf_size) throws HDF5LibraryException; - - public synchronized static native int H5Pget_fapl_family(long fapl_id, long[] memb_size, long[] memb_fapl_id) - throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id) - throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; - public synchronized static native H5FD_hdfs_fapl_t H5Pget_fapl_hdfs(long fapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -8044,17 +10249,99 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_fapl_log(long fapl_id, String logfile, long flags, long buf_size) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_sec2 Sets up use of the sec2 I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_sec2(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_split Sets up use of the split I/O driver. Makes the multi driver act like the + * old split driver which stored meta data in one file and raw + * data in another file + * + * @param fapl_id + * IN: File access property list identifier + * @param meta_ext + * IN: meta filename extension + * @param meta_plist_id + * IN: File access property list identifier for metadata + * @param raw_ext + * IN: raw data filename extension + * @param raw_plist_id + * IN: File access property list identifier raw data + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native void H5Pset_fapl_split(long fapl_id, String meta_ext, long meta_plist_id, String raw_ext, long raw_plist_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_stdio Sets up use of the stdio I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_stdio(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_windows Sets up use of the windows I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_windows(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_ros3 Modify the file access property list to use the H5FD_ROS3 driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param fapl_conf + * IN: the properties of the ros3 driver + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; + /** + * H5Pget_fapl_ros3 gets the properties of the ros3 I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return the properties of the ros3 driver. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native H5FD_ros3_fapl_t H5Pget_fapl_ros3(long fapl_id) throws HDF5LibraryException, NullPointerException; // /////// unimplemented //////// @@ -8762,50 +11049,7 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - /** - * H5Sclose releases a dataspace. - * - * @param space_id - * Identifier of dataspace to release. - * - * @return a non-negative value if successful - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - **/ - public static int H5Sclose(long space_id) throws HDF5LibraryException { - if (space_id < 0) - return 0; // throw new HDF5LibraryException("Negative ID");; - - log.trace("OPEN_IDS: H5Sclose remove {}", space_id); - OPEN_IDS.remove(space_id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - return _H5Sclose(space_id); - } - - private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException; - - /** - * H5Scopy creates a new dataspace which is an exact copy of the dataspace identified by space_id. - * - * @param space_id - * Identifier of dataspace to copy. - * @return a dataspace identifier if successful - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - **/ - public static long H5Scopy(long space_id) throws HDF5LibraryException { - long id = _H5Scopy(space_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Scopy add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; - } - - private synchronized static native long _H5Scopy(long space_id) throws HDF5LibraryException; + /**************** Operations on dataspaces ********************/ /** * H5Screate creates a new dataspace of a particular type. @@ -8862,169 +11106,257 @@ public class H5 implements java.io.Serializable { throws HDF5Exception, NullPointerException; /** + * H5Sset_extent_simple sets or resets the size of an existing dataspace. + * + * @param space_id + * Dataspace identifier. + * @param rank + * Rank, or dimensionality, of the dataspace. + * @param current_size + * Array containing current size of dataspace. + * @param maximum_size + * Array containing maximum size of dataspace. + * + * @return a dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size, + long[] maximum_size) throws HDF5LibraryException, NullPointerException; + + /** + * H5Sset_extent_simple sets or resets the size of an existing dataspace. + * + * @param space_id + * Dataspace identifier. + * @param rank + * Rank, or dimensionality, of the dataspace. + * @param current_size + * Array containing current size of dataspace. + * @param maximum_size + * Array containing maximum size of dataspace. + * + * @return a dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size, + byte[] maximum_size) throws HDF5LibraryException, NullPointerException { + ByteBuffer csbb = ByteBuffer.wrap(current_size); + long[] lacs = (csbb.asLongBuffer()).array(); + ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size); + long[] lamaxs = (maxsbb.asLongBuffer()).array(); + + return H5Sset_extent_simple(space_id, rank, lacs, lamaxs); + } + + /** + * H5Scopy creates a new dataspace which is an exact copy of the dataspace identified by space_id. + * + * @param space_id + * Identifier of dataspace to copy. + * @return a dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Scopy(long space_id) throws HDF5LibraryException { + long id = _H5Scopy(space_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Scopy add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Scopy(long space_id) throws HDF5LibraryException; + + /** + * H5Sclose releases a dataspace. + * + * @param space_id + * Identifier of dataspace to release. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static int H5Sclose(long space_id) throws HDF5LibraryException { + if (space_id < 0) + return 0; // throw new HDF5LibraryException("Negative ID");; + + log.trace("OPEN_IDS: H5Sclose remove {}", space_id); + OPEN_IDS.remove(space_id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + return _H5Sclose(space_id); + } + + private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException; + + /** + * H5Sencode converts a data space description into binary form in a buffer. + * + * @param obj_id + * IN: Identifier of the object to be encoded. + * + * @return the buffer for the object to be encoded into. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native byte[] H5Sencode(long obj_id) throws HDF5LibraryException, NullPointerException; + + /** * H5Sdecode reconstructs the HDF5 data space object and returns a new object handle for it. * * @param buf * IN: Buffer for the data space object to be decoded. * - * @return a new object handle + * @return a new object handle + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native long H5Sdecode(byte[] buf) throws HDF5LibraryException, NullPointerException; + + /** + * H5Sget_simple_extent_npoints determines the number of elements in a dataspace. + * + * @param space_id + * ID of the dataspace object to query + * @return the number of elements in the dataspace if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. **/ - public synchronized static native long H5Sdecode(byte[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException; /** - * H5Sencode converts a data space description into binary form in a buffer. + * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace. * - * @param obj_id - * IN: Identifier of the object to be encoded. + * @param space_id + * IN: Identifier of the dataspace * - * @return the buffer for the object to be encoded into. + * @return the number of dimensions in the dataspace if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native byte[] H5Sencode(long obj_id) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException; /** - * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the - * dataspace. + * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims + * and maxdims parameters. * - * @param dest_space_id - * IN: The identifier for the dataspace from which the extent is copied. - * @param source_space_id - * IN: The identifier for the dataspace to which the extent is copied. + * @param space_id + * IN: Identifier of the dataspace object to query + * @param dims + * OUT: Pointer to array to store the size of each dimension. + * @param maxdims + * OUT: Pointer to array to store the maximum size of each dimension. * - * @return a non-negative value if successful + * @return the number of dimensions in the dataspace if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - dims or maxdims is null. **/ - public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id) - throws HDF5LibraryException; + public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims) + throws HDF5LibraryException, NullPointerException; /** - * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal. + * H5Sis_simple determines whether a dataspace is a simple dataspace. * - * @param first_space_id - * IN: The identifier for the first dataspace. - * @param second_space_id - * IN: The identifier for the seconddataspace. + * @param space_id + * Identifier of the dataspace to query * - * @return true if successful, else false + * @return true if is a simple dataspace * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id) - throws HDF5LibraryException; + public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places - * them into user-supplied buffers. - *

- * The start and end buffers must be large enough to hold the dataspace rank number of coordinates. + * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace. * - * @param spaceid - * Identifier of dataspace to release. - * @param start - * coordinates of lowest corner of bounding box. - * @param end - * coordinates of highest corner of bounding box. + * @param space_id + * Dataspace identifier. * - * @return a non-negative value if successful,with start and end initialized. + * @return a dataspace class name if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - start or end is null. **/ - public synchronized static native int H5Sget_select_bounds(long spaceid, long[] start, long[] end) - throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection. + * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE. * - * @param spaceid - * Identifier of dataspace to release. + * @param space_id + * The identifier for the dataspace from which the extent is to be removed. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException; + public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point - * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per - * point. + * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the + * dataspace. * - * @param spaceid - * Identifier of dataspace to release. - * @param startpoint - * first point to retrieve - * @param numpoints - * number of points to retrieve - * @param buf - * returns points startblock to startblock+num-1, each points is rank longs. + * @param dest_space_id + * IN: The identifier for the dataspace from which the extent is copied. + * @param source_space_id + * IN: The identifier for the dataspace to which the extent is copied. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. **/ - public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints, - long[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id) + throws HDF5LibraryException; /** - * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same - * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows: - * - *

-     *    <"start" coordinate>, immediately followed by
-     *    <"opposite" corner coordinate>, followed by
-     *   the next "start" and "opposite" coordinates,
-     *   etc.
-     *   until all of the selected blocks have been listed.
-     * 
+ * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal. * - * @param spaceid - * Identifier of dataspace to release. - * @param startblock - * first block to retrieve - * @param numblocks - * number of blocks to retrieve - * @param buf - * returns blocks startblock to startblock+num-1, each block is rank * 2 (corners) longs. + * @param first_space_id + * IN: The identifier for the first dataspace. + * @param second_space_id + * IN: The identifier for the seconddataspace. * - * @return a non-negative value if successful + * @return true if successful, else false * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. **/ - public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks, - long[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id) + throws HDF5LibraryException; + + /***************** Operations on dataspace selections *****************/ /** - * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection. + * H5Sget_select_type retrieves the type of selection currently defined for the dataspace space_id. * - * @param spaceid - * Identifier of dataspace to release. + * @param space_id + * IN: Identifier of the dataspace object to query * - * @return a non-negative value if successful + * @return the dataspace selection type if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException; + public synchronized static native int H5Sget_select_type(long space_id) throws HDF5LibraryException; /** * H5Sget_select_npoints determines the number of elements in the current selection of a dataspace. @@ -9040,89 +11372,123 @@ public class H5 implements java.io.Serializable { public synchronized static native long H5Sget_select_npoints(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_type retrieves the type of selection currently defined for the dataspace space_id. + * H5Sselect_copy copies all the selection information (including offset) from the source + * dataspace to the destination dataspace. + * @param dst_id ID of the destination dataspace + * @param src_id ID of the source dataspace + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Sselect_copy(long dst_id, long src_id) throws HDF5LibraryException; + + /** + * H5Sselect_valid verifies that the selection for the dataspace. * * @param space_id - * IN: Identifier of the dataspace object to query + * The identifier for the dataspace in which the selection is being reset. * - * @return the dataspace selection type if successful + * @return true if the selection is contained within the extent and FALSE if it is not or is an error. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native int H5Sget_select_type(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException; /** - * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims - * and maxdims parameters. + * H5Sselect_adjust moves a selection by subtracting an offset from it. * * @param space_id - * IN: Identifier of the dataspace object to query - * @param dims - * OUT: Pointer to array to store the size of each dimension. - * @param maxdims - * OUT: Pointer to array to store the maximum size of each dimension. - * - * @return the number of dimensions in the dataspace if successful + * ID of dataspace to adjust + * @param offset + * Offset to subtract * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - dims or maxdims is null. + * - offset is null. **/ - public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims) - throws HDF5LibraryException, NullPointerException; + public synchronized static native void H5Sselect_adjust(long space_id, long[][] offset) + throws HDF5LibraryException, NullPointerException; /** - * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace. + * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places + * them into user-supplied buffers. + *

+ * The start and end buffers must be large enough to hold the dataspace rank number of coordinates. * * @param space_id - * IN: Identifier of the dataspace + * Identifier of dataspace to release. + * @param start + * coordinates of lowest corner of bounding box. + * @param end + * coordinates of highest corner of bounding box. * - * @return the number of dimensions in the dataspace if successful + * @return a non-negative value if successful,with start and end initialized. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - start or end is null. **/ - public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sget_select_bounds(long space_id, long[] start, long[] end) + throws HDF5LibraryException, NullPointerException; /** - * H5Sget_simple_extent_npoints determines the number of elements in a dataspace. + * H5Sselect_shape_same checks to see if the current selection in the dataspaces are the same + * dimensionality and shape. + * This is primarily used for reading the entire selection in one swoop. * - * @param space_id - * ID of the dataspace object to query - * @return the number of elements in the dataspace if successful + * @param space1_id ID of 1st Dataspace pointer to compare + * @param space2_id ID of 2nd Dataspace pointer to compare + * + * @return true if the selection is the same dimensionality and shape; + * false otherwise * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sselect_shape_same(long space1_id, long space2_id) throws HDF5LibraryException; /** - * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace. + * H5Sselect_intersect_block checks to see if the current selection in the + * dataspace intersects with the block given. * * @param space_id - * Dataspace identifier. + * ID of dataspace pointer to compare + * @param start + * Starting coordinate of block + * @param end + * Opposite ("ending") coordinate of block * - * @return a dataspace class name if successful + * @return a TRUE if the current selection in the dataspace intersects with the block given + * FALSE otherwise * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - offset is null. **/ - public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sselect_intersect_block(long space_id, long[] start, long[] end) + throws HDF5LibraryException, NullPointerException; /** - * H5Sis_simple determines whether a dataspace is a simple dataspace. + * H5Soffset_simple sets the offset of a simple dataspace space_id. * * @param space_id - * Identifier of the dataspace to query + * IN: The identifier for the dataspace object to reset. + * @param offset + * IN: The offset at which to position the selection. * - * @return true if is a simple dataspace + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - offset array is null. **/ - public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Soffset_simple(long space_id, byte[] offset) throws HDF5LibraryException, + NullPointerException; /** * H5Soffset_simple sets the offset of a simple dataspace space_id. @@ -9139,9 +11505,6 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - offset array is null. **/ - public synchronized static native int H5Soffset_simple(long space_id, byte[] offset) throws HDF5LibraryException, - NullPointerException; - public synchronized static int H5Soffset_simple(long space_id, long[] offset) throws HDF5Exception, NullPointerException { if (offset == null) { @@ -9172,6 +11535,18 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Sselect_all(long space_id) throws HDF5LibraryException; /** + * H5Sselect_none resets the selection region for the dataspace space_id to include no elements. + * + * @param space_id + * IN: The identifier of the dataspace to be reset. + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Sselect_none(long space_id) throws HDF5LibraryException; + + /** * H5Sselect_elements selects array elements to be included in the selection for the space_id dataspace. * * @param space_id @@ -9229,6 +11604,43 @@ public class H5 implements java.io.Serializable { } /** + * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection. + * + * @param spaceid + * Identifier of dataspace to release. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException; + + /** + * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point + * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per + * point. + * + * @param spaceid + * Identifier of dataspace to release. + * @param startpoint + * first point to retrieve + * @param numpoints + * number of points to retrieve + * @param buf + * returns points startblock to startblock+num-1, each points is rank longs. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints, + long[] buf) throws HDF5LibraryException, NullPointerException; + + /** * H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace. * @@ -9268,76 +11680,118 @@ public class H5 implements java.io.Serializable { return H5Sselect_hyperslab(space_id, op, lastart, lastride, lacount, lablock); } - public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride, - long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - /** - * H5Sselect_none resets the selection region for the dataspace space_id to include no elements. + * H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified + * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace. * * @param space_id - * IN: The identifier of the dataspace to be reset. + * IN: Identifier of dataspace selection to modify + * @param op + * IN: Operation to perform on current selection. + * @param start + * IN: Offset of start of hyperslab + * @param stride + * IN: Hyperslab stride. + * @param count + * IN: Number of blocks included in hyperslab. + * @param block + * IN: Size of block in hyperslab. + * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. **/ - public synchronized static native int H5Sselect_none(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride, + long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + /** - * H5Sselect_valid verifies that the selection for the dataspace. + * H5Scombine_hyperslab combines a hyperslab selection with the current selection for a dataspace, + * creating a new dataspace to return the generated selection. + * If the current selection is not a hyperslab, it is freed and the hyperslab + * parameters passed in are combined with the H5S_SEL_ALL hyperslab (ie. a + * selection composing the entire current extent). If STRIDE or BLOCK is + * NULL, they are assumed to be set to all '1'. * * @param space_id - * The identifier for the dataspace in which the selection is being reset. + * IN: Dataspace ID of selection to use + * @param op + * IN: Operation to perform on current selection. + * @param start + * IN: Offset of start of hyperslab + * @param stride + * IN: Hyperslab stride. + * @param count + * IN: Number of blocks included in hyperslab. + * @param block + * IN: Size of block in hyperslab. * - * @return true if the selection is contained within the extent and FALSE if it is not or is an error. + * @return a dataspace ID on success / H5I_INVALID_HID on failure * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. **/ - public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException; + public synchronized static native long H5Scombine_hyperslab(long space_id, int op, long[] start, long[] stride, + long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; /** - * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE. + * H5Smodify_select refine an existing hyperslab selection with an operation, using a second + * hyperslab. The first selection is modified to contain the result of + * space1 operated on by space2. * - * @param space_id - * The identifier for the dataspace from which the extent is to be removed. + * @param space1_id + * ID of the destination dataspace + * @param op + * Operation to perform on current selection. + * @param space2_id + * ID of the source dataspace * - * @return a non-negative value if successful + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Smodify_select(long space1_id, int op, long space2_id) throws HDF5LibraryException; + + /** + * H5Scombine_select combines two existing hyperslab selections with an operation, returning + * a new dataspace with the resulting selection. The dataspace extent from + * space1 is copied for the dataspace extent of the newly created dataspace. + * + * @param space1_id + * ID of the first dataspace + * @param op + * Operation to perform on current selection. + * @param space2_id + * ID of the second dataspace + * + * @return a dataspace ID on success / H5I_INVALID_HID on failure * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException; + public synchronized static native long H5Scombine_select(long space1_id, int op, long space2_id) throws HDF5LibraryException; /** - * H5Sset_extent_simple sets or resets the size of an existing dataspace. + * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified + * by space_id. * * @param space_id - * Dataspace identifier. - * @param rank - * Rank, or dimensionality, of the dataspace. - * @param current_size - * Array containing current size of dataspace. - * @param maximum_size - * Array containing maximum size of dataspace. + * IN: Identifier of dataspace selection to query * - * @return a dataspace identifier if successful + * @return a TRUE/FALSE for hyperslab selection if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size, - long[] maximum_size) throws HDF5LibraryException, NullPointerException; - - public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size, - byte[] maximum_size) throws HDF5LibraryException, NullPointerException { - ByteBuffer csbb = ByteBuffer.wrap(current_size); - long[] lacs = (csbb.asLongBuffer()).array(); - ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size); - long[] lamaxs = (maxsbb.asLongBuffer()).array(); - - return H5Sset_extent_simple(space_id, rank, lacs, lamaxs); - } + public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException; /** * H5Sget_regular_hyperslab determines if a hyperslab selection is regular for the dataspace specified @@ -9363,33 +11817,82 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Sget_regular_hyperslab(long space_id, long[] start, long[] stride, long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + /** + * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection. + * + * @param spaceid + * Identifier of dataspace to release. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException; + /** - * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified - * by space_id. + * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same + * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows: * - * @param space_id - * IN: Identifier of dataspace selection to query + *

+     *    <"start" coordinate>, immediately followed by
+     *    <"opposite" corner coordinate>, followed by
+     *   the next "start" and "opposite" coordinates,
+     *   etc.
+     *   until all of the selected blocks have been listed.
+     * 
* - * @return a TRUE/FALSE for hyperslab selection if successful + * @param spaceid + * Identifier of dataspace to release. + * @param startblock + * first block to retrieve + * @param numblocks + * number of blocks to retrieve + * @param buf + * returns blocks startblock to startblock+num-1, each block is rank * 2 (corners) longs. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. **/ - public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks, + long[] buf) throws HDF5LibraryException, NullPointerException; - // /////// unimplemented //////// - // #ifdef NEW_HYPERSLAB_API - // hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, - // const hsize_t start[], - // const hsize_t _stride[], - // const hsize_t count[], - // const hsize_t _block[]); - // herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op, - // hid_t space2_id); - // hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, - // hid_t space2_id); - // #endif /* NEW_HYPERSLAB_API */ - // herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id); + /** + * H5Sselect_project_intersection projects the intersection of the selections of src_space_id and + * src_intersect_space_id within the selection of src_space_id as a + * selection within the selection of dst_space_id. + * + * @param src_space_id + * Selection that is mapped to dst_space_id, and intersected with src_intersect_space_id + * @param dst_space_id + * Selection that is mapped to src_space_id + * @param src_intersect_space_id + * Selection whose intersection with src_space_id is projected to dst_space_id to obtain the result + * + * @return a dataspace with a selection equal to the intersection of + * src_intersect_space_id and src_space_id projected from src_space to dst_space on success + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sselect_project_intersection(long src_space_id, long dst_space_id, + long src_intersect_space_id) throws HDF5LibraryException; + + + // /////// unimplemented //////// + ///// Operations on dataspace selections ///// + + // + ///// Operations on dataspace selection iterators ///// + //public synchronized static native H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags); + //public synchronized static native H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq, + // size_t *nbytes, hsize_t *off, size_t *len); + //public synchronized static native H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id); + //public synchronized static native H5Ssel_iter_close(hid_t sel_iter_id); @@ -9737,6 +12240,23 @@ public class H5 implements java.io.Serializable { return H5Tenum_insert_int(type, name, value); } + /** + * H5Tenum_insert inserts a new enumeration datatype member into an enumeration datatype. + * + * @param type + * IN: Identifier of datatype. + * @param name + * IN: The name of the member + * @param value + * IN: The value of the member, data of the correct type + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public static int H5Tenum_insert(long type, String name, int value) throws HDF5LibraryException, NullPointerException { int[] val = { value }; @@ -10893,15 +13413,128 @@ public class H5 implements java.io.Serializable { // //////////////////////////////////////////////////////////// /// VOL Connector Functionality + /** + * H5VLregister_connector_by_name registers a new VOL connector as a member of the virtual object layer class. + * + * @param connector_name + * IN: name of the connector. + * @param vipl_id + * IN: VOL initialization property list which must be + * created with H5Pcreate(H5P_VOL_INITIALIZE) (or H5P_DEFAULT). + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLregister_connector_by_name(String connector_name, long vipl_id); + /** + * H5VLregister_connector_by_value registers a new VOL connector as a member of the virtual object layer class. + * + * @param connector_value + * IN: value of the connector. + * @param vipl_id + * IN: VOL initialization property list which must be + * created with H5Pcreate(H5P_VOL_INITIALIZE) (or H5P_DEFAULT). + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLregister_connector_by_value(int connector_value, long vipl_id); + /** + * H5VLis_connector_registered_by_name tests whether a VOL class has been registered. + * + * @param name + * IN: name of the connector. + * + * @return true if a VOL connector with that name has been registered + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native boolean H5VLis_connector_registered_by_name(String name); + /** + * H5VLis_connector_registered_by_value tests whether a VOL class has been registered. + * + * @param connector_value + * IN: value of the connector. + * + * @return true if a VOL connector with that value has been registered + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native boolean H5VLis_connector_registered_by_value(int connector_value); + /** + * H5VLget_connector_id retrieves the ID for a registered VOL connector for a given object. + * + * @param object_id + * IN: Identifier of the object. + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLget_connector_id(long object_id); + /** + * H5VLget_connector_id_by_name retrieves the ID for a registered VOL connector. + * + * @param name + * IN: name of the connector. + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLget_connector_id_by_name(String name); + /** + * H5VLget_connector_id_by_value retrieves the ID for a registered VOL connector. + * + * @param connector_value + * IN: value of the connector. + * + * @return a VOL connector ID + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5VLget_connector_id_by_value(int connector_value); + /** + * H5VLget_connector_name returns the connector name for the VOL associated with the + * object or file ID. + * + * @param object_id + * IN: Identifier of the object. + * + * @return the connector name + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native String H5VLget_connector_name(long object_id); + /** + * H5VLclose closes a VOL connector ID. + * + * @param connector_id + * IN: Identifier of the connector. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5VLclose(long connector_id); + /** + * H5VLunregister_connector removes a VOL connector ID from the library. + * + * @param connector_id + * IN: Identifier of the connector. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5VLunregister_connector(long connector_id); // /////// unimplemented //////// @@ -10914,11 +13547,44 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException, NullPointerException; + /** + * H5Zfilter_avail checks if a filter is available. + * + * @param filter + * IN: filter number. + * + * @return a non-negative(TRUE/FALSE) value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException; + /** + * H5Zget_filter_info gets information about a pipeline data filter. + * + * @param filter + * IN: filter number. + * + * @return the filter information flags + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Zget_filter_info(int filter) throws HDF5LibraryException; - public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException, NullPointerException; + /** + * H5Zunregister unregisters a filter. + * + * @param filter + * IN: filter number. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException; // /////// unimplemented //////// diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 5801655..4125907 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -35,260 +35,650 @@ public class HDF5Constants { // Get the HDF5 constants from the library // // ///////////////////////////////////////////////////////////////////////// - public static final long H5_QUARTER_HADDR_MAX = H5_QUARTER_HADDR_MAX(); + //public static final long H5_QUARTER_HADDR_MAX = H5_QUARTER_HADDR_MAX(); + /** Special parameters for szip compression */ public static final int H5_SZIP_MAX_PIXELS_PER_BLOCK = H5_SZIP_MAX_PIXELS_PER_BLOCK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_NN_OPTION_MASK = H5_SZIP_NN_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_EC_OPTION_MASK = H5_SZIP_EC_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_ALLOW_K13_OPTION_MASK = H5_SZIP_ALLOW_K13_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_CHIP_OPTION_MASK = H5_SZIP_CHIP_OPTION_MASK(); + /** indices on links, unknown index type */ public static final int H5_INDEX_UNKNOWN = H5_INDEX_UNKNOWN(); + /** indices on links, index on names */ public static final int H5_INDEX_NAME = H5_INDEX_NAME(); + /** indices on links, index on creation order */ public static final int H5_INDEX_CRT_ORDER = H5_INDEX_CRT_ORDER(); + /** indices on links, number of indices defined */ public static final int H5_INDEX_N = H5_INDEX_N(); + /** Common iteration orders, Unknown order */ public static final int H5_ITER_UNKNOWN = H5_ITER_UNKNOWN(); + /** Common iteration orders, Increasing order */ public static final int H5_ITER_INC = H5_ITER_INC(); + /** Common iteration orders, Decreasing order */ public static final int H5_ITER_DEC = H5_ITER_DEC(); + /** Common iteration orders, No particular order, whatever is fastest */ public static final int H5_ITER_NATIVE = H5_ITER_NATIVE(); + /** Common iteration orders, Number of iteration orders */ public static final int H5_ITER_N = H5_ITER_N(); + /** */ public static final int H5AC_CURR_CACHE_CONFIG_VERSION = H5AC_CURR_CACHE_CONFIG_VERSION(); + /** */ public static final int H5AC_MAX_TRACE_FILE_NAME_LEN = H5AC_MAX_TRACE_FILE_NAME_LEN(); + /** */ public static final int H5AC_METADATA_WRITE_STRATEGY_PROCESS_ZERO_ONLY = H5AC_METADATA_WRITE_STRATEGY_PROCESS_ZERO_ONLY(); + /** */ public static final int H5AC_METADATA_WRITE_STRATEGY_DISTRIBUTED = H5AC_METADATA_WRITE_STRATEGY_DISTRIBUTED(); + /** */ public static final int H5C_incr_off = H5C_incr_off(); + /** */ public static final int H5C_incr_threshold = H5C_incr_threshold(); + /** */ public static final int H5C_flash_incr_off = H5C_flash_incr_off(); + /** */ public static final int H5C_flash_incr_add_space = H5C_flash_incr_add_space(); + /** */ public static final int H5C_decr_off = H5C_decr_off(); + /** */ public static final int H5C_decr_threshold = H5C_decr_threshold(); + /** */ public static final int H5C_decr_age_out = H5C_decr_age_out(); + /** */ public static final int H5C_decr_age_out_with_threshold = H5C_decr_age_out_with_threshold(); + /** */ public static final int H5D_CHUNK_IDX_BTREE = H5D_CHUNK_IDX_BTREE(); + /** */ public static final int H5D_ALLOC_TIME_DEFAULT = H5D_ALLOC_TIME_DEFAULT(); + /** */ public static final int H5D_ALLOC_TIME_EARLY = H5D_ALLOC_TIME_EARLY(); + /** */ public static final int H5D_ALLOC_TIME_ERROR = H5D_ALLOC_TIME_ERROR(); + /** */ public static final int H5D_ALLOC_TIME_INCR = H5D_ALLOC_TIME_INCR(); + /** */ public static final int H5D_ALLOC_TIME_LATE = H5D_ALLOC_TIME_LATE(); + /** */ public static final int H5D_FILL_TIME_ERROR = H5D_FILL_TIME_ERROR(); + /** */ public static final int H5D_FILL_TIME_ALLOC = H5D_FILL_TIME_ALLOC(); + /** */ public static final int H5D_FILL_TIME_NEVER = H5D_FILL_TIME_NEVER(); + /** */ public static final int H5D_FILL_TIME_IFSET = H5D_FILL_TIME_IFSET(); + /** */ public static final int H5D_FILL_VALUE_DEFAULT = H5D_FILL_VALUE_DEFAULT(); + /** */ public static final int H5D_FILL_VALUE_ERROR = H5D_FILL_VALUE_ERROR(); + /** */ public static final int H5D_FILL_VALUE_UNDEFINED = H5D_FILL_VALUE_UNDEFINED(); + /** */ public static final int H5D_FILL_VALUE_USER_DEFINED = H5D_FILL_VALUE_USER_DEFINED(); + /** */ public static final int H5D_LAYOUT_ERROR = H5D_LAYOUT_ERROR(); + /** */ public static final int H5D_CHUNKED = H5D_CHUNKED(); + /** */ public static final int H5D_COMPACT = H5D_COMPACT(); + /** */ public static final int H5D_CONTIGUOUS = H5D_CONTIGUOUS(); + /** */ public static final int H5D_VIRTUAL = H5D_VIRTUAL(); + /** */ public static final int H5D_NLAYOUTS = H5D_NLAYOUTS(); + /** */ public static final int H5D_SPACE_STATUS_ALLOCATED = H5D_SPACE_STATUS_ALLOCATED(); + /** */ public static final int H5D_SPACE_STATUS_ERROR = H5D_SPACE_STATUS_ERROR(); + /** */ public static final int H5D_SPACE_STATUS_NOT_ALLOCATED = H5D_SPACE_STATUS_NOT_ALLOCATED(); + /** */ public static final int H5D_SPACE_STATUS_PART_ALLOCATED = H5D_SPACE_STATUS_PART_ALLOCATED(); + /** */ public static final int H5D_VDS_ERROR = H5D_VDS_ERROR(); + /** */ public static final int H5D_VDS_FIRST_MISSING = H5D_VDS_FIRST_MISSING(); + /** */ public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); + /** */ public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); + /** Different kinds of error information - H5E_type_t */ public static final int H5E_MAJOR = H5E_MAJOR(); + /** Different kinds of error information - H5E_type_t */ public static final int H5E_MINOR = H5E_MINOR(); + /** Minor error codes - Object header related errors - Alignment error */ public static final long H5E_ALIGNMENT = H5E_ALIGNMENT(); + /** Minor error codes - Resource errors - Object already exists */ public static final long H5E_ALREADYEXISTS = H5E_ALREADYEXISTS(); + /** Minor error codes - Function entry/exit interface - Object already initialized */ public static final long H5E_ALREADYINIT = H5E_ALREADYINIT(); + /** Major error codes - Invalid arguments to routine */ public static final long H5E_ARGS = H5E_ARGS(); - public static final long H5E_ATOM = H5E_ATOM(); + /** Major error codes - Object ID */ + public static final long H5E_ID = H5E_ID(); + /** Major error codes - Attribute */ public static final long H5E_ATTR = H5E_ATTR(); - public static final long H5E_BADATOM = H5E_BADATOM(); + /** Minor error codes - Object ID related errors - Unable to find ID information (already closed?) */ + public static final long H5E_BADID = H5E_BADID(); + /** Minor error codes - File accessibility errors - Bad file ID accessed */ public static final long H5E_BADFILE = H5E_BADFILE(); + /** Minor error codes - Object ID related errors - Unable to find ID group information */ public static final long H5E_BADGROUP = H5E_BADGROUP(); + /** Minor error codes - Object header related errors - Iteration failed */ + public static final long H5E_BADITER = H5E_BADITER(); + /** Minor error codes - Object header related errors - Unrecognized message */ public static final long H5E_BADMESG = H5E_BADMESG(); + /** Minor error codes - Argument errors - Out of range */ public static final long H5E_BADRANGE = H5E_BADRANGE(); + /** Minor error codes - Dataspace errors - Invalid selection */ public static final long H5E_BADSELECT = H5E_BADSELECT(); + /** Datatype conversion errors - Bad size for object */ public static final long H5E_BADSIZE = H5E_BADSIZE(); + /** Minor error codes - Argument errors - Inappropriate type */ public static final long H5E_BADTYPE = H5E_BADTYPE(); + /** Minor error codes - Argument errors - Bad value */ public static final long H5E_BADVALUE = H5E_BADVALUE(); + /** Major error codes - B-Tree node */ public static final long H5E_BTREE = H5E_BTREE(); + /** Major error codes - Object cache */ public static final long H5E_CACHE = H5E_CACHE(); + /** I/O pipeline errors - Callback failed */ public static final long H5E_CALLBACK = H5E_CALLBACK(); + /** I/O pipeline errors - Error from filter 'can apply' callback */ public static final long H5E_CANAPPLY = H5E_CANAPPLY(); - // public static final long H5E_CANTALLOC = H5E_CANTALLOC(); + /** Minor error codes - Resource errors - Can't allocate space */ + public static final long H5E_CANTALLOC = H5E_CANTALLOC(); + /** Minor error codes - Dataspace errors - Can't append object */ + public static final long H5E_CANTAPPEND = H5E_CANTAPPEND(); + /** Minor error codes - Heap errors - Can't attach object */ + public static final long H5E_CANTATTACH = H5E_CANTATTACH(); + /** Minor error codes - Cache related errors - Unable to mark metadata as clean */ + public static final long H5E_CANTCLEAN = H5E_CANTCLEAN(); + /** Minor error codes - Dataspace errors - Can't clip hyperslab region */ public static final long H5E_CANTCLIP = H5E_CANTCLIP(); + /** Minor error codes - File accessibility errors - Unable to close file */ public static final long H5E_CANTCLOSEFILE = H5E_CANTCLOSEFILE(); + /** Minor error codes - Group related errors - Can't close object */ + public static final long H5E_CANTCLOSEOBJ = H5E_CANTCLOSEOBJ(); + /** Minor error codes - Dataspace errors - Can't compare objects */ + public static final long H5E_CANTCOMPARE = H5E_CANTCOMPARE(); + /** Minor error codes - Heap errors - Can't compute value */ + public static final long H5E_CANTCOMPUTE = H5E_CANTCOMPUTE(); + /** Datatype conversion errors - Can't convert datatypes */ public static final long H5E_CANTCONVERT = H5E_CANTCONVERT(); + /** Minor error codes - Resource errors - Unable to copy object */ public static final long H5E_CANTCOPY = H5E_CANTCOPY(); + /** Minor error codes - Cache related errors - Unable to cork an object */ + public static final long H5E_CANTCORK = H5E_CANTCORK(); + /** Minor error codes - Dataspace errors - Can't count elements */ public static final long H5E_CANTCOUNT = H5E_CANTCOUNT(); + /** Minor error codes - File accessibility errors - Unable to create file */ public static final long H5E_CANTCREATE = H5E_CANTCREATE(); + /** Minor error codes - Object ID related errors - Unable to decrement reference count */ public static final long H5E_CANTDEC = H5E_CANTDEC(); + /** Minor error codes - B-tree related errors - Unable to decode value */ public static final long H5E_CANTDECODE = H5E_CANTDECODE(); + /** Minor error codes - Object header related errors - Can't delete message */ public static final long H5E_CANTDELETE = H5E_CANTDELETE(); + /** Minor error codes - File accessibility errors - Unable to delete file */ public static final long H5E_CANTDELETEFILE = H5E_CANTDELETEFILE(); + /** Minor error codes - Cache related errors - Unable to create a flush dependency */ + public static final long H5E_CANTDEPEND = H5E_CANTDEPEND(); + /** Minor error codes - Cache related errors - Unable to mark metadata as dirty */ + public static final long H5E_CANTDIRTY = H5E_CANTDIRTY(); + /** Minor error codes - B-tree related errors - Unable to encode value */ public static final long H5E_CANTENCODE = H5E_CANTENCODE(); + /** Minor error codes - Cache related errors - Unable to expunge a metadata cache entry */ + public static final long H5E_CANTEXPUNGE = H5E_CANTEXPUNGE(); + /** Minor error codes - Heap errors - Can't extend heap's space */ + public static final long H5E_CANTEXTEND = H5E_CANTEXTEND(); + /** I/O pipeline errors - Filter operation failed */ + public static final long H5E_CANTFILTER = H5E_CANTFILTER(); + /** Minor error codes - Cache related errors - Unable to flush data from cache */ public static final long H5E_CANTFLUSH = H5E_CANTFLUSH(); + /** Minor error codes - Resource errors - Unable to free object */ public static final long H5E_CANTFREE = H5E_CANTFREE(); + /** Minor error codes - Parallel MPI - Can't gather data */ + public static final long H5E_CANTGATHER = H5E_CANTGATHER(); + /** Minor error codes - Resource errors - Unable to garbage collect */ + public static final long H5E_CANTGC = H5E_CANTGC(); + /** Minor error codes - Property list errors - Can't get value */ public static final long H5E_CANTGET = H5E_CANTGET(); + /** Minor error codes - Resource errors - Unable to compute size */ + public static final long H5E_CANTGETSIZE = H5E_CANTGETSIZE(); + /** Minor error codes - Object ID related errors - Unable to increment reference count */ public static final long H5E_CANTINC = H5E_CANTINC(); + /** Minor error codes - Function entry/exit interface - Unable to initialize object */ public static final long H5E_CANTINIT = H5E_CANTINIT(); + /** Minor error codes - Cache related errors - Unable to insert metadata into cache */ + public static final long H5E_CANTINS = H5E_CANTINS(); + /** Minor error codes - B-tree related errors - Unable to insert object */ public static final long H5E_CANTINSERT = H5E_CANTINSERT(); + /** Minor error codes - B-tree related errors - Unable to list node */ public static final long H5E_CANTLIST = H5E_CANTLIST(); + /** Minor error codes - Cache related errors - Unable to load metadata into cache */ public static final long H5E_CANTLOAD = H5E_CANTLOAD(); + /** Minor error codes - Resource errors - Unable to lock object */ public static final long H5E_CANTLOCK = H5E_CANTLOCK(); + /** Minor error codes - File accessibility errors Unable to lock file */ + public static final long H5E_CANTLOCKFILE = H5E_CANTLOCKFILE(); + /** Minor error codes - Cache related errors - Unable to mark a pinned entry as clean */ + public static final long H5E_CANTMARKCLEAN = H5E_CANTMARKCLEAN(); + /** Minor error codes - Cache related errors - Unable to mark a pinned entry as dirty */ + public static final long H5E_CANTMARKDIRTY = H5E_CANTMARKDIRTY(); + /** Minor error codes - Cache related errors - Unable to mark an entry as unserialized */ + public static final long H5E_CANTMARKSERIALIZED = H5E_CANTMARKSERIALIZED(); + /** Minor error codes - Cache related errors - Unable to mark an entry as serialized */ + public static final long H5E_CANTMARKUNSERIALIZED = H5E_CANTMARKUNSERIALIZED(); + /** Minor error codes - Free space errors - Can't merge objects */ + public static final long H5E_CANTMERGE = H5E_CANTMERGE(); + /** Minor error codes - B-tree related errors - Unable to modify record */ + public static final long H5E_CANTMODIFY = H5E_CANTMODIFY(); + /** Minor error codes - Link related errors - Can't move object */ + public static final long H5E_CANTMOVE = H5E_CANTMOVE(); + /** Minor error codes - Dataspace errors - Can't move to next iterator location */ public static final long H5E_CANTNEXT = H5E_CANTNEXT(); + /** Minor error codes - Cache related errors - Unable to notify object about action */ + public static final long H5E_CANTNOTIFY = H5E_CANTNOTIFY(); + /** Minor error codes - File accessibility errors - Unable to open file */ public static final long H5E_CANTOPENFILE = H5E_CANTOPENFILE(); + /** Minor error codes - Group related errors - Can't open object */ public static final long H5E_CANTOPENOBJ = H5E_CANTOPENOBJ(); - // public static final long H5E_CANTRECV = H5E_CANTRECV(); + /** Minor error codes - Heap errors - Can't operate on object */ + public static final long H5E_CANTOPERATE = H5E_CANTOPERATE(); + /** Minor error codes - Object header related errors - Can't pack messages */ + public static final long H5E_CANTPACK = H5E_CANTPACK(); + /** Minor error codes - Cache related errors - Unable to pin cache entry */ + public static final long H5E_CANTPIN = H5E_CANTPIN(); + /** Minor error codes - Cache related errors - Unable to protect metadata */ + public static final long H5E_CANTPROTECT = H5E_CANTPROTECT(); + /** Minor error codes - Parallel MPI - Can't receive data */ + public static final long H5E_CANTRECV = H5E_CANTRECV(); + /** Minor error codes - B-tree related errors - Unable to redistribute records */ + public static final long H5E_CANTREDISTRIBUTE = H5E_CANTREDISTRIBUTE(); + /** Minor error codes - Object ID related errors - Unable to register new ID */ public static final long H5E_CANTREGISTER = H5E_CANTREGISTER(); + /** Minor error codes - Function entry/exit interface - Unable to release object */ public static final long H5E_CANTRELEASE = H5E_CANTRELEASE(); + /** Minor error codes - B-tree related errors - Unable to remove object */ + public static final long H5E_CANTREMOVE = H5E_CANTREMOVE(); + /** Minor error codes - Object header related errors - Unable to rename object */ + public static final long H5E_CANTRENAME = H5E_CANTRENAME(); + /** Minor error codes - Object header related errors - Can't reset object */ + public static final long H5E_CANTRESET = H5E_CANTRESET(); + /** Minor error codes - Cache related errors - Unable to resize a metadata cache entry */ + public static final long H5E_CANTRESIZE = H5E_CANTRESIZE(); + /** Minor error codes - Heap errors - Can't restore condition */ + public static final long H5E_CANTRESTORE = H5E_CANTRESTORE(); + /** Minor error codes - Free space errors - Can't revive object */ + public static final long H5E_CANTREVIVE = H5E_CANTREVIVE(); + /** Minor error codes - Free space errors - Can't shrink container */ + public static final long H5E_CANTSHRINK = H5E_CANTSHRINK(); + /** Minor error codes - Dataspace errors - Can't select hyperslab */ public static final long H5E_CANTSELECT = H5E_CANTSELECT(); + /** Minor error codes - Cache related errors - Unable to serialize data from cache */ + public static final long H5E_CANTSERIALIZE = H5E_CANTSERIALIZE(); + /** Minor error codes - Property list errors - Can't set value */ public static final long H5E_CANTSET = H5E_CANTSET(); + /** Minor error codes - Link related errors - Can't sort objects */ + public static final long H5E_CANTSORT = H5E_CANTSORT(); + /** Minor error codes - B-tree related errors - Unable to split node */ public static final long H5E_CANTSPLIT = H5E_CANTSPLIT(); + /** Minor error codes - B-tree related errors - Unable to swap records */ + public static final long H5E_CANTSWAP = H5E_CANTSWAP(); + /** Minor error codes - Cache related errors - Unable to tag metadata in the cache */ + public static final long H5E_CANTTAG = H5E_CANTTAG(); + /** Minor error codes - Cache related errors - Unable to uncork an object */ + public static final long H5E_CANTUNCORK = H5E_CANTUNCORK(); + /** Minor error codes - Cache related errors - Unable to destroy a flush dependency */ + public static final long H5E_CANTUNDEPEND = H5E_CANTUNDEPEND(); + /** Minor error codes - Resource errors - Unable to unlock object */ public static final long H5E_CANTUNLOCK = H5E_CANTUNLOCK(); + /** Minor error codes - File accessibility errors Unable to unlock file */ + public static final long H5E_CANTUNLOCKFILE = H5E_CANTUNLOCKFILE(); + /** Minor error codes - Cache related errors - Unable to un-pin cache entry */ + public static final long H5E_CANTUNPIN = H5E_CANTUNPIN(); + /** Minor error codes - Cache related errors - Unable to unprotect metadata */ + public static final long H5E_CANTUNPROTECT = H5E_CANTUNPROTECT(); + /** Minor error codes - Cache related errors - Unable to mark metadata as unserialized */ + public static final long H5E_CANTUNSERIALIZE = H5E_CANTUNSERIALIZE(); + /** Minor error codes - Heap errors - Can't update object */ + public static final long H5E_CANTUPDATE = H5E_CANTUPDATE(); + /** Generic low-level file I/O errors - Close failed */ public static final long H5E_CLOSEERROR = H5E_CLOSEERROR(); + /** Minor error codes - Group related errors - Name component is too long */ public static final long H5E_COMPLEN = H5E_COMPLEN(); + /** Major error codes - API Context */ + public static final long H5E_CONTEXT = H5E_CONTEXT(); + /** Major error codes - Dataset */ public static final long H5E_DATASET = H5E_DATASET(); + /** Major error codes - Dataspace */ public static final long H5E_DATASPACE = H5E_DATASPACE(); + /** Major error codes - Datatype */ public static final long H5E_DATATYPE = H5E_DATATYPE(); + /** Value for the default error stack */ public static final long H5E_DEFAULT = H5E_DEFAULT(); + /** Minor error codes - Property list errors - Duplicate class name in parent class */ public static final long H5E_DUPCLASS = H5E_DUPCLASS(); + /** Major error codes - Extensible Array */ + public static final long H5E_EARRAY = H5E_EARRAY(); + /** Major error codes - External file list */ public static final long H5E_EFL = H5E_EFL(); + /** Major error codes - Error API */ + public static final long H5E_ERROR = H5E_ERROR(); + /** Minor error codes - B-tree related errors - Object already exists */ public static final long H5E_EXISTS = H5E_EXISTS(); + /** Major error codes - Fixed Array */ + public static final long H5E_FARRAY = H5E_FARRAY(); + /** Generic low-level file I/O errors - File control (fcntl) failed */ public static final long H5E_FCNTL = H5E_FCNTL(); + /** Major error codes - File accessibility */ public static final long H5E_FILE = H5E_FILE(); + /** Minor error codes - File accessibility errors - File already exists */ public static final long H5E_FILEEXISTS = H5E_FILEEXISTS(); + /** Minor error codes - File accessibility errors - File already open */ public static final long H5E_FILEOPEN = H5E_FILEOPEN(); + /** Major error codes - Free Space Manager */ + public static final long H5E_FSPACE = H5E_FSPACE(); + /** Major error codes - Function entry/exit */ public static final long H5E_FUNC = H5E_FUNC(); + /** Major error codes - Heap */ public static final long H5E_HEAP = H5E_HEAP(); + /** Minor error codes - Dataspace errors - Internal states are inconsistent */ + public static final long H5E_INCONSISTENTSTATE = H5E_INCONSISTENTSTATE(); + /** Major error codes - Internal error (too specific to document in detail) */ public static final long H5E_INTERNAL = H5E_INTERNAL(); + /** Major error codes - Low-level I/O */ public static final long H5E_IO = H5E_IO(); + /** Major error codes - Links */ public static final long H5E_LINK = H5E_LINK(); + /** Minor error codes - Object header related errors - Bad object header link count */ public static final long H5E_LINKCOUNT = H5E_LINKCOUNT(); + /** Minor error codes - Cache related errors - Failure in the cache logging framework */ + public static final long H5E_LOGGING = H5E_LOGGING(); + /** Major error codes - Map */ + public static final long H5E_MAP = H5E_MAP(); + /** Minor error codes - File accessibility errors - File mount error */ public static final long H5E_MOUNT = H5E_MOUNT(); + /** Minor error codes - Parallel MPI - Some MPI function failed */ public static final long H5E_MPI = H5E_MPI(); + /** Minor error codes - Parallel MPI - MPI Error String */ public static final long H5E_MPIERRSTR = H5E_MPIERRSTR(); + /** Minor error codes - Link related errors - Too many soft links in path */ + public static final long H5E_NLINKS = H5E_NLINKS(); + /** Minor error codes - Parallel MPI - Can't perform independent IO */ + public static final long H5E_NO_INDEPENDENT = H5E_NO_INDEPENDENT(); + /** I/O pipeline errors - Filter present but encoding disabled */ + public static final long H5E_NOENCODER = H5E_NOENCODER(); + /** I/O pipeline errors - Requested filter is not available */ public static final long H5E_NOFILTER = H5E_NOFILTER(); + /** Minor error codes - Object ID related errors - Out of IDs for group */ public static final long H5E_NOIDS = H5E_NOIDS(); + /** Major error codes - No error */ public static final long H5E_NONE_MAJOR = H5E_NONE_MAJOR(); + /** No error */ public static final long H5E_NONE_MINOR = H5E_NONE_MINOR(); + /** Minor error codes - Resource errors - No space available for allocation */ public static final long H5E_NOSPACE = H5E_NOSPACE(); + /** Minor error codes - Cache related errors - Metadata not currently cached */ public static final long H5E_NOTCACHED = H5E_NOTCACHED(); + /** Minor error codes - B-tree related errors - Object not found */ public static final long H5E_NOTFOUND = H5E_NOTFOUND(); + /** Minor error codes - File accessibility errors - Not an HDF5 file */ public static final long H5E_NOTHDF5 = H5E_NOTHDF5(); + /** Minor error codes - Link related errors - Link class not registered */ + public static final long H5E_NOTREGISTERED = H5E_NOTREGISTERED(); + /** Minor error codes - Resource errors - Object is already open */ + public static final long H5E_OBJOPEN = H5E_OBJOPEN(); + /** Major error codes - Object header */ public static final long H5E_OHDR = H5E_OHDR(); + /** Minor error codes - Plugin errors - Can't open directory or file */ + public static final long H5E_OPENERROR = H5E_OPENERROR(); + /** Generic low-level file I/O errors - Address overflowed */ public static final long H5E_OVERFLOW = H5E_OVERFLOW(); + /** Major error codes - Page Buffering */ + public static final long H5E_PAGEBUF = H5E_PAGEBUF(); + /** Minor error codes - Group related errors - Problem with path to object */ + public static final long H5E_PATH = H5E_PATH(); + /** Major error codes - Data filters */ public static final long H5E_PLINE = H5E_PLINE(); + /** Major error codes - Property lists */ public static final long H5E_PLIST = H5E_PLIST(); + /** Major error codes - Plugin for dynamically loaded library */ + public static final long H5E_PLUGIN = H5E_PLUGIN(); + /** Minor error codes - Cache related errors - Protected metadata error */ public static final long H5E_PROTECT = H5E_PROTECT(); + /** Generic low-level file I/O errors - Read failed */ public static final long H5E_READERROR = H5E_READERROR(); + /** Major error codes - References */ public static final long H5E_REFERENCE = H5E_REFERENCE(); + /** Major error codes - Resource unavailable */ public static final long H5E_RESOURCE = H5E_RESOURCE(); + /** Major error codes - Reference Counted Strings */ public static final long H5E_RS = H5E_RS(); + /** Generic low-level file I/O errors - Seek failed */ public static final long H5E_SEEKERROR = H5E_SEEKERROR(); + /** Minor error codes - Property list errors - Disallowed operation */ + public static final long H5E_SETDISALLOWED = H5E_SETDISALLOWED(); + /** I/O pipeline errors - Error from filter 'set local' callback */ public static final long H5E_SETLOCAL = H5E_SETLOCAL(); + /** Major error codes - Skip Lists */ + public static final long H5E_SLIST = H5E_SLIST(); + /** Major error codes - Shared Object Header Messages */ + public static final long H5E_SOHM = H5E_SOHM(); + /** Major error codes - Data storage */ public static final long H5E_STORAGE = H5E_STORAGE(); + /** Major error codes - Symbol table */ public static final long H5E_SYM = H5E_SYM(); + /** Minor error codes - System level errors - System error message */ + public static final long H5E_SYSERRSTR = H5E_SYSERRSTR(); + /** Minor error codes - Cache related errors - Internal error detected */ + public static final long H5E_SYSTEM = H5E_SYSTEM(); + /** Minor error codes - Link related errors - Link traversal failure */ + public static final long H5E_TRAVERSE = H5E_TRAVERSE(); + /** Minor error codes - File accessibility errors - File has been truncated */ public static final long H5E_TRUNCATED = H5E_TRUNCATED(); + /** Major error codes - Ternary Search Trees */ public static final long H5E_TST = H5E_TST(); + /** Minor error codes - Argument errors - Information is uinitialized */ public static final long H5E_UNINITIALIZED = H5E_UNINITIALIZED(); + /** Minor error codes - Argument errors - Feature is unsupported */ public static final long H5E_UNSUPPORTED = H5E_UNSUPPORTED(); + /** Minor error codes - Object header related errors - Wrong version number */ public static final long H5E_VERSION = H5E_VERSION(); + /** Major error codes - Virtual File Layer */ public static final long H5E_VFL = H5E_VFL(); + /** Major error codes - Virtual Object Layer */ public static final long H5E_VOL = H5E_VOL(); + /** Error stack traversal direction - begin at API function, end deep */ public static final long H5E_WALK_DOWNWARD = H5E_WALK_DOWNWARD(); + /** Error stack traversal direction - begin deep, end at API function */ public static final long H5E_WALK_UPWARD = H5E_WALK_UPWARD(); + /** Generic low-level file I/O errors - Write failed */ public static final long H5E_WRITEERROR = H5E_WRITEERROR(); + /** */ private static final int H5ES_STATUS_IN_PROGRESS = H5ES_STATUS_IN_PROGRESS(); + /** */ private static final int H5ES_STATUS_SUCCEED = H5ES_STATUS_SUCCEED(); + /** */ private static final int H5ES_STATUS_FAIL = H5ES_STATUS_FAIL(); - private static final int H5ES_STATUS_CANCELED = H5ES_STATUS_CANCELED(); + /** */ public static final int H5F_ACC_CREAT = H5F_ACC_CREAT(); + /** */ public static final int H5F_ACC_EXCL = H5F_ACC_EXCL(); + /** */ public static final int H5F_ACC_RDONLY = H5F_ACC_RDONLY(); + /** */ public static final int H5F_ACC_RDWR = H5F_ACC_RDWR(); + /** */ public static final int H5F_ACC_TRUNC = H5F_ACC_TRUNC(); + /** */ public static final int H5F_ACC_DEFAULT = H5F_ACC_DEFAULT(); + /** */ public static final int H5F_ACC_SWMR_READ = H5F_ACC_SWMR_READ(); + /** */ public static final int H5F_ACC_SWMR_WRITE = H5F_ACC_SWMR_WRITE(); + /** */ public static final int H5F_CLOSE_DEFAULT = H5F_CLOSE_DEFAULT(); + /** */ public static final int H5F_CLOSE_SEMI = H5F_CLOSE_SEMI(); + /** */ public static final int H5F_CLOSE_STRONG = H5F_CLOSE_STRONG(); + /** */ public static final int H5F_CLOSE_WEAK = H5F_CLOSE_WEAK(); + /** */ public static final int H5F_LIBVER_ERROR = H5F_LIBVER_ERROR(); + /** */ public static final int H5F_LIBVER_EARLIEST = H5F_LIBVER_EARLIEST(); + /** */ public static final int H5F_LIBVER_V18 = H5F_LIBVER_V18(); + /** */ public static final int H5F_LIBVER_V110 = H5F_LIBVER_V110(); + /** */ public static final int H5F_LIBVER_V112 = H5F_LIBVER_V112(); + /** */ public static final int H5F_LIBVER_V114 = H5F_LIBVER_V114(); + /** */ public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS(); + /** */ public static final int H5F_LIBVER_LATEST = H5F_LIBVER_LATEST(); + /** */ public static final int H5F_OBJ_ALL = H5F_OBJ_ALL(); + /** */ public static final int H5F_OBJ_ATTR = H5F_OBJ_ATTR(); + /** */ public static final int H5F_OBJ_DATASET = H5F_OBJ_DATASET(); + /** */ public static final int H5F_OBJ_DATATYPE = H5F_OBJ_DATATYPE(); + /** */ public static final int H5F_OBJ_FILE = H5F_OBJ_FILE(); + /** */ public static final int H5F_OBJ_GROUP = H5F_OBJ_GROUP(); + /** */ public static final int H5F_OBJ_LOCAL = H5F_OBJ_LOCAL(); + /** */ public static final int H5F_SCOPE_GLOBAL = H5F_SCOPE_GLOBAL(); + /** */ public static final int H5F_SCOPE_LOCAL = H5F_SCOPE_LOCAL(); + /** */ public static final int H5F_UNLIMITED = H5F_UNLIMITED(); + /** */ public static final int H5F_FSPACE_STRATEGY_FSM_AGGR = H5F_FSPACE_STRATEGY_FSM_AGGR(); + /** */ public static final int H5F_FSPACE_STRATEGY_AGGR = H5F_FSPACE_STRATEGY_AGGR(); + /** */ public static final int H5F_FSPACE_STRATEGY_PAGE = H5F_FSPACE_STRATEGY_PAGE(); + /** */ public static final int H5F_FSPACE_STRATEGY_NONE = H5F_FSPACE_STRATEGY_NONE(); + /** */ public static final int H5F_FSPACE_STRATEGY_NTYPES = H5F_FSPACE_STRATEGY_NTYPES(); + /** */ public static final long H5FD_CORE = H5FD_CORE(); + /** */ public static final long H5FD_DIRECT = H5FD_DIRECT(); + /** */ public static final long H5FD_FAMILY = H5FD_FAMILY(); + /** */ public static final long H5FD_LOG = H5FD_LOG(); + /** */ public static final long H5FD_MPIO = H5FD_MPIO(); + /** */ public static final long H5FD_MULTI = H5FD_MULTI(); + /** */ public static final long H5FD_SEC2 = H5FD_SEC2(); + /** */ public static final long H5FD_STDIO = H5FD_STDIO(); + /** */ public static final long H5FD_WINDOWS = H5FD_WINDOWS(); + /** */ public static final long H5FD_ROS3 = H5FD_ROS3(); + /** */ public static final long H5FD_HDFS = H5FD_HDFS(); + /** */ public static final int H5FD_LOG_LOC_READ = H5FD_LOG_LOC_READ(); + /** */ public static final int H5FD_LOG_LOC_WRITE = H5FD_LOG_LOC_WRITE(); + /** */ public static final int H5FD_LOG_LOC_SEEK = H5FD_LOG_LOC_SEEK(); + /** */ public static final int H5FD_LOG_LOC_IO = H5FD_LOG_LOC_IO(); + /** */ public static final int H5FD_LOG_FILE_READ = H5FD_LOG_FILE_READ(); + /** */ public static final int H5FD_LOG_FILE_WRITE = H5FD_LOG_FILE_WRITE(); + /** */ public static final int H5FD_LOG_FILE_IO = H5FD_LOG_FILE_IO(); + /** */ public static final int H5FD_LOG_FLAVOR = H5FD_LOG_FLAVOR(); + /** */ public static final int H5FD_LOG_NUM_READ = H5FD_LOG_NUM_READ(); + /** */ public static final int H5FD_LOG_NUM_WRITE = H5FD_LOG_NUM_WRITE(); + /** */ public static final int H5FD_LOG_NUM_SEEK = H5FD_LOG_NUM_SEEK(); + /** */ public static final int H5FD_LOG_NUM_TRUNCATE = H5FD_LOG_NUM_TRUNCATE(); + /** */ public static final int H5FD_LOG_NUM_IO = H5FD_LOG_NUM_IO(); + /** */ public static final int H5FD_LOG_TIME_OPEN = H5FD_LOG_TIME_OPEN(); + /** */ public static final int H5FD_LOG_TIME_STAT = H5FD_LOG_TIME_STAT(); + /** */ public static final int H5FD_LOG_TIME_READ = H5FD_LOG_TIME_READ(); + /** */ public static final int H5FD_LOG_TIME_WRITE = H5FD_LOG_TIME_WRITE(); + /** */ public static final int H5FD_LOG_TIME_SEEK = H5FD_LOG_TIME_SEEK(); + /** */ public static final int H5FD_LOG_TIME_CLOSE = H5FD_LOG_TIME_CLOSE(); + /** */ public static final int H5FD_LOG_TIME_IO = H5FD_LOG_TIME_IO(); + /** */ public static final int H5FD_LOG_ALLOC = H5FD_LOG_ALLOC(); + /** */ public static final int H5FD_LOG_ALL = H5FD_LOG_ALL(); + /** */ public static final int H5FD_MEM_NOLIST = H5FD_MEM_NOLIST(); + /** */ public static final int H5FD_MEM_DEFAULT = H5FD_MEM_DEFAULT(); + /** */ public static final int H5FD_MEM_SUPER = H5FD_MEM_SUPER(); + /** */ public static final int H5FD_MEM_BTREE = H5FD_MEM_BTREE(); + /** */ public static final int H5FD_MEM_DRAW = H5FD_MEM_DRAW(); + /** */ public static final int H5FD_MEM_GHEAP = H5FD_MEM_GHEAP(); + /** */ public static final int H5FD_MEM_LHEAP = H5FD_MEM_LHEAP(); + /** */ public static final int H5FD_MEM_OHDR = H5FD_MEM_OHDR(); + /** */ public static final int H5FD_MEM_NTYPES = H5FD_MEM_NTYPES(); + /** */ public static final long H5FD_DEFAULT_HADDR_SIZE = H5FD_DEFAULT_HADDR_SIZE(); + /** */ public static final long H5FD_MEM_DEFAULT_SIZE = H5FD_MEM_DEFAULT_SIZE(); + /** */ public static final long H5FD_MEM_DEFAULT_SUPER_SIZE = H5FD_MEM_DEFAULT_SUPER_SIZE(); + /** */ public static final long H5FD_MEM_DEFAULT_BTREE_SIZE = H5FD_MEM_DEFAULT_BTREE_SIZE(); + /** */ public static final long H5FD_MEM_DEFAULT_DRAW_SIZE = H5FD_MEM_DEFAULT_DRAW_SIZE(); + /** */ public static final long H5FD_MEM_DEFAULT_GHEAP_SIZE = H5FD_MEM_DEFAULT_GHEAP_SIZE(); + /** */ public static final long H5FD_MEM_DEFAULT_LHEAP_SIZE = H5FD_MEM_DEFAULT_LHEAP_SIZE(); + /** */ public static final long H5FD_MEM_DEFAULT_OHDR_SIZE = H5FD_MEM_DEFAULT_OHDR_SIZE(); // public static final int H5G_DATASET = H5G_DATASET(); @@ -308,405 +698,802 @@ public class HDF5Constants { // public static final int H5G_TYPE = H5G_TYPE(); // public static final int H5G_UNKNOWN = H5G_UNKNOWN(); + /** */ public static final int H5G_STORAGE_TYPE_UNKNOWN = H5G_STORAGE_TYPE_UNKNOWN(); + /** */ public static final int H5G_STORAGE_TYPE_SYMBOL_TABLE = H5G_STORAGE_TYPE_SYMBOL_TABLE(); + /** */ public static final int H5G_STORAGE_TYPE_COMPACT = H5G_STORAGE_TYPE_COMPACT(); + /** */ public static final int H5G_STORAGE_TYPE_DENSE = H5G_STORAGE_TYPE_DENSE(); + /** */ public static final int H5I_ATTR = H5I_ATTR(); + /** */ public static final int H5I_BADID = H5I_BADID(); + /** */ public static final int H5I_DATASET = H5I_DATASET(); + /** */ public static final int H5I_DATASPACE = H5I_DATASPACE(); + /** */ public static final int H5I_DATATYPE = H5I_DATATYPE(); + /** */ public static final int H5I_ERROR_CLASS = H5I_ERROR_CLASS(); + /** */ public static final int H5I_ERROR_MSG = H5I_ERROR_MSG(); + /** */ public static final int H5I_ERROR_STACK = H5I_ERROR_STACK(); + /** */ public static final int H5I_FILE = H5I_FILE(); + /** */ public static final int H5I_GENPROP_CLS = H5I_GENPROP_CLS(); + /** */ public static final int H5I_GENPROP_LST = H5I_GENPROP_LST(); + /** */ public static final int H5I_GROUP = H5I_GROUP(); + /** */ public static final int H5I_INVALID_HID = H5I_INVALID_HID(); + /** */ public static final int H5I_NTYPES = H5I_NTYPES(); + /** */ public static final int H5I_UNINIT = H5I_UNINIT(); + /** */ public static final int H5I_VFL = H5I_VFL(); + /** */ public static final int H5I_VOL = H5I_VOL(); + /** */ public static final int H5L_TYPE_ERROR = H5L_TYPE_ERROR(); + /** */ public static final int H5L_TYPE_HARD = H5L_TYPE_HARD(); + /** */ public static final int H5L_TYPE_SOFT = H5L_TYPE_SOFT(); + /** */ public static final int H5L_TYPE_EXTERNAL = H5L_TYPE_EXTERNAL(); + /** */ public static final int H5L_TYPE_MAX = H5L_TYPE_MAX(); + /** */ public static final int H5O_COPY_SHALLOW_HIERARCHY_FLAG = H5O_COPY_SHALLOW_HIERARCHY_FLAG(); + /** */ public static final int H5O_COPY_EXPAND_SOFT_LINK_FLAG = H5O_COPY_EXPAND_SOFT_LINK_FLAG(); + /** */ public static final int H5O_COPY_EXPAND_EXT_LINK_FLAG = H5O_COPY_EXPAND_EXT_LINK_FLAG(); + /** */ public static final int H5O_COPY_EXPAND_REFERENCE_FLAG = H5O_COPY_EXPAND_REFERENCE_FLAG(); + /** */ public static final int H5O_COPY_WITHOUT_ATTR_FLAG = H5O_COPY_WITHOUT_ATTR_FLAG(); + /** */ public static final int H5O_COPY_PRESERVE_NULL_FLAG = H5O_COPY_PRESERVE_NULL_FLAG(); + /** */ public static final int H5O_INFO_BASIC = H5O_INFO_BASIC(); + /** */ public static final int H5O_INFO_TIME = H5O_INFO_TIME(); + /** */ public static final int H5O_INFO_NUM_ATTRS = H5O_INFO_NUM_ATTRS(); + /** */ public static final int H5O_INFO_ALL = H5O_INFO_ALL(); + /** */ public static final int H5O_NATIVE_INFO_HDR = H5O_NATIVE_INFO_HDR(); + /** */ public static final int H5O_NATIVE_INFO_META_SIZE = H5O_NATIVE_INFO_META_SIZE(); + /** */ public static final int H5O_NATIVE_INFO_ALL = H5O_NATIVE_INFO_ALL(); + /** */ public static final int H5O_SHMESG_NONE_FLAG = H5O_SHMESG_NONE_FLAG(); + /** */ public static final int H5O_SHMESG_SDSPACE_FLAG = H5O_SHMESG_SDSPACE_FLAG(); + /** */ public static final int H5O_SHMESG_DTYPE_FLAG = H5O_SHMESG_DTYPE_FLAG(); + /** */ public static final int H5O_SHMESG_FILL_FLAG = H5O_SHMESG_FILL_FLAG(); + /** */ public static final int H5O_SHMESG_PLINE_FLAG = H5O_SHMESG_PLINE_FLAG(); + /** */ public static final int H5O_SHMESG_ATTR_FLAG = H5O_SHMESG_ATTR_FLAG(); + /** */ public static final int H5O_SHMESG_ALL_FLAG = H5O_SHMESG_ALL_FLAG(); + /** */ public static final int H5O_TYPE_UNKNOWN = H5O_TYPE_UNKNOWN(); + /** */ public static final int H5O_TYPE_GROUP = H5O_TYPE_GROUP(); + /** */ public static final int H5O_TYPE_DATASET = H5O_TYPE_DATASET(); + /** */ public static final int H5O_TYPE_NAMED_DATATYPE = H5O_TYPE_NAMED_DATATYPE(); + /** */ public static final int H5O_TYPE_NTYPES = H5O_TYPE_NTYPES(); + /** */ public static final int H5O_MAX_TOKEN_SIZE = H5O_MAX_TOKEN_SIZE(); + /** */ public static final H5O_token_t H5O_TOKEN_UNDEF = H5O_TOKEN_UNDEF(); + /** */ public static final long H5P_ROOT = H5P_ROOT(); + /** */ public static final long H5P_OBJECT_CREATE = H5P_OBJECT_CREATE(); + /** */ public static final long H5P_FILE_CREATE = H5P_FILE_CREATE(); + /** */ public static final long H5P_FILE_ACCESS = H5P_FILE_ACCESS(); + /** */ public static final long H5P_DATASET_CREATE = H5P_DATASET_CREATE(); + /** */ public static final long H5P_DATASET_ACCESS = H5P_DATASET_ACCESS(); + /** */ public static final long H5P_DATASET_XFER = H5P_DATASET_XFER(); + /** */ public static final long H5P_FILE_MOUNT = H5P_FILE_MOUNT(); + /** */ public static final long H5P_GROUP_CREATE = H5P_GROUP_CREATE(); + /** */ public static final long H5P_GROUP_ACCESS = H5P_GROUP_ACCESS(); + /** */ public static final long H5P_DATATYPE_CREATE = H5P_DATATYPE_CREATE(); + /** */ public static final long H5P_DATATYPE_ACCESS = H5P_DATATYPE_ACCESS(); + /** */ public static final long H5P_STRING_CREATE = H5P_STRING_CREATE(); + /** */ public static final long H5P_ATTRIBUTE_CREATE = H5P_ATTRIBUTE_CREATE(); + /** */ public static final long H5P_ATTRIBUTE_ACCESS = H5P_ATTRIBUTE_ACCESS(); + /** */ public static final long H5P_OBJECT_COPY = H5P_OBJECT_COPY(); + /** */ public static final long H5P_LINK_CREATE = H5P_LINK_CREATE(); + /** */ public static final long H5P_LINK_ACCESS = H5P_LINK_ACCESS(); + /** */ public static final long H5P_VOL_INITIALIZE = H5P_VOL_INITIALIZE(); + /** */ public static final long H5P_FILE_CREATE_DEFAULT = H5P_FILE_CREATE_DEFAULT(); + /** */ public static final long H5P_FILE_ACCESS_DEFAULT = H5P_FILE_ACCESS_DEFAULT(); + /** */ public static final long H5P_DATASET_CREATE_DEFAULT = H5P_DATASET_CREATE_DEFAULT(); + /** */ public static final long H5P_DATASET_ACCESS_DEFAULT = H5P_DATASET_ACCESS_DEFAULT(); + /** */ public static final long H5P_DATASET_XFER_DEFAULT = H5P_DATASET_XFER_DEFAULT(); + /** */ public static final long H5P_FILE_MOUNT_DEFAULT = H5P_FILE_MOUNT_DEFAULT(); + /** */ public static final long H5P_GROUP_CREATE_DEFAULT = H5P_GROUP_CREATE_DEFAULT(); + /** */ public static final long H5P_GROUP_ACCESS_DEFAULT = H5P_GROUP_ACCESS_DEFAULT(); + /** */ public static final long H5P_DATATYPE_CREATE_DEFAULT = H5P_DATATYPE_CREATE_DEFAULT(); + /** */ public static final long H5P_DATATYPE_ACCESS_DEFAULT = H5P_DATATYPE_ACCESS_DEFAULT(); + /** */ public static final long H5P_ATTRIBUTE_CREATE_DEFAULT = H5P_ATTRIBUTE_CREATE_DEFAULT(); + /** */ public static final long H5P_ATTRIBUTE_ACCESS_DEFAULT = H5P_ATTRIBUTE_ACCESS_DEFAULT(); + /** */ public static final long H5P_OBJECT_COPY_DEFAULT = H5P_OBJECT_COPY_DEFAULT(); + /** */ public static final long H5P_LINK_CREATE_DEFAULT = H5P_LINK_CREATE_DEFAULT(); + /** */ public static final long H5P_LINK_ACCESS_DEFAULT = H5P_LINK_ACCESS_DEFAULT(); + /** */ public static final long H5P_VOL_INITIALIZE_DEFAULT = H5P_VOL_INITIALIZE_DEFAULT(); + /** */ public static final int H5P_CRT_ORDER_TRACKED = H5P_CRT_ORDER_TRACKED(); + /** */ public static final int H5P_CRT_ORDER_INDEXED = H5P_CRT_ORDER_INDEXED(); + /** */ public static final long H5P_DEFAULT = H5P_DEFAULT(); + /** */ public static final int H5PL_TYPE_ERROR = H5PL_TYPE_ERROR(); + /** */ public static final int H5PL_TYPE_FILTER = H5PL_TYPE_FILTER(); + /** */ public static final int H5PL_TYPE_VOL = H5PL_TYPE_VOL(); + /** */ public static final int H5PL_TYPE_NONE = H5PL_TYPE_NONE(); + /** */ public static final int H5PL_FILTER_PLUGIN = H5PL_FILTER_PLUGIN(); + /** */ public static final int H5PL_VOL_PLUGIN = H5PL_VOL_PLUGIN(); + /** */ public static final int H5PL_ALL_PLUGIN = H5PL_ALL_PLUGIN(); + /** */ public static final int H5R_ATTR = H5R_ATTR(); + /** */ public static final int H5R_BADTYPE = H5R_BADTYPE(); + /** */ public static final int H5R_DATASET_REGION = H5R_DATASET_REGION(); + /** */ public static final int H5R_DATASET_REGION1 = H5R_DATASET_REGION1(); + /** */ public static final int H5R_DATASET_REGION2 = H5R_DATASET_REGION2(); + /** */ public static final int H5R_MAXTYPE = H5R_MAXTYPE(); + /** */ public static final int H5R_REF_BUF_SIZE = H5R_REF_BUF_SIZE(); + /** */ public static final int H5R_OBJ_REF_BUF_SIZE = H5R_OBJ_REF_BUF_SIZE(); + /** */ public static final int H5R_OBJECT = H5R_OBJECT(); + /** */ public static final int H5R_OBJECT1 = H5R_OBJECT1(); + /** */ public static final int H5R_OBJECT2 = H5R_OBJECT2(); + /** Define atomic datatypes */ public static final int H5S_ALL = H5S_ALL(); + /** Define user-level maximum number of dimensions */ public static final int H5S_MAX_RANK = H5S_MAX_RANK(); + /** Different types of dataspaces - error */ public static final int H5S_NO_CLASS = H5S_NO_CLASS(); + /** Different types of dataspaces - null dataspace */ public static final int H5S_NULL = H5S_NULL(); + /** Different types of dataspaces - scalar variable */ public static final int H5S_SCALAR = H5S_SCALAR(); + /** Enumerated type for the type of selection - Entire extent selected */ public static final int H5S_SEL_ALL = H5S_SEL_ALL(); + /** Enumerated type for the type of selection - Error */ public static final int H5S_SEL_ERROR = H5S_SEL_ERROR(); + /** Enumerated type for the type of selection - Hyperslab selected */ public static final int H5S_SEL_HYPERSLABS = H5S_SEL_HYPERSLABS(); + /** Enumerated type for the type of selection - LAST */ public static final int H5S_SEL_N = H5S_SEL_N(); + /** Enumerated type for the type of selection - Nothing selected */ public static final int H5S_SEL_NONE = H5S_SEL_NONE(); + /** Enumerated type for the type of selection - Points / elements selected */ public static final int H5S_SEL_POINTS = H5S_SEL_POINTS(); + /** Different ways of combining selections - Binary "and" operation for hyperslabs */ public static final int H5S_SELECT_AND = H5S_SELECT_AND(); + /** Different ways of combining selections - Append elements to end of point selection */ public static final int H5S_SELECT_APPEND = H5S_SELECT_APPEND(); + /** Different ways of combining selections - Invalid upper bound on selection operations */ public static final int H5S_SELECT_INVALID = H5S_SELECT_INVALID(); + /** Different ways of combining selections - error */ public static final int H5S_SELECT_NOOP = H5S_SELECT_NOOP(); + /** Different ways of combining selections - Binary "not" operation for hyperslabs */ public static final int H5S_SELECT_NOTA = H5S_SELECT_NOTA(); + /** Different ways of combining selections - Binary "not" operation for hyperslabs */ public static final int H5S_SELECT_NOTB = H5S_SELECT_NOTB(); + /** Different ways of combining selections - Binary "or" operation for hyperslabs */ public static final int H5S_SELECT_OR = H5S_SELECT_OR(); + /** Different ways of combining selections - Prepend elements to beginning of point selection */ public static final int H5S_SELECT_PREPEND = H5S_SELECT_PREPEND(); + /** Different ways of combining selections - Select "set" operation */ public static final int H5S_SELECT_SET = H5S_SELECT_SET(); + /** Different ways of combining selections - Binary "xor" operation for hyperslabs */ public static final int H5S_SELECT_XOR = H5S_SELECT_XOR(); + /** Different types of dataspaces - simple dataspace */ public static final int H5S_SIMPLE = H5S_SIMPLE(); + /** Define atomic datatypes */ public static final int H5S_UNLIMITED = H5S_UNLIMITED(); + + /** */ public static final long H5T_ALPHA_B16 = H5T_ALPHA_B16(); + /** */ public static final long H5T_ALPHA_B32 = H5T_ALPHA_B32(); + /** */ public static final long H5T_ALPHA_B64 = H5T_ALPHA_B64(); + /** */ public static final long H5T_ALPHA_B8 = H5T_ALPHA_B8(); + /** */ public static final long H5T_ALPHA_F32 = H5T_ALPHA_F32(); + /** */ public static final long H5T_ALPHA_F64 = H5T_ALPHA_F64(); + /** */ public static final long H5T_ALPHA_I16 = H5T_ALPHA_I16(); + /** */ public static final long H5T_ALPHA_I32 = H5T_ALPHA_I32(); + /** */ public static final long H5T_ALPHA_I64 = H5T_ALPHA_I64(); + /** */ public static final long H5T_ALPHA_I8 = H5T_ALPHA_I8(); + /** */ public static final long H5T_ALPHA_U16 = H5T_ALPHA_U16(); + /** */ public static final long H5T_ALPHA_U32 = H5T_ALPHA_U32(); + /** */ public static final long H5T_ALPHA_U64 = H5T_ALPHA_U64(); + /** */ public static final long H5T_ALPHA_U8 = H5T_ALPHA_U8(); + /** */ public static final int H5T_ARRAY = H5T_ARRAY(); + /** */ public static final int H5T_BITFIELD = H5T_BITFIELD(); + /** */ public static final int H5T_BKG_NO = H5T_BKG_NO(); + /** */ public static final int H5T_BKG_YES = H5T_BKG_YES(); + /** */ public static final long H5T_C_S1 = H5T_C_S1(); + /** */ public static final int H5T_COMPOUND = H5T_COMPOUND(); + /** */ public static final int H5T_CONV_CONV = H5T_CONV_CONV(); + /** */ public static final int H5T_CONV_FREE = H5T_CONV_FREE(); + /** */ public static final int H5T_CONV_INIT = H5T_CONV_INIT(); + /** */ public static final int H5T_CSET_ERROR = H5T_CSET_ERROR(); + /** */ public static final int H5T_CSET_ASCII = H5T_CSET_ASCII(); + /** */ public static final int H5T_CSET_UTF8 = H5T_CSET_UTF8(); + /** */ public static final int H5T_CSET_RESERVED_10 = H5T_CSET_RESERVED_10(); + /** */ public static final int H5T_CSET_RESERVED_11 = H5T_CSET_RESERVED_11(); + /** */ public static final int H5T_CSET_RESERVED_12 = H5T_CSET_RESERVED_12(); + /** */ public static final int H5T_CSET_RESERVED_13 = H5T_CSET_RESERVED_13(); + /** */ public static final int H5T_CSET_RESERVED_14 = H5T_CSET_RESERVED_14(); + /** */ public static final int H5T_CSET_RESERVED_15 = H5T_CSET_RESERVED_15(); + /** */ public static final int H5T_CSET_RESERVED_2 = H5T_CSET_RESERVED_2(); + /** */ public static final int H5T_CSET_RESERVED_3 = H5T_CSET_RESERVED_3(); + /** */ public static final int H5T_CSET_RESERVED_4 = H5T_CSET_RESERVED_4(); + /** */ public static final int H5T_CSET_RESERVED_5 = H5T_CSET_RESERVED_5(); + /** */ public static final int H5T_CSET_RESERVED_6 = H5T_CSET_RESERVED_6(); + /** */ public static final int H5T_CSET_RESERVED_7 = H5T_CSET_RESERVED_7(); + /** */ public static final int H5T_CSET_RESERVED_8 = H5T_CSET_RESERVED_8(); + /** */ public static final int H5T_CSET_RESERVED_9 = H5T_CSET_RESERVED_9(); + /** */ public static final int H5T_DIR_ASCEND = H5T_DIR_ASCEND(); + /** */ public static final int H5T_DIR_DEFAULT = H5T_DIR_DEFAULT(); + /** */ public static final int H5T_DIR_DESCEND = H5T_DIR_DESCEND(); + /** */ public static final int H5T_ENUM = H5T_ENUM(); + /** */ public static final int H5T_FLOAT = H5T_FLOAT(); + /** */ public static final long H5T_FORTRAN_S1 = H5T_FORTRAN_S1(); + /** */ public static final long H5T_IEEE_F32BE = H5T_IEEE_F32BE(); + /** */ public static final long H5T_IEEE_F32LE = H5T_IEEE_F32LE(); + /** */ public static final long H5T_IEEE_F64BE = H5T_IEEE_F64BE(); + /** */ public static final long H5T_IEEE_F64LE = H5T_IEEE_F64LE(); + /** */ public static final int H5T_INTEGER = H5T_INTEGER(); + /** */ public static final long H5T_INTEL_B16 = H5T_INTEL_B16(); + /** */ public static final long H5T_INTEL_B32 = H5T_INTEL_B32(); + /** */ public static final long H5T_INTEL_B64 = H5T_INTEL_B64(); + /** */ public static final long H5T_INTEL_B8 = H5T_INTEL_B8(); + /** */ public static final long H5T_INTEL_F32 = H5T_INTEL_F32(); + /** */ public static final long H5T_INTEL_F64 = H5T_INTEL_F64(); + /** */ public static final long H5T_INTEL_I16 = H5T_INTEL_I16(); + /** */ public static final long H5T_INTEL_I32 = H5T_INTEL_I32(); + /** */ public static final long H5T_INTEL_I64 = H5T_INTEL_I64(); + /** */ public static final long H5T_INTEL_I8 = H5T_INTEL_I8(); + /** */ public static final long H5T_INTEL_U16 = H5T_INTEL_U16(); + /** */ public static final long H5T_INTEL_U32 = H5T_INTEL_U32(); + /** */ public static final long H5T_INTEL_U64 = H5T_INTEL_U64(); + /** */ public static final long H5T_INTEL_U8 = H5T_INTEL_U8(); + /** */ public static final long H5T_MIPS_B16 = H5T_MIPS_B16(); + /** */ public static final long H5T_MIPS_B32 = H5T_MIPS_B32(); + /** */ public static final long H5T_MIPS_B64 = H5T_MIPS_B64(); + /** */ public static final long H5T_MIPS_B8 = H5T_MIPS_B8(); + /** */ public static final long H5T_MIPS_F32 = H5T_MIPS_F32(); + /** */ public static final long H5T_MIPS_F64 = H5T_MIPS_F64(); + /** */ public static final long H5T_MIPS_I16 = H5T_MIPS_I16(); + /** */ public static final long H5T_MIPS_I32 = H5T_MIPS_I32(); + /** */ public static final long H5T_MIPS_I64 = H5T_MIPS_I64(); + /** */ public static final long H5T_MIPS_I8 = H5T_MIPS_I8(); + /** */ public static final long H5T_MIPS_U16 = H5T_MIPS_U16(); + /** */ public static final long H5T_MIPS_U32 = H5T_MIPS_U32(); + /** */ public static final long H5T_MIPS_U64 = H5T_MIPS_U64(); + /** */ public static final long H5T_MIPS_U8 = H5T_MIPS_U8(); + /** */ public static final long H5T_NATIVE_B16 = H5T_NATIVE_B16(); + /** */ public static final long H5T_NATIVE_B32 = H5T_NATIVE_B32(); + /** */ public static final long H5T_NATIVE_B64 = H5T_NATIVE_B64(); + /** */ public static final long H5T_NATIVE_B8 = H5T_NATIVE_B8(); + /** */ public static final long H5T_NATIVE_CHAR = H5T_NATIVE_CHAR(); + /** */ public static final long H5T_NATIVE_DOUBLE = H5T_NATIVE_DOUBLE(); + /** */ public static final long H5T_NATIVE_FLOAT = H5T_NATIVE_FLOAT(); + /** */ public static final long H5T_NATIVE_HADDR = H5T_NATIVE_HADDR(); + /** */ public static final long H5T_NATIVE_HBOOL = H5T_NATIVE_HBOOL(); + /** */ public static final long H5T_NATIVE_HERR = H5T_NATIVE_HERR(); + /** */ public static final long H5T_NATIVE_HSIZE = H5T_NATIVE_HSIZE(); + /** */ public static final long H5T_NATIVE_HSSIZE = H5T_NATIVE_HSSIZE(); + /** */ public static final long H5T_NATIVE_INT = H5T_NATIVE_INT(); + /** */ public static final long H5T_NATIVE_INT_FAST16 = H5T_NATIVE_INT_FAST16(); + /** */ public static final long H5T_NATIVE_INT_FAST32 = H5T_NATIVE_INT_FAST32(); + /** */ public static final long H5T_NATIVE_INT_FAST64 = H5T_NATIVE_INT_FAST64(); + /** */ public static final long H5T_NATIVE_INT_FAST8 = H5T_NATIVE_INT_FAST8(); + /** */ public static final long H5T_NATIVE_INT_LEAST16 = H5T_NATIVE_INT_LEAST16(); + /** */ public static final long H5T_NATIVE_INT_LEAST32 = H5T_NATIVE_INT_LEAST32(); + /** */ public static final long H5T_NATIVE_INT_LEAST64 = H5T_NATIVE_INT_LEAST64(); + /** */ public static final long H5T_NATIVE_INT_LEAST8 = H5T_NATIVE_INT_LEAST8(); + /** */ public static final long H5T_NATIVE_INT16 = H5T_NATIVE_INT16(); + /** */ public static final long H5T_NATIVE_INT32 = H5T_NATIVE_INT32(); + /** */ public static final long H5T_NATIVE_INT64 = H5T_NATIVE_INT64(); + /** */ public static final long H5T_NATIVE_INT8 = H5T_NATIVE_INT8(); + /** */ public static final long H5T_NATIVE_LDOUBLE = H5T_NATIVE_LDOUBLE(); + /** */ public static final long H5T_NATIVE_LLONG = H5T_NATIVE_LLONG(); + /** */ public static final long H5T_NATIVE_LONG = H5T_NATIVE_LONG(); + /** */ public static final long H5T_NATIVE_OPAQUE = H5T_NATIVE_OPAQUE(); + /** */ public static final long H5T_NATIVE_SCHAR = H5T_NATIVE_SCHAR(); + /** */ public static final long H5T_NATIVE_SHORT = H5T_NATIVE_SHORT(); + /** */ public static final long H5T_NATIVE_UCHAR = H5T_NATIVE_UCHAR(); + /** */ public static final long H5T_NATIVE_UINT = H5T_NATIVE_UINT(); + /** */ public static final long H5T_NATIVE_UINT_FAST16 = H5T_NATIVE_UINT_FAST16(); + /** */ public static final long H5T_NATIVE_UINT_FAST32 = H5T_NATIVE_UINT_FAST32(); + /** */ public static final long H5T_NATIVE_UINT_FAST64 = H5T_NATIVE_UINT_FAST64(); + /** */ public static final long H5T_NATIVE_UINT_FAST8 = H5T_NATIVE_UINT_FAST8(); + /** */ public static final long H5T_NATIVE_UINT_LEAST16 = H5T_NATIVE_UINT_LEAST16(); + /** */ public static final long H5T_NATIVE_UINT_LEAST32 = H5T_NATIVE_UINT_LEAST32(); + /** */ public static final long H5T_NATIVE_UINT_LEAST64 = H5T_NATIVE_UINT_LEAST64(); + /** */ public static final long H5T_NATIVE_UINT_LEAST8 = H5T_NATIVE_UINT_LEAST8(); + /** */ public static final long H5T_NATIVE_UINT16 = H5T_NATIVE_UINT16(); + /** */ public static final long H5T_NATIVE_UINT32 = H5T_NATIVE_UINT32(); + /** */ public static final long H5T_NATIVE_UINT64 = H5T_NATIVE_UINT64(); + /** */ public static final long H5T_NATIVE_UINT8 = H5T_NATIVE_UINT8(); + /** */ public static final long H5T_NATIVE_ULLONG = H5T_NATIVE_ULLONG(); + /** */ public static final long H5T_NATIVE_ULONG = H5T_NATIVE_ULONG(); + /** */ public static final long H5T_NATIVE_USHORT = H5T_NATIVE_USHORT(); + /** */ public static final int H5T_NCLASSES = H5T_NCLASSES(); + /** */ public static final int H5T_NO_CLASS = H5T_NO_CLASS(); + /** */ public static final int H5T_NORM_ERROR = H5T_NORM_ERROR(); + /** */ public static final int H5T_NORM_IMPLIED = H5T_NORM_IMPLIED(); + /** */ public static final int H5T_NORM_MSBSET = H5T_NORM_MSBSET(); + /** */ public static final int H5T_NORM_NONE = H5T_NORM_NONE(); + /** */ public static final int H5T_NPAD = H5T_NPAD(); + /** */ public static final int H5T_NSGN = H5T_NSGN(); + /** */ public static final int H5T_OPAQUE = H5T_OPAQUE(); + /** */ public static final int H5T_OPAQUE_TAG_MAX = H5T_OPAQUE_TAG_MAX(); /* 1.6.5 */ + /** */ public static final int H5T_ORDER_BE = H5T_ORDER_BE(); + /** */ public static final int H5T_ORDER_ERROR = H5T_ORDER_ERROR(); + /** */ public static final int H5T_ORDER_LE = H5T_ORDER_LE(); + /** */ public static final int H5T_ORDER_NONE = H5T_ORDER_NONE(); + /** */ public static final int H5T_ORDER_VAX = H5T_ORDER_VAX(); + /** */ public static final int H5T_PAD_BACKGROUND = H5T_PAD_BACKGROUND(); + /** */ public static final int H5T_PAD_ERROR = H5T_PAD_ERROR(); + /** */ public static final int H5T_PAD_ONE = H5T_PAD_ONE(); + /** */ public static final int H5T_PAD_ZERO = H5T_PAD_ZERO(); + /** */ public static final int H5T_PERS_DONTCARE = H5T_PERS_DONTCARE(); + /** */ public static final int H5T_PERS_HARD = H5T_PERS_HARD(); + /** */ public static final int H5T_PERS_SOFT = H5T_PERS_SOFT(); + /** */ public static final int H5T_REFERENCE = H5T_REFERENCE(); + /** */ public static final int H5T_SGN_2 = H5T_SGN_2(); + /** */ public static final int H5T_SGN_ERROR = H5T_SGN_ERROR(); + /** */ public static final int H5T_SGN_NONE = H5T_SGN_NONE(); + /** */ public static final long H5T_STD_B16BE = H5T_STD_B16BE(); + /** */ public static final long H5T_STD_B16LE = H5T_STD_B16LE(); + /** */ public static final long H5T_STD_B32BE = H5T_STD_B32BE(); + /** */ public static final long H5T_STD_B32LE = H5T_STD_B32LE(); + /** */ public static final long H5T_STD_B64BE = H5T_STD_B64BE(); + /** */ public static final long H5T_STD_B64LE = H5T_STD_B64LE(); + /** */ public static final long H5T_STD_B8BE = H5T_STD_B8BE(); + /** */ public static final long H5T_STD_B8LE = H5T_STD_B8LE(); + /** */ public static final long H5T_STD_I16BE = H5T_STD_I16BE(); + /** */ public static final long H5T_STD_I16LE = H5T_STD_I16LE(); + /** */ public static final long H5T_STD_I32BE = H5T_STD_I32BE(); + /** */ public static final long H5T_STD_I32LE = H5T_STD_I32LE(); + /** */ public static final long H5T_STD_I64BE = H5T_STD_I64BE(); + /** */ public static final long H5T_STD_I64LE = H5T_STD_I64LE(); + /** */ public static final long H5T_STD_I8BE = H5T_STD_I8BE(); + /** */ public static final long H5T_STD_I8LE = H5T_STD_I8LE(); + /** */ public static final long H5T_STD_REF_DSETREG = H5T_STD_REF_DSETREG(); + /** */ public static final long H5T_STD_REF_OBJ = H5T_STD_REF_OBJ(); + /** */ public static final long H5T_STD_REF = H5T_STD_REF(); + /** */ public static final long H5T_STD_U16BE = H5T_STD_U16BE(); + /** */ public static final long H5T_STD_U16LE = H5T_STD_U16LE(); + /** */ public static final long H5T_STD_U32BE = H5T_STD_U32BE(); + /** */ public static final long H5T_STD_U32LE = H5T_STD_U32LE(); + /** */ public static final long H5T_STD_U64BE = H5T_STD_U64BE(); + /** */ public static final long H5T_STD_U64LE = H5T_STD_U64LE(); + /** */ public static final long H5T_STD_U8BE = H5T_STD_U8BE(); + /** */ public static final long H5T_STD_U8LE = H5T_STD_U8LE(); + /** */ public static final int H5T_STR_ERROR = H5T_STR_ERROR(); + /** */ public static final int H5T_STR_NULLPAD = H5T_STR_NULLPAD(); + /** */ public static final int H5T_STR_NULLTERM = H5T_STR_NULLTERM(); + /** */ public static final int H5T_STR_RESERVED_10 = H5T_STR_RESERVED_10(); + /** */ public static final int H5T_STR_RESERVED_11 = H5T_STR_RESERVED_11(); + /** */ public static final int H5T_STR_RESERVED_12 = H5T_STR_RESERVED_12(); + /** */ public static final int H5T_STR_RESERVED_13 = H5T_STR_RESERVED_13(); + /** */ public static final int H5T_STR_RESERVED_14 = H5T_STR_RESERVED_14(); + /** */ public static final int H5T_STR_RESERVED_15 = H5T_STR_RESERVED_15(); + /** */ public static final int H5T_STR_RESERVED_3 = H5T_STR_RESERVED_3(); + /** */ public static final int H5T_STR_RESERVED_4 = H5T_STR_RESERVED_4(); + /** */ public static final int H5T_STR_RESERVED_5 = H5T_STR_RESERVED_5(); + /** */ public static final int H5T_STR_RESERVED_6 = H5T_STR_RESERVED_6(); + /** */ public static final int H5T_STR_RESERVED_7 = H5T_STR_RESERVED_7(); + /** */ public static final int H5T_STR_RESERVED_8 = H5T_STR_RESERVED_8(); + /** */ public static final int H5T_STR_RESERVED_9 = H5T_STR_RESERVED_9(); + /** */ public static final int H5T_STR_SPACEPAD = H5T_STR_SPACEPAD(); + /** */ public static final int H5T_STRING = H5T_STRING(); + /** */ public static final int H5T_TIME = H5T_TIME(); + /** */ public static final long H5T_UNIX_D32BE = H5T_UNIX_D32BE(); + /** */ public static final long H5T_UNIX_D32LE = H5T_UNIX_D32LE(); + /** */ public static final long H5T_UNIX_D64BE = H5T_UNIX_D64BE(); + /** */ public static final long H5T_UNIX_D64LE = H5T_UNIX_D64LE(); + /** */ public static final long H5T_VARIABLE = H5T_VARIABLE(); + /** */ public static final int H5T_VLEN = H5T_VLEN(); + /** */ public static final int H5T_VL_T = H5T_VL_T(); + /** */ public static final int H5VL_CAP_FLAG_NONE = H5VL_CAP_FLAG_NONE(); + /** */ public static final int H5VL_CAP_FLAG_THREADSAFE = H5VL_CAP_FLAG_THREADSAFE(); + /** */ public static final long H5VL_NATIVE = H5VL_NATIVE(); + /** */ public static final String H5VL_NATIVE_NAME = H5VL_NATIVE_NAME(); + /** */ public static final int H5VL_NATIVE_VALUE = H5VL_NATIVE_VALUE(); + /** */ public static final int H5VL_NATIVE_VERSION = H5VL_NATIVE_VERSION(); + /** */ public static final int H5_VOL_INVALID = H5_VOL_INVALID(); + /** */ public static final int H5_VOL_NATIVE = H5_VOL_NATIVE(); + /** */ public static final int H5_VOL_RESERVED = H5_VOL_RESERVED(); + /** */ public static final int H5_VOL_MAX = H5_VOL_MAX(); + /** Return values for filter callback function */ public static final int H5Z_CB_CONT = H5Z_CB_CONT(); + /** Return values for filter callback function */ public static final int H5Z_CB_ERROR = H5Z_CB_ERROR(); + /** Return values for filter callback function */ public static final int H5Z_CB_FAIL = H5Z_CB_FAIL(); + /** Return values for filter callback function */ public static final int H5Z_CB_NO = H5Z_CB_NO(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_DISABLE_EDC = H5Z_DISABLE_EDC(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_ENABLE_EDC = H5Z_ENABLE_EDC(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_ERROR_EDC = H5Z_ERROR_EDC(); + /** Filter IDs - deflation like gzip */ public static final int H5Z_FILTER_DEFLATE = H5Z_FILTER_DEFLATE(); + /** Filter IDs - no filter */ public static final int H5Z_FILTER_ERROR = H5Z_FILTER_ERROR(); + /** Filter IDs - fletcher32 checksum of EDC */ public static final int H5Z_FILTER_FLETCHER32 = H5Z_FILTER_FLETCHER32(); + /** Filter IDs - maximum filter id */ public static final int H5Z_FILTER_MAX = H5Z_FILTER_MAX(); + /** Filter IDs - nbit compression */ public static final int H5Z_FILTER_NBIT = H5Z_FILTER_NBIT(); + /** Filter IDs - reserved indefinitely */ public static final int H5Z_FILTER_NONE = H5Z_FILTER_NONE(); + /** Filter IDs - filter ids below this value are reserved for library use */ public static final int H5Z_FILTER_RESERVED = H5Z_FILTER_RESERVED(); + /** Filter IDs - scale+offset compression */ public static final int H5Z_FILTER_SCALEOFFSET = H5Z_FILTER_SCALEOFFSET(); + /** Filter IDs - shuffle the data */ public static final int H5Z_FILTER_SHUFFLE = H5Z_FILTER_SHUFFLE(); + /** Filter IDs - szip compression */ public static final int H5Z_FILTER_SZIP = H5Z_FILTER_SZIP(); + /** Flags for filter definition (stored) + * definition flag mask */ public static final int H5Z_FLAG_DEFMASK = H5Z_FLAG_DEFMASK(); + /** Additional flags for filter invocation (not stored) + * invocation flag mask */ public static final int H5Z_FLAG_INVMASK = H5Z_FLAG_INVMASK(); + /** Flags for filter definition (stored) + * filter is mandatory */ public static final int H5Z_FLAG_MANDATORY = H5Z_FLAG_MANDATORY(); + /** Flags for filter definition (stored) + * filter is optional */ public static final int H5Z_FLAG_OPTIONAL = H5Z_FLAG_OPTIONAL(); + /** Additional flags for filter invocation (not stored) + * reverse direction; read */ public static final int H5Z_FLAG_REVERSE = H5Z_FLAG_REVERSE(); + /** Additional flags for filter invocation (not stored) + * skip EDC filters for read */ public static final int H5Z_FLAG_SKIP_EDC = H5Z_FLAG_SKIP_EDC(); + /** Symbol to remove all filters in H5Premove_filter */ + public static final int H5Z_FILTER_ALL = H5Z_FILTER_ALL(); + /** Maximum number of filters allowed in a pipeline */ public static final int H5Z_MAX_NFILTERS = H5Z_MAX_NFILTERS(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_NO_EDC = H5Z_NO_EDC(); + /** Bit flags for H5Zget_filter_info */ public static final int H5Z_FILTER_CONFIG_ENCODE_ENABLED = H5Z_FILTER_CONFIG_ENCODE_ENABLED(); + /** Bit flags for H5Zget_filter_info */ public static final int H5Z_FILTER_CONFIG_DECODE_ENABLED = H5Z_FILTER_CONFIG_DECODE_ENABLED(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_INT_MINBITS_DEFAULT = H5Z_SO_INT_MINBITS_DEFAULT(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_FLOAT_DSCALE = H5Z_SO_FLOAT_DSCALE(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_FLOAT_ESCALE = H5Z_SO_FLOAT_ESCALE(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_INT = H5Z_SO_INT(); + /** shuffle filter - Number of parameters that users can set */ public static final int H5Z_SHUFFLE_USER_NPARMS = H5Z_SHUFFLE_USER_NPARMS(); + /** shuffle filter - Total number of parameters for filter */ public static final int H5Z_SHUFFLE_TOTAL_NPARMS = H5Z_SHUFFLE_TOTAL_NPARMS(); + /** szip filter - Number of parameters that users can set */ public static final int H5Z_SZIP_USER_NPARMS = H5Z_SZIP_USER_NPARMS(); + /** szip filter - Total number of parameters for filter */ public static final int H5Z_SZIP_TOTAL_NPARMS = H5Z_SZIP_TOTAL_NPARMS(); + /** szip filter - "User" parameter for option mask */ public static final int H5Z_SZIP_PARM_MASK = H5Z_SZIP_PARM_MASK(); + /** szip filter - "User" parameter for pixels-per-block */ public static final int H5Z_SZIP_PARM_PPB = H5Z_SZIP_PARM_PPB(); + /** szip filter - "Local" parameter for bits-per-pixel */ public static final int H5Z_SZIP_PARM_BPP = H5Z_SZIP_PARM_BPP(); + /** szip filter - "Local" parameter for pixels-per-scanline */ public static final int H5Z_SZIP_PARM_PPS = H5Z_SZIP_PARM_PPS(); + /** nbit filter - Number of parameters that users can set */ public static final int H5Z_NBIT_USER_NPARMS = H5Z_NBIT_USER_NPARMS(); + /** scale offset filter - Number of parameters that users can set */ public static final int H5Z_SCALEOFFSET_USER_NPARMS = H5Z_SCALEOFFSET_USER_NPARMS(); - public static final int H5Z_FILTER_ALL = H5Z_FILTER_ALL(); // ///////////////////////////////////////////////////////////////////////// // List of private native variables to get constant values from C // @@ -831,16 +1618,18 @@ public class HDF5Constants { private static native final long H5E_ARGS(); - private static native final long H5E_ATOM(); + private static native final long H5E_ID(); private static native final long H5E_ATTR(); - private static native final long H5E_BADATOM(); + private static native final long H5E_BADID(); private static native final long H5E_BADFILE(); private static native final long H5E_BADGROUP(); + private static native final long H5E_BADITER(); + private static native final long H5E_BADMESG(); private static native final long H5E_BADRANGE(); @@ -861,15 +1650,30 @@ public class HDF5Constants { private static native final long H5E_CANAPPLY(); - // private static native final long H5E_CANTALLOC(); + private static native final long H5E_CANTALLOC(); + + private static native final long H5E_CANTAPPEND(); + + private static native final long H5E_CANTATTACH(); + + private static native final long H5E_CANTCLEAN(); + private static native final long H5E_CANTCLIP(); private static native final long H5E_CANTCLOSEFILE(); + private static native final long H5E_CANTCLOSEOBJ(); + + private static native final long H5E_CANTCOMPARE(); + + private static native final long H5E_CANTCOMPUTE(); + private static native final long H5E_CANTCONVERT(); private static native final long H5E_CANTCOPY(); + private static native final long H5E_CANTCORK(); + private static native final long H5E_CANTCOUNT(); private static native final long H5E_CANTCREATE(); @@ -882,18 +1686,36 @@ public class HDF5Constants { private static native final long H5E_CANTDELETEFILE(); + private static native final long H5E_CANTDEPEND(); + + private static native final long H5E_CANTDIRTY(); + private static native final long H5E_CANTENCODE(); + private static native final long H5E_CANTEXPUNGE(); + + private static native final long H5E_CANTEXTEND(); + + private static native final long H5E_CANTFILTER(); + private static native final long H5E_CANTFLUSH(); private static native final long H5E_CANTFREE(); + private static native final long H5E_CANTGATHER(); + + private static native final long H5E_CANTGC(); + private static native final long H5E_CANTGET(); + private static native final long H5E_CANTGETSIZE(); + private static native final long H5E_CANTINC(); private static native final long H5E_CANTINIT(); + private static native final long H5E_CANTINS(); + private static native final long H5E_CANTINSERT(); private static native final long H5E_CANTLIST(); @@ -902,29 +1724,96 @@ public class HDF5Constants { private static native final long H5E_CANTLOCK(); + private static native final long H5E_CANTLOCKFILE(); + + private static native final long H5E_CANTMARKCLEAN(); + + private static native final long H5E_CANTMARKDIRTY(); + + private static native final long H5E_CANTMARKSERIALIZED(); + + private static native final long H5E_CANTMARKUNSERIALIZED(); + + private static native final long H5E_CANTMERGE(); + + private static native final long H5E_CANTMOVE(); + + private static native final long H5E_CANTMODIFY(); + private static native final long H5E_CANTNEXT(); + private static native final long H5E_CANTNOTIFY(); + private static native final long H5E_CANTOPENFILE(); private static native final long H5E_CANTOPENOBJ(); - // private static native final long H5E_CANTRECV(); + private static native final long H5E_CANTOPERATE(); + + private static native final long H5E_CANTPACK(); + + private static native final long H5E_CANTPIN(); + + private static native final long H5E_CANTPROTECT(); + + private static native final long H5E_CANTRECV(); + + private static native final long H5E_CANTREDISTRIBUTE(); + private static native final long H5E_CANTREGISTER(); private static native final long H5E_CANTRELEASE(); + private static native final long H5E_CANTREMOVE(); + + private static native final long H5E_CANTRENAME(); + + private static native final long H5E_CANTRESET(); + + private static native final long H5E_CANTRESIZE(); + + private static native final long H5E_CANTRESTORE(); + + private static native final long H5E_CANTREVIVE(); + + private static native final long H5E_CANTSHRINK(); + private static native final long H5E_CANTSELECT(); private static native final long H5E_CANTSET(); + private static native final long H5E_CANTSERIALIZE(); + + private static native final long H5E_CANTSORT(); + private static native final long H5E_CANTSPLIT(); + private static native final long H5E_CANTSWAP(); + + private static native final long H5E_CANTTAG(); + + private static native final long H5E_CANTUNCORK(); + + private static native final long H5E_CANTUNDEPEND(); + private static native final long H5E_CANTUNLOCK(); + private static native final long H5E_CANTUNLOCKFILE(); + + private static native final long H5E_CANTUNPIN(); + + private static native final long H5E_CANTUNPROTECT(); + + private static native final long H5E_CANTUNSERIALIZE(); + + private static native final long H5E_CANTUPDATE(); + private static native final long H5E_CLOSEERROR(); private static native final long H5E_COMPLEN(); + private static native final long H5E_CONTEXT(); + private static native final long H5E_DATASET(); private static native final long H5E_DATASPACE(); @@ -935,10 +1824,16 @@ public class HDF5Constants { private static native final long H5E_DUPCLASS(); + private static native final long H5E_EARRAY(); + private static native final long H5E_EFL(); + private static native final long H5E_ERROR(); + private static native final long H5E_EXISTS(); + private static native final long H5E_FARRAY(); + private static native final long H5E_FCNTL(); private static native final long H5E_FILE(); @@ -947,10 +1842,14 @@ public class HDF5Constants { private static native final long H5E_FILEOPEN(); + private static native final long H5E_FSPACE(); + private static native final long H5E_FUNC(); private static native final long H5E_HEAP(); + private static native final long H5E_INCONSISTENTSTATE(); + private static native final long H5E_INTERNAL(); private static native final long H5E_IO(); @@ -959,8 +1858,12 @@ public class HDF5Constants { private static native final long H5E_LINKCOUNT(); + private static native final long H5E_LOGGING(); + private static native final int H5E_MAJOR(); + private static native final long H5E_MAP(); + private static native final int H5E_MINOR(); private static native final long H5E_MOUNT(); @@ -969,6 +1872,12 @@ public class HDF5Constants { private static native final long H5E_MPIERRSTR(); + private static native final long H5E_NLINKS(); + + private static native final long H5E_NO_INDEPENDENT(); + + private static native final long H5E_NOENCODER(); + private static native final long H5E_NOFILTER(); private static native final long H5E_NOIDS(); @@ -985,14 +1894,26 @@ public class HDF5Constants { private static native final long H5E_NOTHDF5(); + private static native final long H5E_NOTREGISTERED(); + + private static native final long H5E_OBJOPEN(); + private static native final long H5E_OHDR(); + private static native final long H5E_OPENERROR(); + private static native final long H5E_OVERFLOW(); + private static native final long H5E_PAGEBUF(); + + private static native final long H5E_PATH(); + private static native final long H5E_PLINE(); private static native final long H5E_PLIST(); + private static native final long H5E_PLUGIN(); + private static native final long H5E_PROTECT(); private static native final long H5E_READERROR(); @@ -1005,12 +1926,24 @@ public class HDF5Constants { private static native final long H5E_SEEKERROR(); + private static native final long H5E_SETDISALLOWED(); + private static native final long H5E_SETLOCAL(); + private static native final long H5E_SLIST(); + + private static native final long H5E_SOHM(); + private static native final long H5E_STORAGE(); private static native final long H5E_SYM(); + private static native final long H5E_SYSERRSTR(); + + private static native final long H5E_SYSTEM(); + + private static native final long H5E_TRAVERSE(); + private static native final long H5E_TRUNCATED(); private static native final long H5E_TST(); @@ -1037,8 +1970,6 @@ public class HDF5Constants { private static native final int H5ES_STATUS_FAIL(); - private static native final int H5ES_STATUS_CANCELED(); - private static native final int H5F_ACC_CREAT(); private static native final int H5F_ACC_EXCL(); diff --git a/java/src/hdf/hdf5lib/HDF5GroupInfo.java b/java/src/hdf/hdf5lib/HDF5GroupInfo.java index 44b41bb..4c31af7 100644 --- a/java/src/hdf/hdf5lib/HDF5GroupInfo.java +++ b/java/src/hdf/hdf5lib/HDF5GroupInfo.java @@ -41,6 +41,8 @@ public class HDF5GroupInfo { long mtime; int linklen; + /** Container for the information reported about an HDF5 Object + * from the H5Gget_obj_info() method */ public HDF5GroupInfo() { fileno = new long[2]; objno = new long[2]; @@ -88,27 +90,44 @@ public class HDF5GroupInfo { linklen = 0; } - /* accessors */ + /** fileno accessors + * @return the file number if successful + */ public long[] getFileno() { return fileno; } + /** accessors + * @return the object number if successful + */ public long[] getObjno() { return objno; } + /** accessors + * @return type of group if successful + */ public int getType() { return type; } + /** accessors + * @return the number of links in the group if successful + */ public int getNlink() { return nlink; } + /** accessors + * @return the modified time value if successful + */ public long getMtime() { return mtime; } + /** accessors + * @return a length of link name if successful + */ public int getLinklen() { return linklen; } diff --git a/java/src/hdf/hdf5lib/HDFArray.java b/java/src/hdf/hdf5lib/HDFArray.java index 0c2cd73..bb9357e 100644 --- a/java/src/hdf/hdf5lib/HDFArray.java +++ b/java/src/hdf/hdf5lib/HDFArray.java @@ -11,28 +11,25 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - package hdf.hdf5lib; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5JavaException; +import java.util.Arrays; /** * This is a class for handling multidimensional arrays for HDF. *

- * The purpose is to allow the storage and retrieval of arbitrary array types - * containing scientific data. + * The purpose is to allow the storage and retrieval of arbitrary array types containing scientific data. *

- * The methods support the conversion of an array to and from Java to a - * one-dimensional array of bytes suitable for I/O by the C library. + * The methods support the conversion of an array to and from Java to a one-dimensional array of bytes suitable for I/O + * by the C library. *

- * This class heavily uses the HDFNativeData class to - * convert between Java and C representations. + * This class heavily uses the HDFNativeData class to convert between + * Java and C representations. */ public class HDFArray { - private Object _theArray = null; private ArrayDescriptor _desc = null; private byte[] _barray = null; @@ -40,31 +37,27 @@ public class HDFArray { // public HDFArray() {} /** - * The input must be a Java Array (possibly multidimensional) of primitive - * numbers or sub-classes of Number. + * The input must be a Java Array (possibly multidimensional) of primitive numbers or sub-classes of Number. *

- * The input is analysed to determine the number of dimensions and size of - * each dimension, as well as the type of the elements. + * The input is analysed to determine the number of dimensions and size of each dimension, as well as the type of + * the elements. *

* The description is saved in private variables, and used to convert data. * * @param anArray - * The array object. - * + * The array object. * @exception hdf.hdf5lib.exceptions.HDF5Exception - * object is not an array. + * object is not an array. */ - public HDFArray(Object anArray) throws HDF5Exception { - + public HDFArray(Object anArray) throws HDF5Exception + { if (anArray == null) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: array is null?: "); + HDF5JavaException ex = new HDF5JavaException("HDFArray: array is null?: "); } Class tc = anArray.getClass(); if (tc.isArray() == false) { /* exception: not an array */ - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: not an array?: "); + HDF5JavaException ex = new HDF5JavaException("HDFArray: not an array?: "); throw (ex); } _theArray = anArray; @@ -72,8 +65,7 @@ public class HDFArray { /* extra error checking -- probably not needed */ if (_desc == null) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: internal error: array description failed?: "); + HDF5JavaException ex = new HDF5JavaException("HDFArray: internal error: array description failed?: "); throw (ex); } } @@ -81,49 +73,48 @@ public class HDFArray { /** * Allocate a one-dimensional array of bytes sufficient to store the array. * - * @return A one-D array of bytes, filled with zeroes. The bytes are - * sufficient to hold the data of the Array passed to the - * constructor. + * @return A one-D array of bytes, filled with zeroes. The bytes are sufficient to hold the data of the Array passed + * to the constructor. * @exception hdf.hdf5lib.exceptions.HDF5JavaException - * Allocation failed. + * Allocation failed. */ - public byte[] emptyBytes() throws HDF5JavaException { + public byte[] emptyBytes() + throws HDF5JavaException + { byte[] b = null; - if ((ArrayDescriptor.dims == 1) && (ArrayDescriptor.NT == 'B')) { + if ((ArrayDescriptor.dims == 1) + && (ArrayDescriptor.NT == 'B')) { b = (byte[]) _theArray; } else { b = new byte[ArrayDescriptor.totalSize]; } if (b == null) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: emptyBytes: allocation failed"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: emptyBytes: allocation failed"); throw (ex); } return (b); } /** - * Given a Java array of numbers, convert it to a one-dimensional array of - * bytes in correct native order. + * Given a Java array of numbers, convert it to a one-dimensional array of bytes in correct native order. * - * @return A one-D array of bytes, constructed from the Array passed to the - * constructor. + * @return A one-D array of bytes, constructed from the Array passed to the constructor. * @exception hdf.hdf5lib.exceptions.HDF5JavaException - * the object not an array or other internal error. + * the object not an array or other internal error. */ - public byte[] byteify() throws HDF5JavaException { - + public byte[] byteify() + throws HDF5JavaException + { if (_barray != null) { return _barray; } if (_theArray == null) { /* exception: not an array */ - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify not an array?: "); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify not an array?: "); throw (ex); } @@ -140,73 +131,53 @@ public class HDFArray { byte[] therow; if (ArrayDescriptor.NT == 'I') { - therow = HDFNativeData.intToByte(0, - ArrayDescriptor.dimlen[1], (int[]) _theArray); + therow = HDFNativeData.intToByte(0, ArrayDescriptor.dimlen[1], (int[]) _theArray); } else if (ArrayDescriptor.NT == 'S') { - therow = HDFNativeData.shortToByte(0, - ArrayDescriptor.dimlen[1], (short[]) _theArray); + therow = HDFNativeData.shortToByte(0, ArrayDescriptor.dimlen[1], (short[]) _theArray); } else if (ArrayDescriptor.NT == 'F') { - therow = HDFNativeData.floatToByte(0, - ArrayDescriptor.dimlen[1], (float[]) _theArray); + therow = HDFNativeData.floatToByte(0, ArrayDescriptor.dimlen[1], (float[]) _theArray); } else if (ArrayDescriptor.NT == 'J') { - therow = HDFNativeData.longToByte(0, - ArrayDescriptor.dimlen[1], (long[]) _theArray); + therow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[1], (long[]) _theArray); } else if (ArrayDescriptor.NT == 'D') { - therow = HDFNativeData - .doubleToByte(0, ArrayDescriptor.dimlen[1], - (double[]) _theArray); + therow = HDFNativeData.doubleToByte(0, ArrayDescriptor.dimlen[1], (double[]) _theArray); } else if (ArrayDescriptor.NT == 'L') { if (ArrayDescriptor.className.equals("java.lang.Byte")) { therow = ByteObjToByte((Byte[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Integer")) { + else if (ArrayDescriptor.className.equals("java.lang.Integer")) { therow = IntegerToByte((Integer[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Short")) { + else if (ArrayDescriptor.className.equals("java.lang.Short")) { therow = ShortToByte((Short[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Float")) { + else if (ArrayDescriptor.className.equals("java.lang.Float")) { therow = FloatObjToByte((Float[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Double")) { + else if (ArrayDescriptor.className.equals("java.lang.Double")) { therow = DoubleObjToByte((Double[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Long")) { + else if (ArrayDescriptor.className.equals("java.lang.Long")) { therow = LongObjToByte((Long[]) _theArray); } else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: unknown type of Object?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown type of Object?"); throw (ex); } } else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: unknown type of data?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown type of data?"); throw (ex); } - System - .arraycopy( - therow, - 0, - _barray, - 0, - (ArrayDescriptor.dimlen[1] * ArrayDescriptor.NTsize)); + System.arraycopy(therow, 0, _barray, 0, (ArrayDescriptor.dimlen[1] * ArrayDescriptor.NTsize)); return _barray; } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?"); throw (ex); } } @@ -216,8 +187,7 @@ public class HDFArray { _barray = new byte[ArrayDescriptor.totalSize]; } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?"); throw (ex); } @@ -240,8 +210,7 @@ public class HDFArray { else { /* check range of index */ if (index > (ArrayDescriptor.dimlen[i] - 1)) { - throw new java.lang.IndexOutOfBoundsException( - "HDFArray: byteify index OOB?"); + throw new java.lang.IndexOutOfBoundsException("HDFArray: byteify index OOB?"); } oo = java.lang.reflect.Array.get(oo, index); ArrayDescriptor.currentindex[i] = index; @@ -253,242 +222,187 @@ public class HDFArray { byte arow[]; try { if (ArrayDescriptor.NT == 'J') { - arow = HDFNativeData - .longToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); - arow = HDFNativeData - .longToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'I') { - arow = HDFNativeData - .intToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (int[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.intToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (int[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'S') { - arow = HDFNativeData - .shortToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.shortToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'B') { arow = (byte[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]; } else if (ArrayDescriptor.NT == 'F') { /* 32 bit float */ - arow = HDFNativeData - .floatToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.floatToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'D') { /* 64 bit float */ - arow = HDFNativeData - .doubleToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.doubleToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'L') { if (ArrayDescriptor.className.equals("java.lang.Byte")) { arow = ByteObjToByte((Byte[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } - else if (ArrayDescriptor.className - .equals("java.lang.Integer")) { + else if (ArrayDescriptor.className.equals("java.lang.Integer")) { arow = IntegerToByte((Integer[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } - else if (ArrayDescriptor.className - .equals("java.lang.Short")) { + else if (ArrayDescriptor.className.equals("java.lang.Short")) { arow = ShortToByte((Short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } - else if (ArrayDescriptor.className - .equals("java.lang.Float")) { + else if (ArrayDescriptor.className.equals("java.lang.Float")) { arow = FloatObjToByte((Float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } - else if (ArrayDescriptor.className - .equals("java.lang.Double")) { + else if (ArrayDescriptor.className.equals("java.lang.Double")) { arow = DoubleObjToByte((Double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.className.equals("java.lang.Long")) { arow = LongObjToByte((Long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify Object type not implemented?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify Object type not implemented?"); throw (ex); } } else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify unknown type not implemented?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify unknown type not implemented?"); throw (ex); } - System - .arraycopy( - arow, - 0, - _barray, - n, - (ArrayDescriptor.dimlen[ArrayDescriptor.dims] * ArrayDescriptor.NTsize)); + System.arraycopy(arow, 0, _barray, n, + (ArrayDescriptor.dimlen[ArrayDescriptor.dims] * ArrayDescriptor.NTsize)); n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?"); throw (ex); } } /* assert: the whole array is completed--currentindex should == len - 1 */ - /* error checks */ - if (n < ArrayDescriptor.totalSize) { - throw new java.lang.InternalError(new String( - "HDFArray::byteify: Panic didn't complete all input data: n= " - + n + " size = " + ArrayDescriptor.totalSize)); + throw new java.lang.InternalError(new String("HDFArray::byteify: Panic didn't complete all input data: n= " + + n + " size = " + ArrayDescriptor.totalSize)); } for (i = 0; i < ArrayDescriptor.dims; i++) { if (ArrayDescriptor.currentindex[i] != ArrayDescriptor.dimlen[i] - 1) { throw new java.lang.InternalError(new String( - "Panic didn't complete all data: currentindex[" + i - + "] = " + ArrayDescriptor.currentindex[i] - + " (should be " - + (ArrayDescriptor.dimlen[i] - 1) + " ?)")); + "Panic didn't complete all data: currentindex[" + i + "] = " + ArrayDescriptor.currentindex[i] + + " (should be " + (ArrayDescriptor.dimlen[i] - 1) + " ?)")); } } return _barray; } /** - * Given a one-dimensional array of bytes representing numbers, convert it - * to a java array of the shape and size passed to the constructor. + * Given a one-dimensional array of bytes representing numbers, convert it to a java array of the shape and size + * passed to the constructor. * * @param bytes - * The bytes to construct the Array. - * @return An Array (possibly multidimensional) of primitive or number - * objects. - * @exception hdf.hdf5lib.exceptions.HDF5JavaException - * the object not an array or other internal error. + * The bytes to construct the Array. + * @return + * An Array (possibly multidimensional) of primitive or number objects. + * @exception + * hdf.hdf5lib.exceptions.HDF5JavaException the object not an array or other internal error. */ - public Object arrayify(byte[] bytes) throws HDF5JavaException { - + public Object arrayify(byte[] bytes) throws HDF5JavaException + { if (_theArray == null) { /* exception: not an array */ - HDF5JavaException ex = new HDF5JavaException( - "arrayify: not an array?: "); + HDF5JavaException ex = new HDF5JavaException("arrayify: not an array?: "); throw (ex); } if (java.lang.reflect.Array.getLength(bytes) != ArrayDescriptor.totalSize) { /* exception: array not right size */ - HDF5JavaException ex = new HDF5JavaException( - "arrayify: array is wrong size?: "); + HDF5JavaException ex = new HDF5JavaException("arrayify: array is wrong size?: "); throw (ex); } _barray = bytes; /* hope that the bytes are correct.... */ + if (ArrayDescriptor.dims == 1) { /* special case */ /* 2 data copies here! */ try { if (ArrayDescriptor.NT == 'I') { int[] x = HDFNativeData.byteToInt(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'S') { short[] x = HDFNativeData.byteToShort(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'F') { float x[] = HDFNativeData.byteToFloat(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'J') { long x[] = HDFNativeData.byteToLong(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'D') { double x[] = HDFNativeData.byteToDouble(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'B') { - System.arraycopy(_barray, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(_barray, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'L') { if (ArrayDescriptor.className.equals("java.lang.Byte")) { Byte I[] = ByteToByteObj(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } - else if (ArrayDescriptor.className - .equals("java.lang.Integer")) { + else if (ArrayDescriptor.className.equals("java.lang.Integer")) { Integer I[] = ByteToInteger(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } - else if (ArrayDescriptor.className - .equals("java.lang.Short")) { + else if (ArrayDescriptor.className.equals("java.lang.Short")) { Short I[] = ByteToShort(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } - else if (ArrayDescriptor.className - .equals("java.lang.Float")) { + else if (ArrayDescriptor.className.equals("java.lang.Float")) { Float I[] = ByteToFloatObj(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } - else if (ArrayDescriptor.className - .equals("java.lang.Double")) { + else if (ArrayDescriptor.className.equals("java.lang.Double")) { Double I[] = ByteToDoubleObj(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.className.equals("java.lang.Long")) { Long I[] = ByteToLongObj(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else { - HDF5JavaException ex = new HDF5JavaException( - "arrayify: Object type not implemented yet..."); + HDF5JavaException ex = new HDF5JavaException("arrayify: Object type not implemented yet..."); throw (ex); } } else { - HDF5JavaException ex = new HDF5JavaException( - "arrayify: unknown type not implemented yet..."); + HDF5JavaException ex = new HDF5JavaException("arrayify: unknown type not implemented yet..."); throw (ex); } } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: arrayify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: arrayify array too big?"); throw (ex); } } @@ -496,8 +410,54 @@ public class HDFArray { Object oo = _theArray; int n = 0; /* the current byte */ + int m = 0; /* the current array index */ int index = 0; int i; + Object flattenedArray = null; + + switch (ArrayDescriptor.NT) { + case 'J': + flattenedArray = (Object) HDFNativeData.byteToLong(_barray); + break; + case 'S': + flattenedArray = (Object) HDFNativeData.byteToShort(_barray); + break; + case 'I': + flattenedArray = (Object) HDFNativeData.byteToInt(_barray); + break; + case 'F': + flattenedArray = (Object) HDFNativeData.byteToFloat(_barray); + break; + case 'D': + flattenedArray = (Object) HDFNativeData.byteToDouble(_barray); + break; + case 'B': + flattenedArray = (Object) _barray; + break; + case 'L': + { + if (ArrayDescriptor.className.equals("java.lang.Byte")) + flattenedArray = (Object) ByteToByteObj(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Short")) + flattenedArray = (Object) ByteToShort(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Integer")) + flattenedArray = (Object) ByteToInteger(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Long")) + flattenedArray = (Object) ByteToLongObj(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Float")) + flattenedArray = (Object) ByteToFloatObj(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Double")) + flattenedArray = (Object) ByteToDoubleObj(_barray); + else { + HDF5JavaException ex = new HDF5JavaException("HDFArray: unsupported Object type: " + ArrayDescriptor.NT); + throw (ex); + } + } // end of statement for arrays of boxed objects + default: + HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown or unsupported type: " + ArrayDescriptor.NT); + throw (ex); + } // end of switch statement for arrays of primitives + while (n < ArrayDescriptor.totalSize) { oo = ArrayDescriptor.objs[0]; index = n / ArrayDescriptor.bytetoindex[0]; @@ -524,222 +484,86 @@ public class HDFArray { /* array-ify */ try { - if (ArrayDescriptor.NT == 'J') { - long[] arow = HDFNativeData.byteToLong(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - arow); - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.NT == 'I') { - int[] arow = HDFNativeData.byteToInt(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - arow); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.NT == 'S') { - short[] arow = HDFNativeData.byteToShort(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - arow); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.NT == 'B') { - System.arraycopy(_barray, n, - ArrayDescriptor.objs[ArrayDescriptor.dims - 1], 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims]); - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - } - else if (ArrayDescriptor.NT == 'F') { - float arow[] = HDFNativeData.byteToFloat(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - arow); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.NT == 'D') { - double[] arow = HDFNativeData.byteToDouble(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - arow); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.NT == 'L') { - if (ArrayDescriptor.className.equals("java.lang.Byte")) { - Byte I[] = ByteToByteObj(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - I); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.className - .equals("java.lang.Integer")) { - Integer I[] = ByteToInteger(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - I); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.className - .equals("java.lang.Short")) { - Short I[] = ByteToShort(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - I); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.className - .equals("java.lang.Float")) { - Float I[] = ByteToFloatObj(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - I); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.className - .equals("java.lang.Double")) { - Double I[] = ByteToDoubleObj(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - I); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else if (ArrayDescriptor.className.equals("java.lang.Long")) { - Long I[] = ByteToLongObj(n, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - _barray); - java.lang.reflect.Array - .set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - I); - - n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; - ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; - } - else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: unsupported Object type: " - + ArrayDescriptor.NT); - throw (ex); - } - } - else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: unknown or unsupported type: " - + ArrayDescriptor.NT); - throw (ex); - } + Object arow = null; + int mm = m + ArrayDescriptor.dimlen[ArrayDescriptor.dims]; + switch (ArrayDescriptor.NT) { + case 'B': + arow = (Object) Arrays.copyOfRange((byte[]) flattenedArray, m, mm); + break; + case 'S': + arow = (Object) Arrays.copyOfRange((short[]) flattenedArray, m, mm); + break; + case 'I': + arow = (Object) Arrays.copyOfRange((int[]) flattenedArray, m, mm); + break; + case 'J': + arow = (Object) Arrays.copyOfRange((long[]) flattenedArray, m, mm); + break; + case 'F': + arow = (Object) Arrays.copyOfRange((float[]) flattenedArray, m, mm); + break; + case 'D': + arow = (Object) Arrays.copyOfRange((double[]) flattenedArray, m, mm); + break; + case 'L': + { + if (ArrayDescriptor.className.equals("java.lang.Byte")) + arow = (Object) Arrays.copyOfRange((Byte[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Short")) + arow = (Object) Arrays.copyOfRange((Short[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Integer")) + arow = (Object) Arrays.copyOfRange((Integer[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Long")) + arow = (Object) Arrays.copyOfRange((Long[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Float")) + arow = (Object) Arrays.copyOfRange((Float[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Double")) + arow = (Object) Arrays.copyOfRange((Double[]) flattenedArray, m, mm); + else { + HDF5JavaException ex = new HDF5JavaException("HDFArray: unsupported Object type: " + ArrayDescriptor.NT); + throw (ex); + } + } // end of statement for arrays of boxed numerics + } // end of switch statement for arrays of primitives + + java.lang.reflect.Array.set(ArrayDescriptor.objs[ArrayDescriptor.dims - 2], + (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), arow); + n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; + ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; + m = mm; } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: arrayify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: arrayify array too big?"); throw (ex); } - } /* assert: the whole array is completed--currentindex should == len - 1 */ - /* error checks */ - if (n < ArrayDescriptor.totalSize) { - throw new java.lang.InternalError(new String( - "HDFArray::arrayify Panic didn't complete all input data: n= " - + n + " size = " + ArrayDescriptor.totalSize)); + throw new java.lang.InternalError(new String("HDFArray::arrayify Panic didn't complete all input data: n= " + + n + " size = " + ArrayDescriptor.totalSize)); } for (i = 0; i <= ArrayDescriptor.dims - 2; i++) { if (ArrayDescriptor.currentindex[i] != ArrayDescriptor.dimlen[i] - 1) { - throw new java.lang.InternalError(new String( - "HDFArray::arrayify Panic didn't complete all data: currentindex[" - + i + "] = " + ArrayDescriptor.currentindex[i] - + " (should be " - + (ArrayDescriptor.dimlen[i] - 1) + "?")); - } - } - if (ArrayDescriptor.NT != 'B') { - if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != ArrayDescriptor.dimlen[ArrayDescriptor.dims - 1]) { - throw new java.lang.InternalError(new String( - "HDFArray::arrayify Panic didn't complete all data: currentindex[" - + i + "] = " + ArrayDescriptor.currentindex[i] - + " (should be " + (ArrayDescriptor.dimlen[i]) + throw new java.lang.InternalError( + new String("HDFArray::arrayify Panic didn't complete all data: currentindex[" + i + "] = " + + ArrayDescriptor.currentindex[i] + " (should be " + (ArrayDescriptor.dimlen[i] - 1) + "?")); } } - else { - if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != (ArrayDescriptor.dimlen[ArrayDescriptor.dims - 1] - 1)) { - throw new java.lang.InternalError(new String( - "HDFArray::arrayify Panic didn't complete all data: currentindex[" - + i + "] = " + ArrayDescriptor.currentindex[i] - + " (should be " - + (ArrayDescriptor.dimlen[i] - 1) + "?")); - } + if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != ArrayDescriptor.dimlen[ArrayDescriptor.dims + - 1]) { + throw new java.lang.InternalError( + new String("HDFArray::arrayify Panic didn't complete all data: currentindex[" + i + "] = " + + ArrayDescriptor.currentindex[i] + " (should be " + (ArrayDescriptor.dimlen[i]) + "?")); } return _theArray; } - private byte[] IntegerToByte(Integer in[]) { + private byte[] IntegerToByte(Integer in[]) + { int nelems = java.lang.reflect.Array.getLength(in); int[] out = new int[nelems]; @@ -749,7 +573,8 @@ public class HDFArray { return HDFNativeData.intToByte(0, nelems, out); } - private Integer[] ByteToInteger(byte[] bin) { + private Integer[] ByteToInteger(byte[] bin) + { int in[] = HDFNativeData.byteToInt(bin); int nelems = java.lang.reflect.Array.getLength(in); Integer[] out = new Integer[nelems]; @@ -760,7 +585,8 @@ public class HDFArray { return out; } - private Integer[] ByteToInteger(int start, int len, byte[] bin) { + private Integer[] ByteToInteger(int start, int len, byte[] bin) + { int in[] = HDFNativeData.byteToInt(start, len, bin); int nelems = java.lang.reflect.Array.getLength(in); Integer[] out = new Integer[nelems]; @@ -771,7 +597,8 @@ public class HDFArray { return out; } - private byte[] ShortToByte(Short in[]) { + private byte[] ShortToByte(Short in[]) + { int nelems = java.lang.reflect.Array.getLength(in); short[] out = new short[nelems]; @@ -781,7 +608,8 @@ public class HDFArray { return HDFNativeData.shortToByte(0, nelems, out); } - private Short[] ByteToShort(byte[] bin) { + private Short[] ByteToShort(byte[] bin) + { short in[] = HDFNativeData.byteToShort(bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Short[] out = new Short[nelems]; @@ -792,7 +620,8 @@ public class HDFArray { return out; } - private Short[] ByteToShort(int start, int len, byte[] bin) { + private Short[] ByteToShort(int start, int len, byte[] bin) + { short in[] = (short[]) HDFNativeData.byteToShort(start, len, bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Short[] out = new Short[nelems]; @@ -803,7 +632,8 @@ public class HDFArray { return out; } - private byte[] ByteObjToByte(Byte in[]) { + private byte[] ByteObjToByte(Byte in[]) + { int nelems = java.lang.reflect.Array.getLength((Object) in); byte[] out = new byte[nelems]; @@ -813,7 +643,8 @@ public class HDFArray { return out; } - private Byte[] ByteToByteObj(byte[] bin) { + private Byte[] ByteToByteObj(byte[] bin) + { int nelems = java.lang.reflect.Array.getLength((Object) bin); Byte[] out = new Byte[nelems]; @@ -823,7 +654,8 @@ public class HDFArray { return out; } - private Byte[] ByteToByteObj(int start, int len, byte[] bin) { + private Byte[] ByteToByteObj(int start, int len, byte[] bin) + { Byte[] out = new Byte[len]; for (int i = 0; i < len; i++) { @@ -832,7 +664,8 @@ public class HDFArray { return out; } - private byte[] FloatObjToByte(Float in[]) { + private byte[] FloatObjToByte(Float in[]) + { int nelems = java.lang.reflect.Array.getLength((Object) in); float[] out = new float[nelems]; @@ -842,7 +675,8 @@ public class HDFArray { return HDFNativeData.floatToByte(0, nelems, out); } - private Float[] ByteToFloatObj(byte[] bin) { + private Float[] ByteToFloatObj(byte[] bin) + { float in[] = (float[]) HDFNativeData.byteToFloat(bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Float[] out = new Float[nelems]; @@ -853,7 +687,8 @@ public class HDFArray { return out; } - private Float[] ByteToFloatObj(int start, int len, byte[] bin) { + private Float[] ByteToFloatObj(int start, int len, byte[] bin) + { float in[] = (float[]) HDFNativeData.byteToFloat(start, len, bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Float[] out = new Float[nelems]; @@ -864,7 +699,8 @@ public class HDFArray { return out; } - private byte[] DoubleObjToByte(Double in[]) { + private byte[] DoubleObjToByte(Double in[]) + { int nelems = java.lang.reflect.Array.getLength((Object) in); double[] out = new double[nelems]; @@ -874,7 +710,8 @@ public class HDFArray { return HDFNativeData.doubleToByte(0, nelems, out); } - private Double[] ByteToDoubleObj(byte[] bin) { + private Double[] ByteToDoubleObj(byte[] bin) + { double in[] = (double[]) HDFNativeData.byteToDouble(bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Double[] out = new Double[nelems]; @@ -885,7 +722,8 @@ public class HDFArray { return out; } - private Double[] ByteToDoubleObj(int start, int len, byte[] bin) { + private Double[] ByteToDoubleObj(int start, int len, byte[] bin) + { double in[] = (double[]) HDFNativeData.byteToDouble(start, len, bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Double[] out = new Double[nelems]; @@ -896,7 +734,8 @@ public class HDFArray { return out; } - private byte[] LongObjToByte(Long in[]) { + private byte[] LongObjToByte(Long in[]) + { int nelems = java.lang.reflect.Array.getLength((Object) in); long[] out = new long[nelems]; @@ -906,7 +745,8 @@ public class HDFArray { return HDFNativeData.longToByte(0, nelems, out); } - private Long[] ByteToLongObj(byte[] bin) { + private Long[] ByteToLongObj(byte[] bin) + { long in[] = (long[]) HDFNativeData.byteToLong(bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Long[] out = new Long[nelems]; @@ -917,7 +757,8 @@ public class HDFArray { return out; } - private Long[] ByteToLongObj(int start, int len, byte[] bin) { + private Long[] ByteToLongObj(int start, int len, byte[] bin) + { long in[] = (long[]) HDFNativeData.byteToLong(start, len, bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Long[] out = new Long[nelems]; @@ -930,13 +771,11 @@ public class HDFArray { } /** - * This private class is used by HDFArray to discover the shape and type of an - * arbitrary array. + * This private class is used by HDFArray to discover the shape and type of an arbitrary array. *

* We use java.lang.reflection here. */ class ArrayDescriptor { - static String theType = ""; static Class theClass = null; static int[] dimlen = null; @@ -944,19 +783,19 @@ class ArrayDescriptor { static int[] currentindex = null; static int[] bytetoindex = null; static int totalSize = 0; + static int totalElements = 0; static Object[] objs = null; static char NT = ' '; /* must be B,S,I,L,F,D, else error */ static int NTsize = 0; static int dims = 0; static String className; - public ArrayDescriptor(Object anArray) throws HDF5Exception { - + public ArrayDescriptor(Object anArray) throws HDF5Exception + { Class tc = anArray.getClass(); if (tc.isArray() == false) { /* exception: not an array */ - HDF5Exception ex = new HDF5JavaException( - "ArrayDescriptor: not an array?: "); + HDF5Exception ex = new HDF5JavaException("ArrayDescriptor: not an array?: "); throw (ex); } @@ -1028,16 +867,14 @@ class ArrayDescriptor { NT = 'L'; className = "java.lang.String"; NTsize = 1; - throw new HDF5JavaException(new String( - "ArrayDesciptor: Warning: String array not fully supported yet")); + throw new HDF5JavaException(new String("ArrayDesciptor: Warning: String array not fully supported yet")); } else { /* * exception: not a numeric type */ - throw new HDF5JavaException(new String( - "ArrayDesciptor: Error: array is not numeric (type is " - + css + ") ?")); + throw new HDF5JavaException( + new String("ArrayDesciptor: Error: array is not numeric (type is " + css + ") ?")); } /* fill in the table */ @@ -1052,6 +889,7 @@ class ArrayDescriptor { dimlen[0] = 1; dimstart[0] = 0; currentindex[0] = 0; + int elements = 1; int i; for (i = 1; i <= dims; i++) { dimlen[i] = java.lang.reflect.Array.getLength((Object) o); @@ -1059,7 +897,9 @@ class ArrayDescriptor { objs[i] = o; dimstart[i] = 0; currentindex[i] = 0; + elements *= dimlen[i]; } + totalElements = elements; int j; int dd; @@ -1078,20 +918,19 @@ class ArrayDescriptor { /** * Debug dump */ - public void dumpInfo() { + public void dumpInfo() + { System.out.println("Type: " + theType); System.out.println("Class: " + theClass); System.out.println("NT: " + NT + " NTsize: " + NTsize); System.out.println("Array has " + dims + " dimensions (" + totalSize - + " bytes)"); + + " bytes, " + totalElements + " elements)"); int i; for (i = 0; i <= dims; i++) { Class tc = objs[i].getClass(); String ss = tc.toString(); - System.out.println(i + ": start " + dimstart[i] + ": len " - + dimlen[i] + " current " + currentindex[i] - + " bytetoindex " + bytetoindex[i] + " object " + objs[i] - + " otype " + ss); + System.out.println(i + ": start " + dimstart[i] + ": len " + dimlen[i] + " current " + currentindex[i] + + " bytetoindex " + bytetoindex[i] + " object " + objs[i] + " otype " + ss); } } } diff --git a/java/src/hdf/hdf5lib/callbacks/Callbacks.java b/java/src/hdf/hdf5lib/callbacks/Callbacks.java index e2033fa..11fa465 100644 --- a/java/src/hdf/hdf5lib/callbacks/Callbacks.java +++ b/java/src/hdf/hdf5lib/callbacks/Callbacks.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java index da59567..6c68f36 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,7 +14,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5A_info_t; -//Information class for link callback(for H5Aiterate) +/** + * Information class for link callback for H5Aiterate. + * + */ public interface H5A_iterate_cb extends Callbacks { - int callback(long group, String name, H5A_info_t info, H5A_iterate_t op_data); + /** + * application callback for each attribute + * + * @param loc_id the ID for the group or dataset being iterated over + * @param name the name of the current attribute about the object + * @param info the attribute's "info" struct + * @param op_data the operator data passed in to H5Aiterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5A_info_t info, H5A_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java index d229dd4..d612db3 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Aiterate. + * + */ public interface H5A_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java index a163f11..cf7ada6 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pset/get_append_flush) +/** + * Information class for link callback for H5Pset/get_append_flush. + * + */ public interface H5D_append_cb extends Callbacks { + /** + * application callback for each dataset access property list + * + * @param dataset_id the ID for the dataset being iterated over + * @param cur_dims the dimension sizes for determining boundary + * @param op_data the operator data passed in to H5Pset/get_append_flush + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long dataset_id, long[] cur_dims, H5D_append_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java index 4df25de..7fdb454 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Dappend. + * + */ public interface H5D_append_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java index 8f5b64e..54c12e3 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,29 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Diterate) +/** + * Information class for link callback for H5Diterate. + * + */ public interface H5D_iterate_cb extends Callbacks { + /** + * application callback for each dataset element + * + * @param elem the pointer to the element in memory containing the current point + * @param elem_type the datatype ID for the elements stored in elem + * @param ndim the number of dimensions for POINT array + * @param point the array containing the location of the element within the original dataspace + * @param op_data the operator data passed in to H5Diterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(byte[] elem, long elem_type, int ndim, long[] point, H5D_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java index 36194f9..305cf98 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Diterate. + * + */ public interface H5D_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java index 5b888b8..5722195 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,7 +14,27 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5E_error2_t; -//Information class for link callback(for H5Ewalk) +/** + * Information class for link callback for H5Ewalk. + * + */ public interface H5E_walk_cb extends Callbacks { + /** + * application callback for each error stack element + * + * @param nidx the index of the current error stack element + * @param info the error stack "info" struct + * @param op_data the operator data passed in to H5Ewalk + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(int nidx, H5E_error2_t info, H5E_walk_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java index 72b56d5..5bf0c8b 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Ewalk. + * + */ public interface H5E_walk_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java index 0b20422..d89fd2a 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Lvisit/H5Lvisit_by_name. + * + */ public interface H5L_iterate_opdata_t { } diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java index 31bff6e..53635bf 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,7 +14,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5L_info_t; -// Information class for link callback (for H5Lvisit/H5Lvisit_by_name). +/** + * Information class for link callback for H5Lvisit/H5Lvisit_by_name. + * + */ public interface H5L_iterate_t extends Callbacks { - int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data); + /** + * application callback for each group + * + * @param loc_id the ID for the group being iterated over + * @param name the name of the current link + * @param info the link's "info" struct + * @param op_data the operator data passed in to H5Literate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5L_info_t info, H5L_iterate_opdata_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java index 6f2b3cc..fd643b4 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Ovisit/H5Ovisit_by_name. + * + */ public interface H5O_iterate_opdata_t { } diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java index 45d7746..ecf868c 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,7 +14,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5O_info_t; -// Information class for link callback(for H5Ovisit/H5Ovisit_by_name) +/** + * Information class for link callback for H5Ovisit/H5Ovisit_by_name. + * + */ public interface H5O_iterate_t extends Callbacks { - int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data); + /** + * application callback for each group + * + * @param loc_id the ID for the group or dataset being iterated over + * @param name the name of the current object + * @param info the object's "info" struct + * @param op_data the operator data passed in to H5Oiterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5O_info_t info, H5O_iterate_opdata_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java index d5c2474..0a09a94 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,26 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_close_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list class being iterated over + * @param close_data the function to call when a property list is closed + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, H5P_cls_close_func_t close_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java index 918e05b..11e3a99 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_close_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java index d01185a..53f86be 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class + * + */ public interface H5P_cls_copy_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param new_prop_id the ID for the property list copy + * @param old_prop_id the ID for the property list class being copied + * @param copy_data the function to call when each property list in this class is copied + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long new_prop_id, long old_prop_id, H5P_cls_copy_func_t copy_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java index 0357959..78e5282 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_copy_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java index 7eb633b..8f4e782 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,26 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_create_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list class being iterated over + * @param create_data the function to call when each property list in this class is created + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, H5P_cls_create_func_t create_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java index a217f18..d919d97 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_create_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java index a133512..db98a67 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Piterate) +/** + * Information class for link callback for H5Piterate. + * + */ public interface H5P_iterate_cb extends Callbacks { + /** + * application callback for each property list + * + * @param plist the ID for the property list being iterated over + * @param name the name of the current property list + * @param op_data the operator data passed in to H5Piterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long plist, String name, H5P_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java index 5c25187..0035619 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,6 +12,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Piterate. + * + */ public interface H5P_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java index d332ffc..1aa7ce4 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_close_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property being closed + * @param size the size of the property value + * @param value the value of the property being closed + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java index dfb2cd3..49cef7d 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_compare_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param value1 the value of the first property being compared + * @param value2 the value of the second property being compared + * @param size the size of the property value + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(byte[] value1, byte[] value2, long size); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java index 9a4456e..f4924ee 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_copy_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property being copied + * @param size the size of the property value + * @param value the value of the property being copied + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java index 53f4bdd..bce024b 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_create_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property list being created + * @param size the size of the property value + * @param value the initial value for the property being created + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java index 44e8ac3..8c5dccc 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_delete_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID of the property list the property is deleted from + * @param name the name of the property being deleted + * @param size the size of the property value + * @param value the value of the property being deleted + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java index 5117bd2..0f3457f 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_get_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list being queried + * @param name the name of the property being queried + * @param size the size of the property value + * @param value the value being retrieved for the property + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java index ef01fc9..a55ca3a 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,7 +12,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_set_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list being modified + * @param name the name of the property being modified + * @param size the size of the property value + * @param value the value being set for the property + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java b/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java deleted file mode 100644 index ee1b21f..0000000 --- a/java/src/hdf/hdf5lib/exceptions/HDF5AtomException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * - * * - * This file is part of HDF5. The full HDF5 copyright notice, including * - * terms governing use, modification, and redistribution, is contained in * - * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://www.hdfgroup.org/licenses. * - * If you do not have access to either file, you may request a copy from * - * help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -package hdf.hdf5lib.exceptions; - -/** - * The class HDF5LibraryException returns errors raised by the HDF5 library. - *

- * This sub-class represents HDF-5 major error code H5E_ATOM - */ - -public class HDF5AtomException extends HDF5LibraryException { - /** - * Constructs an HDF5AtomException with no specified detail - * message. - */ - public HDF5AtomException() { - super(); - } - - /** - * Constructs an HDF5AtomException with the specified detail - * message. - * - * @param s - * the detail message. - */ - public HDF5AtomException(String s) { - super(s); - } - -} diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java index 70e4160..0c23af1 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java @@ -31,6 +31,9 @@ package hdf.hdf5lib.exceptions; * */ public class HDF5Exception extends RuntimeException { + /** + * the specified detail message of this exception + */ protected String detailMessage; /** diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5IdException.java b/java/src/hdf/hdf5lib/exceptions/HDF5IdException.java new file mode 100644 index 0000000..04ee0bc --- /dev/null +++ b/java/src/hdf/hdf5lib/exceptions/HDF5IdException.java @@ -0,0 +1,42 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package hdf.hdf5lib.exceptions; + +/** + * The class HDF5LibraryException returns errors raised by the HDF5 library. + *

+ * This sub-class represents HDF-5 major error code H5E_ID + */ + +public class HDF5IdException extends HDF5LibraryException { + /** + * Constructs an HDF5IdException with no specified detail + * message. + */ + public HDF5IdException() { + super(); + } + + /** + * Constructs an HDF5IdException with the specified detail + * message. + * + * @param s + * the detail message. + */ + public HDF5IdException(String s) { + super(s); + } + +} diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java index 5192eb7..532355e 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -30,7 +30,9 @@ import hdf.hdf5lib.HDF5Constants; @SuppressWarnings("serial") public class HDF5LibraryException extends HDF5Exception { + /** major error number of the first error on the HDF5 library error stack. */ private final long majorErrorNumber; + /** minor error number of the first error on the HDF5 library error stack. */ private final long minorErrorNumber; /** @@ -201,14 +203,14 @@ public class HDF5LibraryException extends HDF5Exception { else if (err_code == HDF5Constants.H5E_CANTRELEASE) { return "Can't release object"; } - else if (err_code == HDF5Constants.H5E_BADATOM) { - return "Can't find atom information"; + else if (err_code == HDF5Constants.H5E_BADID) { + return "Can't find ID information"; } else if (err_code == HDF5Constants.H5E_BADGROUP) { return "Can't find group information"; } else if (err_code == HDF5Constants.H5E_CANTREGISTER) { - return "Can't register new atom"; + return "Can't register new ID"; } else if (err_code == HDF5Constants.H5E_CANTINC) { return "Can't increment reference count"; diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java index 9a5392b..0701244 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java @@ -13,6 +13,12 @@ package hdf.hdf5lib.exceptions; +/** + * The class HDF5LibraryException returns errors raised by the HDF5 library. + *

+ * This sub-class represents HDF-5 major error code H5E_REFERENCE + */ + public class HDF5ReferenceException extends HDF5LibraryException { /** * Constructs an HDF5ReferenceException with no specified diff --git a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java index 082cb56..cf84532 100644 --- a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java +++ b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,44 +14,276 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for H5Pget_mdc_config/H5Pset_mdc_config +/** + * Information struct for H5Pget_mdc_config/H5Pset_mdc_config + * + */ public class H5AC_cache_config_t implements Serializable{ private static final long serialVersionUID = -6748085696476149972L; - // general configuration fields: + // general configuration fields + /** + * version: Integer field containing the version number of this version + * of the H5AC_cache_config_t structure. Any instance of + * H5AC_cache_config_t passed to the cache must have a known + * version number, or an error will be flagged. + */ public int version; + /** + * rpt_fcn_enabled: Boolean field used to enable and disable the default + * reporting function. This function is invoked every time the + * automatic cache resize code is run, and reports on its activities. + * + * This is a debugging function, and should normally be turned off. + */ public boolean rpt_fcn_enabled; + /** + * open_trace_file: Boolean field indicating whether the trace_file_name + * field should be used to open a trace file for the cache. + * + * *** DEPRECATED *** Use H5Fstart/stop logging functions instead + */ public boolean open_trace_file; + /** + * close_trace_file: Boolean field indicating whether the current trace + * file (if any) should be closed. + * + * *** DEPRECATED *** Use H5Fstart/stop logging functions instead + */ public boolean close_trace_file; + /** + * trace_file_name: Full path of the trace file to be opened if the + * open_trace_file field is TRUE. + * + * *** DEPRECATED *** Use H5Fstart/stop logging functions instead + */ public String trace_file_name; + /** + * evictions_enabled: Boolean field used to either report the current + * evictions enabled status of the cache, or to set the cache's + * evictions enabled status. + */ public boolean evictions_enabled; + /** + * set_initial_size: Boolean flag indicating whether the size of the + * initial size of the cache is to be set to the value given in + * the initial_size field. If set_initial_size is FALSE, the + * initial_size field is ignored. + */ public boolean set_initial_size; + /** + * initial_size: If enabled, this field contain the size the cache is + * to be set to upon receipt of this structure. Needless to say, + * initial_size must lie in the closed interval [min_size, max_size]. + */ public long initial_size; + /** + * min_clean_fraction: double in the range 0 to 1 indicating the fraction + * of the cache that is to be kept clean. This field is only used + * in parallel mode. Typical values are 0.1 to 0.5. + */ public double min_clean_fraction; + /** + * max_size: Maximum size to which the cache can be adjusted. The + * supplied value must fall in the closed interval + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must + * be greater than or equal to min_size. + */ public long max_size; + /** + * min_size: Minimum size to which the cache can be adjusted. The + * supplied value must fall in the closed interval + * [H5C__MIN_MAX_CACHE_SIZE, H5C__MAX_MAX_CACHE_SIZE]. Also, min_size + * must be less than or equal to max_size. + */ public long min_size; + /** + * epoch_length: Number of accesses on the cache over which to collect + * hit rate stats before running the automatic cache resize code, + * if it is enabled. + */ public long epoch_length; - // size increase control fields: - public int incr_mode; // H5C_cache_incr_mode + // size increase control fields + /** + * incr_mode: Instance of the H5C_cache_incr_mode enumerated type whose + * value indicates how we determine whether the cache size should be + * increased. At present there are two possible values. + */ + public int incr_mode; + /** + * lower_hr_threshold: Lower hit rate threshold. If the increment mode + * (incr_mode) is H5C_incr__threshold and the hit rate drops below the + * value supplied in this field in an epoch, increment the cache size by + * size_increment. Note that cache size may not be incremented above + * max_size, and that the increment may be further restricted by the + * max_increment field if it is enabled. + */ public double lower_hr_threshold; + /** + * increment: Double containing the multiplier used to derive the new + * cache size from the old if a cache size increment is triggered. + * The increment must be greater than 1.0, and should not exceed 2.0. + */ public double increment; + /** + * apply_max_increment: Boolean flag indicating whether the max_increment + * field should be used to limit the maximum cache size increment. + */ public boolean apply_max_increment; + /** + * max_increment: If enabled by the apply_max_increment field described + * above, this field contains the maximum number of bytes by which the + * cache size can be increased in a single re-size. + */ public long max_increment; - public int flash_incr_mode; // H5C_cache_flash_incr_mode + /** + * flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated + * type whose value indicates whether and by which algorithm we should + * make flash increases in the size of the cache to accommodate insertion + * of large entries and large increases in the size of a single entry. + */ + public int flash_incr_mode; + /** + * flash_multiple: Double containing the multiple described above in the + * H5C_flash_incr__add_space section of the discussion of the + * flash_incr_mode section. This field is ignored unless flash_incr_mode + * is H5C_flash_incr__add_space. + */ public double flash_multiple; + /** + * flash_threshold: Double containing the factor by which current max cache + * size is multiplied to obtain the size threshold for the add_space flash + * increment algorithm. The field is ignored unless flash_incr_mode is + * H5C_flash_incr__add_space. + */ public double flash_threshold; - // size decrease control fields: - public int decr_mode; // H5C_cache_decr_mode + // size decrease control fields + /** + * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose + * value indicates how we determine whether the cache size should be + * decreased. At present there are four possibilities. + */ + public int decr_mode; + /** + * upper_hr_threshold: Upper hit rate threshold. The use of this field + * varies according to the current decr_mode. + */ public double upper_hr_threshold; + /** + * decrement: This field is only used when the decr_mode is + * H5C_decr__threshold. + */ public double decrement; + /** + * apply_max_decrement: Boolean flag used to determine whether decrements + * in cache size are to be limited by the max_decrement field. + */ public boolean apply_max_decrement; + /** + * max_decrement: Maximum number of bytes by which the cache size can be + * decreased in a single re-size. Note that decrements may also be + * restricted by the min_size of the cache, and (in age out modes) by + * the empty_reserve field. + */ public long max_decrement; + /** + * epochs_before_eviction: Integer field used in H5C_decr__age_out and + * H5C_decr__age_out_with_threshold decrement modes. + */ public int epochs_before_eviction; + /** + * apply_empty_reserve: Boolean field controlling whether the empty_reserve + * field is to be used in computing the new cache size when the + * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold. + */ public boolean apply_empty_reserve; + /** + * empty_reserve: To avoid a constant racheting down of cache size by small + * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold + * modes, this field allows one to require that any cache size + * reductions leave the specified fraction of unused space in the cache. + */ public double empty_reserve; - // parallel configuration fields: + // parallel configuration fields + /** + * dirty_bytes_threshold: Threshold of dirty byte creation used to + * synchronize updates between caches. + */ public long dirty_bytes_threshold; + /** + * metadata_write_strategy: Integer field containing a code indicating the + * desired metadata write strategy. + */ public int metadata_write_strategy; + /** H5AC_cache_config_t is a public structure intended for use in public APIs. + * At least in its initial incarnation, it is basically a copy of struct + * H5C_auto_size_ctl_t, minus the report_fcn field, and plus the + * dirty_bytes_threshold field. + * + * @param version: Integer field containing the version number of this version + * @param rpt_fcn_enabled: Boolean field used to enable and disable the default reporting function. + * @param open_trace_file: Boolean field indicating whether the trace_file_name + * field should be used to open a trace file for the cache. + * @param close_trace_file: Boolean field indicating whether the current trace + * file (if any) should be closed. + * @param trace_file_name: Full path of the trace file to be opened if the + * open_trace_file field is TRUE. + * @param evictions_enabled: Boolean field used to either report or set the current + * evictions enabled status of the cache. + * @param set_initial_size: Boolean flag indicating whether the size of the + * initial size of the cache is to be set to the value given in + * the initial_size field. + * @param initial_size: If enabled, this field contain the size the cache is + * to be set to upon receipt of this structure. + * @param min_clean_fraction: double in the range 0 to 1 indicating the fraction + * of the cache that is to be kept clean. + * @param max_size: Maximum size to which the cache can be adjusted. + * @param min_size: Minimum size to which the cache can be adjusted. + * @param epoch_length: Number of accesses on the cache over which to collect + * hit rate stats before running the automatic cache resize code. + * @param incr_mode: Instance of the H5C_cache_incr_mode enumerated type. + * @param lower_hr_threshold: Lower hit rate threshold. + * @param increment: Double containing the multiplier used to derive the new + * cache size from the old if a cache size increment is triggered. + * @param apply_max_increment: Boolean flag indicating whether the max_increment + * field should be used to limit the maximum cache size increment. + * @param max_increment: If enabled by the apply_max_increment field described + * above, this field contains the maximum number of bytes by which the + * cache size can be increased in a single re-size. + * @param flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated + * type whose value indicates whether and by which algorithm we should + * make flash increases in the size of the cache to accommodate insertion + * of large entries and large increases in the size of a single entry. + * @param flash_multiple: Double containing the multiple described above in the + * H5C_flash_incr__add_space section of the discussion of the + * flash_incr_mode section. + * @param flash_threshold: Double containing the factor by which current max cache + * size is multiplied to obtain the size threshold for the add_space flash + * increment algorithm. + * @param decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose + * value indicates how we determine whether the cache size should be + * decreased. + * @param upper_hr_threshold: Upper hit rate threshold. The use of this field + * varies according to the current decr_mode. + * @param decrement: This field is only used when the decr_mode is + * H5C_decr__threshold. + * @param apply_max_decrement: Boolean flag used to determine whether decrements + * in cache size are to be limited by the max_decrement field. + * @param max_decrement: Maximum number of bytes by which the cache size can be + * decreased in a single re-size. + * @param epochs_before_eviction: Integer field used in H5C_decr__age_out and + * H5C_decr__age_out_with_threshold decrement modes. + * @param apply_empty_reserve: Boolean field controlling whether the empty_reserve + * field is to be used in computing the new cache size when the + * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold. + * @param empty_reserve: To avoid a constant racheting down of cache size by small + * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold + * modes. + * @param dirty_bytes_threshold: Threshold of dirty byte creation used to + * synchronize updates between caches. + * @param metadata_write_strategy: Integer field containing a code indicating the + * desired metadata write strategy. + */ public H5AC_cache_config_t (int version, boolean rpt_fcn_enabled, boolean open_trace_file, boolean close_trace_file, String trace_file_name, boolean evictions_enabled, boolean set_initial_size, long initial_size, double min_clean_fraction, long max_size, diff --git a/java/src/hdf/hdf5lib/structs/H5A_info_t.java b/java/src/hdf/hdf5lib/structs/H5A_info_t.java index 334ac24..f2c10f0 100644 --- a/java/src/hdf/hdf5lib/structs/H5A_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5A_info_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,13 +14,20 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for Attribute (For H5Aget_info/H5Aget_info_by_idx/H5Aget_info_by_name) +/** + * Information struct for Attribute (For H5Aget_info/H5Aget_info_by_idx/H5Aget_info_by_name) + * + */ public class H5A_info_t implements Serializable{ private static final long serialVersionUID = 2791443594041667613L; - public boolean corder_valid; // Indicate if creation order is valid - public long corder; // Creation order of attribute - public int cset; // Character set of attribute name - public long data_size; // Size of raw data + /** Indicate if creation order is valid */ + public boolean corder_valid; + /** Creation order of attribute */ + public long corder; + /** Character set of attribute name */ + public int cset; + /** Size of raw data */ + public long data_size; H5A_info_t(boolean corder_valid, long corder, int cset, long data_size) { this.corder_valid = corder_valid; diff --git a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java index f0a0158..5981fc7 100644 --- a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,17 +14,26 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for Attribute (For H5Ewalk) +/** + * Information struct for Attribute (For H5Ewalk) + * + */ public class H5E_error2_t implements Serializable{ private static final long serialVersionUID = 279144359041667613L; - - public long cls_id; //class ID - public long maj_num; //major error ID - public long min_num; //minor error number - public int line; //line in file where error occurs - public String func_name; //function in which error occurred - public String file_name; //file in which error occurred - public String desc; //optional supplied description + /** class ID */ + public long cls_id; + /** major error ID */ + public long maj_num; + /** minor error number */ + public long min_num; + /** line in file where error occurs */ + public int line; + /** function in which error occurred */ + public String func_name; + /** file in which error occurred */ + public String file_name; + /** optional supplied description */ + public String desc; H5E_error2_t(long cls_id, long maj_num, long min_num, int line, String func_name, String file_name, String desc) { this.cls_id = cls_id; diff --git a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java index 9fcff2e..5da4abd 100644 --- a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java +++ b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java @@ -16,7 +16,7 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -/* +/** * Java representation of the HDFS VFD file access property list (fapl) * structure. * @@ -26,15 +26,31 @@ import java.io.Serializable; public class H5FD_hdfs_fapl_t implements Serializable { private static final long serialVersionUID = 2072473407027648309L; + /** Version number of the H5FD_hdfs_fapl_t structure. */ private int version; + /** Name of "Name Node" to access as the HDFS server. */ private String namenode_name; + /** Port number to use to connect with Name Node. */ private int namenode_port; + /** Username to use when accessing file. */ private String user_name; + /** Path to the location of the Kerberos authentication cache. */ private String kerberos_ticket_cache; + /** Size (in bytes) of the file read stream buffer. */ private int stream_buffer_size; - /* + /** * Create a fapl_t structure with the specified components. + * @param namenode_name + * Name of "Name Node" to access as the HDFS server. + * @param namenode_port + * Port number to use to connect with Name Node. + * @param user_name + * Username to use when accessing file. + * @param kerberos_ticket_cache + * Path to the location of the Kerberos authentication cache. + * @param stream_buffer_size + * Size (in bytes) of the file read stream buffer. */ public H5FD_hdfs_fapl_t( String namenode_name, diff --git a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java index a899e10..39f5424 100644 --- a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java +++ b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java @@ -16,7 +16,7 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -/* +/** * Java representation of the ROS3 VFD file access property list (fapl) * structure. * @@ -46,10 +46,15 @@ import java.io.Serializable; public class H5FD_ros3_fapl_t implements Serializable { private static final long serialVersionUID = 8985533001471224030L; + /** Version number of the H5FD_ros3_fapl_t structure */ private int version; + /** Flag TRUE or FALSE whether or not requests are to be authenticated with the AWS4 algorithm. */ private boolean authenticate; + /** region "aws region" for authenticating request */ private String aws_region; + /** id "secret id" or "access id" for authenticating request */ private String secret_id; + /** key "secret key" or "access key" for authenticating request */ private String secret_key; /** diff --git a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java index 6f5f595..f951bb4 100644 --- a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,19 +14,43 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for object (for H5Fget_info) +/** + * Information struct for object (for H5Fget_info) + * + */ public class H5F_info2_t implements Serializable{ private static final long serialVersionUID = 4691681162544054518L; - public int super_version; // Superblock version # - public long super_size; // Superblock size - public long super_ext_size; // Superblock extension size - public int free_version; // Version # of file free space management - public long free_meta_size; // Free space manager metadata size - public long free_tot_space; // Amount of free space in the file - public int sohm_version; // Version # of shared object header info - public long sohm_hdr_size; // Shared object header message header size - public H5_ih_info_t sohm_msgs_info; // Shared object header message index & heap size + /** Superblock version number */ + public int super_version; + /** Superblock size */ + public long super_size; + /** Superblock extension size */ + public long super_ext_size; + /** Version number of file free space management */ + public int free_version; + /** Free space manager metadata size */ + public long free_meta_size; + /** Amount of free space in the file */ + public long free_tot_space; + /** Version number of shared object header info */ + public int sohm_version; + /** Shared object header message header size */ + public long sohm_hdr_size; + /** Shared object header message index and heap size */ + public H5_ih_info_t sohm_msgs_info; + /** + * Constructor fot current "global" information about file + * @param super_version: Superblock version number + * @param super_size: Superblock size + * @param super_ext_size: Superblock extension size + * @param free_version: Version number of file free space management + * @param free_meta_size: Free space manager metadata size + * @param free_tot_space: Amount of free space in the file + * @param sohm_version: Version number of shared object header info + * @param sohm_hdr_size: Shared object header message header size + * @param sohm_msgs_info: Shared object header message index and heap size + */ public H5F_info2_t (int super_version, long super_size, long super_ext_size, int free_version, long free_meta_size, long free_tot_space, int sohm_version, long sohm_hdr_size, H5_ih_info_t sohm_msgs_info) diff --git a/java/src/hdf/hdf5lib/structs/H5G_info_t.java b/java/src/hdf/hdf5lib/structs/H5G_info_t.java index e9f0aac..e79f859 100644 --- a/java/src/hdf/hdf5lib/structs/H5G_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5G_info_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,11 +14,18 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) +/** + * Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) + * + */ public class H5G_info_t implements Serializable{ private static final long serialVersionUID = -3746463015312132912L; - public int storage_type; // Type of storage for links in group - public long nlinks; // Number of links in group - public long max_corder; // Current max. creation order value for group - public boolean mounted; // Whether group has a file mounted on it + /** Type of storage for links in group */ + public int storage_type; + /** Number of links in group */ + public long nlinks; + /** Current max. creation order value for group */ + public long max_corder; + /** Whether group has a file mounted on it */ + public boolean mounted; } diff --git a/java/src/hdf/hdf5lib/structs/H5L_info_t.java b/java/src/hdf/hdf5lib/structs/H5L_info_t.java index 4a1545b..a3011c0 100644 --- a/java/src/hdf/hdf5lib/structs/H5L_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5L_info_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -17,17 +16,26 @@ import java.io.Serializable; import hdf.hdf5lib.HDF5Constants; -// Information struct for link (for H5Lget_info/H5Lget_info_by_idx) +/** + * Information struct for link (for H5Lget_info/H5Lget_info_by_idx) + * + */ public class H5L_info_t implements Serializable { private static final long serialVersionUID = -4754320605310155033L; + /** Type of link */ public int type; + /** Indicate if creation order is valid */ public boolean corder_valid; + /** Creation order */ public long corder; + /** Character set of link name */ public int cset; + /** Character set of link name */ public H5O_token_t token; + /** Size of a soft link or user-defined link value */ public long val_size; - // Constructor for using object token portion of C union + /** Constructor for using object token portion of C union */ H5L_info_t (int type, boolean corder_valid, long corder, int cset, H5O_token_t token) { @@ -39,7 +47,7 @@ public class H5L_info_t implements Serializable { this.val_size = -1; } - // Constructor for using val_size portion of C union + /** Constructor for using val_size portion of C union */ H5L_info_t (int type, boolean corder_valid, long corder, int cset, long val_size) { diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java index 596337d..2475dd9 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,19 +14,32 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -// Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) +/** + * Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) + * + */ public class H5O_hdr_info_t implements Serializable { private static final long serialVersionUID = 7883826382952577189L; - public int version; /* Version number of header format in file */ - public int nmesgs; /* Number of object header messages */ - public int nchunks; /* Number of object header chunks */ - public int flags; /* Object header status flags */ - public long space_total; /* Total space for storing object header in file */ - public long space_meta; /* Space within header for object header metadata information */ - public long space_mesg; /* Space within header for actual message information */ - public long space_free; /* Free space within object header */ - public long mesg_present; /* Flags to indicate presence of message type in header */ - public long mesg_shared; /* Flags to indicate message type is shared in header */ + /** Version number of header format in file */ + public int version; + /** Number of object header messages */ + public int nmesgs; + /** Number of object header chunks */ + public int nchunks; + /** Object header status flags */ + public int flags; + /** Total space for storing object header in file */ + public long space_total; + /** Space within header for object header metadata information */ + public long space_meta; + /** Space within header for actual message information */ + public long space_mesg; + /** Free space within object header */ + public long space_free; + /** Flags to indicate presence of message type in header */ + public long mesg_present; + /** Flags to indicate message type is shared in header */ + public long mesg_shared; H5O_hdr_info_t (int version, int nmesgs, int nchunks, int flags, long space_total, long space_meta, long space_mesg, long space_free, @@ -56,25 +68,25 @@ public class H5O_hdr_info_t implements Serializable { H5O_hdr_info_t info = (H5O_hdr_info_t) o; if (this.version != info.version) - return false; + return false; if (this.nmesgs != info.nmesgs) - return false; + return false; if (this.nchunks != info.nchunks) - return false; + return false; if (this.flags != info.flags) - return false; + return false; if (this.space_total != info.space_total) - return false; + return false; if (this.space_meta != info.space_meta) - return false; + return false; if (this.space_mesg != info.space_mesg) - return false; + return false; if (this.space_free != info.space_free) - return false; + return false; if (this.mesg_present != info.mesg_present) - return false; + return false; if (this.mesg_shared != info.mesg_shared) - return false; + return false; return true; } diff --git a/java/src/hdf/hdf5lib/structs/H5O_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_info_t.java index 7bf1336..d2208d2 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_info_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,19 +14,43 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -// Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) +/** + * Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) + * + */ public class H5O_info_t implements Serializable { private static final long serialVersionUID = 4691681163544054518L; - public long fileno; /* File number that object is located in */ - public H5O_token_t token; /* Object token in file */ - public int type; /* Basic object type (group, dataset, etc.) */ - public int rc; /* Reference count of object */ - public long atime; /* Access time */ - public long mtime; /* Modification time */ - public long ctime; /* Change time */ - public long btime; /* Birth time */ - public long num_attrs; /* # of attributes attached to object */ + /** File number that object is located in */ + public long fileno; + /** Object token in file */ + public H5O_token_t token; + /** Basic object type (group, dataset, etc.) */ + public int type; + /** Reference count of object */ + public int rc; + /** Access time */ + public long atime; + /** Modification time */ + public long mtime; + /** Change time */ + public long ctime; + /** Birth time */ + public long btime; + /** Number of attributes attached to object */ + public long num_attrs; + /** Constructor for data model information struct for objects + * + * @param fileno: File number that object is located in + * @param token: Object token in file + * @param type: Basic object type + * @param rc: Reference count of object + * @param atime: Access time + * @param mtime: Modification time + * @param ctime: Change time + * @param btime: Birth time + * @param num_attrs: Number of attributes attached to object + */ public H5O_info_t (long fileno, H5O_token_t token, int type, int rc, long atime, long mtime, long ctime, long btime, long num_attrs) { diff --git a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java index f859ca4..70e5231 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,15 +14,20 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -// Information struct for native HDF5 object info, such as object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx). +/** + * Information struct for native HDF5 object info, such as object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx). + * + */ public class H5O_native_info_t implements Serializable { private static final long serialVersionUID = 7883826382952577189L; - - public H5O_hdr_info_t hdr_info; /* Object header information */ + /** Object header information */ + public H5O_hdr_info_t hdr_info; /* Extra metadata storage for obj & attributes */ - public H5_ih_info_t obj_info; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ - public H5_ih_info_t attr_info; /* v2 B-tree & heap for attributes */ + /** v1/v2 B-tree and local/fractal heap for groups, B-tree for chunked datasets */ + public H5_ih_info_t obj_info; + /** v2 B-tree and heap for attributes */ + public H5_ih_info_t attr_info; H5O_native_info_t (H5O_hdr_info_t oheader_info, H5_ih_info_t obj_info, H5_ih_info_t attr_info) { @@ -45,7 +49,7 @@ public class H5O_native_info_t implements Serializable { if (!this.hdr_info.equals(info.hdr_info) || !this.obj_info.equals(info.obj_info) || !this.attr_info.equals(info.attr_info)) - return false; + return false; return true; } diff --git a/java/src/hdf/hdf5lib/structs/H5O_token_t.java b/java/src/hdf/hdf5lib/structs/H5O_token_t.java index 24612bb..f0bb978 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_token_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_token_t.java @@ -17,15 +17,28 @@ import java.util.Arrays; import hdf.hdf5lib.HDF5Constants; -// Object token, which is a unique and permanent identifier, for an HDF5 object within a container. +/** + * Object token, which is a unique and permanent identifier, for an HDF5 object within a container. + * + */ public class H5O_token_t implements Serializable { private static final long serialVersionUID = -4754320605310155032L; + /** + * Tokens are unique and permanent identifiers that are + * used to reference HDF5 objects in a container. + * Use basic byte array to store the dat + */ public byte[] data; H5O_token_t (byte[] data) { this.data = data; } + /** + * Check if token data is undefined + * + * @return true if token data is undefined + */ public boolean isUndefined() { return this.equals(HDF5Constants.H5O_TOKEN_UNDEF); } diff --git a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java index db89c9a..0c6111b 100644 --- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -15,10 +14,15 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) +/** + * Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) + * + */ public class H5_ih_info_t implements Serializable { private static final long serialVersionUID = -142238015615462707L; - public long index_size; /* btree and/or list */ + /** btree and/or list size of index */ + public long index_size; + /** btree and/or list size of hp */ public long heap_size; H5_ih_info_t (long index_size, long heap_size) @@ -38,9 +42,9 @@ public class H5_ih_info_t implements Serializable { H5_ih_info_t info = (H5_ih_info_t) o; if (this.index_size != info.index_size) - return false; + return false; if (this.heap_size != info.heap_size) - return false; + return false; return true; } diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index d137747..ab306ef 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -45,6 +45,7 @@ set (HDF5_JAVA_JNI_CHDRS ${HDF5_JAVA_JNI_SOURCE_DIR}/h5fImp.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5gImp.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5iImp.h + ${HDF5_JAVA_JNI_SOURCE_DIR}/h5Imp.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5jni.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5lImp.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5oImp.h diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index 6e08023..3ccb6ef 100644 --- a/java/src/jni/exceptionImp.c +++ b/java/src/jni/exceptionImp.c @@ -262,12 +262,25 @@ done: * exception. */ jboolean -h5outOfMemory(JNIEnv *env, const char *functName) +h5outOfMemory(JNIEnv *env, const char *message) { - return H5JNIErrorClass(env, functName, "java/lang/OutOfMemoryError"); + return H5JNIErrorClass(env, message, "java/lang/OutOfMemoryError"); } /* end h5outOfMemory() */ /* + * Create and throw an 'AssertionError' + * + * Note: This routine never returns from the 'throw', + * and the Java native method immediately raises the + * exception. + */ +jboolean +h5assertion(JNIEnv *env, const char *message) +{ + return H5JNIErrorClass(env, message, "java/lang/AssertionError"); +} /* end h5assertion() */ + +/* * A fatal error in a JNI call * Create and throw an 'InternalError' * @@ -276,9 +289,9 @@ h5outOfMemory(JNIEnv *env, const char *functName) * exception. */ jboolean -h5JNIFatalError(JNIEnv *env, const char *functName) +h5JNIFatalError(JNIEnv *env, const char *message) { - return H5JNIErrorClass(env, functName, "java/lang/InternalError"); + return H5JNIErrorClass(env, message, "java/lang/InternalError"); } /* end h5JNIFatalError() */ /* @@ -290,9 +303,9 @@ h5JNIFatalError(JNIEnv *env, const char *functName) * exception. */ jboolean -h5nullArgument(JNIEnv *env, const char *functName) +h5nullArgument(JNIEnv *env, const char *message) { - return H5JNIErrorClass(env, functName, "java/lang/NullPointerException"); + return H5JNIErrorClass(env, message, "java/lang/NullPointerException"); } /* end h5nullArgument() */ /* @@ -304,9 +317,9 @@ h5nullArgument(JNIEnv *env, const char *functName) * exception. */ jboolean -h5badArgument(JNIEnv *env, const char *functName) +h5badArgument(JNIEnv *env, const char *message) { - return H5JNIErrorClass(env, functName, "java/lang/IllegalArgumentException"); + return H5JNIErrorClass(env, message, "java/lang/IllegalArgumentException"); } /* end h5badArgument() */ /* @@ -318,9 +331,9 @@ h5badArgument(JNIEnv *env, const char *functName) * exception. */ jboolean -h5unimplemented(JNIEnv *env, const char *functName) +h5unimplemented(JNIEnv *env, const char *message) { - return H5JNIErrorClass(env, functName, "java/lang/UnsupportedOperationException"); + return H5JNIErrorClass(env, message, "java/lang/UnsupportedOperationException"); } /* end h5unimplemented() */ /* h5raiseException(). This routine is called to generate diff --git a/java/src/jni/exceptionImp.h b/java/src/jni/exceptionImp.h index 4b81605..38469df 100644 --- a/java/src/jni/exceptionImp.h +++ b/java/src/jni/exceptionImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_exception */ -#ifndef _Included_hdf_hdf5lib_H5_exception -#define _Included_hdf_hdf5lib_H5_exception +#ifndef Included_hdf_hdf5lib_H5_exception +#define Included_hdf_hdf5lib_H5_exception #ifdef __cplusplus extern "C" { @@ -68,4 +67,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMi } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_exception */ +#endif /* Included_hdf_hdf5lib_H5_exception */ diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 4b9a276..7354e95 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -355,6 +355,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1BADGROUP(JNIEnv *env, jclass cls) return H5E_BADGROUP; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1BADITER(JNIEnv *env, jclass cls) +{ + return H5E_BADITER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADMESG(JNIEnv *env, jclass cls) { return H5E_BADMESG; @@ -404,8 +409,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANAPPLY(JNIEnv *env, jclass cls) { return H5E_CANAPPLY; } -/*JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) { return H5E_CANTALLOC; }*/ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) +{ + return H5E_CANTALLOC; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTAPPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTAPPEND; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTATTACH(JNIEnv *env, jclass cls) +{ + return H5E_CANTATTACH; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLEAN(JNIEnv *env, jclass cls) +{ + return H5E_CANTCLEAN; +} JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLIP(JNIEnv *env, jclass cls) { @@ -417,6 +440,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEFILE(JNIEnv *env, jclass cls) return H5E_CANTCLOSEFILE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEOBJ(JNIEnv *env, jclass cls) +{ + return H5E_CANTCLOSEOBJ; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOMPARE(JNIEnv *env, jclass cls) +{ + return H5E_CANTCOMPARE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOMPUTE(JNIEnv *env, jclass cls) +{ + return H5E_CANTCOMPUTE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCONVERT(JNIEnv *env, jclass cls) { return H5E_CANTCONVERT; @@ -427,6 +465,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOPY(JNIEnv *env, jclass cls) return H5E_CANTCOPY; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCORK(JNIEnv *env, jclass cls) +{ + return H5E_CANTCORK; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOUNT(JNIEnv *env, jclass cls) { return H5E_CANTCOUNT; @@ -457,11 +500,36 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDELETEFILE(JNIEnv *env, jclass cls) return H5E_CANTDELETEFILE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDEPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTDEPEND; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDIRTY(JNIEnv *env, jclass cls) +{ + return H5E_CANTDIRTY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFILTER(JNIEnv *env, jclass cls) +{ + return H5E_CANTFILTER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTENCODE(JNIEnv *env, jclass cls) { return H5E_CANTENCODE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTEXPUNGE(JNIEnv *env, jclass cls) +{ + return H5E_CANTEXPUNGE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTEXTEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTEXTEND; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFLUSH(JNIEnv *env, jclass cls) { return H5E_CANTFLUSH; @@ -472,11 +540,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFREE(JNIEnv *env, jclass cls) return H5E_CANTFREE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGATHER(JNIEnv *env, jclass cls) +{ + return H5E_CANTGATHER; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGC(JNIEnv *env, jclass cls) +{ + return H5E_CANTGC; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGET(JNIEnv *env, jclass cls) { return H5E_CANTGET; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGETSIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTGETSIZE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINC(JNIEnv *env, jclass cls) { return H5E_CANTINC; @@ -487,6 +570,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINIT(JNIEnv *env, jclass cls) return H5E_CANTINIT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINS(JNIEnv *env, jclass cls) +{ + return H5E_CANTINS; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINSERT(JNIEnv *env, jclass cls) { return H5E_CANTINSERT; @@ -507,11 +595,56 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCK(JNIEnv *env, jclass cls) return H5E_CANTLOCK; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCKFILE(JNIEnv *env, jclass cls) +{ + return H5E_CANTLOCKFILE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKCLEAN(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKCLEAN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKDIRTY(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKDIRTY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKSERIALIZED(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKSERIALIZED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKUNSERIALIZED(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKUNSERIALIZED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMERGE(JNIEnv *env, jclass cls) +{ + return H5E_CANTMERGE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMODIFY(JNIEnv *env, jclass cls) +{ + return H5E_CANTMODIFY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMOVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTMOVE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNEXT(JNIEnv *env, jclass cls) { return H5E_CANTNEXT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNOTIFY(JNIEnv *env, jclass cls) +{ + return H5E_CANTNOTIFY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENFILE(JNIEnv *env, jclass cls) { return H5E_CANTOPENFILE; @@ -521,8 +654,36 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENOBJ(JNIEnv *env, jclass cls) { return H5E_CANTOPENOBJ; } -/*JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) { return H5E_CANTRECV; }*/ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPERATE(JNIEnv *env, jclass cls) +{ + return H5E_CANTOPERATE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPACK(JNIEnv *env, jclass cls) +{ + return H5E_CANTPACK; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPIN(JNIEnv *env, jclass cls) +{ + return H5E_CANTPIN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPROTECT(JNIEnv *env, jclass cls) +{ + return H5E_CANTPROTECT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) +{ + return H5E_CANTRECV; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREDISTRIBUTE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREDISTRIBUTE; +} JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREGISTER(JNIEnv *env, jclass cls) { @@ -534,6 +695,41 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRELEASE(JNIEnv *env, jclass cls) return H5E_CANTRELEASE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREMOVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREMOVE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRENAME(JNIEnv *env, jclass cls) +{ + return H5E_CANTRENAME; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESET(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESET; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESTORE(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESTORE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREVIVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREVIVE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSHRINK(JNIEnv *env, jclass cls) +{ + return H5E_CANTSHRINK; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSELECT(JNIEnv *env, jclass cls) { return H5E_CANTSELECT; @@ -544,16 +740,71 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSET(JNIEnv *env, jclass cls) return H5E_CANTSET; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSERIALIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTSERIALIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSORT(JNIEnv *env, jclass cls) +{ + return H5E_CANTSORT; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSPLIT(JNIEnv *env, jclass cls) { return H5E_CANTSPLIT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSWAP(JNIEnv *env, jclass cls) +{ + return H5E_CANTSWAP; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTTAG(JNIEnv *env, jclass cls) +{ + return H5E_CANTTAG; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNCORK(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNCORK; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNDEPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNDEPEND; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCK(JNIEnv *env, jclass cls) { return H5E_CANTUNLOCK; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCKFILE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNLOCKFILE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNPIN(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNPIN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNPROTECT(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNPROTECT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNSERIALIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNSERIALIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUPDATE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUPDATE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CLOSEERROR(JNIEnv *env, jclass cls) { return H5E_CLOSEERROR; @@ -564,6 +815,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1COMPLEN(JNIEnv *env, jclass cls) return H5E_COMPLEN; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CONTEXT(JNIEnv *env, jclass cls) +{ + return H5E_CONTEXT; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATASET(JNIEnv *env, jclass cls) { return H5E_DATASET; @@ -589,16 +845,31 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1DUPCLASS(JNIEnv *env, jclass cls) return H5E_DUPCLASS; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1EARRAY(JNIEnv *env, jclass cls) +{ + return H5E_EARRAY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EFL(JNIEnv *env, jclass cls) { return H5E_EFL; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1ERROR(JNIEnv *env, jclass cls) +{ + return H5E_ERROR; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EXISTS(JNIEnv *env, jclass cls) { return H5E_EXISTS; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1FARRAY(JNIEnv *env, jclass cls) +{ + return H5E_FARRAY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FCNTL(JNIEnv *env, jclass cls) { return H5E_FCNTL; @@ -619,6 +890,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1FILEOPEN(JNIEnv *env, jclass cls) return H5E_FILEOPEN; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1FSPACE(JNIEnv *env, jclass cls) +{ + return H5E_FSPACE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FUNC(JNIEnv *env, jclass cls) { return H5E_FUNC; @@ -629,6 +905,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1HEAP(JNIEnv *env, jclass cls) return H5E_HEAP; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1INCONSISTENTSTATE(JNIEnv *env, jclass cls) +{ + return H5E_INCONSISTENTSTATE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1INTERNAL(JNIEnv *env, jclass cls) { return H5E_INTERNAL; @@ -648,11 +929,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1LINKCOUNT(JNIEnv *env, jclass cls) { return H5E_LINKCOUNT; } +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1LOGGING(JNIEnv *env, jclass cls) +{ + return H5E_LOGGING; +} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MAJOR(JNIEnv *env, jclass cls) { return H5E_MAJOR; } +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1MAP(JNIEnv *env, jclass cls) +{ + return H5E_MAP; +} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MINOR(JNIEnv *env, jclass cls) { @@ -674,6 +965,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1MPIERRSTR(JNIEnv *env, jclass cls) return H5E_MPIERRSTR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NLINKS(JNIEnv *env, jclass cls) +{ + return H5E_NLINKS; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NO_1INDEPENDENT(JNIEnv *env, jclass cls) +{ + return H5E_NO_INDEPENDENT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NOENCODER(JNIEnv *env, jclass cls) +{ + return H5E_NOENCODER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOFILTER(JNIEnv *env, jclass cls) { return H5E_NOFILTER; @@ -714,16 +1020,41 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTHDF5(JNIEnv *env, jclass cls) return H5E_NOTHDF5; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTREGISTERED(JNIEnv *env, jclass cls) +{ + return H5E_NOTREGISTERED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1OBJOPEN(JNIEnv *env, jclass cls) +{ + return H5E_OBJOPEN; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OHDR(JNIEnv *env, jclass cls) { return H5E_OHDR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1OPENERROR(JNIEnv *env, jclass cls) +{ + return H5E_OPENERROR; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OVERFLOW(JNIEnv *env, jclass cls) { return H5E_OVERFLOW; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PAGEBUF(JNIEnv *env, jclass cls) +{ + return H5E_PAGEBUF; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PATH(JNIEnv *env, jclass cls) +{ + return H5E_PATH; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PLINE(JNIEnv *env, jclass cls) { return H5E_PLINE; @@ -734,6 +1065,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1PLIST(JNIEnv *env, jclass cls) return H5E_PLIST; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PLUGIN(JNIEnv *env, jclass cls) +{ + return H5E_PLUGIN; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PROTECT(JNIEnv *env, jclass cls) { return H5E_PROTECT; @@ -764,11 +1100,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1SEEKERROR(JNIEnv *env, jclass cls) return H5E_SEEKERROR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SETDISALLOWED(JNIEnv *env, jclass cls) +{ + return H5E_SETDISALLOWED; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SETLOCAL(JNIEnv *env, jclass cls) { return H5E_SETLOCAL; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SLIST(JNIEnv *env, jclass cls) +{ + return H5E_SLIST; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SOHM(JNIEnv *env, jclass cls) +{ + return H5E_SOHM; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1STORAGE(JNIEnv *env, jclass cls) { return H5E_STORAGE; @@ -779,6 +1130,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1SYM(JNIEnv *env, jclass cls) return H5E_SYM; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SYSERRSTR(JNIEnv *env, jclass cls) +{ + return H5E_SYSERRSTR; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SYSTEM(JNIEnv *env, jclass cls) +{ + return H5E_SYSTEM; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1TRAVERSE(JNIEnv *env, jclass cls) +{ + return H5E_TRAVERSE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1TRUNCATED(JNIEnv *env, jclass cls) { return H5E_TRUNCATED; @@ -844,11 +1210,6 @@ Java_hdf_hdf5lib_HDF5Constants_H5ES_1STATUS_1FAIL(JNIEnv *env, jclass cls) { return H5ES_STATUS_FAIL; } -JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5ES_1STATUS_1CANCELED(JNIEnv *env, jclass cls) -{ - return H5ES_STATUS_CANCELED; -} /* Java does not have unsigned native types */ H5_GCC_DIAG_OFF("sign-conversion") diff --git a/java/src/jni/h5Imp.h b/java/src/jni/h5Imp.h index 226a2fe..8ab7662 100644 --- a/java/src/jni/h5Imp.h +++ b/java/src/jni/h5Imp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5 */ -#ifndef _Included_hdf_hdf5lib_H5_H5 -#define _Included_hdf_hdf5lib_H5_H5 +#ifndef Included_hdf_hdf5lib_H5_H5 +#define Included_hdf_hdf5lib_H5_H5 #ifdef __cplusplus extern "C" { @@ -83,4 +82,4 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5is_1library_1threadsafe(JNIEnv } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5 */ +#endif /* Included_hdf_hdf5lib_H5_H5 */ diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index c365144..6bf86d0 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -1133,7 +1133,7 @@ H5AreadVL_asstr(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf) for (i = 0; i < (size_t)n; i++) { h5str.s[0] = '\0'; - if (!h5str_sprintf(ENVONLY, &h5str, aid, tid, &(((char *)readBuf)[i * typeSize]), typeSize, 0)) + if (!h5str_sprintf(ENVONLY, &h5str, aid, tid, &(((char *)readBuf)[i * typeSize]), 0)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s))) @@ -1425,7 +1425,7 @@ Java_hdf_hdf5lib_H5_H5Aread_1reg_1ref(JNIEnv *env, jclass clss, jlong attr_id, j for (i = 0; i < n; i++) { h5str.s[0] = '\0'; - if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)attr_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0, 0)) + if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)attr_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s))) diff --git a/java/src/jni/h5aImp.h b/java/src/jni/h5aImp.h index 7615946..aee0e40 100644 --- a/java/src/jni/h5aImp.h +++ b/java/src/jni/h5aImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5A */ -#ifndef _Included_hdf_hdf5lib_H5_H5A -#define _Included_hdf_hdf5lib_H5_H5A +#ifndef Included_hdf_hdf5lib_H5_H5A +#define Included_hdf_hdf5lib_H5_H5A #ifdef __cplusplus extern "C" { @@ -376,4 +375,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Aiterate_1by_1name(JNIEnv *, jclass } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5A */ +#endif /* Included_hdf_hdf5lib_H5_H5A */ diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index f8f2325..73b252a 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -1290,7 +1290,7 @@ H5DreadVL_asstr(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid for (i = 0; i < (size_t)n; i++) { h5str.s[0] = '\0'; - if (!h5str_sprintf(ENVONLY, &h5str, did, tid, &(((char *)readBuf)[i * typeSize]), typeSize, 0)) + if (!h5str_sprintf(ENVONLY, &h5str, did, tid, &(((char *)readBuf)[i * typeSize]), 0)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s))) @@ -1669,8 +1669,7 @@ Java_hdf_hdf5lib_H5_H5Dread_1reg_1ref(JNIEnv *env, jclass clss, jlong dataset_id for (i = 0; i < n; i++) { h5str.s[0] = '\0'; - if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)dataset_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0, - 0)) + if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)dataset_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s))) diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h index c1ed065..e339dad 100644 --- a/java/src/jni/h5dImp.h +++ b/java/src/jni/h5dImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5D */ -#ifndef _Included_hdf_hdf5lib_H5_H5D -#define _Included_hdf_hdf5lib_H5_H5D +#ifndef Included_hdf_hdf5lib_H5_H5D +#define Included_hdf_hdf5lib_H5_H5D #ifdef __cplusplus extern "C" { @@ -323,4 +322,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Drefresh(JNIEnv *, jclass, jlong); } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5D */ +#endif /* Included_hdf_hdf5lib_H5_H5D */ diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c index 7d7a2cf..5bdeae8 100644 --- a/java/src/jni/h5eImp.c +++ b/java/src/jni/h5eImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5eImp.h b/java/src/jni/h5eImp.h index d849b92..95e43fa 100644 --- a/java/src/jni/h5eImp.h +++ b/java/src/jni/h5eImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5E */ -#ifndef _Included_hdf_hdf5lib_H5_H5E -#define _Included_hdf_hdf5lib_H5_H5E +#ifndef Included_hdf_hdf5lib_H5_H5E +#define Included_hdf_hdf5lib_H5_H5E #ifdef __cplusplus extern "C" { @@ -145,4 +144,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Ewalk2(JNIEnv *, jclass, jlong, jlo } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5E */ +#endif /* Included_hdf_hdf5lib_H5_H5E */ diff --git a/java/src/jni/h5fImp.h b/java/src/jni/h5fImp.h index ed90ee9..bf2f199 100644 --- a/java/src/jni/h5fImp.h +++ b/java/src/jni/h5fImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5F */ -#ifndef _Included_hdf_hdf5lib_H5_H5F -#define _Included_hdf_hdf5lib_H5_H5F +#ifndef Included_hdf_hdf5lib_H5_H5F +#define Included_hdf_hdf5lib_H5_H5F #ifdef __cplusplus extern "C" { @@ -237,4 +236,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Fset_1libver_1bounds(JNIEnv *, jcla } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5F */ +#endif /* Included_hdf_hdf5lib_H5_H5F */ diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h index 393d5d8..b7130ed 100644 --- a/java/src/jni/h5gImp.h +++ b/java/src/jni/h5gImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5G */ -#ifndef _Included_hdf_hdf5lib_H5_H5G -#define _Included_hdf_hdf5lib_H5_H5G +#ifndef Included_hdf_hdf5lib_H5_H5G +#define Included_hdf_hdf5lib_H5_H5G #ifdef __cplusplus extern "C" { @@ -97,4 +96,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Grefresh(JNIEnv *, jclass, jlong); } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5G */ +#endif /* Included_hdf_hdf5lib_H5_H5G */ diff --git a/java/src/jni/h5iImp.h b/java/src/jni/h5iImp.h index eff5048..08d5fa1 100644 --- a/java/src/jni/h5iImp.h +++ b/java/src/jni/h5iImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5I */ -#ifndef _Included_hdf_hdf5lib_H5_H5I -#define _Included_hdf_hdf5lib_H5_H5I +#ifndef Included_hdf_hdf5lib_H5_H5I +#define Included_hdf_hdf5lib_H5_H5I #ifdef __cplusplus extern "C" { @@ -131,4 +130,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Idestroy_1type(JNIEnv *, jclass, ji } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5I */ +#endif /* Included_hdf_hdf5lib_H5_H5I */ diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h index fb6f22a..2c93846 100644 --- a/java/src/jni/h5jni.h +++ b/java/src/jni/h5jni.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -22,8 +21,8 @@ #include #include "H5private.h" -#ifndef _Included_h5jni -#define _Included_h5jni +#ifndef Included_h5jni +#define Included_h5jni #ifdef __cplusplus #define ENVPTR (env) @@ -267,9 +266,10 @@ extern jboolean h5JNIFatalError(JNIEnv *env, const char *); extern jboolean h5nullArgument(JNIEnv *env, const char *); extern jboolean h5badArgument(JNIEnv *env, const char *); extern jboolean h5outOfMemory(JNIEnv *env, const char *); +extern jboolean h5assertion(JNIEnv *env, const char *); +extern jboolean h5unimplemented(JNIEnv *env, const char *); extern jboolean h5libraryError(JNIEnv *env); extern jboolean h5raiseException(JNIEnv *env, const char *, const char *); -extern jboolean h5unimplemented(JNIEnv *env, const char *functName); /* * The following macros are to facilitate immediate cleanup+return @@ -305,21 +305,27 @@ extern jboolean h5unimplemented(JNIEnv *env, const char *functName); goto done; \ } while (0) -#define H5_LIBRARY_ERROR(env) \ +#define H5_ASSERTION_ERROR(env, message) \ do { \ - h5libraryError(env); \ + h5assertion(env, message); \ goto done; \ } while (0) -#define H5_RAISE_EXCEPTION(env, message, exception) \ +#define H5_UNIMPLEMENTED(env, message) \ do { \ - h5raiseException(env, message, exception); \ + h5unimplemented(env, message); \ goto done; \ } while (0) -#define H5_UNIMPLEMENTED(env, message) \ +#define H5_LIBRARY_ERROR(env) \ do { \ - h5unimplemented(env, message); \ + h5libraryError(env); \ + goto done; \ + } while (0) + +#define H5_RAISE_EXCEPTION(env, message, exception) \ + do { \ + h5raiseException(env, message, exception); \ goto done; \ } while (0) @@ -338,4 +344,4 @@ extern jobject create_H5O_token_t(JNIEnv *env, const H5O_token_t *token, hbool_t } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_h5jni */ +#endif /* Included_h5jni */ diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index fabd920..43db4e9 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5lImp.h b/java/src/jni/h5lImp.h index 2e949fe..85aff03 100644 --- a/java/src/jni/h5lImp.h +++ b/java/src/jni/h5lImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5_H5L */ -#ifndef _Included_hdf_hdf5lib_H5_H5L -#define _Included_hdf_hdf5lib_H5_H5L +#ifndef Included_hdf_hdf5lib_H5_H5L +#define Included_hdf_hdf5lib_H5_H5L #ifdef __cplusplus extern "C" { @@ -171,4 +170,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Lunregister(JNIEnv *, jclass, jint) } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5L */ +#endif /* Included_hdf_hdf5lib_H5_H5L */ diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index e06ad79..3037bc6 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h index e6675be..a7d7f31 100644 --- a/java/src/jni/h5oImp.h +++ b/java/src/jni/h5oImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5_H5O */ -#ifndef _Included_hdf_hdf5lib_H5_H5O -#define _Included_hdf_hdf5lib_H5_H5O +#ifndef Included_hdf_hdf5lib_H5_H5O +#define Included_hdf_hdf5lib_H5_H5O #ifdef __cplusplus extern "C" { @@ -218,4 +217,4 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Oare_1mdc_1flushes_1disabled(JN } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5O */ +#endif /* Included_hdf_hdf5lib_H5_H5O */ diff --git a/java/src/jni/h5pACPLImp.c b/java/src/jni/h5pACPLImp.c index 611016f..6290e0e 100644 --- a/java/src/jni/h5pACPLImp.c +++ b/java/src/jni/h5pACPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pACPLImp.h b/java/src/jni/h5pACPLImp.h index 21c0cc6..15fcf33 100644 --- a/java/src/jni/h5pACPLImp.h +++ b/java/src/jni/h5pACPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PACPL -#define _Included_hdf_hdf5lib_H5_H5PACPL +#ifndef Included_hdf_hdf5lib_H5_H5PACPL +#define Included_hdf_hdf5lib_H5_H5PACPL #include @@ -24,4 +23,4 @@ extern "C" { } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PACPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PACPL */ diff --git a/java/src/jni/h5pDAPLImp.c b/java/src/jni/h5pDAPLImp.c index 430fc79..82802b9 100644 --- a/java/src/jni/h5pDAPLImp.c +++ b/java/src/jni/h5pDAPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pDAPLImp.h b/java/src/jni/h5pDAPLImp.h index a15e964..bf11fef 100644 --- a/java/src/jni/h5pDAPLImp.h +++ b/java/src/jni/h5pDAPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PDAPL -#define _Included_hdf_hdf5lib_H5_H5PDAPL +#ifndef Included_hdf_hdf5lib_H5_H5PDAPL +#define Included_hdf_hdf5lib_H5_H5PDAPL #include @@ -94,4 +93,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap(JNIEnv } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PDAPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PDAPL */ diff --git a/java/src/jni/h5pDCPLImp.c b/java/src/jni/h5pDCPLImp.c index 9e8b2b6..760a5a8 100644 --- a/java/src/jni/h5pDCPLImp.c +++ b/java/src/jni/h5pDCPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pDCPLImp.h b/java/src/jni/h5pDCPLImp.h index 6adcbe4..46d1cc3 100644 --- a/java/src/jni/h5pDCPLImp.h +++ b/java/src/jni/h5pDCPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PDCPL -#define _Included_hdf_hdf5lib_H5_H5PDCPL +#ifndef Included_hdf_hdf5lib_H5_H5PDCPL +#define Included_hdf_hdf5lib_H5_H5PDCPL #include @@ -321,4 +320,4 @@ JNIEXPORT jstring JNICALL Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix(JNIEnv *, } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PDCPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PDCPL */ diff --git a/java/src/jni/h5pDXPLImp.c b/java/src/jni/h5pDXPLImp.c index 8b930dc..c555d53 100644 --- a/java/src/jni/h5pDXPLImp.c +++ b/java/src/jni/h5pDXPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pDXPLImp.h b/java/src/jni/h5pDXPLImp.h index 8d2df68..21c40c4 100644 --- a/java/src/jni/h5pDXPLImp.h +++ b/java/src/jni/h5pDXPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PDXPL -#define _Included_hdf_hdf5lib_H5_H5PDXPL +#ifndef Included_hdf_hdf5lib_H5_H5PDXPL +#define Included_hdf_hdf5lib_H5_H5PDXPL #include @@ -182,4 +181,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1btree_1ratios(JNIEnv *, jclas } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PDXPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PDXPL */ diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c index 46adc30..ad85aae 100644 --- a/java/src/jni/h5pFAPLImp.c +++ b/java/src/jni/h5pFAPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -1364,6 +1363,76 @@ 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 */ diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h index 25b0eee..3c5988f 100644 --- a/java/src/jni/h5pFAPLImp.h +++ b/java/src/jni/h5pFAPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PFAPL -#define _Included_hdf_hdf5lib_H5_H5PFAPL +#ifndef Included_hdf_hdf5lib_H5_H5PFAPL +#define Included_hdf_hdf5lib_H5_H5PFAPL #include @@ -331,6 +330,32 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close(JNIEnv * /* * 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 */ @@ -451,4 +476,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1libver_1bounds(JNIEnv *, jcla } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PFAPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PFAPL */ diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c index fe12760..ded3248 100644 --- a/java/src/jni/h5pFCPLImp.c +++ b/java/src/jni/h5pFCPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pFCPLImp.h b/java/src/jni/h5pFCPLImp.h index 7799e49..94411d6 100644 --- a/java/src/jni/h5pFCPLImp.h +++ b/java/src/jni/h5pFCPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PFCPL -#define _Included_hdf_hdf5lib_H5_H5PFCPL +#ifndef Included_hdf_hdf5lib_H5_H5PFCPL +#define Included_hdf_hdf5lib_H5_H5PFCPL #include @@ -171,4 +170,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1phase_1change(J } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PFCPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PFCPL */ diff --git a/java/src/jni/h5pGAPLImp.c b/java/src/jni/h5pGAPLImp.c index c43609d..b92e180 100644 --- a/java/src/jni/h5pGAPLImp.c +++ b/java/src/jni/h5pGAPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pGAPLImp.h b/java/src/jni/h5pGAPLImp.h index db95f5d..9091ff8 100644 --- a/java/src/jni/h5pGAPLImp.h +++ b/java/src/jni/h5pGAPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PGAPL -#define _Included_hdf_hdf5lib_H5_H5PGAPL +#ifndef Included_hdf_hdf5lib_H5_H5PGAPL +#define Included_hdf_hdf5lib_H5_H5PGAPL #include @@ -24,4 +23,4 @@ extern "C" { } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PGAPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PGAPL */ diff --git a/java/src/jni/h5pGCPLImp.c b/java/src/jni/h5pGCPLImp.c index 46d102f..2ba140d 100644 --- a/java/src/jni/h5pGCPLImp.c +++ b/java/src/jni/h5pGCPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pGCPLImp.h b/java/src/jni/h5pGCPLImp.h index a1b8b28..5090c3a 100644 --- a/java/src/jni/h5pGCPLImp.h +++ b/java/src/jni/h5pGCPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PGCPL -#define _Included_hdf_hdf5lib_H5_H5PGCPL +#ifndef Included_hdf_hdf5lib_H5_H5PGCPL +#define Included_hdf_hdf5lib_H5_H5PGCPL #include @@ -80,4 +79,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1link_1phase_1change(JNIEnv *, } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PGCPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PGCPL */ diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h index 49d36a6..189e9d7 100644 --- a/java/src/jni/h5pImp.h +++ b/java/src/jni/h5pImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -13,8 +12,8 @@ /* Header for class hdf_hdf5lib_H5_H5_H5P */ -#ifndef _Included_hdf_hdf5lib_H5_H5P -#define _Included_hdf_hdf5lib_H5_H5P +#ifndef Included_hdf_hdf5lib_H5_H5P +#define Included_hdf_hdf5lib_H5_H5P #include @@ -211,4 +210,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5__1H5Pclose_1class(JNIEnv *, jclass, j } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5P */ +#endif /* Included_hdf_hdf5lib_H5_H5P */ diff --git a/java/src/jni/h5pLAPLImp.c b/java/src/jni/h5pLAPLImp.c index 8b5afa2..1db495c 100644 --- a/java/src/jni/h5pLAPLImp.c +++ b/java/src/jni/h5pLAPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pLAPLImp.h b/java/src/jni/h5pLAPLImp.h index 204901d..8ddc8d2 100644 --- a/java/src/jni/h5pLAPLImp.h +++ b/java/src/jni/h5pLAPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PLAPL -#define _Included_hdf_hdf5lib_H5_H5PLAPL +#ifndef Included_hdf_hdf5lib_H5_H5PLAPL +#define Included_hdf_hdf5lib_H5_H5PLAPL #include @@ -88,4 +87,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1elink_1acc_1flags(JNIEnv *, j } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PLAPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PLAPL */ diff --git a/java/src/jni/h5pLCPLImp.c b/java/src/jni/h5pLCPLImp.c index 455936b..b5eebd1 100644 --- a/java/src/jni/h5pLCPLImp.c +++ b/java/src/jni/h5pLCPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pLCPLImp.h b/java/src/jni/h5pLCPLImp.h index b744815..4cdf6cd 100644 --- a/java/src/jni/h5pLCPLImp.h +++ b/java/src/jni/h5pLCPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PLCPL -#define _Included_hdf_hdf5lib_H5_H5PLCPL +#ifndef Included_hdf_hdf5lib_H5_H5PLCPL +#define Included_hdf_hdf5lib_H5_H5PLCPL #include @@ -24,4 +23,4 @@ extern "C" { } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PLCPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PLCPL */ diff --git a/java/src/jni/h5pOCPLImp.c b/java/src/jni/h5pOCPLImp.c index 6cf62d7..bdcba46 100644 --- a/java/src/jni/h5pOCPLImp.c +++ b/java/src/jni/h5pOCPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pOCPLImp.h b/java/src/jni/h5pOCPLImp.h index ccc4c78..94d397b 100644 --- a/java/src/jni/h5pOCPLImp.h +++ b/java/src/jni/h5pOCPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5POCPL -#define _Included_hdf_hdf5lib_H5_H5POCPL +#ifndef Included_hdf_hdf5lib_H5_H5POCPL +#define Included_hdf_hdf5lib_H5_H5POCPL #include @@ -81,4 +80,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1attr_1creation_1order(JNIEnv } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5POCPL */ +#endif /* Included_hdf_hdf5lib_H5_H5POCPL */ diff --git a/java/src/jni/h5pOCpyPLImp.c b/java/src/jni/h5pOCpyPLImp.c index 9cf18fd..b525b68 100644 --- a/java/src/jni/h5pOCpyPLImp.c +++ b/java/src/jni/h5pOCpyPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pOCpyPLImp.h b/java/src/jni/h5pOCpyPLImp.h index 82369b3..50ee972 100644 --- a/java/src/jni/h5pOCpyPLImp.h +++ b/java/src/jni/h5pOCpyPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5POCpyPL -#define _Included_hdf_hdf5lib_H5_H5POCpyPL +#ifndef Included_hdf_hdf5lib_H5_H5POCpyPL +#define Included_hdf_hdf5lib_H5_H5POCpyPL #include @@ -54,4 +53,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1copy_1object(JNIEnv *, jclass } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5POCpyPL */ +#endif /* Included_hdf_hdf5lib_H5_H5POCpyPL */ diff --git a/java/src/jni/h5pStrCPLImp.c b/java/src/jni/h5pStrCPLImp.c index 33dbdd7..a056e3a 100644 --- a/java/src/jni/h5pStrCPLImp.c +++ b/java/src/jni/h5pStrCPLImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5pStrCPLImp.h b/java/src/jni/h5pStrCPLImp.h index 01cde89..c0a7ec2 100644 --- a/java/src/jni/h5pStrCPLImp.h +++ b/java/src/jni/h5pStrCPLImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -11,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifndef _Included_hdf_hdf5lib_H5_H5PStrCPL -#define _Included_hdf_hdf5lib_H5_H5PStrCPL +#ifndef Included_hdf_hdf5lib_H5_H5PStrCPL +#define Included_hdf_hdf5lib_H5_H5PStrCPL #include @@ -38,4 +37,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget_1char_1encoding(JNIEnv *, jcla } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PStrCPL */ +#endif /* Included_hdf_hdf5lib_H5_H5PStrCPL */ diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index bef1242..9193028 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5plImp.h b/java/src/jni/h5plImp.h index 228d512..410a34f 100644 --- a/java/src/jni/h5plImp.h +++ b/java/src/jni/h5plImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5PL */ -#ifndef _Included_hdf_hdf5lib_H5_H5PL -#define _Included_hdf_hdf5lib_H5_H5PL +#ifndef Included_hdf_hdf5lib_H5_H5PL +#define Included_hdf_hdf5lib_H5_H5PL #ifdef __cplusplus extern "C" { @@ -88,4 +87,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5PLsize(JNIEnv *, jclass); } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5PL */ +#endif /* Included_hdf_hdf5lib_H5_H5PL */ diff --git a/java/src/jni/h5rImp.h b/java/src/jni/h5rImp.h index 94e7911..cdfdd8e 100644 --- a/java/src/jni/h5rImp.h +++ b/java/src/jni/h5rImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5R */ -#ifndef _Included_hdf_hdf5lib_H5_H5R -#define _Included_hdf_hdf5lib_H5_H5R +#ifndef Included_hdf_hdf5lib_H5_H5R +#define Included_hdf_hdf5lib_H5_H5R #ifdef __cplusplus extern "C" { @@ -175,4 +174,4 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Rget_1name(JNIEnv *, jclass, jlong } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5R */ +#endif /* Included_hdf_hdf5lib_H5_H5R */ diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index cbce1ea..c3a8460 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -1340,6 +1340,389 @@ done: return; } /* end Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_copy + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1copy(JNIEnv *env, jclass clss, jlong dst_id, jlong src_id) +{ + herr_t status = FAIL; + + UNUSED(clss); + + if ((status = H5Sselect_copy((hid_t)dst_id, (hid_t)src_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1copy */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_shape_same + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same(JNIEnv *env, jclass clss, jlong space1_id, jlong space2_id) +{ + htri_t bval = JNI_FALSE; + + UNUSED(clss); + + if ((bval = H5Sselect_shape_same((hid_t)space1_id, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; + +done: + return (jboolean)bval; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_adjust + * Signature: (J[J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *env, jclass clss, jlong space_id, jlongArray offset) +{ + jboolean isCopy; + hssize_t *offst = NULL; + jlong * offsetP = NULL; + jsize offset_rank = -1; + int i, rank = -1; + herr_t status = FAIL; + + UNUSED(clss); + + if (space_id < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: invalid dataspace ID"); + + if ((rank = H5Sget_simple_extent_ndims(space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (NULL == offset) { + offsetP = NULL; + offst = (hssize_t *)offsetP; + } + else { + if ((offset_rank = ENVPTR->GetArrayLength(ENVONLY, offset)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: offset length < 0"); + } + + if (offset_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: offset rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, offset, offsetP, &isCopy, "H5Sselect_adjust: offset not pinned"); + + if (NULL == (offst = (hssize_t *)HDmalloc((size_t)offset_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_adjust: failed to allocate offset buffer"); + } + + if ((status = H5Sselect_adjust(space_id, (hssize_t *)offst)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + for (i = 0; i < offset_rank; i++) { + offsetP[i] = (jlong)offst[i]; + } /* end for */ + +done: + if (offst) + HDfree(offst); + if (offsetP) + UNPIN_LONG_ARRAY(ENVONLY, offset, offsetP, (status < 0) ? JNI_ABORT : 0); + + return; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1adjust */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_intersect_block + * Signature: (J[J[J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *env, jclass clss, jlong space_id, jlongArray start, + jlongArray end) +{ + htri_t bval = JNI_FALSE; + jboolean isCopy; + hsize_t *strt = NULL, *nd = NULL; + jlong * startP = NULL, *endP = NULL; + jsize start_rank = -1, end_rank = -1; + int i, rank = -1; + + UNUSED(clss); + + if (space_id < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: invalid dataspace ID"); + + if ((rank = H5Sget_simple_extent_ndims(space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (NULL == start) { + startP = NULL; + strt = (hsize_t *)startP; + } + else { + if ((start_rank = ENVPTR->GetArrayLength(ENVONLY, start)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: start length < 0"); + } + + if (start_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, + "H5Sselect_intersect_block: start rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sselect_intersect_block: start not pinned"); + + if (NULL == (strt = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate start buffer"); + } + + if (NULL == end) { + endP = NULL; + nd = (hsize_t *)endP; + } + else { + if ((end_rank = ENVPTR->GetArrayLength(ENVONLY, end)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: end array length < 0"); + } + + if (end_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, + "H5Sselect_intersect_block: end rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, end, endP, &isCopy, "H5Sselect_intersect_block: end not pinned"); + + if (NULL == (nd = (hsize_t *)HDmalloc((size_t)end_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate end buffer"); + } + + if ((bval = H5Sselect_intersect_block(space_id, (hsize_t *)strt, (hsize_t *)nd)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; + + for (i = 0; i < start_rank; i++) { + startP[i] = (jlong)strt[i]; + endP[i] = (jlong)nd[i]; + } /* end for */ + +done: + if (strt) + HDfree(strt); + if (startP) + UNPIN_LONG_ARRAY(ENVONLY, start, startP, (bval < 0) ? JNI_ABORT : 0); + if (nd) + HDfree(nd); + if (endP) + UNPIN_LONG_ARRAY(ENVONLY, end, endP, (bval < 0) ? JNI_ABORT : 0); + + return (jboolean)bval; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_project_intersection + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection(JNIEnv *env, jclass clss, jlong src_space_id, + jlong dst_space_id, jlong src_intersect_space_id) +{ + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if ((sid = H5Sselect_project_intersection(src_space_id, dst_space_id, src_intersect_space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_hyperslab + * Signature: (JI[J[J[J[J)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_id, jint op, jlongArray start, + jlongArray stride, jlongArray count, jlongArray block) +{ + jboolean isCopy; + hsize_t *strt = NULL, *strd = NULL, *cnt = NULL, *blk = NULL; + hsize_t *lp = NULL; + jlong * startP = NULL, *strideP = NULL, *countP = NULL, *blockP = NULL; + jlong * jlp = NULL; + jsize start_rank, stride_rank, count_rank, block_rank; + int i; + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if (NULL == start) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: start is NULL"); + if (NULL == count) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count is NULL"); + + if ((start_rank = ENVPTR->GetArrayLength(ENVONLY, start)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: start array length < 0"); + } + if ((count_rank = ENVPTR->GetArrayLength(ENVONLY, count)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count array length < 0"); + } + + if (start_rank != count_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Scombine_hyperslab: start not pinned"); + + if (NULL == (strt = lp = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate start buffer"); + + jlp = (jlong *)startP; + for (i = 0; i < start_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + + PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Scombine_hyperslab: count not pinned"); + + if (NULL == (cnt = lp = (hsize_t *)HDmalloc((size_t)count_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate count buffer"); + + jlp = (jlong *)countP; + for (i = 0; i < count_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + + if (NULL == stride) { + strideP = NULL; + strd = (hsize_t *)strideP; + } + else { + if ((stride_rank = ENVPTR->GetArrayLength(ENVONLY, stride)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: stride array length < 0"); + } + + if (stride_rank != start_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: stride and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Scombine_hyperslab: stride not pinned"); + + if (NULL == (strd = lp = (hsize_t *)HDmalloc((size_t)stride_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate stride buffer"); + + jlp = (jlong *)strideP; + for (i = 0; i < stride_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + } + + if (NULL == block) { + blockP = NULL; + blk = (hsize_t *)blockP; + } + else { + if ((block_rank = ENVPTR->GetArrayLength(ENVONLY, block)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: block array length < 0"); + } + + if (block_rank != start_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: block and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Scombine_hyperslab: block not pinned"); + + if (NULL == (blk = lp = (hsize_t *)HDmalloc((size_t)block_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate block buffer"); + + jlp = (jlong *)blockP; + for (i = 0; i < block_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end for */ + } + + if ((sid = H5Scombine_hyperslab(space_id, (H5S_seloper_t)op, (const hsize_t *)strt, (const hsize_t *)strd, + (const hsize_t *)cnt, (const hsize_t *)blk)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + if (blk) + HDfree(blk); + if (blockP) + UNPIN_LONG_ARRAY(ENVONLY, block, blockP, JNI_ABORT); + if (strd) + HDfree(strd); + if (strideP) + UNPIN_LONG_ARRAY(ENVONLY, stride, strideP, JNI_ABORT); + if (cnt) + HDfree(cnt); + if (countP) + UNPIN_LONG_ARRAY(ENVONLY, count, countP, JNI_ABORT); + if (strt) + HDfree(strt); + if (startP) + UNPIN_LONG_ARRAY(ENVONLY, start, startP, JNI_ABORT); + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Smodify_select + * Signature: (JIJ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Smodify_1select(JNIEnv *env, jclass clss, jlong space1_id, jint op, jlong space2_id) +{ + herr_t status = FAIL; + + UNUSED(clss); + + if ((status = H5Smodify_select((hid_t)space1_id, (H5S_seloper_t)op, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return; +} /* end Java_hdf_hdf5lib_H5_H5Smodify_1select */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_select + * Signature: (JIJ)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *env, jclass clss, jlong space1_id, jint op, jlong space2_id) +{ + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if ((sid = H5Scombine_select((hid_t)space1_id, (H5S_seloper_t)op, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Scombine_1select */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h index aa8fc60..a758d5a 100644 --- a/java/src/jni/h5sImp.h +++ b/java/src/jni/h5sImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5S */ -#ifndef _Included_hdf_hdf5lib_H5_H5S -#define _Included_hdf_hdf5lib_H5_H5S +#ifndef Included_hdf_hdf5lib_H5_H5S +#define Included_hdf_hdf5lib_H5_H5S #ifdef __cplusplus extern "C" { @@ -259,8 +258,67 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sis_1regular_1hyperslab(JNIEnv JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *, jclass, jlong, jlongArray, jlongArray, jlongArray, jlongArray); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_copy + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1copy(JNIEnv *, jclass, jlong, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_shape_same + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same(JNIEnv *, jclass, jlong, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_adjust + * Signature: (J[J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *, jclass, jlong, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_intersect_block + * Signature: (J[J[J)Z + */ +JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *, jclass, jlong, + jlongArray, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_project_intersection + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection(JNIEnv *, jclass, jlong, jlong, + jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_hyperslab + * Signature: (JI[J[J[J[J)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *, jclass, jlong, jint, jlongArray, + jlongArray, jlongArray, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Smodify_select + * Signature: (JIJ)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Smodify_1select(JNIEnv *, jclass, jlong, jint, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_select + * Signature: (JIJ)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *, jclass, jlong, jint, jlong); + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5S */ +#endif /* Included_hdf_hdf5lib_H5_H5S */ diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h index 3769cf3..e671456 100644 --- a/java/src/jni/h5tImp.h +++ b/java/src/jni/h5tImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5T */ -#ifndef _Included_hdf_hdf5lib_H5_H5T -#define _Included_hdf_hdf5lib_H5_H5T +#ifndef Included_hdf_hdf5lib_H5_H5T +#define Included_hdf_hdf5lib_H5_H5T #ifdef __cplusplus extern "C" { @@ -506,4 +505,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Trefresh(JNIEnv *, jclass, jlong); } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5T */ +#endif /* Included_hdf_hdf5lib_H5_H5T */ diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 3d47fde..6281481 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -28,8 +28,6 @@ extern "C" { #include "hdf5.h" #include "h5util.h" -#define SKIP_UNUSED_DUMP_ROUTINES - /* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */ hsize_t H5TOOLS_BUFSIZE = (32 * 1024 * 1024); /* 32 MB */ int H5TOOLS_TEXT_BLOCK = 16; /* Number of elements on a line in a text export file */ @@ -54,18 +52,21 @@ void * edata; /* Local Prototypes */ /********************/ -#ifndef SKIP_UNUSED_DUMP_ROUTINES -static int h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj); -static int h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj); -#endif +int h5str_region_dataset(JNIEnv *env, h5str_t *out_str, H5R_ref_t *ref_vp, int expand_data); + +static int h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj, + int expand_data); +static int h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj, + int expand_data); +static int h5str_dump_region_attribute(JNIEnv *env, h5str_t *str, hid_t region_id); static int h5str_is_zero(const void *_mem, size_t size); static hid_t h5str_get_native_type(hid_t type); static hid_t h5str_get_little_endian_type(hid_t type); static hid_t h5str_get_big_endian_type(hid_t type); static htri_t h5str_detect_vlen(hid_t tid); static htri_t h5str_detect_vlen_str(hid_t tid); -static int h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem, - hsize_t nelmts); +static int h5str_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem, + hsize_t nelmts); static int h5str_render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t block_nelmts); static int render_bin_output_region_data_blocks(FILE *stream, hid_t region_id, hid_t container, int ndims, @@ -185,13 +186,14 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ H5T_class_t tclass = H5T_NO_CLASS; const char delimiter[] = " ," H5_COMPOUND_BEGIN_INDICATOR H5_COMPOUND_END_INDICATOR H5_ARRAY_BEGIN_INDICATOR H5_ARRAY_END_INDICATOR H5_VLEN_BEGIN_INDICATOR H5_VLEN_END_INDICATOR; - size_t typeSize = 0; - hid_t mtid = H5I_INVALID_HID; - char * this_str = NULL; - char * token; - char * cptr = NULL; - int n; - size_t retVal = 0; + + size_t retVal = 0; + size_t typeSize = 0; + hid_t mtid = H5I_INVALID_HID; + char * this_str = NULL; + char * cptr = NULL; + char * token; + int n; if (!in_str) H5_NULL_ARGUMENT_ERROR(ENVONLY, "h5str_convert: in_str is NULL"); @@ -239,7 +241,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ case sizeof(long double): { long double tmp_ldouble = 0.0; - sscanf(token, "%Lf", &tmp_ldouble); + sscanf(token, "%Lg", &tmp_ldouble); HDmemcpy(cptr, &tmp_ldouble, sizeof(long double)); break; } @@ -644,27 +646,27 @@ done: * * Purpose: Object reference -- show the name of the referenced object. * - * Return: Nothing + * Return: SUCCEED or FAIL *------------------------------------------------------------------------- */ -void -h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref_p) +int +h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, void *ref_p) { - ssize_t buf_size; - char * ref_name = NULL; - const H5R_ref_t *ref_vp = (H5R_ref_t *)ref_p; + ssize_t buf_size; + char * ref_name = NULL; + H5R_ref_t *ref_vp = (H5R_ref_t *)ref_p; - UNUSED(container); + int ret_value = FAIL; if (!h5str_append(out_str, " \"")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); buf_size = H5Rget_file_name(ref_vp, NULL, 0); if (buf_size) { ref_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1); if (H5Rget_file_name(ref_vp, ref_name, buf_size + 1) >= 0) { ref_name[buf_size] = '\0'; if (!h5str_append(out_str, ref_name)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } HDfree(ref_name); ref_name = NULL; @@ -676,7 +678,7 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref if (H5Rget_obj_name(ref_vp, H5P_DEFAULT, ref_name, buf_size + 1) >= 0) { ref_name[buf_size] = '\0'; if (!h5str_append(out_str, ref_name)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } HDfree(ref_name); ref_name = NULL; @@ -689,17 +691,61 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref if (H5Rget_attr_name(ref_vp, ref_name, buf_size + 1) >= 0) { ref_name[buf_size] = '\0'; if (!h5str_append(out_str, ref_name)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } HDfree(ref_name); ref_name = NULL; } } if (!h5str_append(out_str, "\"")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); + + ret_value = SUCCEED; done: if (ref_name) HDfree(ref_name); + + return ret_value; +} /* h5str_sprint_reference */ + +int +h5str_region_dataset(JNIEnv *env, h5str_t *out_str, H5R_ref_t *ref_vp, int expand_data) +{ + hid_t new_obj_id = H5I_INVALID_HID; + hid_t new_obj_sid = H5I_INVALID_HID; + H5S_sel_type region_type; + + int ret_value = FAIL; + + if ((new_obj_id = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + ret_value = SUCCEED; /* An uncreated region is a valid state */ + goto done; + } + + if ((new_obj_sid = H5Ropen_region(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if ((region_type = H5Sget_select_type(new_obj_sid)) > H5S_SEL_ERROR) { + if (H5S_SEL_POINTS == region_type) { + if (h5str_dump_region_points(ENVONLY, out_str, new_obj_sid, new_obj_id, expand_data) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } + else if (H5S_SEL_HYPERSLABS == region_type) { + if (h5str_dump_region_blocks(ENVONLY, out_str, new_obj_sid, new_obj_id, expand_data) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } + } + + ret_value = SUCCEED; +done: + if (new_obj_sid >= 0) + if (H5Sclose(new_obj_sid) < 0) + H5_LIBRARY_ERROR(ENVONLY); + if (new_obj_id >= 0) + if (H5Dclose(new_obj_id) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + return ret_value; } /* @@ -710,8 +756,7 @@ done: * FAILURE: 0 */ size_t -h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf, size_t in_buf_len, - int expand_data) +h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf, int expand_data) { unsigned char *ucptr = (unsigned char *)in_buf; static char fmt_llong[8], fmt_ullong[8]; @@ -719,7 +764,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i size_t typeSize = 0; H5T_sign_t nsign = H5T_SGN_ERROR; hid_t mtid = H5I_INVALID_HID; - hid_t obj = H5I_INVALID_HID; char * cptr = (char *)in_buf; char * this_str = NULL; int n; @@ -734,8 +778,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i 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]) { @@ -744,7 +786,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i 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) { case H5T_FLOAT: { switch (typeSize) { @@ -784,7 +825,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i if (NULL == (this_str = (char *)HDmalloc(27))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer"); - if (HDsprintf(this_str, "%Lf", tmp_ldouble) < 0) + if (HDsprintf(this_str, "%Lg", tmp_ldouble) < 0) H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); break; @@ -805,6 +846,8 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i htri_t is_variable; char * tmp_str; + typeSize = 0; + if ((is_variable = H5Tis_variable_str(tid)) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -1003,7 +1046,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i H5_LIBRARY_ERROR(ENVONLY); if (!h5str_append(out_str, H5_COMPOUND_BEGIN_INDICATOR)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); for (i = 0; i < (unsigned)n; i++) { offset = H5Tget_member_offset(tid, i); @@ -1011,12 +1054,12 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i if ((mtid = H5Tget_member_type(tid, i)) < 0) H5_LIBRARY_ERROR(ENVONLY); - if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &cptr[offset], in_buf_len, expand_data)) + if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &cptr[offset], expand_data)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if ((i + 1) < (unsigned)n) if (!h5str_append(out_str, ", ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); if (H5Tclose(mtid) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -1024,7 +1067,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i } if (!h5str_append(out_str, H5_COMPOUND_END_INDICATOR)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); break; } @@ -1034,7 +1077,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i if (H5Tenum_nameof(tid, cptr, enum_name, sizeof enum_name) >= 0) { if (!h5str_append(out_str, enum_name)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } else { size_t i; @@ -1057,124 +1100,112 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i } case H5T_REFERENCE: { - if (h5str_is_zero(cptr, typeSize)) { - if (!h5str_append(out_str, "NULL")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - break; - } + /* H5T_STD_REF */ + hid_t new_obj_id = H5I_INVALID_HID; + H5O_type_t obj_type = -1; /* Object type */ + H5R_type_t ref_type; /* Reference type */ - if (H5Tequal(tid, H5T_STD_REF)) { - H5O_type_t obj_type = -1; /* Object type */ - H5R_type_t ref_type; /* Reference type */ - const H5R_ref_t *ref_vp = (H5R_ref_t *)cptr; + H5R_ref_t *ref_vp = (H5R_ref_t *)cptr; - ref_type = H5Rget_type(ref_vp); - H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type); + ref_type = H5Rget_type(ref_vp); + if (!h5str_is_zero(ref_vp, H5Tget_size(H5T_STD_REF))) { switch (ref_type) { - case H5R_OBJECT1: { - /* Object references -- show the type and OID of the referenced object. */ - H5O_info2_t oi; - - if ((obj = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - H5Oget_info3(obj, &oi, H5O_INFO_BASIC); - if (H5Oclose(obj) < 0) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + case H5R_OBJECT1: + if (H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type) >= 0) { + switch (obj_type) { + case H5O_TYPE_DATASET: + if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + break; + + case H5O_TYPE_GROUP: + case H5O_TYPE_NAMED_DATATYPE: + case H5O_TYPE_MAP: + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: { + /* Object references -- show the type and OID of the referenced object. */ + H5O_info2_t oi; + char * obj_tok_str = NULL; + if ((new_obj_id = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >= + 0) { + H5Oget_info3(new_obj_id, &oi, H5O_INFO_BASIC); + H5Otoken_to_str(new_obj_id, &oi.token, &obj_tok_str); + if (H5Dclose(new_obj_id) < 0) + H5_LIBRARY_ERROR(ENVONLY); + } + else + H5_LIBRARY_ERROR(ENVONLY); + + if (NULL == (this_str = (char *)HDmalloc(14))) + H5_OUT_OF_MEMORY_ERROR( + ENVONLY, "h5str_sprintf: failed to allocate string buffer"); + if (HDsprintf(this_str, "%u-", (unsigned)oi.type) < 0) + H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); + if (!h5str_append(out_str, this_str)) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); + HDfree(this_str); + this_str = NULL; + + /* Print OID */ + { + char *token_str; + + H5Otoken_to_str(tid, &oi.token, &token_str); + + if (NULL == (this_str = (char *)HDmalloc(64 + strlen(token_str) + 1))) + H5_OUT_OF_MEMORY_ERROR( + ENVONLY, "h5str_sprintf: failed to allocate string buffer"); + if (HDsprintf(this_str, "%lu:%s", oi.fileno, token_str) < 0) + H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); + + H5free_memory(token_str); + } + } break; + } /* end switch */ } else - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - - if (NULL == (this_str = (char *)HDmalloc(14))) - H5_OUT_OF_MEMORY_ERROR(ENVONLY, - "h5str_sprintf: failed to allocate string buffer"); - if (HDsprintf(this_str, "%u-", (unsigned)oi.type) < 0) - H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); - if (!h5str_append(out_str, this_str)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - HDfree(this_str); - this_str = NULL; - - switch (obj_type) { - case H5O_TYPE_GROUP: - if (!h5str_append(out_str, H5_TOOLS_GROUP)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - break; - - case H5O_TYPE_DATASET: - if (!h5str_append(out_str, H5_TOOLS_DATASET)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - break; - - case H5O_TYPE_NAMED_DATATYPE: - if (!h5str_append(out_str, H5_TOOLS_DATATYPE)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - break; - - case H5O_TYPE_MAP: - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - break; - } /* end switch */ - H5Oclose(obj); - h5str_sprint_reference(ENVONLY, out_str, container, ref_vp); - - /* Print OID */ - { - char *token_str; - - H5Otoken_to_str(tid, &oi.token, &token_str); - - if (NULL == (this_str = (char *)HDmalloc(64 + strlen(token_str) + 1))) - H5_OUT_OF_MEMORY_ERROR(ENVONLY, - "h5str_sprintf: failed to allocate string buffer"); - if (HDsprintf(this_str, "%lu:%s", oi.fileno, token_str) < 0) - H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); - - H5free_memory(token_str); - } - - } - - break; + H5_LIBRARY_ERROR(ENVONLY); + break; case H5R_DATASET_REGION1: - if (!h5str_append(out_str, H5_TOOLS_DATASET)) + if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr); break; case H5R_OBJECT2: - switch (obj_type) { - case H5O_TYPE_GROUP: - if (!h5str_append(out_str, H5_TOOLS_GROUP)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - break; - - case H5O_TYPE_DATASET: - if (!h5str_append(out_str, H5_TOOLS_DATASET)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - break; - - case H5O_TYPE_NAMED_DATATYPE: - if (!h5str_append(out_str, H5_TOOLS_DATATYPE)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - break; - - case H5O_TYPE_MAP: - case H5O_TYPE_UNKNOWN: - case H5O_TYPE_NTYPES: - default: - break; - } /* end switch */ - h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr); + if (H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type) >= 0) { + switch (obj_type) { + case H5O_TYPE_GROUP: + break; + + case H5O_TYPE_DATASET: + if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + break; + + case H5O_TYPE_NAMED_DATATYPE: + break; + + case H5O_TYPE_MAP: + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + break; + } /* end switch */ + } + else + H5_ASSERTION_ERROR(ENVONLY, "h5str_sprintf: H5R_OBJECT2 failed"); break; case H5R_DATASET_REGION2: - if (!h5str_append(out_str, H5_TOOLS_DATASET)) + if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr); break; case H5R_ATTR: - if (!h5str_append(out_str, H5_TOOLS_ATTRIBUTE)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr); + if ((new_obj_id = H5Ropen_attr(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (h5str_dump_region_attribute(ENVONLY, out_str, new_obj_id) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + if (H5Aclose(new_obj_id) < 0) + H5_LIBRARY_ERROR(ENVONLY); + } break; case H5R_BADTYPE: case H5R_MAXTYPE: @@ -1182,14 +1213,9 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i break; } /* end switch */ } - else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) { - /* (H5R_DSET_REG_REF_BUF_SIZE == typeSize) */ - H5_LIBRARY_ERROR(ENVONLY); - } - else if (H5Tequal(tid, H5T_STD_REF_OBJ)) { - /* (H5R_OBJ_REF_BUF_SIZE == typeSize) */ + + if (H5Rdestroy(ref_vp) < 0) H5_LIBRARY_ERROR(ENVONLY); - } break; } @@ -1200,7 +1226,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i int rank = 0; if (!h5str_append(out_str, H5_ARRAY_BEGIN_INDICATOR)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); if ((mtid = H5Tget_super(tid)) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -1218,17 +1244,16 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i total_elmts *= dims[i]; for (i = 0; i < total_elmts; i++) { - if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(cptr[i * baseSize]), in_buf_len, - expand_data)) + if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(cptr[i * baseSize]), expand_data)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if ((i + 1) < total_elmts) if (!h5str_append(out_str, ", ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } if (!h5str_append(out_str, H5_ARRAY_END_INDICATOR)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); if (H5Tclose(mtid) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -1249,20 +1274,20 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i H5_LIBRARY_ERROR(ENVONLY); if (!h5str_append(out_str, H5_VLEN_BEGIN_INDICATOR)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); for (i = 0; i < (unsigned)vl_buf->len; i++) { if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(((char *)vl_buf->p)[i * baseSize]), - vl_buf->len, expand_data)) + expand_data)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if ((i + 1) < (unsigned)vl_buf->len) if (!h5str_append(out_str, ", ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } if (!h5str_append(out_str, H5_VLEN_END_INDICATOR)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); if (H5Tclose(mtid) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -1304,7 +1329,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i if (this_str) { if (!h5str_append(out_str, this_str)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); HDfree(this_str); this_str = NULL; @@ -1405,12 +1430,12 @@ h5str_print_region_data_blocks(JNIEnv *env, hid_t region_id, h5str_t *str, int n for (numindex = 0; numindex < numelem; numindex++) { if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + numindex * type_size), - 0, 1)) + 1)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if (numindex + 1 < numelem) if (!h5str_append(str, ", ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } /* end for (jndx = 0; jndx < numelem; jndx++, region_elmtno++, ctx.cur_elmt++) */ } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ @@ -1434,7 +1459,7 @@ done: } /* end h5str_print_region_data_blocks */ int -h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id) +h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region_space, hid_t region_id, int expand_data) { hssize_t nblocks; hsize_t alloc_size; @@ -1443,32 +1468,34 @@ h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t reg hid_t type_id = H5I_INVALID_HID; int ndims = -1; int ret_value = FAIL; + int i; + char tmp_str[256]; /* * This function fails if the region does not have blocks. */ H5E_BEGIN_TRY { - nblocks = H5Sget_select_hyper_nblocks(region); + nblocks = H5Sget_select_hyper_nblocks(region_space); } H5E_END_TRY; - if (nblocks < 0) - H5_LIBRARY_ERROR(ENVONLY); - - if ((ndims = H5Sget_simple_extent_ndims(region)) < 0) + if (nblocks <= 0) { + ret_value = SUCCEED; + goto done; + } + if ((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) H5_LIBRARY_ERROR(ENVONLY); /* Print block information */ 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_OUT_OF_MEMORY_ERROR(ENVONLY, - "h5str_dump_region_blocks_data: failed to allocate region block buffer"); + if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size))) + 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); + if (H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, (hsize_t)nblocks, ptdata) < 0) + H5_LIBRARY_ERROR(ENVONLY); + if (expand_data) { if ((dtype = H5Dget_type(region_id)) < 0) H5_LIBRARY_ERROR(ENVONLY); @@ -1477,69 +1504,19 @@ h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t reg if (h5str_print_region_data_blocks(ENVONLY, region_id, str, ndims, type_id, nblocks, ptdata) < 0) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - } /* if (alloc_size == (hsize_t)((size_t)alloc_size)) */ - - ret_value = SUCCEED; - -done: - if (type_id >= 0) - H5Tclose(type_id); - if (dtype >= 0) - H5Tclose(dtype); - if (ptdata) - HDfree(ptdata); - - return ret_value; -} /* end h5str_dump_region_blocks_data */ - -#ifndef SKIP_UNUSED_DUMP_ROUTINES -static int -h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id) -{ - hssize_t nblocks; - hsize_t alloc_size; - hsize_t *ptdata = NULL; - char tmp_str[256]; - int ndims = -1; - int ret_value = FAIL; - - UNUSED(region_id); - - /* - * This function fails if the region does not have blocks. - */ - H5E_BEGIN_TRY - { - nblocks = H5Sget_select_hyper_nblocks(region); } - H5E_END_TRY; - - if (nblocks < 0) - H5_LIBRARY_ERROR(ENVONLY); - - if ((ndims = H5Sget_simple_extent_ndims(region)) < 0) - H5_LIBRARY_ERROR(ENVONLY); - - /* Print block information */ - alloc_size = (hsize_t)nblocks * (hsize_t)ndims * 2 * (hsize_t)sizeof(ptdata[0]); - if (alloc_size == (hsize_t)((size_t)alloc_size)) { - int i; - - if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size))) - 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); + else { + if (!h5str_append(str, " REGION_TYPE BLOCK")) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); if (!h5str_append(str, " {")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); for (i = 0; i < nblocks; i++) { int j; if (!h5str_append(str, " ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); /* Start coordinates and opposite corner */ for (j = 0; j < ndims; j++) { @@ -1549,7 +1526,7 @@ h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_i H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_blocks: HDsprintf failure"); if (!h5str_append(str, tmp_str)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } for (j = 0; j < ndims; j++) { @@ -1560,28 +1537,30 @@ h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_i H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_blocks: HDsprintf failure"); if (!h5str_append(str, tmp_str)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } if (!h5str_append(str, ") ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); tmp_str[0] = '\0'; } if (!h5str_append(str, " }")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - } /* if (alloc_size == (hsize_t)((size_t)alloc_size)) */ - + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); + } ret_value = SUCCEED; done: + if (type_id >= 0) + H5Tclose(type_id); + if (dtype >= 0) + H5Tclose(dtype); if (ptdata) HDfree(ptdata); return ret_value; } /* end h5str_dump_region_blocks */ -#endif /*------------------------------------------------------------------------- * Purpose: Print the data values from a dataset referenced by region points. @@ -1634,12 +1613,12 @@ h5str_print_region_data_points(JNIEnv *env, hid_t region_space, hid_t region_id, if (H5Sget_simple_extent_dims(mem_space, total_size, NULL) < 0) H5_LIBRARY_ERROR(ENVONLY); - if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + jndx * type_size), 0, 1)) + if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + jndx * type_size), 1)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if (jndx + 1 < (size_t)npoints) if (!h5str_append(str, ", ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); } /* end for (jndx = 0; jndx < npoints; jndx++, elmtno++) */ ret_value = SUCCEED; @@ -1656,146 +1635,96 @@ done: } /* end h5str_print_region_data_points */ int -h5str_dump_region_points_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id) +h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region_space, hid_t region_id, int expand_data) { - hssize_t npoints; hsize_t alloc_size; + hssize_t npoints = -1; hsize_t *ptdata = NULL; hid_t dtype = H5I_INVALID_HID; hid_t type_id = H5I_INVALID_HID; int ndims = -1; int ret_value = FAIL; + int i; + char tmp_str[256]; /* * This function fails if the region does not have points. */ H5E_BEGIN_TRY { - npoints = H5Sget_select_elem_npoints(region); + npoints = H5Sget_select_elem_npoints(region_space); } H5E_END_TRY; - if (npoints < 0) - H5_LIBRARY_ERROR(ENVONLY); - - if ((ndims = H5Sget_simple_extent_ndims(region)) < 0) + if (npoints <= 0) { + ret_value = SUCCEED; + goto done; + } + if ((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) H5_LIBRARY_ERROR(ENVONLY); /* Print point information */ - if (npoints > 0) { - 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_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); - - if ((dtype = H5Dget_type(region_id)) < 0) - H5_LIBRARY_ERROR(ENVONLY); - - if ((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) - H5_LIBRARY_ERROR(ENVONLY); - - if (h5str_print_region_data_points(ENVONLY, region, region_id, str, ndims, type_id, npoints, - ptdata) < 0) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - } - } - - ret_value = SUCCEED; - -done: - if (type_id >= 0) - H5Tclose(type_id); - if (dtype >= 0) - H5Tclose(dtype); - if (ptdata) - HDfree(ptdata); - - return ret_value; -} /* end h5str_dump_region_points_data */ - -#ifndef SKIP_UNUSED_DUMP_ROUTINES -static int -h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id) -{ - hssize_t npoints; - hsize_t alloc_size; - hsize_t *ptdata = NULL; - char tmp_str[256]; - int ndims = -1; - int ret_value = FAIL; - - UNUSED(region_id); - - /* - * This function fails if the region does not have points. - */ - H5E_BEGIN_TRY - { - npoints = H5Sget_select_elem_npoints(region); - } - H5E_END_TRY; - - if (npoints < 0) - H5_LIBRARY_ERROR(ENVONLY); + alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]); + if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, + "h5str_dump_region_points: failed to allocate region point data buffer"); - if ((ndims = H5Sget_simple_extent_ndims(region)) < 0) + if (H5Sget_select_elem_pointlist(region_space, (hsize_t)0, (hsize_t)npoints, ptdata) < 0) H5_LIBRARY_ERROR(ENVONLY); - /* Print point information */ - if (npoints > 0) { - int i; - - 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_OUT_OF_MEMORY_ERROR(ENVONLY, - "h5str_dump_region_points: failed to allocate region point buffer"); + if (expand_data) { + if ((dtype = H5Dget_type(region_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); - if (H5Sget_select_elem_pointlist(region, (hsize_t)0, (hsize_t)npoints, ptdata) < 0) - H5_LIBRARY_ERROR(ENVONLY); + if ((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) + H5_LIBRARY_ERROR(ENVONLY); - if (!h5str_append(str, " {")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + if (h5str_print_region_data_points(ENVONLY, region_space, region_id, str, ndims, type_id, npoints, + ptdata) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } + else { + if (!h5str_append(str, " REGION_TYPE POINT")) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); - for (i = 0; i < npoints; i++) { - int j; + if (!h5str_append(str, " {")) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); - if (!h5str_append(str, " ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + for (i = 0; i < npoints; i++) { + int j; - for (j = 0; j < ndims; j++) { - tmp_str[0] = '\0'; + if (!h5str_append(str, " ")) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); - if (HDsprintf(tmp_str, "%s%lu", j ? "," : "(", (unsigned long)(ptdata[i * ndims + j])) < - 0) - H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_points: HDsprintf failure"); + for (j = 0; j < ndims; j++) { + tmp_str[0] = '\0'; - if (!h5str_append(str, tmp_str)) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - } /* end for (j = 0; j < ndims; j++) */ + if (HDsprintf(tmp_str, "%s%lu", j ? "," : "(", (unsigned long)(ptdata[i * ndims + j])) < 0) + H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_points: HDsprintf failure"); - if (!h5str_append(str, ") ")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - } /* end for (i = 0; i < npoints; i++) */ + if (!h5str_append(str, tmp_str)) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); + } /* end for (j = 0; j < ndims; j++) */ - if (!h5str_append(str, " }")) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - } /* end if (alloc_size == (hsize_t)((size_t) alloc_size)) */ - } /* end if (npoints > 0) */ + if (!h5str_append(str, ") ")) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); + } /* end for (i = 0; i < npoints; i++) */ + if (!h5str_append(str, " }")) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); + } ret_value = SUCCEED; done: + if (type_id >= 0) + H5Tclose(type_id); + if (dtype >= 0) + H5Tclose(dtype); if (ptdata) HDfree(ptdata); return ret_value; } /* end h5str_dump_region_points */ -#endif static int h5str_is_zero(const void *_mem, size_t size) @@ -2312,47 +2241,31 @@ h5str_render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hs } case H5T_REFERENCE: { - if (H5Tequal(tid, H5T_STD_REF)) { - hid_t region_id = H5I_INVALID_HID; - hid_t region_space = H5I_INVALID_HID; - H5S_sel_type region_type; - - /* Region data */ - for (block_index = 0; block_index < block_nelmts; block_index++) { - mem = ((unsigned char *)_mem) + block_index * size; - if ((region_id = H5Ropen_object((const H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0) - continue; - else { - if ((region_space = - H5Ropen_region((const H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { - if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) { - region_type = H5Sget_select_type(region_space); - if (region_type == H5S_SEL_POINTS) - ret_value = render_bin_output_region_points(stream, region_space, - region_id, container); - else - ret_value = render_bin_output_region_blocks(stream, region_space, - region_id, container); - } - H5Sclose(region_space); - } /* end if (region_space >= 0) */ - H5Dclose(region_id); - } + hid_t region_id = H5I_INVALID_HID; + hid_t region_space = H5I_INVALID_HID; + H5S_sel_type region_type; - if ((region_type = H5Sget_select_type(region_space)) < 0) { - H5Sclose(region_space); - H5Dclose(region_id); - continue; + /* Region data */ + for (block_index = 0; block_index < block_nelmts; block_index++) { + mem = ((unsigned char *)_mem) + block_index * size; + if ((region_id = H5Ropen_object((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0) + continue; + if ((region_space = H5Ropen_region((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) { + region_type = H5Sget_select_type(region_space); + if (region_type == H5S_SEL_POINTS) + ret_value = + render_bin_output_region_points(stream, region_space, region_id, container); + else if (region_type == H5S_SEL_HYPERSLABS) + ret_value = + render_bin_output_region_blocks(stream, region_space, region_id, container); } - if (ret_value < 0) - break; - } - } - else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) { - ; - } - else if (H5Tequal(tid, H5T_STD_REF_OBJ)) { - ; + H5Sclose(region_space); + } /* end if (region_space >= 0) */ + H5Dclose(region_id); + + if (ret_value < 0) + break; } break; @@ -2723,6 +2636,109 @@ done: return ret_value; } /* end render_bin_output_region_points */ +/*------------------------------------------------------------------------- + * Purpose: Print some values from an attribute referenced by object reference. + * + * Parameters Description: + * FILE *buffer is the string into which to render + *------------------------------------------------------------------------- + */ +static int +h5str_dump_region_attribute(JNIEnv *env, h5str_t *str, hid_t region_id) +{ + int ret_value = SUCCEED; + hid_t atype = H5I_INVALID_HID; + hid_t type_id = H5I_INVALID_HID; + hid_t region_space = H5I_INVALID_HID; + hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ + size_t i; /* counter */ + size_t size; /* datum size */ + int sndims; /* rank of dataspace */ + hsize_t p_nelmts; /* total selected elmts */ + hsize_t alloc_size; + + unsigned char *buf = NULL; /* buffer for raw data */ + + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + + if ((region_space = H5Aget_space(region_id)) < 0) { + ret_value = FAIL; + goto done; + } + + if ((sndims = H5Sget_simple_extent_ndims(region_space)) < 0) { + ret_value = FAIL; + goto done; + } + + /* Assume entire data space to be read */ + H5Sget_simple_extent_dims(region_space, total_size, NULL); + p_nelmts = 1; + + for (i = 0; i < sndims; i++) + p_nelmts *= total_size[i]; + + if ((atype = H5Aget_type(region_id)) < 0) { + ret_value = FAIL; + goto done; + } + if ((type_id = H5Tget_native_type(atype, H5T_DIR_DEFAULT)) < 0) { + ret_value = FAIL; + goto done; + } + + /* Check if we have VL data in the dataset's datatype */ + if (h5str_detect_vlen(type_id) == TRUE) + vl_data = TRUE; + + if (!(size = H5Tget_size(type_id))) { + ret_value = FAIL; + goto done; + } + + alloc_size = p_nelmts * size; + HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) { + /* Read the data */ + if (H5Aread(region_id, type_id, buf) >= 0) { + + for (i = 0; i < p_nelmts; i++) { + size_t bytes_in = 0; /* # of bytes to write */ + void * memref = buf + i * size; + + if (!(bytes_in = h5str_sprintf(ENVONLY, str, region_id, type_id, memref, 1))) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + + if ((i < p_nelmts - 1) && (bytes_in > 0)) { + if (!h5str_append(str, ", ")) + H5_ASSERTION_ERROR(ENVONLY, "Unable to append string."); + } + } + + /* Reclaim any VL memory, if necessary */ + if (vl_data) { + if (H5Treclaim(type_id, region_space, H5P_DEFAULT, buf) < 0) + H5_LIBRARY_ERROR(ENVONLY); + } + } + else + H5_LIBRARY_ERROR(ENVONLY); + } + +done: + if (buf) + HDfree(buf); + if (region_space >= 0) + H5Sclose(region_space); + if (type_id >= 0) + H5Tclose(type_id); + if (atype >= 0) + H5Tclose(type_id); + + return ret_value; +} + int h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order) { @@ -2739,11 +2755,11 @@ h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order) size_t p_type_nbytes; /* size of memory type */ /* Stripmine info */ - unsigned char *sm_buf = NULL; /* buffer for raw data */ - hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ - hsize_t sm_nbytes; /* bytes per stripmine */ - hsize_t sm_nelmts; /* elements per stripmine */ - hid_t sm_space = H5I_INVALID_HID; /* stripmine data space */ + void * sm_buf = NULL; /* buffer for raw data */ + hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ + hsize_t sm_nbytes; /* bytes per stripmine */ + hsize_t sm_nelmts; /* elements per stripmine */ + hid_t sm_space = H5I_INVALID_HID; /* stripmine data space */ /* Hyperslab info */ hsize_t hs_offset[H5S_MAX_RANK]; /* starting offset */ @@ -2763,142 +2779,168 @@ h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order) if ((f_type = H5Dget_type(dset)) < 0) H5_LIBRARY_ERROR(ENVONLY); - switch (binary_order) { - case 1: { - if ((p_type = h5str_get_native_type(f_type)) < 0) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + if ((f_space = H5Dget_space(dset)) < 0) + H5_LIBRARY_ERROR(ENVONLY); - break; - } + if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0) + H5_LIBRARY_ERROR(ENVONLY); - case 2: { - if ((p_type = h5str_get_little_endian_type(f_type)) < 0) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) + H5_LIBRARY_ERROR(ENVONLY); - break; - } + if (H5Tequal(f_type, H5T_STD_REF_DSETREG)) { + p_nelmts = H5Sget_simple_extent_npoints(f_space); + if (NULL == + (sm_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)p_nelmts))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf"); - case 3: { - if ((p_type = h5str_get_big_endian_type(f_type)) < 0) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + /* Read the data */ + if (H5Dread(dset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, sm_buf) < 0) + H5_LIBRARY_ERROR(ENVONLY); - break; + if (binary_order == 99) { + if (h5str_dump_simple_data(ENVONLY, stream, dset, H5T_STD_REF, sm_buf, p_nelmts) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); } - - default: { - if ((p_type = H5Tcopy(f_type)) < 0) - H5_LIBRARY_ERROR(ENVONLY); - - break; + else { + if (h5str_render_bin_output(stream, dset, H5T_STD_REF, sm_buf, p_nelmts) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); } } + else { + switch (binary_order) { + case 1: { + if ((p_type = h5str_get_native_type(f_type)) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - if ((f_space = H5Dget_space(dset)) < 0) - H5_LIBRARY_ERROR(ENVONLY); + break; + } - if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0) - H5_LIBRARY_ERROR(ENVONLY); + case 2: { + if ((p_type = h5str_get_little_endian_type(f_type)) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) { - if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) - H5_LIBRARY_ERROR(ENVONLY); + break; + } - /* Calculate the number of elements we're going to print */ - p_nelmts = 1; + case 3: { + if ((p_type = h5str_get_big_endian_type(f_type)) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - if (ndims > 0) { - for (i = 0; i < (size_t)ndims; i++) - p_nelmts *= total_size[i]; - } /* end if */ + break; + } + + default: { + if ((p_type = H5Tcopy(f_type)) < 0) + H5_LIBRARY_ERROR(ENVONLY); - if (p_nelmts > 0) { - /* Check if we have VL data in the dataset's datatype */ - if (h5str_detect_vlen(p_type) != 0) - vl_data = 1; + break; + } + } - /* - * Determine the strip mine size and allocate a buffer. The strip mine is - * a hyperslab whose size is manageable. - */ - if (!(sm_nbytes = p_type_nbytes = H5Tget_size(p_type))) + if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) { + if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) H5_LIBRARY_ERROR(ENVONLY); + /* Calculate the number of elements we're going to print */ + p_nelmts = 1; + if (ndims > 0) { - for (i = (size_t)ndims; i > 0; --i) { - hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ - size = 1; - sm_size[i - 1] = (((total_size[i - 1]) < (size)) ? (total_size[i - 1]) : (size)); - sm_nbytes *= sm_size[i - 1]; + for (i = 0; i < (size_t)ndims; i++) + p_nelmts *= total_size[i]; + } /* end if */ + + if (p_nelmts > 0) { + /* Check if we have VL data in the dataset's datatype */ + if (h5str_detect_vlen(p_type) != 0) + vl_data = 1; + + /* + * Determine the strip mine size and allocate a buffer. The strip mine is + * a hyperslab whose size is manageable. + */ + if (!(sm_nbytes = p_type_nbytes = H5Tget_size(p_type))) + H5_LIBRARY_ERROR(ENVONLY); + + if (ndims > 0) { + for (i = (size_t)ndims; i > 0; --i) { + hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; + if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ + size = 1; + sm_size[i - 1] = (((total_size[i - 1]) < (size)) ? (total_size[i - 1]) : (size)); + sm_nbytes *= sm_size[i - 1]; + } } - } - if (sm_nbytes > 0) { - if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes))) - H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_dset: failed to allocate sm_buf"); + if (sm_nbytes > 0) { + if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_dset: failed to allocate sm_buf"); - sm_nelmts = sm_nbytes / p_type_nbytes; + sm_nelmts = sm_nbytes / p_type_nbytes; - if ((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0) - H5_LIBRARY_ERROR(ENVONLY); + if ((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0) + H5_LIBRARY_ERROR(ENVONLY); - /* The stripmine loop */ - HDmemset(hs_offset, 0, sizeof hs_offset); - HDmemset(zero, 0, sizeof zero); - - for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { - /* Calculate the hyperslab size */ - if (ndims > 0) { - for (i = 0, hs_nelmts = 1; i < (size_t)ndims; i++) { - hs_size[i] = (((total_size[i] - hs_offset[i]) < (sm_size[i])) - ? (total_size[i] - hs_offset[i]) - : (sm_size[i])); - hs_nelmts *= hs_size[i]; - } + /* The stripmine loop */ + HDmemset(hs_offset, 0, sizeof hs_offset); + HDmemset(zero, 0, sizeof zero); + + for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { + /* Calculate the hyperslab size */ + if (ndims > 0) { + for (i = 0, hs_nelmts = 1; i < (size_t)ndims; i++) { + hs_size[i] = (((total_size[i] - hs_offset[i]) < (sm_size[i])) + ? (total_size[i] - hs_offset[i]) + : (sm_size[i])); + hs_nelmts *= hs_size[i]; + } - if (H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - H5_LIBRARY_ERROR(ENVONLY); + if (H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < + 0) + H5_LIBRARY_ERROR(ENVONLY); - if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) - H5_LIBRARY_ERROR(ENVONLY); - } - else { - if (H5Sselect_all(f_space) < 0) - H5_LIBRARY_ERROR(ENVONLY); + if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < + 0) + H5_LIBRARY_ERROR(ENVONLY); + } + else { + if (H5Sselect_all(f_space) < 0) + H5_LIBRARY_ERROR(ENVONLY); - if (H5Sselect_all(sm_space) < 0) - H5_LIBRARY_ERROR(ENVONLY); + if (H5Sselect_all(sm_space) < 0) + H5_LIBRARY_ERROR(ENVONLY); - hs_nelmts = 1; - } + hs_nelmts = 1; + } - /* Read the data */ - if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) - H5_LIBRARY_ERROR(ENVONLY); + /* Read the data */ + if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) + H5_LIBRARY_ERROR(ENVONLY); - if (binary_order == 99) { - if (h5tools_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - } - else { - if (h5str_render_bin_output(stream, dset, p_type, sm_buf, hs_nelmts) < 0) - CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - } + if (binary_order == 99) { + if (h5str_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } + else { + if (h5str_render_bin_output(stream, dset, p_type, sm_buf, hs_nelmts) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } - /* Reclaim any VL memory, if necessary */ - if (vl_data) { - if (H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf) < 0) - H5_LIBRARY_ERROR(ENVONLY); - } + /* Reclaim any VL memory, if necessary */ + if (vl_data) { + if (H5Treclaim(p_type, sm_space, H5P_DEFAULT, sm_buf) < 0) + H5_LIBRARY_ERROR(ENVONLY); + } - /* Calculate the next hyperslab offset */ - for (i = (size_t)ndims, carry = 1; i > 0 && carry; --i) { - hs_offset[i - 1] += hs_size[i - 1]; + /* Calculate the next hyperslab offset */ + for (i = (size_t)ndims, carry = 1; i > 0 && carry; --i) { + hs_offset[i - 1] += hs_size[i - 1]; - if (hs_offset[i - 1] == total_size[i - 1]) - hs_offset[i - 1] = 0; - else - carry = 0; + if (hs_offset[i - 1] == total_size[i - 1]) + hs_offset[i - 1] = 0; + else + carry = 0; + } } } } @@ -2922,6 +2964,148 @@ done: return ret_value; } /* end h5str_dump_simple_dset */ +int +h5str_dump_simple_mem(JNIEnv *env, FILE *stream, hid_t attr_id, int binary_order) +{ + hid_t f_space = H5I_INVALID_HID; /* file data space */ + hsize_t alloc_size; + int ndims; /* rank of dataspace */ + unsigned i; /* counters */ + hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ + hsize_t p_nelmts; /* total selected elmts */ + + void * sm_buf = NULL; /* buffer for raw data */ + hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ + + int ret_value = 0; + + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + hid_t p_type = H5I_INVALID_HID; + hid_t f_type = H5I_INVALID_HID; + + if (attr_id < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "h5str_dump_simple_mem: attr ID < 0"); + + if ((f_type = H5Aget_type(attr_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (H5I_INVALID_HID == (f_space = H5Aget_space(attr_id))) + H5_LIBRARY_ERROR(ENVONLY); + + if ((ndims = H5Sget_simple_extent_ndims(f_space)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (H5Tequal(f_type, H5T_STD_REF_DSETREG)) { + p_nelmts = H5Sget_simple_extent_npoints(f_space); + if (NULL == + (sm_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)p_nelmts))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf"); + + /* Read the data */ + if (H5Aread(attr_id, H5T_STD_REF, sm_buf) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (binary_order == 99) { + if (h5str_dump_simple_data(ENVONLY, stream, attr_id, H5T_STD_REF, sm_buf, p_nelmts) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } + else { + if (h5str_render_bin_output(stream, attr_id, H5T_STD_REF, sm_buf, p_nelmts) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } + } + else { + switch (binary_order) { + case 1: { + if ((p_type = h5str_get_native_type(f_type)) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + + break; + } + + case 2: { + if ((p_type = h5str_get_little_endian_type(f_type)) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + + break; + } + + case 3: { + if ((p_type = h5str_get_big_endian_type(f_type)) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + + break; + } + + default: { + if ((p_type = H5Tcopy(f_type)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + break; + } + } + + if ((size_t)ndims <= (sizeof(sm_size) / sizeof(sm_size[0]))) { + if (H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) + H5_LIBRARY_ERROR(ENVONLY); + /* Calculate the number of elements we're going to print */ + p_nelmts = 1; + + if (ndims > 0) { + for (i = 0; i < (size_t)ndims; i++) + p_nelmts *= total_size[i]; + } /* end if */ + + if (p_nelmts > 0) { + /* Check if we have VL data in the dataset's datatype */ + if (h5str_detect_vlen(p_type) != 0) + vl_data = 1; + + alloc_size = p_nelmts * H5Tget_size(p_type); + if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)alloc_size))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_mem: failed to allocate sm_buf"); + + /* Read the data */ + if (H5Aread(attr_id, p_type, sm_buf) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (binary_order == 99) { + if (h5str_dump_simple_data(ENVONLY, stream, attr_id, p_type, sm_buf, p_nelmts) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } + else { + if (h5str_render_bin_output(stream, attr_id, p_type, sm_buf, p_nelmts) < 0) + CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); + } + + /* Reclaim any VL memory, if necessary */ + if (vl_data) { + if (H5Treclaim(p_type, f_space, H5P_DEFAULT, sm_buf) < 0) + H5_LIBRARY_ERROR(ENVONLY); + } + } + } + } + + ret_value = SUCCEED; + +done: + if (sm_buf) + HDfree(sm_buf); + if (f_space >= 0) + H5Sclose(f_space); + if (p_type >= 0) + H5Tclose(p_type); + if (f_type >= 0) + H5Tclose(f_type); + + return ret_value; +} + htri_t H5Tdetect_variable_str(hid_t tid) { @@ -2948,7 +3132,7 @@ H5Tdetect_variable_str(hid_t tid) } /* end H5Tdetect_variable_str */ static int -h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem, hsize_t nelmts) +h5str_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem, hsize_t nelmts) { unsigned char *mem = (unsigned char *)_mem; h5str_t buffer; /* string into which to render */ @@ -2968,38 +3152,37 @@ h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, h5str_new(&buffer, 32 * size); if (!buffer.s) - H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5tools_dump_simple_data: failed to allocate buffer"); + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_data: failed to allocate buffer"); - if (!(bytes_in = h5str_sprintf(ENVONLY, &buffer, container, type, memref, 0, 1))) + if (!(bytes_in = h5str_sprintf(ENVONLY, &buffer, container, type, memref, 1))) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); - if (i > 0) { + if ((i > 0) && (bytes_in > 0)) { if (HDfprintf(stream, ", ") < 0) - H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure"); + H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure"); if (line_count >= H5TOOLS_TEXT_BLOCK) { line_count = 0; if (HDfprintf(stream, "\n") < 0) - H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure"); + H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure"); } } - if (HDfprintf(stream, "%s", buffer.s) < 0) - H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure"); + H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure"); h5str_free(&buffer); } /* end for (i = 0; i < nelmts... */ if (HDfprintf(stream, "\n") < 0) - H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure"); + H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure"); done: if (buffer.s) h5str_free(&buffer); return ret_value; -} /* end h5tools_dump_simple_data */ +} /* end h5str_dump_simple_data */ /* * Utility Java APIs @@ -3053,7 +3236,7 @@ Java_hdf_hdf5lib_H5_H5AreadComplex(JNIEnv *env, jclass clss, jlong attr_id, jlon for (i = 0; i < (size_t)n; i++) { h5str.s[0] = '\0'; - if (!h5str_sprintf(ENVONLY, &h5str, attr_id, mem_type_id, readBuf + (i * size), 0, 0)) + if (!h5str_sprintf(ENVONLY, &h5str, attr_id, mem_type_id, readBuf + (i * size), 0)) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s))) @@ -3554,18 +3737,16 @@ done: /* * Class: hdf_hdf5lib_H5 * Method: H5export_dataset - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V + * Signature: (Ljava/lang/String;JLjava/lang/String;I)V */ JNIEXPORT void JNICALL -Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_export_name, jstring file_name, +Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_export_name, jlong file_id, jstring object_path, jint binary_order) { const char *file_export = NULL; const char *object_name = NULL; - const char *fileName = NULL; jboolean isCopy; herr_t ret_val = FAIL; - hid_t file_id = H5I_INVALID_HID; hid_t dataset_id = H5I_INVALID_HID; FILE * stream = NULL; @@ -3574,17 +3755,9 @@ Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_exp if (NULL == file_export_name) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_export_name is NULL"); - if (NULL == file_name) - H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_name is NULL"); - if (NULL == object_path) H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: object_path is NULL"); - PIN_JAVA_STRING(ENVONLY, file_name, fileName, NULL, "H5export_dataset: file name not pinned"); - - if ((file_id = H5Fopen(fileName, (unsigned)H5F_ACC_RDWR, (hid_t)H5P_DEFAULT)) < 0) - H5_LIBRARY_ERROR(ENVONLY); - PIN_JAVA_STRING(ENVONLY, object_path, object_name, &isCopy, "H5export_dataset: object_path not pinned"); if ((dataset_id = H5Dopen2(file_id, object_name, H5P_DEFAULT)) < 0) @@ -3597,7 +3770,7 @@ Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *env, jclass clss, jstring file_exp H5_JNI_FATAL_ERROR(ENVONLY, "HDfopen failed"); if ((ret_val = h5str_dump_simple_dset(ENVONLY, stream, dataset_id, binary_order)) < 0) - H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_dset failed"); + H5_ASSERTION_ERROR(ENVONLY, "h5str_dump_simple_dset failed"); if (stream) { HDfclose(stream); @@ -3611,14 +3784,65 @@ done: UNPIN_JAVA_STRING(ENVONLY, file_export_name, file_export); if (object_name) UNPIN_JAVA_STRING(ENVONLY, object_path, object_name); - if (fileName) - UNPIN_JAVA_STRING(ENVONLY, file_name, fileName); if (dataset_id >= 0) H5Dclose(dataset_id); - if (file_id >= 0) - H5Fclose(file_id); } /* end Java_hdf_hdf5lib_H5_H5export_1dataset */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5export_attribute + * Signature: (Ljava/lang/String;JLjava/lang/String;I)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5export_1attribute(JNIEnv *env, jclass clss, jstring file_export_name, jlong dset_id, + jstring attribute_name, jint binary_order) +{ + const char *file_export = NULL; + const char *object_name = NULL; + jboolean isCopy; + herr_t ret_val = FAIL; + hid_t attr_id = H5I_INVALID_HID; + FILE * stream = NULL; + + UNUSED(clss); + + if (NULL == file_export_name) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: file_export_name is NULL"); + + if (NULL == attribute_name) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5export_dataset: object_path is NULL"); + + PIN_JAVA_STRING(ENVONLY, attribute_name, object_name, &isCopy, + "H5export_dataset: object_path not pinned"); + + if ((attr_id = H5Aopen(dset_id, object_name, H5P_DEFAULT)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + PIN_JAVA_STRING(ENVONLY, file_export_name, file_export, NULL, + "H5export_dataset: file_export name not pinned"); + + if (NULL == (stream = HDfopen(file_export, "w+"))) + H5_JNI_FATAL_ERROR(ENVONLY, "HDfopen failed"); + + if ((ret_val = h5str_dump_simple_mem(ENVONLY, stream, attr_id, binary_order)) < 0) + H5_ASSERTION_ERROR(ENVONLY, "h5str_dump_simple_dset failed"); + + if (stream) { + HDfclose(stream); + stream = NULL; + } + +done: + if (stream) + HDfclose(stream); + if (file_export) + UNPIN_JAVA_STRING(ENVONLY, file_export_name, file_export); + if (object_name) + UNPIN_JAVA_STRING(ENVONLY, attribute_name, object_name); + if (attr_id >= 0) + H5Aclose(attr_id); +} /* end Java_hdf_hdf5lib_H5_H5export_1attribute */ + #ifdef __cplusplus } #endif diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h index 4b79eda..6c568e1 100644 --- a/java/src/jni/h5util.h +++ b/java/src/jni/h5util.h @@ -41,13 +41,12 @@ extern void h5str_resize(h5str_t *str, size_t new_len); extern char * h5str_append(h5str_t *str, const char *cstr); extern size_t h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_buf, size_t out_buf_offset); -extern void h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref_p); +extern int h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, void *ref_p); extern size_t h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf, - size_t in_buf_len, int expand_data); + int expand_data); extern void h5str_array_free(char **strs, size_t len); extern int h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order); -extern int h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj); -extern int h5str_dump_region_points_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj); +extern int h5str_dump_simple_mem(JNIEnv *env, FILE *stream, hid_t attr, int binary_order); extern htri_t H5Tdetect_variable_str(hid_t tid); @@ -107,9 +106,16 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Gget_1obj_1info_1max(JNIEnv *, jcla /* * Class: hdf_hdf5lib_H5 * Method: H5export_dataset - * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V + * Signature: (Ljava/lang/String;JLjava/lang/String;I)V */ -JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *, jclass, jstring, jstring, jstring, - jint); +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1dataset(JNIEnv *, jclass, jstring, jlong, jstring, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5export_attribute + * Signature: (Ljava/lang/String;JLjava/lang/String;I)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5export_1attribute(JNIEnv *, jclass, jstring, jlong, jstring, + jint); #endif /* H5UTIL_H__ */ diff --git a/java/src/jni/h5vlImp.c b/java/src/jni/h5vlImp.c index 9b48d21..40f8863 100644 --- a/java/src/jni/h5vlImp.c +++ b/java/src/jni/h5vlImp.c @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/src/jni/h5vlImp.h b/java/src/jni/h5vlImp.h index 70c5006..a17807f 100644 --- a/java/src/jni/h5vlImp.h +++ b/java/src/jni/h5vlImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5VL */ -#ifndef _Included_hdf_hdf5lib_H5_H5VL -#define _Included_hdf_hdf5lib_H5_H5VL +#ifndef Included_hdf_hdf5lib_H5_H5VL +#define Included_hdf_hdf5lib_H5_H5VL #ifdef __cplusplus extern "C" { @@ -98,4 +97,4 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5VLunregister_1connector(JNIEnv *, j } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5VL */ +#endif /* Included_hdf_hdf5lib_H5_H5VL */ diff --git a/java/src/jni/h5zImp.h b/java/src/jni/h5zImp.h index 924776c..3092ae6 100644 --- a/java/src/jni/h5zImp.h +++ b/java/src/jni/h5zImp.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_H5_H5Z */ -#ifndef _Included_hdf_hdf5lib_H5_H5Z -#define _Included_hdf_hdf5lib_H5_H5Z +#ifndef Included_hdf_hdf5lib_H5_H5Z +#define Included_hdf_hdf5lib_H5_H5Z #ifdef __cplusplus extern "C" { @@ -47,4 +46,4 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Zget_1filter_1info(JNIEnv *, jclass } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_H5_H5Z */ +#endif /* Included_hdf_hdf5lib_H5_H5Z */ diff --git a/java/src/jni/nativeData.h b/java/src/jni/nativeData.h index 398dfc9..9bf313f 100644 --- a/java/src/jni/nativeData.h +++ b/java/src/jni/nativeData.h @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -14,8 +13,8 @@ #include /* Header for class hdf_hdf5lib_HDFNativeData */ -#ifndef _Included_hdf_hdf5lib_HDFNativeData -#define _Included_hdf_hdf5lib_HDFNativeData +#ifndef Included_hdf_hdf5lib_HDFNativeData +#define Included_hdf_hdf5lib_HDFNativeData #ifdef __cplusplus extern "C" { @@ -98,4 +97,4 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToByte__B(JNIEnv } /* end extern "C" */ #endif /* __cplusplus */ -#endif /* _Included_hdf_hdf5lib_HDFNativeData */ +#endif /* Included_hdf_hdf5lib_HDFNativeData */ diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 66991c4..ffaf5f5 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -23,16 +23,19 @@ set (HDF5_JAVA_TEST_SOURCES TestH5Dparams TestH5D TestH5Dplist + TestH5Drw TestH5Lparams TestH5Lbasic TestH5Lcreate TestH5R + TestH5Rref TestH5P TestH5PData TestH5Pfapl TestH5Pvirtual TestH5Plist TestH5A + TestH5Arw TestH5Oparams TestH5Obasic TestH5Ocreate @@ -93,6 +96,12 @@ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateL2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files") HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateO1.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files") HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files") +HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5" "${PROJECT_BINARY_DIR}/trefer_reg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files") +HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5" "${PROJECT_BINARY_DIR}/trefer_attr.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files") +HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tdatareg.h5" "${PROJECT_BINARY_DIR}/tdatareg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files") +HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tattrreg.h5" "${PROJECT_BINARY_DIR}/tattrreg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files") +HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tintsattrs.h5" "${PROJECT_BINARY_DIR}/tintsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files") +HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.h5" "${PROJECT_BINARY_DIR}/tfloatsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files") add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list}) @@ -208,6 +217,12 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateL2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO1.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5" "${PROJECT_BINARY_DIR}/${voltest}/trefer_reg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5" "${PROJECT_BINARY_DIR}/${voltest}/trefer_attr.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tdatareg.h5" "${PROJECT_BINARY_DIR}/${voltest}/tdatareg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tattrreg.h5" "${PROJECT_BINARY_DIR}/${voltest}/tattrreg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tintsattrs.h5" "${PROJECT_BINARY_DIR}/${voltest}/tintsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tfloatsattrs.h5" "${PROJECT_BINARY_DIR}/${voltest}/tfloatsattrs.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files") add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files_list}) diff --git a/java/test/Makefile.am b/java/test/Makefile.am index 83b4188..ac3b619 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -52,11 +52,13 @@ noinst_JAVA = \ TestH5T.java \ TestH5Dparams.java \ TestH5D.java \ + TestH5Drw.java \ TestH5Dplist.java \ TestH5Lparams.java \ TestH5Lbasic.java \ TestH5Lcreate.java \ TestH5R.java \ + TestH5Rref.java \ TestH5P.java \ TestH5PData.java \ TestH5Pfapl.java \ @@ -65,6 +67,7 @@ noinst_JAVA = \ TestH5Pvirtual.java \ TestH5Plist.java \ TestH5A.java \ + TestH5Arw.java \ TestH5Oparams.java \ TestH5Obasic.java \ TestH5Ocreate.java \ diff --git a/java/test/TestAll.java b/java/test/TestAll.java index a59e990..16414e4 100644 --- a/java/test/TestAll.java +++ b/java/test/TestAll.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -23,12 +22,12 @@ import org.junit.runners.Suite; TestH5Gbasic.class, TestH5G.class, TestH5Giterate.class, TestH5Sbasic.class, TestH5S.class, TestH5Tparams.class, TestH5Tbasic.class, TestH5T.class, - TestH5Dparams.class, TestH5D.class, TestH5Dplist.class, + TestH5Dparams.class, TestH5D.class, TestH5Dplist.class, TestH5Drw.class, TestH5Lparams.class, TestH5Lbasic.class, TestH5Lcreate.class, - TestH5R.class, + TestH5R.class, TestH5Rref.class, TestH5P.class, TestH5PData.class, TestH5Pfapl.class, TestH5Pvirtual.class, TestH5Plist.class, TestH5Pfapls3.class, TestH5Pfaplhdfs.class, - TestH5A.class, + TestH5A.class, TestH5Arw.class, TestH5Oparams.class, TestH5Obasic.class, TestH5Ocopy.class, TestH5Ocreate.class, TestH5PL.class, TestH5Z.class }) diff --git a/java/test/TestH5.java b/java/test/TestH5.java index 717d323..1f298f3 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -32,6 +31,7 @@ import java.io.StreamTokenizer; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; +import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import org.junit.After; @@ -47,22 +47,25 @@ import org.junit.rules.TestName; */ public class TestH5 { @Rule public TestName testname = new TestName(); - @Before - public void showTestName() { - System.out.print(testname.getMethodName()); - } - @After - 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 String H5_REGION_FILE = "trefer_reg.h5"; + private static final String EXPORT_REGION_FILE = "testExportReg.txt"; + private static final String H5_ATTR_FILE = "trefer_attr.h5"; + private static final String EXPORT_ATTR_FILE = "testExportAttr.txt"; + private static final String H5_DREG_FILE = "tdatareg.h5"; + private static final String EXPORT_DREG_FILE = "testExportDReg.txt"; + private static final String H5_AREG_FILE = "tattrreg.h5"; + private static final String EXPORT_AREG_FILE = "testExportAReg.txt"; private static final int DIM_X = 4; private static final int DIM_Y = 6; + private static final int DIM_BLKS = 36; + private static final int DIM_PNTS = 10; + private static final int DIM_ATTR = 12; private static final int RANK = 2; - long H5fid = -1; - long H5dsid = -1; - long H5did = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; private final void _deleteFile(String filename) { @@ -78,7 +81,7 @@ public class TestH5 { } private final long _createDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32LE, dsid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl); @@ -115,22 +118,65 @@ public class TestH5 { } } - public final void _closeH5File() throws HDF5LibraryException { + private final void _closeH5File() { 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; + H5fid = HDF5Constants.H5I_INVALID_HID; + H5dsid = HDF5Constants.H5I_INVALID_HID; + H5did = HDF5Constants.H5I_INVALID_HID; + } + + public void _openH5File(String filename, String dsetname) { + try { + H5fid = H5.H5Fopen(filename, + HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5._openH5file: " + err); + } + assertTrue("TestH5._openH5file: H5.H5Fopen: ", H5fid >= 0); + try { + H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5._openH5file: " + err); + } + assertTrue("TestH5._openH5file: H5.H5Dopen: ", H5did >= 0); + try { + H5dsid = H5.H5Dget_space(H5did); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5._openH5file: " + err); + } + assertTrue("TestH5._openH5file: H5.H5Screate_simple: ",H5dsid > 0); } public final void _deleteH5file() { + _closeH5File(); _deleteFile(H5_FILE); } + @After + public void closeH5File() throws HDF5LibraryException { + _closeH5File(); + assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0); + System.out.println(); + } + + @Before + public void verifyCount() + throws NullPointerException, HDF5Exception { + assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0); + System.out.print(testname.getMethodName()); + } + /** * Test method for {@link hdf.hdf5lib.H5#J2C(int)}. * NOTE: @@ -374,8 +420,10 @@ public class TestH5 { _closeH5File(); + _openH5File(H5_FILE, "/dset"); + try { - H5.H5export_dataset(EXPORT_FILE, H5_FILE, "/dset", 99); + H5.H5export_dataset(EXPORT_FILE, H5fid, "/dset", 99); } catch (HDF5LibraryException err) { err.printStackTrace(); @@ -411,4 +459,168 @@ public class TestH5 { } _deleteH5file(); } + + @Test + public void testH5export_region() { + int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108, + 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171, + 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231, + 207, 66, 252, 48, 84, 96, 12, 14, 213, 99}; + int[] dset_indata = new int[DIM_BLKS+DIM_PNTS]; + String objName = "/Dataset1"; + + _openH5File(H5_REGION_FILE, objName); + + try { + H5.H5export_dataset(EXPORT_REGION_FILE, H5fid, objName, 99); + } + catch (HDF5LibraryException err) { + err.printStackTrace(); + fail("H5export_dataset failed: " + err); + } + + File file = new File(EXPORT_REGION_FILE); + + try { + Reader reader = new FileReader(EXPORT_REGION_FILE); + StreamTokenizer streamTokenizer = new StreamTokenizer(reader); + int indx = 0; + while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){ + if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) { + dset_indata[indx] = (int)streamTokenizer.nval; + indx++; + } + } + reader.close(); + } + catch (IOException err) { + err.printStackTrace(); + fail("read file failed: " + err); + } + for(int row = 0; row < DIM_X; row++) + assertTrue("testH5export_region: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]); + } + + @Test + public void testH5export_attribute() { + int[] dset_data_expect = {0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11}; + int[] dset_indata = new int[DIM_ATTR]; + String objName = "/Dataset3"; + + _openH5File(H5_ATTR_FILE, objName); + + try { + H5.H5export_dataset(EXPORT_ATTR_FILE, H5did, objName, 99); + } + catch (HDF5LibraryException err) { + err.printStackTrace(); + fail("H5export_dataset failed: " + err); + } + + File file = new File(EXPORT_ATTR_FILE); + + try { + Reader reader = new FileReader(EXPORT_ATTR_FILE); + StreamTokenizer streamTokenizer = new StreamTokenizer(reader); + int indx = 0; + int jndx = 0; + while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){ + if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) { + dset_indata[indx] = (int)streamTokenizer.nval; + indx++; + } + } + reader.close(); + } + catch (IOException err) { + err.printStackTrace(); + fail("read file failed: " + err); + } + for(int row = 0; row < DIM_X; row++) + assertTrue("testH5export_attribute: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]); + } + + @Test + public void testH5export_regdataset() { + int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108, + 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171, + 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231, + 207, 66, 252, 48, 84, 96, 12, 14, 213, 99}; + int[] dset_indata = new int[DIM_BLKS+DIM_PNTS]; + String objName = "/Dataset1"; + + _openH5File(H5_DREG_FILE, objName); + + try { + H5.H5export_dataset(EXPORT_DREG_FILE, H5fid, objName, 99); + } + catch (HDF5LibraryException err) { + err.printStackTrace(); + fail("H5export_dataset failed: " + err); + } + + File file = new File(EXPORT_DREG_FILE); + + try { + Reader reader = new FileReader(EXPORT_DREG_FILE); + StreamTokenizer streamTokenizer = new StreamTokenizer(reader); + int indx = 0; + while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){ + if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) { + dset_indata[indx] = (int)streamTokenizer.nval; + indx++; + } + } + reader.close(); + } + catch (IOException err) { + err.printStackTrace(); + fail("read file failed: " + err); + } + for(int row = 0; row < DIM_X; row++) + assertTrue("testH5export_regdataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]); + } + + @Test + public void testH5export_attrdataset() { + int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108, + 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171, + 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231, + 207, 66, 252, 48, 84, 96, 12, 14, 213, 99}; + int[] dset_indata = new int[DIM_BLKS+DIM_PNTS]; + String dsetName = "/Dataset1"; + String objName = "Attribute1"; + + _openH5File(H5_AREG_FILE, dsetName); + + try { + H5.H5export_attribute(EXPORT_AREG_FILE, H5did, objName, 99); + } + catch (HDF5LibraryException err) { + err.printStackTrace(); + fail("H5export_attribute failed: " + err); + } + + File file = new File(EXPORT_AREG_FILE); + + try { + Reader reader = new FileReader(EXPORT_AREG_FILE); + StreamTokenizer streamTokenizer = new StreamTokenizer(reader); + int indx = 0; + int jndx = 0; + while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){ + if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) { + dset_indata[indx] = (int)streamTokenizer.nval; + indx++; + } + } + reader.close(); + } + catch (IOException err) { + err.printStackTrace(); + fail("read file failed: " + err); + } + for(int row = 0; row < DIM_X; row++) + assertTrue("testH5export_attrdataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]); + } } diff --git a/java/test/TestH5A.java b/java/test/TestH5A.java index cff03f9..f2134d2 100644 --- a/java/test/TestH5A.java +++ b/java/test/TestH5A.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -43,14 +42,14 @@ public class TestH5A { private static final String H5_FILE = "testA.h5"; private static final int DIM_X = 4; private static final int DIM_Y = 6; - long H5fid = -1; - long H5dsid = -1; - long H5did = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; - long type_id = -1; - long space_id = -1; - long lapl_id = -1; - long aapl_id = -1; + long type_id = HDF5Constants.H5I_INVALID_HID; + long space_id = HDF5Constants.H5I_INVALID_HID; + long lapl_id = HDF5Constants.H5I_INVALID_HID; + long aapl_id = HDF5Constants.H5I_INVALID_HID; private final void _deleteFile(String filename) { File file = new File(filename); @@ -61,7 +60,7 @@ public class TestH5A { } private final long _createDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl); @@ -132,7 +131,7 @@ public class TestH5A { @Test public void testH5Acreate2() { - long attr_id = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; try { attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); assertTrue("testH5Acreate2", attr_id >= 0); @@ -160,8 +159,8 @@ public class TestH5A { @Test public void testH5Aopen() { String attr_name = "dset"; - long attribute_id = -1; - long attr_id = -1; + long attribute_id = HDF5Constants.H5I_INVALID_HID; + long attr_id = HDF5Constants.H5I_INVALID_HID; try { attr_id = H5.H5Acreate(H5did, attr_name, type_id, space_id, @@ -197,8 +196,8 @@ public class TestH5A { int idx_type = HDF5Constants.H5_INDEX_CRT_ORDER; int order = HDF5Constants.H5_ITER_INC; long n = 0; - long attr_id = -1; - long attribute_id = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; try { attr_id = H5.H5Acreate(H5did, "file", type_id, space_id, @@ -256,7 +255,7 @@ public class TestH5A { public void testH5Acreate_by_name() { String obj_name = "."; String attr_name = "DATASET"; - long attribute_id = -1; + long attribute_id = HDF5Constants.H5I_INVALID_HID; boolean bool_val = false; try { @@ -288,7 +287,7 @@ public class TestH5A { long loc_id = H5fid; String old_attr_name = "old"; String new_attr_name = "new"; - long attr_id = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; int ret_val = -1; boolean bool_val = false; @@ -326,7 +325,7 @@ public class TestH5A { String obj_name = "."; String old_attr_name = "old"; String new_attr_name = "new"; - long attr_id = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; int ret_val = -1; boolean bool_val = false; @@ -368,7 +367,7 @@ public class TestH5A { String obj_name = "."; String attr_name = "DATASET1"; String ret_name = null; - long attribute_id = -1; + long attribute_id = HDF5Constants.H5I_INVALID_HID; try { attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name, @@ -398,8 +397,8 @@ public class TestH5A { int idx_type = HDF5Constants.H5_INDEX_NAME; int order = HDF5Constants.H5_ITER_INC; int n = 0; - long attr1_id = -1; - long attr2_id = -1; + long attr1_id = HDF5Constants.H5I_INVALID_HID; + long attr2_id = HDF5Constants.H5I_INVALID_HID; try { attr1_id = H5.H5Acreate_by_name(loc_id, obj_name, attr_name, @@ -435,8 +434,8 @@ public class TestH5A { @Test public void testH5Aget_storage_size() { - long attr_id = -1; - long attr_size = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; + long attr_size = HDF5Constants.H5I_INVALID_HID; try { attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id, @@ -458,8 +457,8 @@ public class TestH5A { @Test public void testH5Aget_info() { H5A_info_t attr_info = null; - long attribute_id = -1; - long attr_id = -1; + long attribute_id = HDF5Constants.H5I_INVALID_HID; + long attr_id = HDF5Constants.H5I_INVALID_HID; try { attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id, @@ -490,8 +489,8 @@ public class TestH5A { @Test public void testH5Aget_info1() { H5A_info_t attr_info = null; - long attribute_id = -1; - long attr_id = -1; + long attribute_id = HDF5Constants.H5I_INVALID_HID; + long attr_id = HDF5Constants.H5I_INVALID_HID; int order = HDF5Constants.H5_ITER_INC; try { @@ -526,8 +525,8 @@ public class TestH5A { @Test public void testH5Aget_info_by_idx() { - long attr_id = -1; - long attr2_id = -1;; + long attr_id = HDF5Constants.H5I_INVALID_HID; + long attr2_id = HDF5Constants.H5I_INVALID_HID;; H5A_info_t attr_info = null; try { @@ -582,7 +581,7 @@ public class TestH5A { @Test public void testH5Aget_info_by_name() { - long attr_id = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; H5A_info_t attr_info = null; String obj_name = "."; String attr_name = "DATASET"; @@ -607,7 +606,7 @@ public class TestH5A { @Test public void testH5Adelete_by_name() { - long attr_id = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; int ret_val = -1; boolean bool_val = false; boolean exists = false; @@ -650,8 +649,8 @@ public class TestH5A { @Test public void testH5Aexists() { boolean exists = false; - long attr_id = -1; - long attribute_id = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; try { exists = H5.H5Aexists(H5fid, "None"); @@ -689,10 +688,10 @@ public class TestH5A { @Test public void testH5Adelete_by_idx_order() { boolean exists = false; - long attr1_id = -1; - long attr2_id = -1; - long attr3_id = -1; - long attr4_id = -1; + long attr1_id = HDF5Constants.H5I_INVALID_HID; + long attr2_id = HDF5Constants.H5I_INVALID_HID; + long attr3_id = HDF5Constants.H5I_INVALID_HID; + long attr4_id = HDF5Constants.H5I_INVALID_HID; try { attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1", @@ -731,9 +730,9 @@ public class TestH5A { @Test public void testH5Adelete_by_idx_name1() { boolean exists = false; - long attr1_id = -1; - long attr2_id = -1; - long attr3_id = -1; + long attr1_id = HDF5Constants.H5I_INVALID_HID; + long attr2_id = HDF5Constants.H5I_INVALID_HID; + long attr3_id = HDF5Constants.H5I_INVALID_HID; try { attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1", @@ -766,10 +765,10 @@ public class TestH5A { @Test public void testH5Adelete_by_idx_name2() { boolean exists = false; - long attr1_id = -1; - long attr2_id = -1; - long attr3_id = -1; - long attr4_id = -1; + long attr1_id = HDF5Constants.H5I_INVALID_HID; + long attr2_id = HDF5Constants.H5I_INVALID_HID; + long attr3_id = HDF5Constants.H5I_INVALID_HID; + long attr4_id = HDF5Constants.H5I_INVALID_HID; try { attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1", @@ -821,8 +820,8 @@ public class TestH5A { public void testH5Aopen_by_name() { String obj_name = "."; String attr_name = "DATASET"; - long attribute_id = -1; - long aid = -1; + long attribute_id = HDF5Constants.H5I_INVALID_HID; + long aid = HDF5Constants.H5I_INVALID_HID; try { attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name, @@ -856,9 +855,9 @@ public class TestH5A { @Test public void testH5Awrite_readVL() { String attr_name = "VLdata"; - long attr_id = -1; - long atype_id = -1; - long aspace_id = -1; + long attr_id = HDF5Constants.H5I_INVALID_HID; + long atype_id = HDF5Constants.H5I_INVALID_HID; + long aspace_id = HDF5Constants.H5I_INVALID_HID; String[] str_data = { "Parting", "is such", "sweet", "sorrow." }; long[] dims = { str_data.length }; long lsize = 1; @@ -923,8 +922,8 @@ public class TestH5A { public void testH5Aget_create_plist() { String attr_name = "DATASET1"; int char_encoding = 0; - long plist_id = -1; - long attribute_id = -1; + long plist_id = HDF5Constants.H5I_INVALID_HID; + long attribute_id = HDF5Constants.H5I_INVALID_HID; try { plist_id = H5.H5Pcreate(HDF5Constants.H5P_ATTRIBUTE_CREATE); @@ -984,10 +983,10 @@ public class TestH5A { @Test public void testH5Aiterate() { - long attr1_id = -1; - long attr2_id = -1; - long attr3_id = -1; - long attr4_id = -1; + long attr1_id = HDF5Constants.H5I_INVALID_HID; + long attr2_id = HDF5Constants.H5I_INVALID_HID; + long attr3_id = HDF5Constants.H5I_INVALID_HID; + long attr4_id = HDF5Constants.H5I_INVALID_HID; class idata { public String attr_name = null; @@ -1052,10 +1051,10 @@ public class TestH5A { @Test public void testH5Aiterate_by_name() { - long attr1_id = -1; - long attr2_id = -1; - long attr3_id = -1; - long attr4_id = -1; + long attr1_id = HDF5Constants.H5I_INVALID_HID; + long attr2_id = HDF5Constants.H5I_INVALID_HID; + long attr3_id = HDF5Constants.H5I_INVALID_HID; + long attr4_id = HDF5Constants.H5I_INVALID_HID; class idata { public String attr_name = null; diff --git a/java/test/TestH5Arw.java b/java/test/TestH5Arw.java new file mode 100644 index 0000000..282b736 --- /dev/null +++ b/java/test/TestH5Arw.java @@ -0,0 +1,449 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; + +import hdf.hdf5lib.H5; +import hdf.hdf5lib.HDF5Constants; +import hdf.hdf5lib.HDFNativeData; +import hdf.hdf5lib.callbacks.H5A_iterate_cb; +import hdf.hdf5lib.callbacks.H5A_iterate_t; +import hdf.hdf5lib.exceptions.HDF5Exception; +import hdf.hdf5lib.exceptions.HDF5LibraryException; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; + +public class TestH5Arw { + @Rule public TestName testname = new TestName(); + private static final String H5_INTS_FILE = "tintsattrs.h5"; + private static final String H5_FLTS_FILE = "tfloatsattrs.h5"; + private static final int DIM_X = 8; + private static final int DIM8_Y = 8; + private static final int DIM16_Y = 16; + private static final int DIM32_Y = 32; + private static final int DIM64_Y = 64; + private static final int DIM128_Y = 128; + private static final String DATASETU08 = "DU08BITS"; + private static final String DATASETS08 = "DS08BITS"; + private static final String DATASETU16 = "DU16BITS"; + private static final String DATASETS16 = "DS16BITS"; + private static final String DATASETU32 = "DU32BITS"; + private static final String DATASETS32 = "DS32BITS"; + private static final String DATASETU64 = "DU64BITS"; + private static final String DATASETS64 = "DS64BITS"; + private static final String DATASETF32 = "DS32BITS"; + private static final String DATASETF64 = "DS64BITS"; + private static final String DATASETF128 = "DS128BITS"; + private static final int RANK = 2; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5aid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + + private final void _closeH5file() throws HDF5LibraryException { + if (H5aid >= 0) + try {H5.H5Aclose(H5aid);} catch (Exception ex) {} + if (H5did >= 0) + try {H5.H5Dclose(H5did);} catch (Exception ex) {} + if (H5fid > 0) + try {H5.H5Fclose(H5fid);} catch (Exception ex) {} + } + + public void openH5file(String filename, String dsetname) { + try { + H5fid = H5.H5Fopen(filename, + HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5Arw._openH5file: " + err); + } + assertTrue("TestH5Arw._openH5file: H5.H5Fopen: ", H5fid >= 0); + try { + H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5Arw._openH5file: " + err); + } + assertTrue("TestH5Arw._openH5file: H5.H5Dopen: ", H5did >= 0); + try { + H5aid = H5.H5Aopen(H5did, dsetname, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5Arw._openH5file: " + err); + } + assertTrue("TestH5Arw._openH5file: H5.H5Aopen: ", H5aid >= 0); + } + + @After + public void closeH5file() throws HDF5LibraryException { + if (H5aid >= 0) + try {H5.H5Aclose(H5aid);} catch (Exception ex) {} + if (H5did >= 0) + try {H5.H5Aclose(H5did);} catch (Exception ex) {} + if (H5fid > 0) + try {H5.H5Fclose(H5fid);} catch (Exception ex) {} + H5fid = HDF5Constants.H5I_INVALID_HID; + H5did = HDF5Constants.H5I_INVALID_HID; + H5aid = HDF5Constants.H5I_INVALID_HID; + System.out.println(); + } + + @Before + public void verifyCount() + throws NullPointerException, HDF5Exception { + assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0); + System.out.print(testname.getMethodName()); + } + + @Test + public void testH5Aread_8bit_ints() { + byte[][] attr_data = new byte[DIM_X][DIM8_Y]; + + try { + openH5file(H5_INTS_FILE, DATASETU08); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Aread_8bit_ints: openH5file: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT8, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_8bit_ints: H5Aread: " + err); + } + + // End access to the attribute and release resources used by it. + try { + H5.H5Aclose(H5aid); + } + catch (Exception err) { + err.printStackTrace(); + } + + // End access to the dataset and release resources used by it. + try { + H5.H5Dclose(H5did); + } + catch (Exception err) { + err.printStackTrace(); + } + + // Open an existing dataset. + try { + H5did = H5.H5Dopen(H5fid, DATASETS08, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_8bit_ints: H5Dopen: " + err); + } + + // Open an existing attribute. + try { + H5aid = H5.H5Aopen(H5did, DATASETS08, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_8bit_ints: H5Aopen: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT8, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_8bit_ints: H5Aread: " + err); + } + } + + @Test + public void testH5Aread_16bit_ints() { + short[][] attr_data = new short[DIM_X][DIM16_Y]; + + try { + openH5file(H5_INTS_FILE, DATASETU16); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Aread_16bit_ints: openH5file: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT16, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_16bit_ints: H5Aread: " + err); + } + + // End access to the attribute and release resources used by it. + try { + H5.H5Aclose(H5aid); + } + catch (Exception err) { + err.printStackTrace(); + } + + // End access to the dataset and release resources used by it. + try { + H5.H5Dclose(H5did); + } + catch (Exception err) { + err.printStackTrace(); + } + + // Open an existing dataset. + try { + H5did = H5.H5Dopen(H5fid, DATASETS16, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_16bit_ints: H5Dopen: " + err); + } + + // Open an existing attribute. + try { + H5aid = H5.H5Aopen(H5did, DATASETS16, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_16bit_ints: H5Aopen: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT16, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_16bit_ints: H5Aread: " + err); + } + } + + @Test + public void testH5Aread_32bit_ints() { + int[][] attr_data = new int[DIM_X][DIM16_Y]; + + try { + openH5file(H5_INTS_FILE, DATASETU32); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Aread_32bit_ints: openH5file: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT32, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_32bit_ints: H5Aread: " + err); + } + + // End access to the attribute and release resources used by it. + try { + H5.H5Aclose(H5aid); + } + catch (Exception err) { + err.printStackTrace(); + } + + // End access to the dataset and release resources used by it. + try { + H5.H5Dclose(H5did); + } + catch (Exception err) { + err.printStackTrace(); + } + + // Open an existing dataset. + try { + H5did = H5.H5Dopen(H5fid, DATASETS32, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_32bit_ints: H5Dopen: " + err); + } + + // Open an existing attribute. + try { + H5aid = H5.H5Aopen(H5did, DATASETS32, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_32bit_ints: H5Aopen: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT32, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_32bit_ints: H5Aread: " + err); + } + } + + @Test + public void testH5Aread_64bit_ints() { + long[][] attr_data = new long[DIM_X][DIM64_Y]; + + try { + openH5file(H5_INTS_FILE, DATASETU64); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Aread_64bit_ints: openH5file: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_UINT64, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_64bit_ints: H5Aread: " + err); + } + + // End access to the attribute and release resources used by it. + try { + H5.H5Aclose(H5aid); + } + catch (Exception err) { + err.printStackTrace(); + } + + // End access to the dataset and release resources used by it. + try { + H5.H5Dclose(H5did); + } + catch (Exception err) { + err.printStackTrace(); + } + + // Open an existing dataset. + try { + H5did = H5.H5Dopen(H5fid, DATASETS64, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_64bit_ints: H5Dopen: " + err); + } + + // Open an existing attribute. + try { + H5aid = H5.H5Aopen(H5did, DATASETS64, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_64bit_ints: H5Aopen: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_INT64, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_64bit_ints: H5Aread: " + err); + } + } + + @Test + public void testH5Aread_32bit_floats() { + float[][] attr_data = new float[DIM_X][DIM32_Y]; + + try { + openH5file(H5_FLTS_FILE, DATASETF32); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Aread_32bit_floats: openH5file: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_FLOAT, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_32bit_floats: H5Aread: " + err); + } + for (int i = 0; i < DIM_X; i++) + assertTrue("testH5Aread_32bit_floats - H5.H5Aread: ", attr_data[i][0] == (32 - i)); + } + + @Test + public void testH5Aread_64bit_floats() { + double[][] attr_data = new double[DIM_X][DIM64_Y]; + + try { + openH5file(H5_FLTS_FILE, DATASETF64); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Aread_64bit_floats: openH5file: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_DOUBLE, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_64bit_floats: H5Aread: " + err); + } + for (int i = 0; i < DIM_X; i++) + assertTrue("testH5Aread_64bit_floats - H5.H5Aread: ", attr_data[i][0] == (64 - i)); + } + + @Test + public void testH5Aread_128bit_floats() { + byte[][][] attr_data = new byte[DIM_X][DIM128_Y][8]; + + try { + openH5file(H5_FLTS_FILE, DATASETF128); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Aread_128bit_floats: openH5file: " + err); + } + + // Read data. + try { + H5.H5Aread(H5aid, HDF5Constants.H5T_NATIVE_LDOUBLE, attr_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Aread_128bit_floats: H5Aread: " + err); + } + } + +} diff --git a/java/test/TestH5D.java b/java/test/TestH5D.java index 21f0879..dac3a9c 100644 --- a/java/test/TestH5D.java +++ b/java/test/TestH5D.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -39,13 +38,13 @@ public class TestH5D { private static final int DIM_X = 4; private static final int DIM_Y = 6; private static final int RANK = 2; - long H5fid = -1; - long H5faplid = -1; - long H5dsid = -1; - long H5dtid = -1; - long H5did = -1; - long H5did0 = -1; - long H5dcpl_id = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5faplid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5dtid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + long H5did0 = HDF5Constants.H5I_INVALID_HID; + long H5dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; // Values for the status of space allocation @@ -195,10 +194,10 @@ public class TestH5D { try {H5.H5Fclose(H5fid);} catch (Exception ex) {} } - private final void _openH5file(String name, long dapl) { + private final void _openH5file(String filename, String dsetname, long dapl) { try { - H5fid = H5.H5Fopen(H5_FILE, - HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT); + H5fid = H5.H5Fopen(filename, + HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { err.printStackTrace(); @@ -206,7 +205,7 @@ public class TestH5D { } assertTrue("TestH5D._openH5file: H5.H5Fopen: ",H5fid >= 0); try { - H5did = H5.H5Dopen(H5fid, name, dapl); + H5did = H5.H5Dopen(H5fid, dsetname, dapl); } catch (Throwable err) { err.printStackTrace(); @@ -268,7 +267,7 @@ public class TestH5D { @Test public void testH5Dcreate() { - long dataset_id = -1; + long dataset_id = HDF5Constants.H5I_INVALID_HID; try { dataset_id = H5.H5Dcreate(H5fid, "dset", HDF5Constants.H5T_STD_I32BE, H5dsid, @@ -292,7 +291,7 @@ public class TestH5D { @Test public void testH5Dcreate_anon() { - long dataset_id = -1; + long dataset_id = HDF5Constants.H5I_INVALID_HID; try { dataset_id = H5.H5Dcreate_anon(H5fid, HDF5Constants.H5T_STD_I32BE, H5dsid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); @@ -315,12 +314,12 @@ public class TestH5D { @Test public void testH5Dopen() { - long dataset_id = -1; + long dataset_id = HDF5Constants.H5I_INVALID_HID; _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT); try { H5.H5Dclose(H5did); - H5did = -1; + H5did = HDF5Constants.H5I_INVALID_HID; dataset_id = H5.H5Dopen(H5fid, "dset", HDF5Constants.H5P_DEFAULT); } catch (Exception err) { @@ -388,8 +387,8 @@ public class TestH5D { @Test public void testH5Dget_access_plist() { - long dapl_id = -1; - long test_dapl_id = -1; + long dapl_id = HDF5Constants.H5I_INVALID_HID; + long test_dapl_id = HDF5Constants.H5I_INVALID_HID; int[] mdc_nelmts1 = {0}; int[] mdc_nelmts2 = {0}; long[] rdcc_nelmts1 = {0}; @@ -500,7 +499,7 @@ public class TestH5D { @Test(expected = HDF5LibraryException.class) public void testH5Dget_space_closed() throws Throwable { - long dataset_id = -1; + long dataset_id = HDF5Constants.H5I_INVALID_HID; try { dataset_id = H5.H5Dcreate(H5fid, "dset", HDF5Constants.H5T_STD_I32BE, H5dsid, @@ -518,7 +517,7 @@ public class TestH5D { @Test public void testH5Dget_space() { - long dataspace_id = -1; + long dataspace_id = HDF5Constants.H5I_INVALID_HID; _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT); try { @@ -542,7 +541,7 @@ public class TestH5D { @Test(expected = HDF5LibraryException.class) public void testH5Dget_type_closed() throws Throwable { - long dataset_id = -1; + long dataset_id = HDF5Constants.H5I_INVALID_HID; try { dataset_id = H5.H5Dcreate(H5fid, "dset", HDF5Constants.H5T_STD_I32BE, H5dsid, @@ -560,7 +559,7 @@ public class TestH5D { @Test public void testH5Dget_type() { - long datatype_id = -1; + long datatype_id = HDF5Constants.H5I_INVALID_HID; _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT); try { diff --git a/java/test/TestH5Dparams.java b/java/test/TestH5Dparams.java index 66f0d83..3661139 100644 --- a/java/test/TestH5Dparams.java +++ b/java/test/TestH5Dparams.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/test/TestH5Dplist.java b/java/test/TestH5Dplist.java index 97ce084..774b9dd 100644 --- a/java/test/TestH5Dplist.java +++ b/java/test/TestH5Dplist.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -42,10 +41,10 @@ public class TestH5Dplist { private static final int NDIMS = 2; private static final int FILLVAL = 99; private static final int RANK = 2; - long H5fid = -1; - long H5dsid = -1; - long H5did = -1; - long H5dcpl_id = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + long H5dcpl_id = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; long[] H5extdims = { EDIM_X, EDIM_Y }; long[] H5chunk_dims = { CHUNK_X, CHUNK_Y }; diff --git a/java/test/TestH5Drw.java b/java/test/TestH5Drw.java new file mode 100644 index 0000000..69fb9d7 --- /dev/null +++ b/java/test/TestH5Drw.java @@ -0,0 +1,378 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; + +import hdf.hdf5lib.H5; +import hdf.hdf5lib.HDF5Constants; +import hdf.hdf5lib.HDFNativeData; +import hdf.hdf5lib.callbacks.H5D_iterate_cb; +import hdf.hdf5lib.callbacks.H5D_iterate_t; +import hdf.hdf5lib.exceptions.HDF5Exception; +import hdf.hdf5lib.exceptions.HDF5LibraryException; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; + +public class TestH5Drw { + @Rule public TestName testname = new TestName(); + private static final String H5_INTS_FILE = "tintsattrs.h5"; + private static final String H5_FLTS_FILE = "tfloatsattrs.h5"; + private static final int DIM_X = 8; + private static final int DIM8_Y = 8; + private static final int DIM16_Y = 16; + private static final int DIM32_Y = 32; + private static final int DIM64_Y = 64; + private static final int DIM128_Y = 128; + private static final String DATASETU08 = "DU08BITS"; + private static final String DATASETS08 = "DS08BITS"; + private static final String DATASETU16 = "DU16BITS"; + private static final String DATASETS16 = "DS16BITS"; + private static final String DATASETU32 = "DU32BITS"; + private static final String DATASETS32 = "DS32BITS"; + private static final String DATASETU64 = "DU64BITS"; + private static final String DATASETS64 = "DS64BITS"; + private static final String DATASETF32 = "DS32BITS"; + private static final String DATASETF64 = "DS64BITS"; + private static final String DATASETF128 = "DS128BITS"; + private static final int RANK = 2; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + + private final void _closeH5file() throws HDF5LibraryException { + if (H5did >= 0) + try {H5.H5Dclose(H5did);} catch (Exception ex) {} + if (H5fid > 0) + try {H5.H5Fclose(H5fid);} catch (Exception ex) {} + } + + public void openH5file(String filename, String dsetname) { + try { + H5fid = H5.H5Fopen(filename, + HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5Drw._openH5file: " + err); + } + assertTrue("TestH5Drw._openH5file: H5.H5Fopen: ", H5fid >= 0); + try { + H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5Drw._openH5file: " + err); + } + assertTrue("TestH5Drw._openH5file: H5.H5Dopen: ", H5did >= 0); + } + + @After + public void closeH5file() throws HDF5LibraryException { + if (H5did >= 0) + try {H5.H5Dclose(H5did);} catch (Exception ex) {} + if (H5fid > 0) + try {H5.H5Fclose(H5fid);} catch (Exception ex) {} + H5fid = HDF5Constants.H5I_INVALID_HID; + H5did = HDF5Constants.H5I_INVALID_HID; + System.out.println(); + } + + @Before + public void verifyCount() + throws NullPointerException, HDF5Exception { + assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0); + System.out.print(testname.getMethodName()); + } + + @Test + public void testH5Dread_8bit_ints() { + byte[][] dset_data = new byte[DIM_X][DIM8_Y]; + + try { + openH5file(H5_INTS_FILE, DATASETU08); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Dread_8bit_ints: openH5file: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT8, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_8bit_ints: H5Dread: " + err); + } + + // End access to the dataset and release resources used by it. + try { + H5.H5Dclose(H5did); + } + catch (Exception err) { + err.printStackTrace(); + } + + // Open an existing dataset. + try { + H5did = H5.H5Dopen(H5fid, DATASETS08, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_8bit_ints: H5Dopen: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT8, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_8bit_ints: H5Dread: " + err); + } + } + + @Test + public void testH5Dread_16bit_ints() { + short[][] dset_data = new short[DIM_X][DIM16_Y]; + + try { + openH5file(H5_INTS_FILE, DATASETU16); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Dread_16bit_ints: openH5file: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT16, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_16bit_ints: H5Dread: " + err); + } + + // End access to the dataset and release resources used by it. + try { + H5.H5Dclose(H5did); + } + catch (Exception err) { + err.printStackTrace(); + } + + // Open an existing dataset. + try { + H5did = H5.H5Dopen(H5fid, DATASETS16, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_16bit_ints: H5Dopen: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT16, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_16bit_ints: H5Dread: " + err); + } + } + + @Test + public void testH5Dread_32bit_ints() { + int[][] dset_data = new int[DIM_X][DIM16_Y]; + + try { + openH5file(H5_INTS_FILE, DATASETU32); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Dread_32bit_ints: openH5file: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT32, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_32bit_ints: H5Dread: " + err); + } + + // End access to the dataset and release resources used by it. + try { + H5.H5Dclose(H5did); + } + catch (Exception err) { + err.printStackTrace(); + } + + // Open an existing dataset. + try { + H5did = H5.H5Dopen(H5fid, DATASETS32, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_32bit_ints: H5Dopen: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT32, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_32bit_ints: H5Dread: " + err); + } + } + + @Test + public void testH5Dread_64bit_ints() { + long[][] dset_data = new long[DIM_X][DIM64_Y]; + + try { + openH5file(H5_INTS_FILE, DATASETU64); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Dread_64bit_ints: openH5file: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_UINT64, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_64bit_ints: H5Dread: " + err); + } + + // End access to the dataset and release resources used by it. + try { + H5.H5Dclose(H5did); + } + catch (Exception err) { + err.printStackTrace(); + } + + // Open an existing dataset. + try { + H5did = H5.H5Dopen(H5fid, DATASETS64, HDF5Constants.H5P_DEFAULT); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_64bit_ints: H5Dopen: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_INT64, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_64bit_ints: H5Dread: " + err); + } + } + + @Test + public void testH5Dread_32bit_floats() { + float[][] dset_data = new float[DIM_X][DIM32_Y]; + + try { + openH5file(H5_FLTS_FILE, DATASETF32); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Dread_32bit_floats: openH5file: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_FLOAT, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_32bit_floats: H5Dread: " + err); + } + for (int i = 0; i < DIM_X; i++) + assertTrue("testH5Dread_32bit_floats - H5.H5Dread: ", dset_data[i][0] == (32 - i)); + } + + @Test + public void testH5Dread_64bit_floats() { + double[][] dset_data = new double[DIM_X][DIM64_Y]; + + try { + openH5file(H5_FLTS_FILE, DATASETF64); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Dread_64bit_floats: openH5file: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_DOUBLE, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_64bit_floats: H5Dread: " + err); + } + for (int i = 0; i < DIM_X; i++) + assertTrue("testH5Dread_64bit_floats - H5.H5Dread: ", dset_data[i][0] == (64 - i)); + } + + @Test + public void testH5Dread_128bit_floats() { + byte[][][] dset_data = new byte[DIM_X][DIM128_Y][8]; + + try { + openH5file(H5_FLTS_FILE, DATASETF128); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Dread_128bit_floats: openH5file: " + err); + } + + // Read data. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_NATIVE_LDOUBLE, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, dset_data); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Dread_128bit_floats: H5Dread: " + err); + } + } + +} diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index 68cd933..cad0a06 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java index 2f05c75..9e93cea 100644 --- a/java/test/TestH5Edefault.java +++ b/java/test/TestH5Edefault.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -58,27 +57,27 @@ public class TestH5Edefault { @Ignore public void testH5Eprint() { - /* - * If HDF5_VOL_CONNECTOR is set, this might not be the - * native connector and the error stack might be different. - * Only check for the specific error stack if the native - * connector is being used. - */ - String connector = System.getenv("HDF5_VOL_CONNECTOR"); - if (connector == null) { - try { - H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT); - } - catch (Throwable err) { - } - try { - H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5Eprint: " + err); - } - } + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector and the error stack might be different. + * Only check for the specific error stack if the native + * connector is being used. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) { + try { + H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + } + try { + H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5Eprint: " + err); + } + } } @Test @@ -439,27 +438,27 @@ public class TestH5Edefault { @Ignore public void testH5EprintInt() { - /* - * If HDF5_VOL_CONNECTOR is set, this might not be the - * native connector and the error stack might be different. - * Only check for the specific error stack if the native - * connector is being used. - */ - String connector = System.getenv("HDF5_VOL_CONNECTOR"); - if (connector == null) { - try { - H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT); - } - catch (Throwable err) { - } - try { - H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5EprintInt: " + err); - } - } + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector and the error stack might be different. + * Only check for the specific error stack if the native + * connector is being used. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) { + try { + H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + } + try { + H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5EprintInt: " + err); + } + } } @Test diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java index e74475f..e55f1fc 100644 --- a/java/test/TestH5Eparams.java +++ b/java/test/TestH5Eparams.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/test/TestH5Eregister.java b/java/test/TestH5Eregister.java index 99f8303..99e8e5f 100644 --- a/java/test/TestH5Eregister.java +++ b/java/test/TestH5Eregister.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/test/TestH5F.java b/java/test/TestH5F.java index 3ef4635..16786b9 100644 --- a/java/test/TestH5F.java +++ b/java/test/TestH5F.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -49,7 +48,7 @@ public class TestH5F { HDF5Constants.H5F_OBJ_DATASET, HDF5Constants.H5F_OBJ_GROUP, HDF5Constants.H5F_OBJ_DATATYPE, HDF5Constants.H5F_OBJ_ATTR, HDF5Constants.H5F_OBJ_ALL }; - long H5fid = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; private final void _deleteFile(String filename) { File file = new File(filename); @@ -74,7 +73,7 @@ public class TestH5F { public void deleteH5file() throws HDF5LibraryException { if (H5fid > 0) { try {H5.H5Fclose(H5fid);} catch (Exception ex) {} - H5fid = -1; + H5fid = HDF5Constants.H5I_INVALID_HID; } _deleteFile(H5_FILE); System.out.println(); @@ -82,7 +81,7 @@ public class TestH5F { @Test public void testH5Fget_create_plist() { - long plist = -1; + long plist = HDF5Constants.H5I_INVALID_HID; try { plist = H5.H5Fget_create_plist(H5fid); @@ -106,7 +105,7 @@ public class TestH5F { @Test public void testH5Fget_access_plist() { - long plist = -1; + long plist = HDF5Constants.H5I_INVALID_HID; try { plist = H5.H5Fget_access_plist(H5fid); @@ -134,7 +133,7 @@ public class TestH5F { if (H5fid > 0) { try {H5.H5Fclose(H5fid);} catch (Exception ex) {} - H5fid = -1; + H5fid = HDF5Constants.H5I_INVALID_HID; } try { @@ -159,7 +158,7 @@ public class TestH5F { if (H5fid > 0) { try {H5.H5Fclose(H5fid);} catch (Exception ex) {} - H5fid = -1; + H5fid = HDF5Constants.H5I_INVALID_HID; } try { @@ -182,8 +181,8 @@ public class TestH5F { public void testH5Fget_fileno_same() { long fileno1 = 0; long fileno2 = 0; - long fid1 = -1; - long fid2 = -1; + long fid1 = HDF5Constants.H5I_INVALID_HID; + long fid2 = HDF5Constants.H5I_INVALID_HID; try { fid1 = H5.H5Fcreate(H5_FILE2, HDF5Constants.H5F_ACC_TRUNC, @@ -213,7 +212,7 @@ public class TestH5F { public void testH5Fget_fileno_diff() { long fileno1 = 0; long fileno2 = 0; - long fid2 = -1; + long fid2 = HDF5Constants.H5I_INVALID_HID; try { fid2 = H5.H5Fcreate(H5_FILE2, HDF5Constants.H5F_ACC_TRUNC, diff --git a/java/test/TestH5Fbasic.java b/java/test/TestH5Fbasic.java index 225e311..4f3d928 100644 --- a/java/test/TestH5Fbasic.java +++ b/java/test/TestH5Fbasic.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -35,7 +34,7 @@ public class TestH5Fbasic { @Rule public TestName testname = new TestName(); private static final String H5_FILE = "testFb.h5"; private static final String TXT_FILE = "testFb.txt"; - long H5fid = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; private final void _deleteFile(String filename) { File file = new File(filename); @@ -90,7 +89,7 @@ public class TestH5Fbasic { @Test(expected = HDF5LibraryException.class) public void testH5Fopen_read_only() throws Throwable { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; try { fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR, @@ -125,8 +124,8 @@ public class TestH5Fbasic { @Test(expected = HDF5LibraryException.class) public void testH5Freopen_closed() throws Throwable { - long fid = -1; - long fid2 = -1; + long fid = HDF5Constants.H5I_INVALID_HID; + long fid2 = HDF5Constants.H5I_INVALID_HID; try { fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR, @@ -148,8 +147,8 @@ public class TestH5Fbasic { @Test public void testH5Freopen() { - long fid = -1; - long fid2 = -1; + long fid = HDF5Constants.H5I_INVALID_HID; + long fid2 = HDF5Constants.H5I_INVALID_HID; try { fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR, @@ -182,7 +181,7 @@ public class TestH5Fbasic { @Test public void testH5Fclose() { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; try { fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR, @@ -202,7 +201,7 @@ public class TestH5Fbasic { @Test(expected = HDF5LibraryException.class) public void testH5Fclose_twice() throws Throwable { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; try { fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR, diff --git a/java/test/TestH5Fparams.java b/java/test/TestH5Fparams.java index 85bfdf5..0376485 100644 --- a/java/test/TestH5Fparams.java +++ b/java/test/TestH5Fparams.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -105,7 +104,7 @@ public class TestH5Fparams { @Test public void testH5Fcreate() { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; File file = null; try { @@ -132,7 +131,7 @@ public class TestH5Fparams { @Test public void testH5Fflush_global() { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; try { fid = H5.H5Fcreate("test.h5", HDF5Constants.H5F_ACC_TRUNC, @@ -158,7 +157,7 @@ public class TestH5Fparams { @Test public void testH5Fflush_local() { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; try { fid = H5.H5Fcreate("test.h5", HDF5Constants.H5F_ACC_TRUNC, @@ -184,7 +183,7 @@ public class TestH5Fparams { @Test public void testH5Fget_info() { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; try { try { @@ -215,7 +214,7 @@ public class TestH5Fparams { @Ignore//(expected = HDF5FunctionArgumentException.class) public void testH5Fset_libver_bounds_invalidlow() throws Throwable { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; try { try { @@ -234,7 +233,7 @@ public class TestH5Fparams { @Ignore//(expected = HDF5FunctionArgumentException.class) public void testH5Fset_libver_bounds_invalidhigh() throws Throwable { - long fid = -1; + long fid = HDF5Constants.H5I_INVALID_HID; try { try { diff --git a/java/test/TestH5Fswmr.java b/java/test/TestH5Fswmr.java index 6a7ccfa..1ec78fe 100644 --- a/java/test/TestH5Fswmr.java +++ b/java/test/TestH5Fswmr.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -33,9 +32,9 @@ public class TestH5Fswmr { @Rule public TestName testname = new TestName(); private static final String H5_FILE = "testswmr.h5"; - long H5fid = -1; - long H5fapl = -1; - long H5fcpl = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5fapl = HDF5Constants.H5I_INVALID_HID; + long H5fcpl = HDF5Constants.H5I_INVALID_HID; private final void _deleteFile(String filename) { File file = new File(filename); @@ -63,15 +62,15 @@ public class TestH5Fswmr { public void deleteH5file() throws HDF5LibraryException { if (H5fapl > 0) { try {H5.H5Pclose(H5fapl);} catch (Exception ex) {} - H5fapl = -1; + H5fapl = HDF5Constants.H5I_INVALID_HID; } if (H5fcpl > 0) { try {H5.H5Pclose(H5fcpl);} catch (Exception ex) {} - H5fcpl = -1; + H5fcpl = HDF5Constants.H5I_INVALID_HID; } if (H5fid > 0) { try {H5.H5Fclose(H5fid);} catch (Exception ex) {} - H5fid = -1; + H5fid = HDF5Constants.H5I_INVALID_HID; } _deleteFile(H5_FILE); System.out.println(); diff --git a/java/test/TestH5G.java b/java/test/TestH5G.java index abd9642..edf2cbe 100644 --- a/java/test/TestH5G.java +++ b/java/test/TestH5G.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -39,11 +38,11 @@ public class TestH5G { private static final String[] GROUPS = { "/G1", "/G1/G11", "/G1/G12", "/G1/G11/G111", "/G1/G11/G112", "/G1/G11/G113", "/G1/G11/G114" }; private static final String[] GROUPS2 = { "/G1", "/G1/G14", "/G1/G12", "/G1/G13", "/G1/G11"}; - long H5fid = -1; - long H5fid2 = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5fid2 = HDF5Constants.H5I_INVALID_HID; private final long _createGroup(long fid, String name) { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); @@ -58,8 +57,8 @@ public class TestH5G { } private final long _createGroup2(long fid, String name) { - long gid = -1; - long gcpl = -1; + long gid = HDF5Constants.H5I_INVALID_HID; + long gcpl = HDF5Constants.H5I_INVALID_HID; try { gcpl = H5.H5Pcreate(HDF5Constants.H5P_GROUP_CREATE); //create gcpl } @@ -92,12 +91,12 @@ public class TestH5G { } private final long _openGroup(long fid, String name) { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { gid = H5.H5Gopen(fid, name, HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { - gid = -1; + gid = HDF5Constants.H5I_INVALID_HID; err.printStackTrace(); fail("H5.H5Gopen: " + err); } @@ -134,7 +133,7 @@ public class TestH5G { assertTrue("TestH5G.createH5file: H5.H5Fcreate: ", H5fid > 0); assertTrue("TestH5G.createH5file: H5.H5Fcreate: ", H5fid2 > 0); - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; for (int i = 0; i < GROUPS.length; i++) { gid = _createGroup(H5fid, GROUPS[i]); @@ -165,7 +164,7 @@ public class TestH5G { @Test public void testH5Gopen() { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; for (int i = 0; i < GROUPS.length; i++) { try { gid = H5.H5Gopen(H5fid, GROUPS[i], HDF5Constants.H5P_DEFAULT); @@ -185,8 +184,8 @@ public class TestH5G { @Test public void testH5Gget_create_plist() { - long gid = -1; - long pid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; + long pid = HDF5Constants.H5I_INVALID_HID; for (int i = 0; i < GROUPS.length; i++) { try { @@ -325,7 +324,7 @@ public class TestH5G { int names_found = 0; try { names_found = H5.H5Gget_obj_info_all(gid, null, objNames, objTypes, lnkTypes, - objTokens, HDF5Constants.H5_INDEX_NAME); + objTokens, HDF5Constants.H5_INDEX_NAME); } catch (Throwable err) { err.printStackTrace(); @@ -366,7 +365,7 @@ public class TestH5G { int names_found = 0; try { names_found = H5.H5Gget_obj_info_all(gid, null, objNames, objTypes, lnkTypes, - objTokens, HDF5Constants.H5_INDEX_NAME); + objTokens, HDF5Constants.H5_INDEX_NAME); } catch (Throwable err) { err.printStackTrace(); @@ -401,7 +400,7 @@ public class TestH5G { int names_found = 0; try { names_found = H5.H5Gget_obj_info_max(gid, objNames, objTypes, lnkTypes, - objTokens, groups_max_size); + objTokens, groups_max_size); } catch (Throwable err) { err.printStackTrace(); @@ -432,7 +431,7 @@ public class TestH5G { int names_found = 0; try { names_found = H5.H5Gget_obj_info_max(gid, objNames, objTypes, lnkTypes, - objTokens, groups_max_size); + objTokens, groups_max_size); } catch (Throwable err) { err.printStackTrace(); diff --git a/java/test/TestH5Gbasic.java b/java/test/TestH5Gbasic.java index aea417e..6e2e450 100644 --- a/java/test/TestH5Gbasic.java +++ b/java/test/TestH5Gbasic.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -33,10 +32,10 @@ import org.junit.rules.TestName; public class TestH5Gbasic { @Rule public TestName testname = new TestName(); private static final String H5_FILE = "testGb.h5"; - long H5fid = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; private final long _createGroup(long fid, String name) { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); @@ -85,7 +84,7 @@ public class TestH5Gbasic { @Test(expected = NullPointerException.class) public void testH5Gcreate_null() throws Throwable { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; // it should fail because the group name is null gid = H5.H5Gcreate(H5fid, null, HDF5Constants.H5P_DEFAULT, @@ -102,7 +101,7 @@ public class TestH5Gbasic { @Test public void testH5Gcreate() { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { gid = H5.H5Gcreate(H5fid, "/testH5Gcreate", HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, @@ -145,7 +144,7 @@ public class TestH5Gbasic { @Test public void testH5Gcreate_anon() { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { gid = H5.H5Gcreate_anon(H5fid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); @@ -161,7 +160,7 @@ public class TestH5Gbasic { @Test(expected = NullPointerException.class) public void testH5Gopen_null() throws Throwable { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; gid = H5.H5Gopen(H5fid, null, HDF5Constants.H5P_DEFAULT); @@ -175,7 +174,7 @@ public class TestH5Gbasic { @Test(expected = HDF5LibraryException.class) public void testH5Gopen_not_exists() throws Throwable { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; gid = H5.H5Gopen(H5fid, "Never_created", HDF5Constants.H5P_DEFAULT); @@ -209,7 +208,7 @@ public class TestH5Gbasic { @Test public void testH5Gget_create_plist() { - long pid = -1; + long pid = HDF5Constants.H5I_INVALID_HID; long gid = _createGroup(H5fid, "/testH5Gcreate"); assertTrue(gid > 0); diff --git a/java/test/TestH5Giterate.java b/java/test/TestH5Giterate.java index af210ca..388d2ac 100644 --- a/java/test/TestH5Giterate.java +++ b/java/test/TestH5Giterate.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -31,15 +30,15 @@ import org.junit.rules.TestName; public class TestH5Giterate { @Rule public TestName testname = new TestName(); private static final String H5_FILE = "h5ex_g_iterate.hdf"; - long H5fid = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; private final long _openGroup(long fid, String name) { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { gid = H5.H5Gopen(fid, name, HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { - gid = -1; + gid = HDF5Constants.H5I_INVALID_HID; err.printStackTrace(); fail("H5.H5Gcreate: " + err); } diff --git a/java/test/TestH5Lbasic.java b/java/test/TestH5Lbasic.java index bc4d65c..a28fc3d 100644 --- a/java/test/TestH5Lbasic.java +++ b/java/test/TestH5Lbasic.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -35,7 +34,7 @@ import org.junit.rules.TestName; public class TestH5Lbasic { @Rule public TestName testname = new TestName(); private static final String H5_FILE = "h5ex_g_iterateL1.hdf"; - long H5fid = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; @Before public void openH5file() diff --git a/java/test/TestH5Lcreate.java b/java/test/TestH5Lcreate.java index de29c1e..44af2e5 100644 --- a/java/test/TestH5Lcreate.java +++ b/java/test/TestH5Lcreate.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -41,13 +40,13 @@ public class TestH5Lcreate { private static final String H5_FILE = "testL.h5"; private static final int DIM_X = 4; private static final int DIM_Y = 6; - long H5fcpl = -1; - long H5fid = -1; - long H5dsid = -1; - long H5did1 = -1; - long H5did2 = -1; - long H5gcpl = -1; - long H5gid = -1; + long H5fcpl = HDF5Constants.H5I_INVALID_HID; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did1 = HDF5Constants.H5I_INVALID_HID; + long H5did2 = HDF5Constants.H5I_INVALID_HID; + long H5gcpl = HDF5Constants.H5I_INVALID_HID; + long H5gid = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; private final void _deleteFile(String filename) { @@ -64,7 +63,7 @@ public class TestH5Lcreate { } private final long _createDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid, @@ -80,7 +79,7 @@ public class TestH5Lcreate { } private final long _createGroup(long fid, String name) { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { H5gcpl = HDF5Constants.H5P_DEFAULT; gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT, diff --git a/java/test/TestH5Lparams.java b/java/test/TestH5Lparams.java index 2ce1eca..30ee242 100644 --- a/java/test/TestH5Lparams.java +++ b/java/test/TestH5Lparams.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/test/TestH5Obasic.java b/java/test/TestH5Obasic.java index 89474c4..350b7aa 100644 --- a/java/test/TestH5Obasic.java +++ b/java/test/TestH5Obasic.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -41,7 +40,7 @@ public class TestH5Obasic { private static final String H5_FILE = "h5ex_g_iterateO1.hdf"; private static H5O_token_t H5la_ds1 = null; private static H5O_token_t H5la_l1 = null; - long H5fid = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; @Before public void openH5file() @@ -69,7 +68,7 @@ public class TestH5Obasic { @Test(expected = HDF5LibraryException.class) public void testH5Oopen_not_exists() throws Throwable { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; oid = H5.H5Oopen(H5fid, "Never_created", HDF5Constants.H5P_DEFAULT); @@ -78,7 +77,7 @@ public class TestH5Obasic { @Test public void testH5Oget_info_dataset() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { @@ -96,7 +95,7 @@ public class TestH5Obasic { @Test public void testH5Oget_info_hardlink() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { oid = H5.H5Oopen(H5fid, "L1", HDF5Constants.H5P_DEFAULT); @@ -113,7 +112,7 @@ public class TestH5Obasic { @Test public void testH5Oget_info_group() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { oid = H5.H5Oopen(H5fid, "G1", HDF5Constants.H5P_DEFAULT); @@ -130,7 +129,7 @@ public class TestH5Obasic { @Test public void testH5Oget_info_datatype() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { oid = H5.H5Oopen(H5fid, "DT1", HDF5Constants.H5P_DEFAULT); @@ -234,7 +233,7 @@ public class TestH5Obasic { @Test public void testH5Oget_info_by_idx_n0() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT); @@ -260,7 +259,7 @@ public class TestH5Obasic { @Test public void testH5Oget_info_by_idx_n3() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { oid = H5.H5Oopen(H5fid, "L1", HDF5Constants.H5P_DEFAULT); @@ -286,7 +285,7 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_dataset() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_native_info_t native_info = null; try { @@ -306,7 +305,7 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_hardlink() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_native_info_t native_info = null; try { @@ -326,7 +325,7 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_group() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_native_info_t native_info = null; try { @@ -346,7 +345,7 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_datatype() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_native_info_t native_info = null; try { @@ -376,10 +375,10 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_by_name_dataset() { - H5O_native_info_t native_info = null; + H5O_native_info_t native_info = null; try { - native_info = H5.H5Oget_native_info_by_name(H5fid, "DS1", HDF5Constants.H5P_DEFAULT); + native_info = H5.H5Oget_native_info_by_name(H5fid, "DS1", HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { err.printStackTrace(); @@ -393,10 +392,10 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_by_name_hardlink() { - H5O_native_info_t native_info = null; + H5O_native_info_t native_info = null; try { - native_info = H5.H5Oget_native_info_by_name(H5fid, "L1", HDF5Constants.H5P_DEFAULT); + native_info = H5.H5Oget_native_info_by_name(H5fid, "L1", HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { err.printStackTrace(); @@ -410,10 +409,10 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_by_name_group() { - H5O_native_info_t native_info = null; + H5O_native_info_t native_info = null; try { - native_info = H5.H5Oget_native_info_by_name(H5fid, "G1", HDF5Constants.H5P_DEFAULT); + native_info = H5.H5Oget_native_info_by_name(H5fid, "G1", HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { err.printStackTrace(); @@ -427,10 +426,10 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_by_name_datatype() { - H5O_native_info_t native_info = null; + H5O_native_info_t native_info = null; try { - native_info = H5.H5Oget_native_info_by_name(H5fid, "DT1", HDF5Constants.H5P_DEFAULT); + native_info = H5.H5Oget_native_info_by_name(H5fid, "DT1", HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { err.printStackTrace(); @@ -464,7 +463,7 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_by_idx_n0() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_native_info_t native_info = null; H5O_hdr_info_t ohdr; H5_ih_info_t oinfo; @@ -486,7 +485,7 @@ public class TestH5Obasic { try {H5.H5Oclose(oid);} catch (Exception ex) {} try { - native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 0, HDF5Constants.H5P_DEFAULT); + native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 0, HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { err.printStackTrace(); @@ -503,7 +502,7 @@ public class TestH5Obasic { @Test public void testH5Oget_native_info_by_idx_n3() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_native_info_t native_info = null; H5O_hdr_info_t ohdr; H5_ih_info_t oinfo; @@ -525,7 +524,7 @@ public class TestH5Obasic { try {H5.H5Oclose(oid);} catch (Exception ex) {} try { - native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 3, HDF5Constants.H5P_DEFAULT); + native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 3, HDF5Constants.H5P_DEFAULT); } catch (Throwable err) { err.printStackTrace(); @@ -630,7 +629,7 @@ public class TestH5Obasic { @Test public void testH5Oopen_by_token() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { try { @@ -668,7 +667,7 @@ public class TestH5Obasic { @Test public void testH5Oopen_by_idx_n0() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { try { @@ -706,7 +705,7 @@ public class TestH5Obasic { @Test public void testH5Oopen_by_idx_n3() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { try { diff --git a/java/test/TestH5Ocopy.java b/java/test/TestH5Ocopy.java index 4888e76..b3b1acd 100644 --- a/java/test/TestH5Ocopy.java +++ b/java/test/TestH5Ocopy.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -36,13 +35,13 @@ public class TestH5Ocopy { private static final String FILENAME = "testRefsattribute.h5"; private static final int DIM_X = 4; private static final int DIM_Y = 6; - long H5fid = -1; - long H5dsid = -1; - long H5did1 = -1; - long H5did2 = -1; - long H5gcpl = -1; - long H5gid = -1; - long H5dsid2 = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did1 = HDF5Constants.H5I_INVALID_HID; + long H5did2 = HDF5Constants.H5I_INVALID_HID; + long H5gcpl = HDF5Constants.H5I_INVALID_HID; + long H5gid = HDF5Constants.H5I_INVALID_HID; + long H5dsid2 = HDF5Constants.H5I_INVALID_HID; long[] dims = { 2 }; private final void _deleteFile(String filename) { @@ -59,7 +58,7 @@ public class TestH5Ocopy { } private final long _createDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid, @@ -75,7 +74,7 @@ public class TestH5Ocopy { } private final long _createGroup(long fid, String name) { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { H5gcpl = HDF5Constants.H5P_DEFAULT; gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT, @@ -136,10 +135,10 @@ public class TestH5Ocopy { @Test public void testH5OcopyRefsAttr() { - long ocp_plist_id = -1; + long ocp_plist_id = HDF5Constants.H5I_INVALID_HID; byte rbuf0[]=null , rbuf1[] = null; byte[] dset_data = new byte[16]; - long attribute_id = -1; + long attribute_id = HDF5Constants.H5I_INVALID_HID; try { @@ -184,9 +183,9 @@ public class TestH5Ocopy { public void testH5OcopyRefsDatasettodiffFile() { byte rbuf1[] = null; byte[] dset_data = new byte[16]; - long ocp_plist_id = -1; - long dataset_id = -1; - long H5fid2 = -1; + long ocp_plist_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long H5fid2 = HDF5Constants.H5I_INVALID_HID; try { rbuf1 = H5.H5Rcreate(H5fid, "DS2", HDF5Constants.H5R_OBJECT, -1); @@ -244,9 +243,9 @@ public class TestH5Ocopy { public void testH5OcopyRefsDatasettosameFile() { byte rbuf0[]=null , rbuf1[] = null; byte[] dset_data = new byte[16]; - long ocp_plist_id = -1; - long dataset_id = -1; - long did = -1; + long ocp_plist_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long did = HDF5Constants.H5I_INVALID_HID; int obj_type = -1; byte[] read_data = new byte[16]; @@ -328,9 +327,9 @@ public class TestH5Ocopy { // @Test(expected = HDF5LibraryException.class) // public void testH5OcopyInvalidRef() throws Throwable { // final long _pid_ = HDF5Constants.H5P_DEFAULT; -// long sid = -1; -// long did = -1; -// long aid = -1; +// long sid = HDF5Constants.H5I_INVALID_HID; +// long did = HDF5Constants.H5I_INVALID_HID; +// long aid = HDF5Constants.H5I_INVALID_HID; // // try { // sid = H5.H5Screate_simple(1, new long[] {1}, null); diff --git a/java/test/TestH5Ocreate.java b/java/test/TestH5Ocreate.java index 959e990..78ea744 100644 --- a/java/test/TestH5Ocreate.java +++ b/java/test/TestH5Ocreate.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -41,13 +40,13 @@ public class TestH5Ocreate { private static final String H5_FILE = "testO.h5"; private static final int DIM_X = 4; private static final int DIM_Y = 6; - long H5fcpl = -1; - long H5fid = -1; - long H5dsid = -1; - long H5did1 = -1; - long H5did2 = -1; - long H5gcpl = -1; - long H5gid = -1; + long H5fcpl = HDF5Constants.H5I_INVALID_HID; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did1 = HDF5Constants.H5I_INVALID_HID; + long H5did2 = HDF5Constants.H5I_INVALID_HID; + long H5gcpl = HDF5Constants.H5I_INVALID_HID; + long H5gid = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; private final void _deleteFile(String filename) { @@ -64,7 +63,7 @@ public class TestH5Ocreate { } private final long _createDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid, @@ -80,7 +79,7 @@ public class TestH5Ocreate { } private final long _createGroup(long fid, String name) { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { H5gcpl = HDF5Constants.H5P_DEFAULT; gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT, @@ -293,7 +292,7 @@ public class TestH5Ocreate { @Test public void testH5Olink() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; H5O_info_t dst_obj_info = null; try { @@ -380,7 +379,7 @@ public class TestH5Ocreate { @Test public void testH5Ocomment() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; String obj_comment = null; try { oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT); @@ -405,7 +404,7 @@ public class TestH5Ocreate { @Test public void testH5Ocomment_clear() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; String obj_comment = null; try { oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT); @@ -506,7 +505,7 @@ public class TestH5Ocreate { @Test public void testH5Oinc_dec_count() { - long oid = -1; + long oid = HDF5Constants.H5I_INVALID_HID; H5O_info_t obj_info = null; try { try { diff --git a/java/test/TestH5Oparams.java b/java/test/TestH5Oparams.java index 1ad31cb..5cbabe1 100644 --- a/java/test/TestH5Oparams.java +++ b/java/test/TestH5Oparams.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 786c330..3879128 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -41,20 +40,20 @@ public class TestH5P { private static final int DIM_X = 4; private static final int DIM_Y = 6; long[] H5dims = { DIM_X, DIM_Y }; - long H5fid = -1; - long H5dsid = -1; - long H5did = -1; - long lapl_id = -1; - long fapl_id = -1; - long fcpl_id = -1; - long ocpl_id = -1; - long ocp_plist_id = -1; - long lcpl_id = -1; - long plapl_id = -1; - long plist_id = -1; - long gapl_id = -1; - long gcpl_id = -1; - long acpl_id = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + long lapl_id = HDF5Constants.H5I_INVALID_HID; + long fapl_id = HDF5Constants.H5I_INVALID_HID; + long fcpl_id = HDF5Constants.H5I_INVALID_HID; + long ocpl_id = HDF5Constants.H5I_INVALID_HID; + long ocp_plist_id = HDF5Constants.H5I_INVALID_HID; + long lcpl_id = HDF5Constants.H5I_INVALID_HID; + long plapl_id = HDF5Constants.H5I_INVALID_HID; + long plist_id = HDF5Constants.H5I_INVALID_HID; + long gapl_id = HDF5Constants.H5I_INVALID_HID; + long gcpl_id = HDF5Constants.H5I_INVALID_HID; + long acpl_id = HDF5Constants.H5I_INVALID_HID; private final void _deleteFile(String filename) { File file = new File(filename); @@ -65,7 +64,7 @@ public class TestH5P { } private final long _createDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl); diff --git a/java/test/TestH5PData.java b/java/test/TestH5PData.java index 82864cd..8b04629 100644 --- a/java/test/TestH5PData.java +++ b/java/test/TestH5PData.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -37,10 +36,10 @@ public class TestH5PData { private static final String H5_FILE = "testPD.h5"; private static final int DIM_X = 12; private static final int DIM_Y = 18; - long H5fid = -1; - long H5dsid = -1; - long H5did = -1; - long plist_id = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + long plist_id = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; double windchillF[][] = {{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0}, @@ -66,7 +65,7 @@ public class TestH5PData { } private final long _createFloatDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_NATIVE_FLOAT, dsid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl); diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java index 98665dc..d44cc0b 100644 --- a/java/test/TestH5PL.java +++ b/java/test/TestH5PL.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -147,11 +146,11 @@ public class TestH5PL { @Ignore public void TestH5PLdlopen() { - long file_id = -1; - long filespace_id = -1; - long dataset_id = -1; - long fapl_id = -1; - long dcpl_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; + long filespace_id = HDF5Constants.H5I_INVALID_HID; + long dataset_id = HDF5Constants.H5I_INVALID_HID; + long fapl_id = HDF5Constants.H5I_INVALID_HID; + long dcpl_id = HDF5Constants.H5I_INVALID_HID; try { int[] cd_values = {9, 0, 0, 0}; int[] libversion = {0, 0, 0}; diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index e1f5200..cc674e2 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -47,17 +46,17 @@ public class TestH5Pfapl { private static final int DIM_Y = 6; private static final int DIMF_X = 12; private static final int DIMF_Y = 18; - long H5fid = -1; - long H5dsid = -1; - long H5did = -1; - long H5Fdsid = -1; - long H5Fdid = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + long H5Fdsid = HDF5Constants.H5I_INVALID_HID; + long H5Fdid = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; - long fapl_id = -1; - long plapl_id = -1; - long dapl_id = -1; - long plist_id = -1; - long btplist_id = -1; + long fapl_id = HDF5Constants.H5I_INVALID_HID; + long plapl_id = HDF5Constants.H5I_INVALID_HID; + long dapl_id = HDF5Constants.H5I_INVALID_HID; + long plist_id = HDF5Constants.H5I_INVALID_HID; + long btplist_id = HDF5Constants.H5I_INVALID_HID; long[] H5Fdims = { DIMF_X, DIMF_Y }; double windchillF[][] = {{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0}, @@ -130,7 +129,7 @@ public class TestH5Pfapl { } private final long _createDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl); @@ -385,7 +384,7 @@ public class TestH5Pfapl { @Test public void testH5Pget_elink_fapl() { - long ret_val_id = -1; + long ret_val_id = HDF5Constants.H5I_INVALID_HID; try { ret_val_id = H5.H5Pget_elink_fapl(plapl_id); assertTrue("H5Pget_elink_fapl", ret_val_id >= 0); @@ -403,7 +402,7 @@ public class TestH5Pfapl { @Test public void testH5P_elink_fapl() { - long ret_val_id = -1; + long ret_val_id = HDF5Constants.H5I_INVALID_HID; try { H5.H5Pset_elink_fapl(plapl_id, fapl_id ); ret_val_id = H5.H5Pget_elink_fapl(plapl_id); @@ -421,7 +420,7 @@ public class TestH5Pfapl { @Test public void testH5P_elink_file_cache_size() { - long elink_fapl_id = -1; + long elink_fapl_id = HDF5Constants.H5I_INVALID_HID; int efc_size = 0; try { H5.H5Pset_elink_fapl(plapl_id, fapl_id ); @@ -1398,4 +1397,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/TestH5Pfaplhdfs.java b/java/test/TestH5Pfaplhdfs.java index 398a4d4..d922666 100644 --- a/java/test/TestH5Pfaplhdfs.java +++ b/java/test/TestH5Pfaplhdfs.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -34,11 +33,11 @@ import org.junit.rules.TestName; public class TestH5Pfaplhdfs { @Rule public TestName testname = new TestName(); - long fapl_id = -1; - long plapl_id = -1; - long dapl_id = -1; - long plist_id = -1; - long btplist_id = -1; + long fapl_id = HDF5Constants.H5I_INVALID_HID; + long plapl_id = HDF5Constants.H5I_INVALID_HID; + long dapl_id = HDF5Constants.H5I_INVALID_HID; + long plist_id = HDF5Constants.H5I_INVALID_HID; + long btplist_id = HDF5Constants.H5I_INVALID_HID; @Before public void createFileAccess() throws NullPointerException, HDF5Exception diff --git a/java/test/TestH5Pfapls3.java b/java/test/TestH5Pfapls3.java index a55856c..dda2716 100644 --- a/java/test/TestH5Pfapls3.java +++ b/java/test/TestH5Pfapls3.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -34,11 +33,11 @@ import org.junit.rules.TestName; public class TestH5Pfapls3 { @Rule public TestName testname = new TestName(); - long fapl_id = -1; - long plapl_id = -1; - long dapl_id = -1; - long plist_id = -1; - long btplist_id = -1; + long fapl_id = HDF5Constants.H5I_INVALID_HID; + long plapl_id = HDF5Constants.H5I_INVALID_HID; + long dapl_id = HDF5Constants.H5I_INVALID_HID; + long plist_id = HDF5Constants.H5I_INVALID_HID; + long btplist_id = HDF5Constants.H5I_INVALID_HID; @Before public void createFileAccess() throws NullPointerException, HDF5Exception diff --git a/java/test/TestH5Plist.java b/java/test/TestH5Plist.java index 7c43693..0d53071 100644 --- a/java/test/TestH5Plist.java +++ b/java/test/TestH5Plist.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -85,7 +84,7 @@ public class TestH5Plist { PROP3_NAME, PROP4_NAME}; - long plist_class_id = -1; + long plist_class_id = HDF5Constants.H5I_INVALID_HID; @Before public void createPropClass()throws NullPointerException, HDF5Exception @@ -114,9 +113,9 @@ public class TestH5Plist { @Test public void testH5P_genprop_basic_class() { int status = -1; - long cid1 = -1; // Generic Property class ID - long cid2 = -1; // Generic Property class ID - long cid3 = -1; // Generic Property class ID + long cid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID + long cid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID + long cid3 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID String name = null; // Name of class try { @@ -162,7 +161,7 @@ public class TestH5Plist { // Close parent class try { H5.H5Pclose_class(cid2); - cid2 = -1; + cid2 = HDF5Constants.H5I_INVALID_HID; } catch (Throwable err) { err.printStackTrace(); @@ -172,7 +171,7 @@ public class TestH5Plist { // Close class try { H5.H5Pclose_class(plist_class_id); - plist_class_id = -1; + plist_class_id = HDF5Constants.H5I_INVALID_HID; } catch (Throwable err) { err.printStackTrace(); @@ -242,7 +241,7 @@ public class TestH5Plist { // Close parent class's parent try { H5.H5Pclose_class(cid3); - cid3 = -1; + cid3 = HDF5Constants.H5I_INVALID_HID; } catch (Throwable err) { err.printStackTrace(); @@ -252,7 +251,7 @@ public class TestH5Plist { // Close parent class's parent try { H5.H5Pclose_class(cid2); - cid2 = -1; + cid2 = HDF5Constants.H5I_INVALID_HID; } catch (Throwable err) { err.printStackTrace(); @@ -262,7 +261,7 @@ public class TestH5Plist { // Close parent class's parent try { H5.H5Pclose_class(cid1); - cid1 = -1; + cid1 = HDF5Constants.H5I_INVALID_HID; } catch (Throwable err) { err.printStackTrace(); @@ -634,7 +633,7 @@ public class TestH5Plist { @Test public void testH5P_genprop_basic_list_prop() { boolean status = false; - long lid1 = -1; // Generic Property list ID + long lid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID long nprops = -1; // Number of properties in class try { @@ -760,7 +759,7 @@ public class TestH5Plist { // @Test // public void testH5P_genprop_class_callback() { // class cdata { -// public long cls_id = -1; +// public long cls_id = HDF5Constants.H5I_INVALID_HID; // public int cls_count = -1; // cdata(long id, int count) { // this.cls_id = id; @@ -813,11 +812,11 @@ public class TestH5Plist { // } // H5P_cls_close_func_cb cls_close_cb = new H5P_cls_close_callback(); // -// long cid1 = -1; // Generic Property class ID -// long cid2 = -1; // Generic Property class ID -// long lid1 = -1; // Generic Property list ID -// long lid2 = -1; // Generic Property list ID -// long lid3 = -1; // Generic Property list ID +// long cid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID +// long cid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID +// long lid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID +// long lid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID +// long lid3 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID // long nprops = -1; // Number of properties in class // // try { diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 4c9a763..0478356 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -52,13 +51,13 @@ public class TestH5Pvirtual { private static final int fill_value = -1; long[] H5dims = { DIM_Y }; long[] VDSH5dims = { VDSDIM_X, VDSDIM_Y }; - long H5fid = -1; - long H5dsid = -1; - long H5dssid = -1; - long H5dvsid = -1; - long H5did = -1; - long H5dcplid = -1; - long H5dapl_id = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5dssid = HDF5Constants.H5I_INVALID_HID; + long H5dvsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + long H5dcplid = HDF5Constants.H5I_INVALID_HID; + long H5dapl_id = HDF5Constants.H5I_INVALID_HID; private final void _deleteFile(String filename) { File file = new File(filename); @@ -69,8 +68,8 @@ public class TestH5Pvirtual { } private final long _createDataset(long fid, long dsid, String name, long dcpl, long dapl) { - long did = -1; - long space_id = -1; + long did = HDF5Constants.H5I_INVALID_HID; + long space_id = HDF5Constants.H5I_INVALID_HID; long[] start = {0, 0}; long[] stride = null; long[] count = {1, 1}; @@ -100,9 +99,9 @@ public class TestH5Pvirtual { int[] dset_data = new int[DIM_Y]; // Create source files and datasets for (int i=0; i < 3; i++) { - long space_id = -1; - long dset_id = -1; - long file_id = -1; + long space_id = HDF5Constants.H5I_INVALID_HID; + long dset_id = HDF5Constants.H5I_INVALID_HID; + long file_id = HDF5Constants.H5I_INVALID_HID; for (int j = 0; j < DIM_Y; j++) dset_data[j] = i+1; try { @@ -265,7 +264,7 @@ public class TestH5Pvirtual { @Test public void testH5Pget_selection_source_dataset() throws Throwable { - long src_space = -1; + long src_space = HDF5Constants.H5I_INVALID_HID; long src_selection = -1; H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id); diff --git a/java/test/TestH5R.java b/java/test/TestH5R.java index a51c7b6..031b8e4 100644 --- a/java/test/TestH5R.java +++ b/java/test/TestH5R.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -39,11 +38,11 @@ public class TestH5R { private static final String H5_FILE = "testH5R.h5"; private static final int DIM_X = 4; private static final int DIM_Y = 6; - long H5fid = -1; - long H5dsid = -1; - long H5did = -1; - long H5gid = -1; - long H5did2 = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + long H5gid = HDF5Constants.H5I_INVALID_HID; + long H5did2 = HDF5Constants.H5I_INVALID_HID; long[] H5dims = { DIM_X, DIM_Y }; int[][] dset_data = new int[DIM_X][DIM_Y]; int FILLVAL = 99; @@ -62,7 +61,7 @@ public class TestH5R { } private final long _createDataset(long fid, long dsid, String name, long dapl) { - long did = -1; + long did = HDF5Constants.H5I_INVALID_HID; try { did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid, @@ -78,7 +77,7 @@ public class TestH5R { } private final long _createGroup(long fid, String name) { - long gid = -1; + long gid = HDF5Constants.H5I_INVALID_HID; try { gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); @@ -150,109 +149,6 @@ public class TestH5R { System.out.println(); } - // Test v1.8 APIs params - /* - * @Ignore public void testH5Rget_name() { long loc_id = H5fid; int ref_type = - * HDF5Constants.H5R_OBJECT; long ret_val = -1; byte[] ref = null; String[] name = {""}; String - * objName = "/dset"; - * - * try { ref = H5.H5Rcreate(H5fid, objName, ref_type, -1); } catch (Throwable err) { - * err.printStackTrace(); fail("H5.H5Rget_name:H5Rcreate " + err); } - * - * try { ret_val = H5.H5Rget_name(loc_id, ref_type, ref, name, 16); } catch (Throwable err) { - * err.printStackTrace(); fail("H5.H5Rget_name: " + err); } - * - * assertTrue("testH5Rget_name: H5Rget_name", ret_val>0); assertTrue("The name of the object: ", - * objName.equals(name[0])); } - * - * @Ignore public void testH5Rget_obj_type2() { int ref_type=HDF5Constants.H5R_OBJECT; byte[] - * ref=null; - * - * String objName = "/dset"; int obj_type = -1; - * - * try { ref = H5.H5Rcreate(H5fid, objName, ref_type, -1); } catch(Throwable err) { - * err.printStackTrace(); } - * - * try { obj_type = H5.H5Rget_obj_type(H5fid, HDF5Constants.H5R_OBJECT, ref); } catch (Throwable - * err) { err.printStackTrace(); fail("H5.H5Rget_obj_type2: " + err); } assertEquals(obj_type, - * HDF5Constants.H5O_TYPE_DATASET); } - * - * @Ignore public void testH5Rcreate_refobj() { byte[] ref = null; - * - * try { ref = H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, -1); } catch (Throwable err) { - * err.printStackTrace(); fail("H5.H5Rcreate: " + err); } assertNotNull(ref); } - * - * @Ignore public void testH5Rcreate_regionrefobj() { byte[] ref = null; try { ref = - * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); } catch (Throwable err) { - * err.printStackTrace(); fail("H5.H5Rcreate: " + err); } assertNotNull(ref); } - * - * @Ignore public void testH5Rdereference() { byte[] ref1 = null; byte[] ref2 = null; long - * dataset_id = -1; long group_id = -1; try { //Create reference on dataset ref1 = - * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); dataset_id= - * H5.H5Rdereference(H5fid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_DATASET_REGION, ref1); - * - * //Create reference on group ref2 = H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1); - * group_id= H5.H5Rdereference(H5gid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref2); - * assertNotNull(ref1); assertNotNull(ref2); assertTrue(dataset_id >= 0); assertTrue(group_id >= 0); - * } catch (Throwable err) { err.printStackTrace(); fail("TestH5Rdereference " + err); } finally { - * try {H5.H5Dclose(dataset_id);} catch (Exception ex) {} try {H5.H5Gclose(group_id);} catch - * (Exception ex) {} } } - * - * @Ignore public void testH5Rget_region() { byte[] ref = null; long dsid = -1; try { ref = - * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); dsid = - * H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION, ref); assertNotNull(ref); - * assertTrue(dsid >= 0); } catch (Throwable err) { err.printStackTrace(); - * fail("TestH5Rget_region: " + err); } finally { try {H5.H5Sclose(dsid);} catch (Exception ex) {} } - * } - * - * @Ignore//(expected = IllegalArgumentException.class) public void testH5Rget_name_Invalidreftype() - * throws Throwable { byte[] ref = null; String[] name = {""}; ref = H5.H5Rcreate(H5fid, "/dset", - * HDF5Constants.H5R_OBJECT, -1); H5.H5Rget_name(H5fid, HDF5Constants.H5R_DATASET_REGION, ref, name, - * 16); } - * - * @Ignore//(expected = NullPointerException.class) public void testH5Rget_name_NULLreference() - * throws Throwable { byte[] ref = null; String[] name = {""}; H5.H5Rget_name(H5fid, - * HDF5Constants.H5R_OBJECT, ref, name, 16); } - * - * @Ignore//(expected = HDF5LibraryException.class) public void - * testH5Rget_obj_type2_Invalidreftype() throws Throwable { byte[] ref = null; ref = - * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, -1); H5.H5Rget_obj_type(H5fid, - * HDF5Constants.H5R_DATASET_REGION, ref); } - * - * @Ignore//(expected = HDF5LibraryException.class) public void testH5Rcreate_InvalidObjectName() - * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/GROUPS", HDF5Constants.H5R_OBJECT, -1); } - * - * @Ignore//(expected = HDF5LibraryException.class) public void testH5Rcreate_Invalidspace_id() - * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, -1); - * } - * - * @Ignore//(expected = IllegalArgumentException.class) public void testH5Rcreate_Invalidreftype() - * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_BADTYPE, -1); } - * - * @Ignore//(expected = IllegalArgumentException.class) public void - * testH5Rgetregion_Invalidreftype() throws Throwable { byte[] ref = null; ref = H5.H5Rcreate(H5fid, - * "/dset", HDF5Constants.H5R_OBJECT, H5dsid); H5.H5Rget_region(H5fid, - * HDF5Constants.H5R_DATASET_REGION, ref); } - * - * @Ignore//(expected = IllegalArgumentException.class) public void - * testH5Rgetregion_Badreferencetype() throws Throwable { byte[] ref = null; ref = - * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, H5dsid); H5.H5Rget_region(H5fid, - * HDF5Constants.H5R_OBJECT, ref); } - * - * @Ignore//(expected = NullPointerException.class) public void testH5Rgetregion_Nullreference() - * throws Throwable { byte[] ref = null; H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION, - * ref); } - * - * @Ignore//(expected = NullPointerException.class) public void testH5Rdereference_Nullreference() - * throws Throwable { byte[] ref = null; H5.H5Rdereference(H5did2, HDF5Constants.H5P_DEFAULT, - * HDF5Constants.H5R_OBJECT, ref); } - * - * @Ignore//(expected = IllegalArgumentException.class) public void - * testH5Rdereference_Invalidreference() throws Throwable { byte[] ref1 = null; byte[] ref2 = null; - * ref1 = H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); ref2 = - * H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1); H5.H5Rdereference(H5gid, - * HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref1); } - */ // Test v1.12 APIs params @Test diff --git a/java/test/TestH5Rref.java b/java/test/TestH5Rref.java new file mode 100644 index 0000000..cbdabdd --- /dev/null +++ b/java/test/TestH5Rref.java @@ -0,0 +1,561 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.File; + +import hdf.hdf5lib.H5; +import hdf.hdf5lib.HDF5Constants; +import hdf.hdf5lib.exceptions.HDF5Exception; +import hdf.hdf5lib.exceptions.HDF5LibraryException; +import hdf.hdf5lib.exceptions.HDF5FunctionArgumentException; + +import org.junit.After; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; + +public class TestH5Rref { + @Rule public TestName testname = new TestName(); + private static final String H5_DREG_FILE = "trefer_reg.h5"; + private static final String H5_AREG_FILE = "trefer_attr.h5"; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5dsid = HDF5Constants.H5I_INVALID_HID; + long H5did = HDF5Constants.H5I_INVALID_HID; + + private boolean byteArrayCheck(final byte[] array) { + for (byte b : array) { + if (b != 0) { + return false; + } + } + return true; + } + + public void openH5file(String filename, String dsetname) { + try { + H5fid = H5.H5Fopen(filename, + HDF5Constants.H5F_ACC_RDONLY, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5R._openH5file: " + err); + } + assertTrue("TestH5R._openH5file: H5.H5Fopen: ", H5fid >= 0); + try { + H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5R._openH5file: " + err); + } + assertTrue("TestH5R._openH5file: H5.H5Dopen: ", H5did >= 0); + try { + H5dsid = H5.H5Dget_space(H5did); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5R._openH5file: " + err); + } + assertTrue("TestH5R._openH5file: H5.H5Screate_simple: ",H5dsid > 0); + } + + @After + public 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 = HDF5Constants.H5I_INVALID_HID; + H5dsid = HDF5Constants.H5I_INVALID_HID; + H5did = HDF5Constants.H5I_INVALID_HID; + System.out.println(); + } + + @Before + public void verifyCount() + throws NullPointerException, HDF5Exception { + assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0); + System.out.print(testname.getMethodName()); + } + + // Test v1.12 APIs params + + @Test + public void testH5Rget_object() { + int ref_type = HDF5Constants.H5R_OBJECT1; + long f_type = HDF5Constants.H5I_INVALID_HID; + int obj_type = -1; + int ndims = 1; + long ret_val = -1; + byte[][] refbuf = null; + String name = ""; + String objName = "/DS_NA"; + + try { + openH5file(H5_DREG_FILE, objName); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_object: openH5file: " + err); + } + try { + f_type = H5.H5Dget_type(H5did); + int result = H5.H5Tget_class(f_type); + assertTrue("testH5Rget_object: H5Tget_class", result > 0); + String class_name = H5.H5Tget_class_name(result); + assertTrue("testH5Rget_object: H5Tget_class", class_name.compareTo("H5T_REFERENCE")==0); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_object: " + err); + } + finally { + try {H5.H5Tclose(f_type);} catch (Exception ex) {} + } + try { + ndims = H5.H5Sget_simple_extent_ndims(H5dsid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_object: H5Sget_simple_extent_ndims: " + err); + } + refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE]; + // Read the reference from the dataset. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF, + HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, refbuf); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Rget_object: H5Dread: " + err); + } + + for (int i = 0; i < ndims; i++) { + try { + ret_val = H5.H5Rget_type(refbuf[i]); + assertTrue("testH5Rget_object: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type); + if (!byteArrayCheck(refbuf[i])) { + try { + obj_type = H5.H5Rget_obj_type3(refbuf[i], HDF5Constants.H5P_DEFAULT); + assertEquals(obj_type, HDF5Constants.H5O_TYPE_DATASET); + } + catch (Throwable err2) { + err2.printStackTrace(); + fail("testH5Rget_object: H5.H5Rget_obj_type3: " + err2); + } + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_object: H5Rget_type: " + err); + } + finally { + H5.H5Rdestroy(refbuf[i]); + } + } + } + + @Test + public void testH5Rget_obj_type3() { + long f_type = HDF5Constants.H5I_INVALID_HID; + int ref_type = HDF5Constants.H5R_DATASET_REGION2; + int obj_type = -1; + int ndims = 1; + long ret_val = -1; + byte[][] refbuf = null; + String objName = "/Dataset1"; + + try { + openH5file(H5_DREG_FILE, objName); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_obj_type3: openH5file: " + err); + } + try { + f_type = H5.H5Dget_type(H5did); + int result = H5.H5Tget_class(f_type); + assertTrue("testH5Rget_obj_type3: H5Tget_class", result > 0); + String class_name = H5.H5Tget_class_name(result); + assertTrue("testH5Rget_obj_type3: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_obj_type3: " + err); + } + finally { + try {H5.H5Tclose(f_type);} catch (Exception ex) {} + } + try { + ndims = H5.H5Sget_simple_extent_ndims(H5dsid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_obj_type3: H5Sget_simple_extent_ndims: " + err); + } + refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE]; + // Read the reference from the dataset. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF, + HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, refbuf); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Rget_obj_type3: H5Dread: " + err); + } + + for (int i = 0; i < ndims; i++) { + try { + ret_val = H5.H5Rget_type(refbuf[i]); + assertTrue("testH5Rget_obj_type3: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type); + if (!byteArrayCheck(refbuf[i])) { + try { + obj_type = H5.H5Rget_obj_type3(refbuf[i], HDF5Constants.H5P_DEFAULT); + assertEquals(obj_type, HDF5Constants.H5O_TYPE_DATASET); + } + catch (Throwable err2) { + err2.printStackTrace(); + fail("testH5Rget_obj_type3: H5.H5Rget_obj_type3: " + err2); + } + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_obj_type3: H5Rget_type: " + err); + } + finally { + H5.H5Rdestroy(refbuf[i]); + } + } + } + + @Test + public void testH5Rget_region_dataset() { + long f_type = HDF5Constants.H5I_INVALID_HID; + long loc_id = HDF5Constants.H5I_INVALID_HID; + long loc_sid = HDF5Constants.H5I_INVALID_HID; + int ref_type = HDF5Constants.H5R_DATASET_REGION2; + int ndims = 1; + long ret_val = -1; + byte[][] refbuf = null; + String name = ""; + String objName = "/Dataset1"; + + try { + openH5file(H5_DREG_FILE, objName); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_region_dataset: openH5file: " + err); + } + try { + f_type = H5.H5Dget_type(H5did); + int result = H5.H5Tget_class(f_type); + assertTrue("testH5Rget_region_dataset: H5Tget_class", result > 0); + String class_name = H5.H5Tget_class_name(result); + assertTrue("testH5Rget_region_dataset: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_region_dataset: " + err); + } + finally { + try {H5.H5Tclose(f_type);} catch (Exception ex) {} + } + try { + ndims = H5.H5Sget_simple_extent_ndims(H5dsid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_region_dataset: H5Sget_simple_extent_ndims: " + err); + } + refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE]; + // Read the reference from the dataset. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF, + HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, refbuf); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Rget_obj_type3: H5Dread: " + err); + } + for (int i = 0; i < ndims; i++) { + try { + ret_val = H5.H5Rget_type(refbuf[i]); + assertTrue("testH5Rget_region_dataset: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type); + try { + loc_id = H5.H5Ropen_object(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); + assertTrue(loc_id >= 0); + boolean regionzero = byteArrayCheck(refbuf[i]); + if (i > 1) + assertTrue(regionzero); + else { + try { + loc_sid = H5.H5Ropen_region(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); + assertTrue(loc_sid >= 0); + int region_type = -1; + try { + int reg_ndims = H5.H5Sget_simple_extent_ndims(loc_sid); + region_type = H5.H5Sget_select_type(loc_sid); + if (i == 1) + assertTrue(region_type == HDF5Constants.H5S_SEL_POINTS); + else + assertTrue(region_type == HDF5Constants.H5S_SEL_HYPERSLABS); + if (region_type == HDF5Constants.H5S_SEL_POINTS) { + long reg_npoints = H5.H5Sget_select_elem_npoints(loc_sid); + // Coordinates for get point selection + long getcoord[] = new long[reg_ndims * (int)reg_npoints]; + // Known coordinates for point selection + long coord[][] = {{6,9},{2,2},{8,4},{1,6},{2,8},{3,2}, + {0,4},{9,0},{7,1},{3,3}}; + try { + H5.H5Sget_select_elem_pointlist(loc_sid, 0, reg_npoints, getcoord); + assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][0] == getcoord[0]); + assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][1] == getcoord[1]); + assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][0] == getcoord[2]); + assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][1] == getcoord[3]); + assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][0] == getcoord[4]); + assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][1] == getcoord[5]); + } + catch (Throwable err3) { + err3.printStackTrace(); + fail("H5.H5Sget_select_elem_pointlist: " + err3); + } + } + else if (region_type == HDF5Constants.H5S_SEL_HYPERSLABS) { + long reg_nblocks = H5.H5Sget_select_hyper_nblocks(loc_sid); + assertTrue("H5Sget_select_hyper_nblocks", reg_nblocks == 1); + // Coordinates for get block selection + long getblocks[] = new long[reg_ndims * (int)reg_nblocks * 2]; + long start[] = {2,2}; + long block[] = {8,8}; + try { + H5.H5Sget_select_hyper_blocklist(loc_sid, 0, reg_nblocks, getblocks); + assertTrue("H5.H5Sget_select_hyper_blocklist", start[0] == getblocks[0]); + assertTrue("H5.H5Sget_select_hyper_blocklist", start[1] == getblocks[1]); + assertTrue("H5.H5Sget_select_hyper_blocklist", (block[0]-1) == getblocks[2]); + assertTrue("H5.H5Sget_select_hyper_blocklist", (block[1]-1) == getblocks[3]); + } + catch (Throwable err3) { + err3.printStackTrace(); + fail("H5.H5Sget_select_hyper_blocklist: " + err3); + } + } + } + catch (Throwable err2) { + err2.printStackTrace(); + fail("testH5Rget_region_dataset: H5Sget_select_type: " + err2); + } + } + catch (Throwable err1) { + err1.printStackTrace(); + fail("testH5Rget_region_dataset: " + err1); + } + finally { + try {H5.H5Sclose(loc_sid);} catch (Exception ex) {} + } + } + } + catch (Throwable err0) { + err0.printStackTrace(); + fail("testH5Rget_region_dataset: " + err0); + } + finally { + try {H5.H5Dclose(loc_id);} catch (Exception ex) {} + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_region_dataset: H5Rget_type: " + err); + } + finally { + H5.H5Rdestroy(refbuf[i]); + } + } //for (int i = 0; i < ndims; i++) + } + + @Test + public void testH5Rget_region_attribute() { + long f_type = HDF5Constants.H5I_INVALID_HID; + long loc_id = HDF5Constants.H5I_INVALID_HID; + long loc_sid = HDF5Constants.H5I_INVALID_HID; + int ref_type = HDF5Constants.H5R_ATTR; + int obj_type = -1; + int ndims = 1; + long ret_val = -1; + byte[][] refbuf = null; + String objName = "/Dataset3"; + + try { + openH5file(H5_AREG_FILE, objName); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_region_attribute: openH5file: " + err); + } + try { + f_type = H5.H5Dget_type(H5did); + int result = H5.H5Tget_class(f_type); + assertTrue("testH5Rget_region_attribute: H5Tget_class", result > 0); + String class_name = H5.H5Tget_class_name(result); + assertTrue("testH5Rget_region_attribute: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_region_attribute: " + err); + } + finally { + try {H5.H5Tclose(f_type);} catch (Exception ex) {} + } + try { + ndims = H5.H5Sget_simple_extent_ndims(H5dsid); + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_region_attribute: H5Sget_simple_extent_ndims: " + err); + } + refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE]; + // Read the reference from the dataset. + try { + H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF, + HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, + HDF5Constants.H5P_DEFAULT, refbuf); + } + catch (Exception err) { + err.printStackTrace(); + fail("testH5Rget_region_attribute: H5Dread: " + err); + } + + for (int i = 0; i < ndims; i++) { + try { + ret_val = H5.H5Rget_type(refbuf[i]); + assertTrue("testH5Rget_region_attribute: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type); + try { + loc_id = H5.H5Ropen_attr(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); + assertTrue(loc_id >= 0); + if (!byteArrayCheck(refbuf[i])) { + try { + loc_sid = H5.H5Aget_space(loc_id); + assertTrue(loc_sid >= 0); + } + catch (Throwable err1) { + err1.printStackTrace(); + fail("testH5Rget_region_attribute: " + err1); + } + finally { + try {H5.H5Sclose(loc_sid);} catch (Exception ex) {} + } + } + } + catch (Throwable err0) { + err0.printStackTrace(); + fail("testH5Rget_region_attribute: " + err0); + } + finally { + try {H5.H5Aclose(loc_id);} catch (Exception ex) {} + } + } + catch (Throwable err) { + err.printStackTrace(); + fail("testH5Rget_region_attribute: H5Rget_type: " + err); + } + finally { + H5.H5Rdestroy(refbuf[i]); + } + } + } + + +// These tests need to be updated with new APIs +// @Test// +// public void testH5Rget_group() { +// long loc_id = H5fid; +// int ref_type = HDF5Constants.H5R_OBJECT2; +// long ret_val = -1; +// byte[] ref = null; +// String name = ""; +// String objName = "/dset"; +// +// try { +// ref = H5.H5Rcreate_object(H5fid, objName, HDF5Constants.H5P_DEFAULT); +// } +// catch (Throwable err) { +// err.printStackTrace(); +// fail("testH5Rget_object: H5Rcreate_object " + err); +// } +// try { +// dataset_id= H5.H5Rdereference(H5fid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_DATASET_REGION, ref1); +// +// //Create reference on group +// ref2 = H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1); +// group_id= H5.H5Rdereference(H5gid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref2); +// assertNotNull(ref1); +// assertNotNull(ref2); +// assertTrue(dataset_id >= 0); +// assertTrue(group_id >= 0); +// } +// catch (Throwable err) { +// err.printStackTrace(); +// fail("TestH5Rdereference " + err); +// } +// finally { +// try {H5.H5Dclose(dataset_id);} catch (Exception ex) {} +// try {H5.H5Gclose(group_id);} catch (Exception ex) {} +// } +// } + +// @Test// +// public void testH5Rget_attr() { +// long loc_id = H5fid; +// int ref_type = HDF5Constants.H5R_OBJECT2; +// long ret_val = -1; +// byte[] ref = null; +// String name = ""; +// String objName = "/dset"; +// +// try { +// ref = H5.H5Rcreate_object(H5fid, objName, HDF5Constants.H5P_DEFAULT); +// } +// catch (Throwable err) { +// err.printStackTrace(); +// fail("testH5Rget_object: H5Rcreate_object " + err); +// } +// try { +// dsid = H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION, ref); +// assertNotNull(ref); +// assertTrue(dsid >= 0); +// } +// catch (Throwable err) { +// err.printStackTrace(); +// fail("TestH5Rget_region: " + err); +// } +// finally { +// try {H5.H5Sclose(dsid);} catch (Exception ex) {} +// } +// } + +} diff --git a/java/test/TestH5S.java b/java/test/TestH5S.java index 03943a4..7eeed7a 100644 --- a/java/test/TestH5S.java +++ b/java/test/TestH5S.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -30,7 +29,7 @@ import org.junit.rules.TestName; public class TestH5S { @Rule public TestName testname = new TestName(); - long H5sid = -1; + long H5sid = HDF5Constants.H5I_INVALID_HID; int H5rank = 2; long H5dims[] = {5, 5}; long H5maxdims[] = {10, 10}; @@ -181,7 +180,7 @@ public class TestH5S { @Test public void testH5Scopy() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int read_rank = -1; try { @@ -201,7 +200,7 @@ public class TestH5S { @Test public void testH5Sextent_copy() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int class_type = -1; try { @@ -222,7 +221,7 @@ public class TestH5S { @Test public void testH5Sextent_equal() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; boolean result = false; try { @@ -252,8 +251,8 @@ public class TestH5S { @Test public void testH5Sencode_decode_null_dataspace() { - long sid = -1; - long decoded_sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; + long decoded_sid = HDF5Constants.H5I_INVALID_HID; byte[] null_sbuf = null; boolean result = false; @@ -299,8 +298,8 @@ public class TestH5S { @Test public void testH5Sencode_decode_scalar_dataspace() { - long sid = -1; - long decoded_sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; + long decoded_sid = HDF5Constants.H5I_INVALID_HID; byte[] scalar_sbuf = null; boolean result = false; int iresult = -1; @@ -470,7 +469,7 @@ public class TestH5S { @Test public void testH5Sget_select_hyper() { - long space1 = -1; + long space1 = HDF5Constants.H5I_INVALID_HID; long start[] = {0,0}; long stride[] = {1,1}; long count[] = {1,1}; @@ -508,7 +507,7 @@ public class TestH5S { @Test public void testH5Sget_select_valid() { - long space1 = -1; + long space1 = HDF5Constants.H5I_INVALID_HID; long start[] = {1,0}; long stride[] = {1,1}; long count[] = {2,3}; diff --git a/java/test/TestH5Sbasic.java b/java/test/TestH5Sbasic.java index 3f626dd..548ac95 100644 --- a/java/test/TestH5Sbasic.java +++ b/java/test/TestH5Sbasic.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -56,7 +55,7 @@ public class TestH5Sbasic { @Test public void testH5Screate_scalar() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int class_type = -1; try { sid = H5.H5Screate(HDF5Constants.H5S_SCALAR); @@ -75,7 +74,7 @@ public class TestH5Sbasic { @Test public void testH5Screate_null() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int class_type = -1; try { sid = H5.H5Screate(HDF5Constants.H5S_NULL); @@ -125,7 +124,7 @@ public class TestH5Sbasic { @Test public void testH5Screate_simple() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int class_type = -1; int rank = 2; long dims[] = {5, 5}; @@ -148,7 +147,7 @@ public class TestH5Sbasic { @Test public void testH5Screate_simple_unlimted() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int class_type = -1; int rank = 2; long dims[] = {5, 5}; @@ -171,7 +170,7 @@ public class TestH5Sbasic { @Test public void testH5Screate_simple_unlimted_1d() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int class_type = -1; int rank = 1; long dims[] = {5}; @@ -194,7 +193,7 @@ public class TestH5Sbasic { @Test public void testH5Screate_simple_max_default() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int rank = 2; long dims[] = {5, 5}; @@ -213,7 +212,7 @@ public class TestH5Sbasic { @Test public void testH5Screate_simple_extent() { - long sid = -1; + long sid = HDF5Constants.H5I_INVALID_HID; int rank = 2; long dims[] = {5, 5}; long maxdims[] = {10, 10}; @@ -242,4 +241,142 @@ public class TestH5Sbasic { H5.H5Sdecode(null); } + @Test(expected = IllegalArgumentException.class) + public void testH5Sget_regular_hyperslab_invalid() throws Throwable { + long q_start[] = new long[2]; + long q_stride[] = new long[2]; + long q_count[] = new long[2]; + long q_block[] = new long[2]; + + H5.H5Sget_regular_hyperslab(-1, q_start, q_stride, q_count, q_block); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Sselect_copy_invalid() throws Throwable { + H5.H5Sselect_copy(-1, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class) + public void testH5Sselect_shape_same_invalid() throws Throwable { + H5.H5Sselect_shape_same(-1, -1); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_adjust_invalid() throws Throwable { + long offset[][] = {{0,1},{2,4},{5,6}}; + H5.H5Sselect_adjust(-1, offset); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_adjust_rank_offset() throws Throwable { + long sid = HDF5Constants.H5I_INVALID_HID; + long offset[][] = {{0,1},{2,4},{5,6}}; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_adjust(sid, offset); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_invalid() throws Throwable { + long start[] = new long[2]; + long end[] = new long[2]; + H5.H5Sselect_intersect_block(-1, start, end); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_rank_start() throws Throwable { + long sid = HDF5Constants.H5I_INVALID_HID; + long start[] = new long[2]; + long end[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_intersect_block(sid, start, end); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_rank_end() throws Throwable { + long sid = HDF5Constants.H5I_INVALID_HID; + long start[] = null; + long end[] = new long[2]; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_intersect_block(sid, start, end); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class) + public void testH5Sselect_project_intersection_invalid() throws Throwable { + H5.H5Sselect_project_intersection(-1, -1, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Scombine_hyperslab_invalid() throws Throwable { + long start[] = new long[2]; + long count[] = new long[2]; + H5.H5Scombine_hyperslab(-1, 0, start, null, count, null); + } + + @Test(expected = NullPointerException.class) + public void testH5Scombine_hyperslab_null_start() throws Throwable { + long sid = HDF5Constants.H5I_INVALID_HID; + long start[] = null; + long stride[] = null; + long count[] = new long[2]; + long block[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = NullPointerException.class) + public void testH5Scombine_hyperslab_null_count() throws Throwable { + long sid = HDF5Constants.H5I_INVALID_HID; + long start[] = new long[2]; + long stride[] = null; + long count[] = null; + long block[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Smodify_select_invalid() throws Throwable { + H5.H5Smodify_select(-1, 0, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Scombine_select_invalid() throws Throwable { + H5.H5Scombine_select(-1, 0, -1); + } + } diff --git a/java/test/TestH5T.java b/java/test/TestH5T.java index 18b5985..ed4e2a9 100644 --- a/java/test/TestH5T.java +++ b/java/test/TestH5T.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -33,8 +32,8 @@ import org.junit.rules.TestName; public class TestH5T { @Rule public TestName testname = new TestName(); private static final String H5_FILE = "testT.h5"; - long H5fid = -1; - long H5strdid = -1; + long H5fid = HDF5Constants.H5I_INVALID_HID; + long H5strdid = HDF5Constants.H5I_INVALID_HID; private final void _deleteFile(String filename) { File file = null; @@ -129,7 +128,7 @@ public class TestH5T { @Test public void testH5Tarray_create() { - long filetype_id = -1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; long[] adims = { 3, 5 }; try { @@ -148,7 +147,7 @@ public class TestH5T { @Test public void testH5Tget_array_ndims() { - long filetype_id = -1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; int ndims = 0; long[] adims = { 3, 5 }; @@ -176,7 +175,7 @@ public class TestH5T { @Test public void testH5Tget_array_dims() { - long filetype_id = -1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; int ndims = 0; long[] adims = { 3, 5 }; long[] rdims = new long[2]; @@ -207,7 +206,7 @@ public class TestH5T { @Test public void testH5Tenum_functions() { - long filetype_id =-1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; String enum_type ="Enum_type"; byte[] enum_val = new byte[1]; String enum_name = null; @@ -275,7 +274,7 @@ public class TestH5T { @Test public void testH5Tenum_create_functions() { - long filetype_id = -1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; byte[] enum_val = new byte[1]; // Create a enumerate datatype @@ -315,7 +314,7 @@ public class TestH5T { @Test public void testH5Topaque_functions() { - long filetype_id = -1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; String opaque_name = null; // Create a opaque datatype @@ -345,7 +344,7 @@ public class TestH5T { @Test public void testH5Tvlen_create() { - long filetype_id = -1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; try { filetype_id = H5.H5Tvlen_create(HDF5Constants.H5T_C_S1); @@ -368,7 +367,7 @@ public class TestH5T { @Test public void testH5Tis_variable_str() { - long filetype_id = -1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; try { filetype_id = H5.H5Tcopy(HDF5Constants.H5T_C_S1); @@ -399,7 +398,7 @@ public class TestH5T { @Test public void testH5Tcompound_functions() { - long filetype_id =-1; + long filetype_id = HDF5Constants.H5I_INVALID_HID; // Create a compound datatype try { diff --git a/java/test/TestH5Tbasic.java b/java/test/TestH5Tbasic.java index 6dbc6e3..7aac2ab 100644 --- a/java/test/TestH5Tbasic.java +++ b/java/test/TestH5Tbasic.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -40,7 +39,7 @@ public class TestH5Tbasic { @Test public void testH5Tcopy() { - long H5strdid = -1; + long H5strdid = HDF5Constants.H5I_INVALID_HID; try { H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1); assertTrue("H5.H5Tcopy",H5strdid > 0); @@ -57,7 +56,7 @@ public class TestH5Tbasic { @Test public void testH5Tequal() { - long H5strdid = -1; + long H5strdid = HDF5Constants.H5I_INVALID_HID; try { H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1); assertTrue("H5.H5Tcopy",H5strdid > 0); @@ -76,7 +75,7 @@ public class TestH5Tbasic { @Test public void testH5Tequal_not() { - long H5strdid = -1; + long H5strdid = HDF5Constants.H5I_INVALID_HID; try { H5strdid = H5.H5Tcopy(HDF5Constants.H5T_STD_U64LE); assertTrue("H5.H5Tcopy",H5strdid > 0); @@ -98,8 +97,8 @@ public class TestH5Tbasic { String[] strs = {"a1234","b1234"}; int srcLen = 5; int dstLen = 10; - long srcId = -1; - long dstId = -1; + long srcId = HDF5Constants.H5I_INVALID_HID; + long dstId = HDF5Constants.H5I_INVALID_HID; int dimSize = strs.length; byte[] buf = new byte[dimSize*dstLen]; @@ -131,7 +130,7 @@ public class TestH5Tbasic { @Test public void testH5Torder_size() { - long H5strdid = -1; + long H5strdid = HDF5Constants.H5I_INVALID_HID; try { // Fixed length string H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1); diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java index 4180de5..92a034c 100644 --- a/java/test/TestH5Tparams.java +++ b/java/test/TestH5Tparams.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/test/TestH5VL.java b/java/test/TestH5VL.java index 554c1f7..4253d20 100644 --- a/java/test/TestH5VL.java +++ b/java/test/TestH5VL.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * @@ -72,28 +71,28 @@ public class TestH5VL { @Test public void testH5VLget_connector_id() { - String H5_FILE = "testFvl.h5"; + String H5_FILE = "testFvl.h5"; long H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - try { - long native_id = H5.H5VLget_connector_id(H5fid); - assertTrue("H5.H5VLget_connector_id", native_id >= 0); - - /* - * If HDF5_VOL_CONNECTOR is set, this might not be the - * native connector. Only check for the native connector - * if this isn't set. - */ - String connector = System.getenv("HDF5_VOL_CONNECTOR"); - if (connector == null) - assertEquals(HDF5Constants.H5VL_NATIVE, native_id); - } - catch (Throwable err) { - err.printStackTrace(); - fail("H5.H5VLget_connector_id " + err); - } + try { + long native_id = H5.H5VLget_connector_id(H5fid); + assertTrue("H5.H5VLget_connector_id", native_id >= 0); + + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector. Only check for the native connector + * if this isn't set. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) + assertEquals(HDF5Constants.H5VL_NATIVE, native_id); + } + catch (Throwable err) { + err.printStackTrace(); + fail("H5.H5VLget_connector_id " + err); + } finally { if (H5fid > 0) { try {H5.H5Fclose(H5fid);} catch (Exception ex) {} @@ -139,14 +138,14 @@ public class TestH5VL { try { String native_name = H5.H5VLget_connector_name(H5fid); - /* - * If HDF5_VOL_CONNECTOR is set, this might not be the - * native connector. Only check for the native connector - * if this isn't set. - */ - String connector = System.getenv("HDF5_VOL_CONNECTOR"); - if (connector == null) - assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0); + /* + * If HDF5_VOL_CONNECTOR is set, this might not be the + * native connector. Only check for the native connector + * if this isn't set. + */ + String connector = System.getenv("HDF5_VOL_CONNECTOR"); + if (connector == null) + assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0); } catch (Throwable err) { err.printStackTrace(); diff --git a/java/test/TestH5Z.java b/java/test/TestH5Z.java index 696642b..fde8f1a 100644 --- a/java/test/TestH5Z.java +++ b/java/test/TestH5Z.java @@ -1,6 +1,5 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 8da3384..39db296 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -45,6 +45,8 @@ HDFLIB_HOME="$top_srcdir/java/lib" BLDDIR="." BLDLIBDIR="$BLDDIR/testlibs" HDFTEST_HOME="$top_srcdir/java/test" +TOOLS_TESTFILES="$top_srcdir/tools/testfiles" + JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@test.jar test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR @@ -88,10 +90,12 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5T.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Dparams.txt $HDFTEST_HOME/testfiles/JUnit-TestH5D.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Dplist.txt +$HDFTEST_HOME/testfiles/JUnit-TestH5Drw.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Lparams.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Lbasic.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Lcreate.txt $HDFTEST_HOME/testfiles/JUnit-TestH5R.txt +$HDFTEST_HOME/testfiles/JUnit-TestH5Rref.txt $HDFTEST_HOME/testfiles/JUnit-TestH5P.txt $HDFTEST_HOME/testfiles/JUnit-TestH5PData.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Pfapl.txt @@ -100,6 +104,7 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5Pfaplhdfs.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Pvirtual.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Plist.txt $HDFTEST_HOME/testfiles/JUnit-TestH5A.txt +$HDFTEST_HOME/testfiles/JUnit-TestH5Arw.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Oparams.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Obasic.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Ocreate.txt @@ -145,7 +150,7 @@ COPY_LIBFILES_TO_BLDLIBDIR() fi fi done - if [ "$IS_DARWIN" = "yes" ]; then + 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}'`; \ @@ -247,6 +252,12 @@ COPY_DATAFILES_TO_BLDDIR() $CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateL2.hdf $CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateO1.hdf $CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateO2.hdf + $CP -f $TOOLS_TESTFILES/trefer_reg.h5 $BLDDIR/trefer_reg.h5 + $CP -f $TOOLS_TESTFILES/trefer_attr.h5 $BLDDIR/trefer_attr.h5 + $CP -f $TOOLS_TESTFILES/tdatareg.h5 $BLDDIR/tdatareg.h5 + $CP -f $TOOLS_TESTFILES/tattrreg.h5 $BLDDIR/tattrreg.h5 + $CP -f $TOOLS_TESTFILES/tintsattrs.h5 $BLDDIR/tintsattrs.h5 + $CP -f $TOOLS_TESTFILES/tfloatsattrs.h5 $BLDDIR/tfloatsattrs.h5 } CLEAN_DATAFILES_AND_BLDDIR() @@ -662,6 +673,27 @@ else test yes = "$verbose" && $DIFF JUnit-TestH5D.txt JUnit-TestH5D.out |sed 's/^/ /' fi +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Drw" +TESTING JUnit-TestH5Drw +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Drw > JUnit-TestH5Drw.ext) + +# Extract file name, line number, version and thread IDs because they may be different +sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + JUnit-TestH5Drw.ext > JUnit-TestH5Drw.out + +if diff JUnit-TestH5Drw.out JUnit-TestH5Drw.txt > /dev/null; then + echo " PASSED JUnit-TestH5Drw" +else + echo "**FAILED** JUnit-TestH5Drw" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF JUnit-TestH5Drw.txt JUnit-TestH5Drw.out |sed 's/^/ /' +fi + echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Dplist" TESTING JUnit-TestH5Dplist ($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Dplist > JUnit-TestH5Dplist.ext) @@ -767,6 +799,27 @@ else test yes = "$verbose" && $DIFF JUnit-TestH5R.txt JUnit-TestH5R.out |sed 's/^/ /' fi +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Rref" +TESTING JUnit-TestH5Rref +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Rref > JUnit-TestH5Rref.ext) + +# Extract file name, line number, version and thread IDs because they may be different +sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + JUnit-TestH5Rref.ext > JUnit-TestH5Rref.out + +if diff JUnit-TestH5Rref.out JUnit-TestH5Rref.txt > /dev/null; then + echo " PASSED JUnit-TestH5Rref" +else + echo "**FAILED** JUnit-TestH5Rref" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF JUnit-TestH5Rref.txt JUnit-TestH5Rref.out |sed 's/^/ /' +fi + echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5P" TESTING JUnit-TestH5P ($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5P > JUnit-TestH5P.ext) @@ -893,6 +946,27 @@ else test yes = "$verbose" && $DIFF JUnit-TestH5A.txt JUnit-TestH5A.out |sed 's/^/ /' fi +echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Arw" +TESTING JUnit-TestH5Arw +($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Arw > JUnit-TestH5Arw.ext) + +# Extract file name, line number, version and thread IDs because they may be different +sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + JUnit-TestH5Arw.ext > JUnit-TestH5Arw.out + +if diff JUnit-TestH5Arw.out JUnit-TestH5Arw.txt > /dev/null; then + echo " PASSED JUnit-TestH5Arw" +else + echo "**FAILED** JUnit-TestH5Arw" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF JUnit-TestH5Arw.txt JUnit-TestH5Arw.out |sed 's/^/ /' +fi + echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Oparams" TESTING JUnit-TestH5Oparams ($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Oparams > JUnit-TestH5Oparams.ext) diff --git a/java/test/testfiles/JUnit-TestH5.txt b/java/test/testfiles/JUnit-TestH5.txt index 4bab633..fb50a57 100644 --- a/java/test/testfiles/JUnit-TestH5.txt +++ b/java/test/testfiles/JUnit-TestH5.txt @@ -1,10 +1,14 @@ JUnit version 4.11 +.testH5export_region .testH5get_libversion_null_param .testJ2C .testH5export_dataset .testIsSerializable +.testH5export_attrdataset .testH5garbage_collect .testH5error_off +.testH5export_regdataset +.testH5export_attribute .serializeToDisk .testH5open .testH5check_version @@ -13,5 +17,5 @@ JUnit version 4.11 Time: XXXX -OK (11 tests) +OK (15 tests) diff --git a/java/test/testfiles/JUnit-TestH5Arw.txt b/java/test/testfiles/JUnit-TestH5Arw.txt new file mode 100644 index 0000000..49d3b1c --- /dev/null +++ b/java/test/testfiles/JUnit-TestH5Arw.txt @@ -0,0 +1,13 @@ +JUnit version 4.11 +.testH5Aread_128bit_floats +.testH5Aread_64bit_floats +.testH5Aread_8bit_ints +.testH5Aread_32bit_ints +.testH5Aread_64bit_ints +.testH5Aread_32bit_floats +.testH5Aread_16bit_ints + +Time: XXXX + +OK (7 tests) + diff --git a/java/test/testfiles/JUnit-TestH5Drw.txt b/java/test/testfiles/JUnit-TestH5Drw.txt new file mode 100644 index 0000000..6b854cf --- /dev/null +++ b/java/test/testfiles/JUnit-TestH5Drw.txt @@ -0,0 +1,13 @@ +JUnit version 4.11 +.testH5Dread_32bit_floats +.testH5Dread_32bit_ints +.testH5Dread_64bit_ints +.testH5Dread_64bit_floats +.testH5Dread_8bit_ints +.testH5Dread_128bit_floats +.testH5Dread_16bit_ints + +Time: XXXX + +OK (7 tests) + diff --git a/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) diff --git a/java/test/testfiles/JUnit-TestH5Rref.txt b/java/test/testfiles/JUnit-TestH5Rref.txt new file mode 100644 index 0000000..05019c0 --- /dev/null +++ b/java/test/testfiles/JUnit-TestH5Rref.txt @@ -0,0 +1,10 @@ +JUnit version 4.11 +.testH5Rget_region_dataset +.testH5Rget_object +.testH5Rget_region_attribute +.testH5Rget_obj_type3 + +Time: XXXX + +OK (4 tests) + diff --git a/java/test/testfiles/JUnit-TestH5Sbasic.txt b/java/test/testfiles/JUnit-TestH5Sbasic.txt index 707878e..3422442 100644 --- a/java/test/testfiles/JUnit-TestH5Sbasic.txt +++ b/java/test/testfiles/JUnit-TestH5Sbasic.txt @@ -5,18 +5,32 @@ JUnit version 4.11 .testH5Sdecode_null .testH5Screate_simple_dims_exceed .testH5Screate_simple_unlimted_1d +.testH5Sselect_intersect_block_rank_start +.testH5Sget_regular_hyperslab_invalid +.testH5Sselect_adjust_rank_offset .testH5Screate_simple_dims_invalid .testH5Screate_scalar .testH5Screate_simple +.testH5Sselect_project_intersection_invalid .testH5Screate_simple_rank_invalid .testH5Sget_simple_extent_type_invalid +.testH5Scombine_hyperslab_invalid +.testH5Scombine_hyperslab_null_count +.testH5Scombine_hyperslab_null_start .testH5Sencode_invalid .testH5Screate_null .testH5Screate_simple_extent .testH5Screate_invalid +.testH5Sselect_intersect_block_invalid +.testH5Sselect_adjust_invalid .testH5Screate_simple_unlimted +.testH5Sselect_shape_same_invalid +.testH5Smodify_select_invalid +.testH5Scombine_select_invalid +.testH5Sselect_copy_invalid +.testH5Sselect_intersect_block_rank_end Time: XXXX -OK (16 tests) +OK (30 tests) -- cgit v0.12