diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2021-02-25 21:12:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-25 21:12:57 (GMT) |
commit | c7ffe683e57fd8822fcf04320cf0500454486e53 (patch) | |
tree | 416e84f9adfbc32a9499b4dfff9f215a24684500 /java/src | |
parent | c29e1b9fdfcba9ca276600b1bad4ec2cf17bb01e (diff) | |
download | hdf5-c7ffe683e57fd8822fcf04320cf0500454486e53.zip hdf5-c7ffe683e57fd8822fcf04320cf0500454486e53.tar.gz hdf5-c7ffe683e57fd8822fcf04320cf0500454486e53.tar.bz2 |
Primary change is HDFFV-11212 - new refs and JNI (#372)
* OESS-98 convert plugin option to FetchContent, add tests
* Fixes for pkcfg files because of plugin option
* OESS-98 fix tools test for plugins
* Keep doxygen comments under 100 chars long - format hint
* Whitespace
* HDFFV-11144 - Reclassify CMake messages
* HDFFV-11099/11100 added help text
* Reworked switch statement to compare string instead
* Fix typo
* Update CDash mode
* Correct name of threadsafe
* Correct option name
* Undo accidental commit
* Note LLVM 10 to 11 format default changes
* Update format plugin
* Undo clang-format version 11 changes
* One more correction
* Update supported platforms
* Revert whitespace changes
* Correct whitespace
* Changes from PR#3
* HDFFV-11213 added option to control gcc10 warnings diagnostics
* HDFFV-11212 Use the new references correctly in JNI utility and tests
* format source
* Fix typo
* Add new test file
* HDFFV-11212 - update test and remove unused arg
* Minor non-space formatting changes
* Use H5I_INVALID_ID instead of "-1"
* source formatting
* add missing testfile, update jni function
* Undo commit of debug code
* remove mislocated file
* Fix h5repack test for handling of fapls and id close
* Update h5diff test files usage text
* HDFFV-11212 add new ref tests for JNI export dataset
* src format update
* Remove blank line typo
* src format typo
* long double requires %Lg
* Another long double foramt specifer S.B. %Lg
* issue with t128bit test
* Windows issue with h5dump and type.
* Fix review issues
* refactor function nesting and fix error checks
* format fixes
* Remove untested functions and javadoc quiet comments
* Restore TRY block.
* Change string append errors to memory exception
* revert to H5_JNI_FATAL_ERROR - support functions need work
* Add assertion error for h5util functions
* remove duplicate function
* format fix
* Revert HD function error handling
* Update copyright comments
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/hdf/hdf5lib/HDF5Constants.java | 462 | ||||
-rw-r--r-- | java/src/hdf/hdf5lib/HDF5GroupInfo.java | 9 | ||||
-rw-r--r-- | java/src/hdf/hdf5lib/structs/H5A_info_t.java | 12 | ||||
-rw-r--r-- | java/src/hdf/hdf5lib/structs/H5_ih_info_t.java | 2 | ||||
-rw-r--r-- | java/src/jni/exceptionImp.c | 33 | ||||
-rw-r--r-- | java/src/jni/h5Constants.c | 8 | ||||
-rw-r--r-- | java/src/jni/h5aImp.c | 4 | ||||
-rw-r--r-- | java/src/jni/h5dImp.c | 5 | ||||
-rw-r--r-- | java/src/jni/h5jni.h | 21 | ||||
-rw-r--r-- | java/src/jni/h5util.c | 753 | ||||
-rw-r--r-- | java/src/jni/h5util.h | 6 |
11 files changed, 921 insertions, 394 deletions
diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 39a1e5f..334abee 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -47,54 +47,103 @@ public class HDF5Constants { 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(); + /** */ public static final int H5_ITER_UNKNOWN = H5_ITER_UNKNOWN(); + /** */ public static final int H5_ITER_INC = H5_ITER_INC(); + /** */ public static final int H5_ITER_DEC = H5_ITER_DEC(); + /** */ public static final int H5_ITER_NATIVE = H5_ITER_NATIVE(); + /** */ 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 */ @@ -452,96 +501,184 @@ public class HDF5Constants { /** 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(); + /** */ 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(); @@ -561,120 +698,229 @@ 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 */ @@ -724,222 +970,438 @@ public class HDF5Constants { /** 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 */ diff --git a/java/src/hdf/hdf5lib/HDF5GroupInfo.java b/java/src/hdf/hdf5lib/HDF5GroupInfo.java index 44b41bb..e08f991 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,32 @@ public class HDF5GroupInfo { linklen = 0; } - /* accessors */ + /** fileno accessors */ public long[] getFileno() { return fileno; } + /** accessors */ public long[] getObjno() { return objno; } + /** accessors */ public int getType() { return type; } + /** accessors */ public int getNlink() { return nlink; } + /** accessors */ public long getMtime() { return mtime; } + /** accessors */ public int getLinklen() { return linklen; } diff --git a/java/src/hdf/hdf5lib/structs/H5A_info_t.java b/java/src/hdf/hdf5lib/structs/H5A_info_t.java index a274551..4aa610b 100644 --- a/java/src/hdf/hdf5lib/structs/H5A_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5A_info_t.java @@ -21,10 +21,14 @@ import java.io.Serializable; */ 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/H5_ih_info_t.java b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java index 96082ab..97b239a 100644 --- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java @@ -21,7 +21,9 @@ import java.io.Serializable; */ public class H5_ih_info_t implements Serializable { private static final long serialVersionUID = -142238015615462707L; + /** */ public long index_size; /* btree and/or list */ + /** */ public long heap_size; H5_ih_info_t (long index_size, long heap_size) 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/h5Constants.c b/java/src/jni/h5Constants.c index 7f60153..7354e95 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -1403,7 +1403,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1DIRECT(JNIEnv *env, jclass cls) #ifdef H5_HAVE_DIRECT return H5FD_DIRECT; #else - return -1; + return H5I_INVALID_HID; #endif } JNIEXPORT jlong JNICALL @@ -1417,7 +1417,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1HDFS(JNIEnv *env, jclass cls) #ifdef H5_HAVE_LIBHDFS return H5FD_HDFS; #else - return -1; + return H5I_INVALID_HID; #endif } JNIEXPORT jlong JNICALL @@ -1446,7 +1446,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1ROS3(JNIEnv *env, jclass cls) #ifdef H5_HAVE_ROS3_VFD return H5FD_ROS3; #else - return -1; + return H5I_INVALID_HID; #endif } JNIEXPORT jlong JNICALL @@ -1460,7 +1460,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1WINDOWS(JNIEnv *env, jclass cls) #ifdef H5_HAVE_WINDOWS return H5FD_DIRECT; #else - return -1; + return H5I_INVALID_HID; #endif } JNIEXPORT jint JNICALL 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/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/h5jni.h b/java/src/jni/h5jni.h index fb6f22a..f437d36 100644 --- a/java/src/jni/h5jni.h +++ b/java/src/jni/h5jni.h @@ -267,9 +267,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 +306,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) diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 5b38daf..2e02e4d 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,19 @@ 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 +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 +184,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 +239,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 +644,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 +676,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 +689,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 +754,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 +762,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 +776,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 +784,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) { @@ -805,6 +844,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 +1044,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 +1052,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 +1065,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 +1075,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,130 +1098,120 @@ 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; - } - 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; + hid_t new_obj_id = H5I_INVALID_HID; + H5O_type_t obj_type = -1; /* Object type */ + H5R_type_t ref_type; /* Reference type */ + + H5R_ref_t *ref_vp = (H5R_ref_t *)cptr; ref_type = H5Rget_type(ref_vp); - H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type); 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: default: break; } /* end switch */ + + if (H5Rdestroy(ref_vp) < 0) + H5_LIBRARY_ERROR(ENVONLY); } else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) { /* (H5R_DSET_REG_REF_BUF_SIZE == typeSize) */ @@ -1200,7 +1231,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 +1249,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 +1279,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 +1334,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 +1435,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 +1464,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,29 +1473,31 @@ 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); } + H5E_BEGIN_TRY { 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); @@ -1474,66 +1506,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++) { @@ -1543,7 +1528,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++) { @@ -1554,28 +1539,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. @@ -1628,12 +1615,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; @@ -1650,140 +1637,93 @@ 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); } + H5E_BEGIN_TRY { 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) @@ -2308,30 +2248,22 @@ h5str_render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hs /* 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) + if ((region_id = H5Ropen_object((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); - } - - if ((region_type = H5Sget_select_type(region_space)) < 0) { + if ((region_space = H5Ropen_region((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { + if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) { + region_type = H5Sget_select_type(region_space); + if (region_type == H5S_SEL_POINTS) + ret_value = render_bin_output_region_points(stream, region_space, region_id, + container); + else if (region_type == H5S_SEL_HYPERSLABS) + ret_value = render_bin_output_region_blocks(stream, region_space, region_id, + container); + } H5Sclose(region_space); - H5Dclose(region_id); - continue; - } + } /* end if (region_space >= 0) */ + H5Dclose(region_id); + if (ret_value < 0) break; } @@ -2711,6 +2643,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) { @@ -2865,7 +2900,7 @@ h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order) H5_LIBRARY_ERROR(ENVONLY); if (binary_order == 99) { - if (h5tools_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0) + if (h5str_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0) CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); } else { @@ -2936,7 +2971,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 */ @@ -2956,38 +2991,38 @@ 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 @@ -3041,7 +3076,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))) @@ -3585,7 +3620,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); diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h index 4b79eda..a5e9607 100644 --- a/java/src/jni/h5util.h +++ b/java/src/jni/h5util.h @@ -41,13 +41,11 @@ 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 htri_t H5Tdetect_variable_str(hid_t tid); |