summaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-11-07 15:48:56 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-11-07 15:49:11 (GMT)
commit6b927a773c83bedc111dcd2ad38805f974660b15 (patch)
tree5f836ff5409d5265161b058e75f4d806c8afff1d /java/src
parent2dd5bbfe167e3e9b6b6ee657a882e24072de4aeb (diff)
downloadhdf5-6b927a773c83bedc111dcd2ad38805f974660b15.zip
hdf5-6b927a773c83bedc111dcd2ad38805f974660b15.tar.gz
hdf5-6b927a773c83bedc111dcd2ad38805f974660b15.tar.bz2
HDFFV-10876 Update h5dump and h5ls for new ref api.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/hdf/hdf5lib/H5.java331
-rw-r--r--java/src/hdf/hdf5lib/HDF5Constants.java22
-rw-r--r--java/src/jni/h5Constants.c14
-rw-r--r--java/src/jni/h5pFAPLImp.c10
-rw-r--r--java/src/jni/h5rImp.c593
-rw-r--r--java/src/jni/h5rImp.h130
-rw-r--r--java/src/jni/h5sImp.c6
-rw-r--r--java/src/jni/h5sImp.h6
-rw-r--r--java/src/jni/h5tImp.c6
-rw-r--r--java/src/jni/h5tImp.h4
-rw-r--r--java/src/jni/h5util.c281
-rw-r--r--java/src/jni/h5util.h1
12 files changed, 1274 insertions, 130 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 09fb223..01c18dc 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -1107,7 +1107,9 @@ public class H5 implements java.io.Serializable {
log.trace("H5Aread_dname_D");
status = H5Aread_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning);
}
- else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && (is1D && (dataClass.getComponentType() == String.class))) || H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
+ else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) &&
+ (is1D && (dataClass.getComponentType() == String.class))) ||
+ H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
log.trace("H5Aread_reg_ref");
status = H5Aread_reg_ref(attr_id, mem_type_id, (String[]) obj);
}
@@ -2005,7 +2007,9 @@ public class H5 implements java.io.Serializable {
status = H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
(double[]) obj, isCriticalPinning);
}
- else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && (is1D && (dataClass.getComponentType() == String.class))) || H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
+ else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) &&
+ (is1D && (dataClass.getComponentType() == String.class))) ||
+ H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) {
log.trace("H5Dread_reg_ref");
status = H5Dread_reg_ref(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id,
(String[]) obj);
@@ -8095,6 +8099,325 @@ public class H5 implements java.io.Serializable {
// ////////////////////////////////////////////////////////////
// //
+ // H5R: HDF5 1.12 Reference API Functions //
+ // //
+ // ////////////////////////////////////////////////////////////
+
+ // Constructors //
+
+ /**
+ * H5Rcreate_object creates a reference pointing to the object named name located at loc id.
+ *
+ * @param loc_id
+ * IN: Location identifier used to locate the object being pointed to.
+ * @param name
+ * IN: Name of object at location loc_id.
+ *
+ * @return the reference (byte[]) 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 byte[] H5Rcreate_object(long loc_id, String name)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Rcreate_region creates the reference, pointing to the region represented by
+ * space id within the object named name located at loc id.
+ *
+ * @param loc_id
+ * IN: Location identifier used to locate the object being pointed to.
+ * @param name
+ * IN: Name of object at location loc_id.
+ * @param space_id
+ * IN: Identifies the dataset region that a dataset region reference points to.
+ *
+ * @return the reference (byte[]) 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 byte[] H5Rcreate_region(long loc_id, String name, long space_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Rcreate_attr creates the reference, pointing to the attribute named attr name
+ * and attached to the object named name located at loc id.
+ *
+ * @param loc_id
+ * IN: Location identifier used to locate the object being pointed to.
+ * @param name
+ * IN: Name of object at location loc_id.
+ * @param attr_name
+ * IN: Name of the attribute within the object.
+ *
+ * @return the reference (byte[]) 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 byte[] H5Rcreate_attr(long loc_id, String name, String attr_name)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Rdestroy destroys a reference and releases resources.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ *
+ * @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 void H5Rdestroy(byte[] ref_ptr)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ // Info //
+
+ /**
+ * H5Rget_type retrieves the type of a reference.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ *
+ * @return a valid reference type if successful; otherwise returns H5R UNKNOWN.
+ *
+ * @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 H5Rget_type(byte[] ref_ptr)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Requal determines whether two references point to the same object, region or attribute.
+ *
+ * @param ref1_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ * @param ref2_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ *
+ * @return true if equal, else false
+ *
+ * @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 H5Requal(byte[] ref1_ptr, byte[] ref2_ptr)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Rcopy creates a copy of an existing reference.
+ *
+ * @param src_ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ *
+ * @return a valid copy of the reference (byte[]) 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 byte[] H5Rcopy(byte[] src_ref_ptr)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ // Dereference //
+
+ /**
+ * H5Ropen_object opens that object and returns an identifier.
+ * The object opened with this function should be closed when it is no longer needed
+ * so that resource leaks will not develop. Use the appropriate close function such
+ * as H5Oclose or H5Dclose for datasets.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ * @param rapl_id
+ * IN: A reference access property list identifier for the reference. The access property
+ * list can be used to access external files that the reference points
+ * to (through a file access property list).
+ * @param oapl_id
+ * IN: An object access property list identifier for the reference. The access property
+ * property list must be of the same type as the object being referenced,
+ * that is a group or dataset property list.
+ *
+ * @return a valid identifier 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 long H5Ropen_object(byte[] ref_ptr, long rapl_id, long oapl_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Ropen region creates a copy of the dataspace of the dataset pointed to by a region reference,
+ * ref ptr, and defines a selection matching the selection pointed to by ref ptr within the dataspace copy.
+ * Use H5Sclose to release the dataspace identifier returned by this function when the identifier is no longer needed.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ * @param rapl_id
+ * IN: A reference access property list identifier for the reference. The access property
+ * list can be used to access external files that the reference points
+ * to (through a file access property list).
+ * @param oapl_id
+ * IN: An object access property list identifier for the reference. The access property
+ * property list must be of the same type as the object being referenced,
+ * that is a group or dataset property list.
+ *
+ * @return a valid dataspace identifier 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 long H5Ropen_region(byte[] ref_ptr, long rapl_id, long oapl_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Ropen_attr opens the attribute attached to the object and returns an identifier.
+ * The attribute opened with this function should be closed with H5Aclose when it is no longer needed
+ * so that resource leaks will not develop.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ * @param rapl_id
+ * IN: A reference access property list identifier for the reference. The access property
+ * list can be used to access external files that the reference points
+ * to (through a file access property list).
+ * @param aapl_id
+ * IN: An attribute access property list identifier for the reference. The access property
+ * property list must be of the same type as the object being referenced,
+ * that is a group or dataset property list.
+ *
+ * @return a valid attribute identifier 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 long H5Ropen_attr(byte[] ref_ptr, long rapl_id, long aapl_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ // Get type //
+
+ /**
+ * H5Rget obj type3 retrieves the type of the referenced object pointed to.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ * @param rapl_id
+ * IN: A reference access property list identifier for the reference. The access property
+ * list can be used to access external files that the reference points
+ * to (through a file access property list).
+ *
+ * @return Returns the object type
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - array is null.
+ * @exception IllegalArgumentException
+ * - array is invalid.
+ **/
+ public synchronized static native int H5Rget_obj_type3(byte[] ref_ptr, long rapl_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ // Get name //
+
+ /**
+ * H5Rget_file_name retrieves the file name for the object, region or attribute reference pointed to.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ *
+ * @return Returns the file name of the reference
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - array is null.
+ * @exception IllegalArgumentException
+ * - array is invalid.
+ **/
+ public synchronized static native String H5Rget_file_name(byte[] ref_ptr)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Rget_obj_name retrieves the object name for the object, region or attribute reference pointed to.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ * @param rapl_id
+ * IN: A reference access property list identifier for the reference. The access property
+ * list can be used to access external files that the reference points
+ * to (through a file access property list).
+ *
+ * @return Returns the object name of the reference
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - array is null.
+ * @exception IllegalArgumentException
+ * - array is invalid.
+ **/
+ public synchronized static native String H5Rget_obj_name(byte[] ref_ptr, long rapl_id)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ /**
+ * H5Rget_attr_name retrieves the attribute name for the object, region or attribute reference pointed to.
+ *
+ * @param ref_ptr
+ * IN: Reference to an object, region or attribute attached to an object.
+ *
+ * @return Returns the attribute name of the reference
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ * @exception NullPointerException
+ * - array is null.
+ * @exception IllegalArgumentException
+ * - array is invalid.
+ **/
+ public synchronized static native String H5Rget_attr_name(byte[] ref_ptr)
+ throws HDF5LibraryException, NullPointerException, IllegalArgumentException;
+
+ // ////////////////////////////////////////////////////////////
+ // //
// H5R: HDF5 1.8 Reference API Functions //
// //
// ////////////////////////////////////////////////////////////
@@ -10328,14 +10651,12 @@ public class H5 implements java.io.Serializable {
* @param buf
* Buffer with data to be reclaimed.
*
- * @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 H5Treclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf)
+ public synchronized static native void H5Treclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf)
throws HDF5LibraryException, NullPointerException;
/**
diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java
index f5be38d..4aeeb98 100644
--- a/java/src/hdf/hdf5lib/HDF5Constants.java
+++ b/java/src/hdf/hdf5lib/HDF5Constants.java
@@ -407,11 +407,18 @@ public class HDF5Constants {
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();
+
public static final int H5S_ALL = H5S_ALL();
public static final int H5S_MAX_RANK = H5S_MAX_RANK();
public static final int H5S_NO_CLASS = H5S_NO_CLASS();
@@ -606,6 +613,7 @@ public class HDF5Constants {
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();
@@ -1420,16 +1428,28 @@ public class HDF5Constants {
private static native final int H5PL_VOL_PLUGIN();
+ private static native final int H5R_ATTR();
+
private static native final int H5R_BADTYPE();
private static native final int H5R_DATASET_REGION();
+ private static native final int H5R_DATASET_REGION1();
+
+ private static native final int H5R_DATASET_REGION2();
+
private static native final int H5R_MAXTYPE();
+ private static native final int H5R_REF_BUF_SIZE();
+
private static native final int H5R_OBJ_REF_BUF_SIZE();
private static native final int H5R_OBJECT();
+ private static native final int H5R_OBJECT1();
+
+ private static native final int H5R_OBJECT2();
+
private static native final int H5S_ALL();
private static native final int H5S_MAX_RANK();
@@ -1818,6 +1838,8 @@ public class HDF5Constants {
private static native final long H5T_STD_REF_OBJ();
+ private static native final long H5T_STD_REF();
+
private static native final long H5T_STD_U16BE();
private static native final long H5T_STD_U16LE();
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index 69adebd..05dc2ea 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -813,13 +813,25 @@ Java_hdf_hdf5lib_HDF5Constants_H5R_1BADTYPE(JNIEnv *env, jclass cls) { return H5
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5R_1MAXTYPE(JNIEnv *env, jclass cls) { return H5R_MAXTYPE; }
JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5R_1REF_1BUF_1SIZE(JNIEnv *env, jclass cls) { return H5R_REF_BUF_SIZE; }
+JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5R_1OBJ_1REF_1BUF_1SIZE(JNIEnv *env, jclass cls) { return H5R_OBJ_REF_BUF_SIZE; }
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5R_1DSET_1REG_1REF_1BUF_1SIZE(JNIEnv *env, jclass cls) { return H5R_DSET_REG_REF_BUF_SIZE; }
JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5R_1ATTR(JNIEnv *env, jclass cls) { return H5R_ATTR; }
+JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5R_1OBJECT(JNIEnv *env, jclass cls) { return H5R_OBJECT; }
JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5R_1OBJECT1(JNIEnv *env, jclass cls) { return H5R_OBJECT1; }
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5R_1OBJECT2(JNIEnv *env, jclass cls) { return H5R_OBJECT2; }
+JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5R_1DATASET_1REGION(JNIEnv *env, jclass cls) { return H5R_DATASET_REGION; }
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5R_1DATASET_1REGION1(JNIEnv *env, jclass cls) { return H5R_DATASET_REGION1; }
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5R_1DATASET_1REGION2(JNIEnv *env, jclass cls) { return H5R_DATASET_REGION2; }
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5S_1ALL(JNIEnv *env, jclass cls) { return H5S_ALL; }
@@ -1211,6 +1223,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1REF_1DSETREG(JNIEnv *env, jclass cls) {
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1REF_1OBJ(JNIEnv *env, jclass cls) { return H5T_STD_REF_OBJ; }
JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1REF(JNIEnv *env, jclass cls) { return H5T_STD_REF; }
+JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U16BE(JNIEnv *env, jclass cls) { return H5T_STD_U16BE; }
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_HDF5Constants_H5T_1STD_1U16LE(JNIEnv *env, jclass cls) { return H5T_STD_U16LE; }
diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c
index 006707a..a627e65 100644
--- a/java/src/jni/h5pFAPLImp.c
+++ b/java/src/jni/h5pFAPLImp.c
@@ -425,6 +425,8 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1hdfs
CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5FD_hdfs_fapl_t", "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;I)V", args, ret_obj);
#else
+ UNUSED(fapl_id);
+
H5_UNIMPLEMENTED(ENVONLY, "H5Pget_fapl_hdfs: not implemented");
#endif /* H5_HAVE_LIBHDFS */
@@ -532,6 +534,9 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs
if (H5Pset_fapl_hdfs((hid_t)fapl_id, &instance) < 0)
H5_LIBRARY_ERROR(ENVONLY);
#else
+ UNUSED(fapl_id);
+ UNUSED(fapl_config);
+
H5_UNIMPLEMENTED(ENVONLY, "H5Pset_fapl_hdfs: not implemented");
#endif /* H5_HAVE_LIBHDFS */
@@ -841,6 +846,8 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1ros3
CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5FD_ros3_fapl_t", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", args, ret_obj);
#else
+ UNUSED(fapl_id);
+
H5_UNIMPLEMENTED(ENVONLY, "H5Pget_fapl_ros3: not implemented");
#endif /* H5_HAVE_ROS3_VFD */
@@ -939,6 +946,9 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3
if (H5Pset_fapl_ros3((hid_t)fapl_id, &instance) < 0)
H5_LIBRARY_ERROR(ENVONLY);
#else
+ UNUSED(fapl_id);
+ UNUSED(fapl_config);
+
H5_UNIMPLEMENTED(ENVONLY, "H5Pset_fapl_ros3: not implemented");
#endif /* H5_HAVE_ROS3_VFD */
diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c
index 1a77fd3..f7dcb30 100644
--- a/java/src/jni/h5rImp.c
+++ b/java/src/jni/h5rImp.c
@@ -26,10 +26,599 @@ extern "C" {
#include "h5jni.h"
#include "h5rImp.h"
+
+/* H5R: HDF5 1.12 Reference API Functions */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rcreate_object
+ * Signature: (JLjava/lang/String;)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_hdf_hdf5lib_H5_H5Rcreate_1object
+ (JNIEnv *env, jclass clss, jlong loc_id, jstring name)
+{
+ const char *refName = NULL;
+ jboolean isCopy;
+ jbyteArray ref = NULL;
+ jbyte *refBuf = NULL;
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if (NULL == name)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rcreate_object: name is NULL");
+
+ PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_object: reference name not pinned");
+
+ if (NULL == (refBuf = (unsigned char *) HDcalloc((size_t) 1, H5R_REF_BUF_SIZE)))
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Rcreate_object: failed to allocate reference buffer");
+
+ if ((status = H5Rcreate_object((hid_t)loc_id, refName, (const H5R_ref_t *)refBuf)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (ref = ENVPTR->NewByteArray(ENVONLY, (jsize)H5R_REF_BUF_SIZE)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ ENVPTR->SetByteArrayRegion(ENVONLY, ref, 0, (jsize)H5R_REF_BUF_SIZE, (jbyte *)refBuf);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+done:
+ if (refName)
+ UNPIN_JAVA_STRING(ENVONLY, name, refName);
+ if (refBuf)
+ HDfree(refBuf);
+
+ return ref;
+} /* end Java_hdf_hdf5lib_H5_H5Rcreate_1object */
+
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rcreate_region
+ * Signature: (JLjava/lang/String;J)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_hdf_hdf5lib_H5_H5Rcreate_1region
+ (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong space_id)
+{
+ const char *refName = NULL;
+ jboolean isCopy;
+ jbyteArray ref = NULL;
+ jbyte *refBuf = NULL;
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if (NULL == name)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rcreate_region: name is NULL");
+
+ PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_region: reference name not pinned");
+
+ if (NULL == (refBuf = (unsigned char *) HDcalloc((size_t) 1, H5R_REF_BUF_SIZE)))
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Rcreate_region: failed to allocate reference buffer");
+
+ if ((status = H5Rcreate_region((hid_t)loc_id, refName, space_id, (const H5R_ref_t *)refBuf)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (ref = ENVPTR->NewByteArray(ENVONLY, (jsize)H5R_REF_BUF_SIZE)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ ENVPTR->SetByteArrayRegion(ENVONLY, ref, 0, (jsize)H5R_REF_BUF_SIZE, (jbyte *)refBuf);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+done:
+ if (refName)
+ UNPIN_JAVA_STRING(ENVONLY, name, refName);
+ if (refBuf)
+ HDfree(refBuf);
+
+ return ref;
+} /* end Java_hdf_hdf5lib_H5_H5Rcreate_1region */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rcreate_attr
+ * Signature: (JLjava/lang/String;Ljava/lang/String;)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_hdf_hdf5lib_H5_H5Rcreate_1attr
+ (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jstring attr_name)
+{
+ const char *refName = NULL;
+ const char *attrName = NULL;
+ jboolean isCopy;
+ jbyteArray ref = NULL;
+ jbyte *refBuf = NULL;
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if (NULL == name)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rcreate_attr: name is NULL");
+ if (NULL == attr_name)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rcreate_attr: attribute name is NULL");
+
+ PIN_JAVA_STRING(ENVONLY, attr_name, attrName, NULL, "H5Rcreate_attr: attribute name not pinned");
+
+ PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_attr: reference name not pinned");
+
+ if (NULL == (refBuf = (unsigned char *) HDcalloc((size_t) 1, H5R_REF_BUF_SIZE)))
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Rcreate_attr: failed to allocate reference buffer");
+
+ if ((status = H5Rcreate_attr((hid_t)loc_id, refName, attrName, (const H5R_ref_t *)refBuf)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (ref = ENVPTR->NewByteArray(ENVONLY, (jsize)H5R_REF_BUF_SIZE)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ ENVPTR->SetByteArrayRegion(ENVONLY, ref, 0, (jsize)H5R_REF_BUF_SIZE, (jbyte *)refBuf);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+done:
+ if (attrName)
+ UNPIN_JAVA_STRING(ENVONLY, attr_name, attrName);
+ if (refName)
+ UNPIN_JAVA_STRING(ENVONLY, name, refName);
+ if (refBuf)
+ HDfree(refBuf);
+
+ return ref;
+} /* end Java_hdf_hdf5lib_H5_H5Rcreate_1attr */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rdestroy
+ * Signature: ([B)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Rdestroy
+ (JNIEnv *env, jclass clss, jbyteArray ref)
+{
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ jsize refBufLen;
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rdestroy: reference is NULL");
+
+ if ((refBufLen = ENVPTR->GetArrayLength(ENVONLY, ref)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rdestroy: reference array length < 0");
+ }
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rdestroy: reference buffer not pinned");
+
+ if ((status = H5Rdestroy((const H5R_ref_t *)refBuf)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (status < 0) ? JNI_ABORT : 0);
+} /* end Java_hdf_hdf5lib_H5_H5Rdestroy */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_type
+ * Signature: ([B)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1type
+ (JNIEnv *env, jclass clss, jbyteArray ref)
+{
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ jsize refBufLen;
+ H5R_type_t ref_type;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rget_type: reference is NULL");
+
+ if ((refBufLen = ENVPTR->GetArrayLength(ENVONLY, ref)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rget_type: reference array length < 0");
+ }
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_type: reference buffer not pinned");
+
+ if ((ref_type = H5Rget_type((const H5R_ref_t *)refBuf)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (ref_type < 0) ? JNI_ABORT : 0);
+
+ return (jint)ref_type;
+} /* end Java_hdf_hdf5lib_H5_H5Rget_1type */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Requal
+ * Signature: ([B[B)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Requal
+ (JNIEnv *env, jclass clss, jbyteArray ref1, jbyteArray ref2)
+{
+ jboolean isCopy;
+ jbyte *refBuf1 = NULL;
+ jbyte *refBuf2 = NULL;
+ jsize refBufLen;
+ htri_t bval = JNI_FALSE;
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if (NULL == ref1)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Requal: reference1 is NULL");
+
+ if (NULL == ref2)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Requal: reference2 is NULL");
+
+ if ((refBufLen = ENVPTR->GetArrayLength(ENVONLY, ref1)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Requal: reference1 array length < 0");
+ }
+
+ PIN_BYTE_ARRAY(ENVONLY, ref1, refBuf1, &isCopy, "H5Requal: reference1 buffer not pinned");
+
+ if ((refBufLen = ENVPTR->GetArrayLength(ENVONLY, ref2)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Requal: reference2 array length < 0");
+ }
+
+ PIN_BYTE_ARRAY(ENVONLY, ref2, refBuf2, &isCopy, "H5Requal: reference2 buffer not pinned");
+
+ if ((bval = H5Requal((const H5R_ref_t *)refBuf1, (const H5R_ref_t *)refBuf2)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ status = bval;
+
+ bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ if (refBuf2)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref2, refBuf2, (status < 0) ? JNI_ABORT : 0);
+ if (refBuf1)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref1, refBuf1, (status < 0) ? JNI_ABORT : 0);
+
+ return (jboolean)bval;
+} /* end Java_hdf_hdf5lib_H5_H5Requal */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rcopy
+ * Signature: ([B)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_hdf_hdf5lib_H5_H5Rcopy
+ (JNIEnv *env, jclass clss, jbyteArray src_ref)
+{
+ jboolean isCopy;
+ jbyte *src_refBuf = NULL;
+ jsize refBufLen;
+ jbyteArray dst_ref = NULL;
+ jbyte *dst_refBuf = NULL;
+ herr_t status = FAIL;
+
+ UNUSED(clss);
+
+ if (NULL == src_ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rcopy: src reference is NULL");
+
+ if ((refBufLen = ENVPTR->GetArrayLength(ENVONLY, src_ref)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Rcopy: src reference array length < 0");
+ }
+
+ PIN_BYTE_ARRAY(ENVONLY, src_ref, src_refBuf, &isCopy, "H5Rcopy: src reference buffer not pinned");
+
+ if (NULL == (dst_refBuf = (unsigned char *) HDcalloc((size_t) 1, H5R_REF_BUF_SIZE)))
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Rcreate_attr: failed to allocate dst reference buffer");
+
+ if ((status = H5Rcopy((const H5R_ref_t *)src_refBuf, (const H5R_ref_t *)dst_refBuf)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (dst_ref = ENVPTR->NewByteArray(ENVONLY, (jsize)H5R_REF_BUF_SIZE)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ ENVPTR->SetByteArrayRegion(ENVONLY, dst_ref, 0, (jsize)H5R_REF_BUF_SIZE, (jbyte *)dst_refBuf);
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+done:
+ if (src_refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, src_ref, src_refBuf, (status < 0) ? JNI_ABORT : 0);
+ if (dst_refBuf)
+ HDfree(dst_refBuf);
+
+ return dst_ref;
+} /* end Java_hdf_hdf5lib_H5_H5Rcopy */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Ropen_object
+ * Signature: ([BJJ)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Ropen_1object
+ (JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong oapl_id)
+{
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ jsize refBufLen;
+ hid_t retVal = H5I_INVALID_HID;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ropen_object: reference is NULL");
+
+ if ((refBufLen = ENVPTR->GetArrayLength(ENVONLY, ref)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Ropen_object: reference array length < 0");
+ }
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Ropen_object: reference buffer not pinned");
+
+ if ((retVal = H5Ropen_object((const H5R_ref_t *)refBuf, (hid_t)rapl_id, (hid_t)oapl_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (retVal < 0) ? JNI_ABORT : 0);
+
+ return (jlong)retVal;
+} /* end Java_hdf_hdf5lib_H5_H5Ropen_1object */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Ropen_region
+ * Signature: ([BJJ)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Ropen_1region
+ (JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong oapl_id)
+{
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ jsize refBufLen;
+ hid_t retVal = H5I_INVALID_HID;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ropen_region: reference is NULL");
+
+ if ((refBufLen = ENVPTR->GetArrayLength(ENVONLY, ref)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Ropen_region: reference array length < 0");
+ }
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Ropen_region: reference buffer not pinned");
+
+ if ((retVal = H5Ropen_region((const H5R_ref_t *)refBuf, (hid_t)rapl_id, (hid_t)oapl_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (retVal < 0) ? JNI_ABORT : 0);
+
+ return (jlong)retVal;
+} /* end Java_hdf_hdf5lib_H5_H5Ropen_1region */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Ropen_attr
+ * Signature: ([BJJ)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Ropen_1attr
+ (JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id, jlong aapl_id)
+{
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ jsize refBufLen;
+ hid_t retVal = H5I_INVALID_HID;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ropen_attr: reference is NULL");
+
+ if ((refBufLen = ENVPTR->GetArrayLength(ENVONLY, ref)) < 0) {
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Ropen_attr: reference array length < 0");
+ }
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Ropen_attr: reference buffer not pinned");
+
+ if ((retVal = H5Ropen_attr((const H5R_ref_t *)refBuf, (hid_t)rapl_id, (hid_t)aapl_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (retVal < 0) ? JNI_ABORT : 0);
+
+ return (jlong)retVal;
+} /* end Java_hdf_hdf5lib_H5_H5Ropen_1attr */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_obj_type3
+ * Signature: ([BJ)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1obj_1type3
+ (JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id)
+{
+ H5O_type_t object_info;
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ int retVal = -1;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rget_obj_type3: reference buffer is NULL");
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_obj_type3: reference buffer not pinned");
+
+ if ((retVal = H5Rget_obj_type3((const H5R_ref_t *)refBuf, (hid_t)rapl_id, &object_info)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (retVal >= 0)
+ retVal = object_info;
+
+done:
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (retVal < 0) ? JNI_ABORT : 0);
+
+ return (jint)retVal;
+} /* end Java_hdf_hdf5lib_H5_H5Rget_1obj_1type3 */
+
/*
- * Pointer to the JNI's Virtual Machine; used for callback functions.
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_file_name
+ * Signature: ([B)Ljava/lang/String;
*/
-/* extern JavaVM *jvm; */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1file_1name
+ (JNIEnv *env, jclass clss, jbyteArray ref)
+{
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ jstring str = NULL;
+ ssize_t buf_size;
+ ssize_t check_size;
+ char *namePtr = NULL;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rget_file_name: reference buffer is NULL");
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_file_name: reference buffer not pinned");
+
+ /* Get the length of the name */
+ if ((buf_size = H5Rget_file_name((const H5R_ref_t *)refBuf, NULL, 0)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Rget_file_name: malloc failed");
+
+ if ((check_size = H5Rget_file_name((const H5R_ref_t *)refBuf, namePtr, (size_t)buf_size + 1)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ namePtr[buf_size] = '\0';
+
+ if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, namePtr)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+done:
+ if (namePtr)
+ HDfree(namePtr);
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (check_size < 0) ? JNI_ABORT : 0);
+
+ return str;
+} /* end Java_hdf_hdf5lib_H5_H5Rget_1file_1name */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_obj_name
+ * Signature: ([BJ)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1obj_1name
+ (JNIEnv *env, jclass clss, jbyteArray ref, jlong rapl_id)
+{
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ jstring str = NULL;
+ ssize_t buf_size;
+ ssize_t check_size;
+ char *namePtr = NULL;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rget_obj_name: reference buffer is NULL");
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_obj_name: reference buffer not pinned");
+
+ /* Get the length of the name */
+ if ((buf_size = H5Rget_obj_name((const H5R_ref_t *)refBuf, (hid_t)rapl_id, NULL, 0)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Rget_obj_name: malloc failed");
+
+ if ((check_size = H5Rget_obj_name((const H5R_ref_t *)refBuf, (hid_t)rapl_id, namePtr, (size_t)buf_size + 1)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ namePtr[buf_size] = '\0';
+
+ if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, namePtr)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+done:
+ if (namePtr)
+ HDfree(namePtr);
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (check_size < 0) ? JNI_ABORT : 0);
+
+ return str;
+} /* end Java_hdf_hdf5lib_H5_H5Rget_1obj_1name */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_attr_name
+ * Signature: ([B)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1attr_1name
+ (JNIEnv *env, jclass clss, jbyteArray ref)
+{
+ jboolean isCopy;
+ jbyte *refBuf = NULL;
+ jstring str = NULL;
+ ssize_t buf_size;
+ ssize_t check_size;
+ char *namePtr = NULL;
+
+ UNUSED(clss);
+
+ if (NULL == ref)
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Rget_attr_name: reference buffer is NULL");
+
+ PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_attr_name: reference buffer not pinned");
+
+ /* Get the length of the name */
+ if ((buf_size = H5Rget_attr_name((const H5R_ref_t *)refBuf, NULL, 0)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
+ H5_JNI_FATAL_ERROR(ENVONLY, "H5Rget_attr_name: malloc failed");
+
+ if ((check_size = H5Rget_attr_name((const H5R_ref_t *)refBuf, namePtr, (size_t)buf_size + 1)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ namePtr[buf_size] = '\0';
+
+ if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, namePtr)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+done:
+ if (namePtr)
+ HDfree(namePtr);
+ if (refBuf)
+ UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (check_size < 0) ? JNI_ABORT : 0);
+
+ return str;
+} /* end Java_hdf_hdf5lib_H5_H5Rget_1attr_1name */
+
+/* H5R: HDF5 1.8 Reference API Functions */
/*
* Class: hdf_hdf5lib_H5
diff --git a/java/src/jni/h5rImp.h b/java/src/jni/h5rImp.h
index e28329b..7749f91 100644
--- a/java/src/jni/h5rImp.h
+++ b/java/src/jni/h5rImp.h
@@ -21,6 +21,136 @@
extern "C" {
#endif /* __cplusplus */
+/* H5R: HDF5 1.12 Reference API Functions */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rcreate_object
+ * Signature: (JLjava/lang/String;)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_hdf_hdf5lib_H5_H5Rcreate_1object
+ (JNIEnv *, jclass, jlong, jstring);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rcreate_region
+ * Signature: (JLjava/lang/String;J)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_hdf_hdf5lib_H5_H5Rcreate_1region
+ (JNIEnv *, jclass, jlong, jstring, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rcreate_attr
+ * Signature: (JLjava/lang/String;Ljava/lang/String;)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_hdf_hdf5lib_H5_H5Rcreate_1attr
+ (JNIEnv *, jclass, jlong, jstring, jstring);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rdestroy
+ * Signature: ([B)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Rdestroy
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_type
+ * Signature: ([B)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1type
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Requal
+ * Signature: ([B[B)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5Requal
+ (JNIEnv *, jclass, jbyteArray, jbyteArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rcopy
+ * Signature: ([B)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_hdf_hdf5lib_H5_H5Rcopy
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Ropen_object
+ * Signature: ([BJJ)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Ropen_1object
+ (JNIEnv *, jclass, jbyteArray, jlong, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Ropen_region
+ * Signature: ([BJJ)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Ropen_1region
+ (JNIEnv *, jclass, jbyteArray, jlong, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Ropen_attr
+ * Signature: ([BJJ)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5Ropen_1attr
+ (JNIEnv *, jclass, jbyteArray, jlong, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_obj_type3
+ * Signature: ([BJ)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1obj_1type3
+ (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_file_name
+ * Signature: ([B)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1file_1name
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_obj_name
+ * Signature: ([BJ)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1obj_1name
+ (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Rget_attr_name
+ * Signature: ([B)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5Rget_1attr_1name
+ (JNIEnv *, jclass, jbyteArray);
+
+/* H5R: HDF5 1.8 Reference API Functions */
+
/*
* Class: hdf_hdf5lib_H5
* Method: H5Rcreate
diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c
index eedd42e..c703e90 100644
--- a/java/src/jni/h5sImp.c
+++ b/java/src/jni/h5sImp.c
@@ -162,9 +162,9 @@ done:
} /* end Java_hdf_hdf5lib_H5__1H5Scopy */
#ifdef notdef
-// 10/28/99 -- added code to copy the array -- this is not used,
-// but serves as a reminder in case we try to implement this in
-// the future....
+/* 10/28/99 -- added code to copy the array -- this is not used,
+ * but serves as a reminder in case we try to implement this in
+ */ the future....
/*
* Note: the argument coord is actually long coord[][], which has been
* flattened by the caller.
diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h
index 141e504..87661e3 100644
--- a/java/src/jni/h5sImp.h
+++ b/java/src/jni/h5sImp.h
@@ -49,9 +49,9 @@ Java_hdf_hdf5lib_H5__1H5Scopy
(JNIEnv *, jclass, jlong);
#ifdef notdef
-// 10/28/99 -- added code to copy the array -- this is not used,
-// but serves as a reminder in case we try to implement this in
-// the future....
+/* 10/28/99 -- added code to copy the array -- this is not used,
+ * but serves as a reminder in case we try to implement this in
+ */ the future....
/*
* Note: the argument coord is actually long coord[][], which has been
* flattened by the caller.
diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c
index 3302b7d..1adff3c 100644
--- a/java/src/jni/h5tImp.c
+++ b/java/src/jni/h5tImp.c
@@ -981,9 +981,9 @@ done:
/*
* Class: hdf_hdf5lib_H5
* Method: H5Treclaim
- * Signature: (JJJ[B)I
+ * Signature: (JJJ[B)V
*/
-JNIEXPORT jint JNICALL
+JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Treclaim
(JNIEnv *env, jclass clss, jlong type_id, jlong space_id,
jlong xfer_plist_id, jbyteArray buf)
@@ -1005,8 +1005,6 @@ Java_hdf_hdf5lib_H5_H5Treclaim
done:
if (pinBuf)
UNPIN_BYTE_ARRAY(ENVONLY, buf, pinBuf, (status < 0) ? JNI_ABORT : 0);
-
- return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Treclaim */
/*
diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h
index a63969b..78e4561 100644
--- a/java/src/jni/h5tImp.h
+++ b/java/src/jni/h5tImp.h
@@ -402,9 +402,9 @@ Java_hdf_hdf5lib_H5_H5Tpack
/*
* Class: hdf_hdf5lib_H5
* Method: H5Treclaim
- * Signature: (JJJ[B)I
+ * Signature: (JJJ[B)V
*/
-JNIEXPORT jint JNICALL
+JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Treclaim
(JNIEnv*, jclass, jlong, jlong, jlong, jbyteArray);
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 700f75f..cd54f8b 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -71,6 +71,12 @@ static int render_bin_output_region_data_points(FILE *stream, hid_t region_s
static int render_bin_output_region_points(FILE *stream, hid_t region_space,
hid_t region_id, hid_t container);
+/* Strings for output */
+#define H5_TOOLS_GROUP "GROUP"
+#define H5_TOOLS_DATASET "DATASET"
+#define H5_TOOLS_DATATYPE "DATATYPE"
+#define H5_TOOLS_ATTRIBUTE "ATTRIBUTE"
+
/** frees memory held by array of strings */
void
h5str_array_free
@@ -625,6 +631,64 @@ done:
return retVal;
} /* end h5str_convert */
+/*-------------------------------------------------------------------------
+ * Function: h5str_sprint_reference
+ *
+ * Purpose: Object reference -- show the name of the referenced object.
+ *
+ * Return: Nothing
+ *-------------------------------------------------------------------------
+ */
+void
+h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref_p)
+{
+ ssize_t buf_size, status;
+ char *ref_name = NULL;
+ const H5R_ref_t *ref_vp = (H5R_ref_t *)ref_p;
+
+ UNUSED(container);
+
+ if (!h5str_append(out_str, " "))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ buf_size = H5Rget_file_name(ref_vp, NULL, 0);
+ if (buf_size) {
+ ref_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1);
+ status = H5Rget_file_name(ref_vp, ref_name, buf_size + 1);
+ ref_name[buf_size] = '\0';
+ if (!h5str_append(out_str, ref_name))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ HDfree(ref_name);
+ ref_name = NULL;
+ }
+
+ buf_size = H5Rget_obj_name(ref_vp, H5P_DEFAULT, NULL, 0);
+ if (buf_size) {
+ ref_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1);
+ status = H5Rget_obj_name(ref_vp, H5P_DEFAULT, ref_name, buf_size + 1);
+ ref_name[buf_size] = '\0';
+ if (!h5str_append(out_str, ref_name))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ HDfree(ref_name);
+ ref_name = NULL;
+ }
+
+ if (H5Rget_type(ref_vp) == H5R_ATTR) {
+ buf_size = H5Rget_attr_name(ref_vp, NULL, 0);
+ if (buf_size) {
+ ref_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1);
+ status = H5Rget_attr_name(ref_vp, ref_name, buf_size + 1);
+ ref_name[buf_size] = '\0';
+ if (!h5str_append(out_str, ref_name))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ HDfree(ref_name);
+ ref_name = NULL;
+ }
+ }
+done:
+ if (ref_name)
+ HDfree(ref_name);
+}
+
/*
* Prints the value of a data point into a string.
*
@@ -984,96 +1048,89 @@ h5str_sprintf
break;
}
- if (H5R_DSET_REG_REF_BUF_SIZE == typeSize) {
- H5S_sel_type region_type = H5S_SEL_ERROR;
- hid_t region_obj = H5I_INVALID_HID;
- hid_t region = H5I_INVALID_HID;
- char ref_name[1024];
-
- /*
- * Dataset region reference --
- * show the type and the referenced object
- */
-
- /* Get name of the dataset the region reference points to using H5Rget_name */
- if ((region_obj = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, cptr)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((region = H5Rget_region(container, H5R_DATASET_REGION, cptr)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if (expand_data) {
- if (H5S_SEL_ERROR == (region_type = H5Sget_select_type(region)))
- H5_LIBRARY_ERROR(ENVONLY);
-
- if (H5S_SEL_POINTS == region_type) {
- if (h5str_dump_region_points_data(ENVONLY, out_str, region, region_obj) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
- else {
- if (h5str_dump_region_blocks_data(ENVONLY, out_str, region, region_obj) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
- }
- else {
- if (H5Rget_name(region_obj, H5R_DATASET_REGION, cptr, (char *)ref_name, 1024) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if (!h5str_append(out_str, ref_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
-
- if (H5S_SEL_ERROR == (region_type = H5Sget_select_type(region)))
- H5_LIBRARY_ERROR(ENVONLY);
-
- if (H5S_SEL_POINTS == region_type) {
- if (!h5str_append(out_str, " REGION_TYPE POINT"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
-
- if (h5str_dump_region_points(ENVONLY, out_str, region, region_obj) < 0)
+ if (H5Tequal(tid, H5T_STD_REF)) {
+ H5O_type_t obj_type; /* Object type */
+ H5R_type_t ref_type; /* Reference type */
+ const 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:
+ 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 */
+ break;
+ case H5R_DATASET_REGION1:
+ if (!h5str_append(out_str, H5_TOOLS_DATASET))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
- else {
- if (!h5str_append(out_str, " REGION_TYPE BLOCK"))
+ 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);
+ break;
+ case H5R_DATASET_REGION2:
+ if (!h5str_append(out_str, H5_TOOLS_DATASET))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
-
- if (h5str_dump_region_blocks(ENVONLY, out_str, region, region_obj) < 0)
+ 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);
- }
- }
-
- if (H5Sclose(region) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
- region = H5I_INVALID_HID;
-
- if (H5Dclose(region_obj) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
- region_obj = H5I_INVALID_HID;
+ h5str_sprint_reference(ENVONLY, out_str, container, (void*)cptr);
+ break;
+ default:
+ break;
+ } /* end switch */
}
- else if (H5R_OBJ_REF_BUF_SIZE == typeSize) {
- H5O_info_t oi;
- hid_t obj = H5I_INVALID_HID;
-
- /*
- * Object references -- show the type and OID of the referenced
- * object.
- */
-
- if (NULL == (this_str = (char *) HDmalloc(64)))
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer");
-
- if ((obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, cptr)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if (H5Oget_info2(obj, &oi, H5O_INFO_ALL) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- /* Print object data and close object */
- if (HDsprintf(this_str, "%u-%lu", (unsigned) oi.type, oi.addr) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
-
- if (H5Oclose(obj) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
- obj = H5I_INVALID_HID;
+ 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) */
+ H5_LIBRARY_ERROR(ENVONLY);
}
break;
@@ -2204,20 +2261,28 @@ h5str_render_bin_output
case H5T_REFERENCE:
{
- if (H5Tequal(tid, H5T_STD_REF_DSETREG)) {
+ 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;
- hid_t region_id, region_space;
/* Region data */
for (block_index = 0; block_index < block_nelmts; block_index++) {
mem = ((unsigned char*)_mem) + block_index * size;
-
- if ((region_id = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, mem)) < 0)
+ if((region_id = H5Ropen_object((const H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0)
continue;
-
- if ((region_space = H5Rget_region(container, H5R_DATASET_REGION, mem)) < 0) {
+ 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);
- continue;
}
if ((region_type = H5Sget_select_type(region_space)) < 0) {
@@ -2225,19 +2290,13 @@ h5str_render_bin_output
H5Dclose(region_id);
continue;
}
-
- 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);
- H5Dclose(region_id);
-
if (ret_value < 0)
break;
}
}
+ else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) {
+ ;
+ }
else if (H5Tequal(tid, H5T_STD_REF_OBJ)) {
;
}
@@ -3091,15 +3150,15 @@ done:
} /* end Java_hdf_hdf5lib_H5_H5Dcopy */
/*
-/////////////////////////////////////////////////////////////////////////////////
-//
-//
-// Add these methods so that we don't need to call H5Gget_objtype_by_idx
-// in a loop to get information for all the objects in a group, which takes
-// a lot of time to finish if the number of objects is more than 10,000
-//
-/////////////////////////////////////////////////////////////////////////////////
-*/
+ * /////////////////////////////////////////////////////////////////////////////////
+ * //
+ * //
+ * // Add these methods so that we don't need to call H5Gget_objtype_by_idx
+ * // in a loop to get information for all the objects in a group, which takes
+ * // a lot of time to finish if the number of objects is more than 10,000
+ * //
+ * /////////////////////////////////////////////////////////////////////////////////
+ */
#ifdef __cplusplus
herr_t obj_info_all(hid_t g_id, const char *name, const H5L_info_t *linfo, void *op_data);
diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h
index e5f0d0b..c26cd5d 100644
--- a/java/src/jni/h5util.h
+++ b/java/src/jni/h5util.h
@@ -40,6 +40,7 @@ extern void h5str_free(h5str_t *str);
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 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);
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);