summaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/hdf/hdf5lib/H5.java4
-rw-r--r--java/src/jni/h5rImp.c16
-rw-r--r--java/src/jni/h5util.c10
-rw-r--r--java/src/jni/h5vlImp.c60
-rw-r--r--java/src/jni/h5vlImp.h22
5 files changed, 93 insertions, 19 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index 5b704dd..872fbc7 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -10895,9 +10895,11 @@ public class H5 implements java.io.Serializable {
/// VOL Connector Functionality
public synchronized static native long H5VLregister_connector_by_name(String connector_name, long vipl_id);
public synchronized static native long H5VLregister_connector_by_value(int connector_value, long vipl_id);
- public synchronized static native boolean H5VLis_connector_registered(String name);
+ public synchronized static native boolean H5VLis_connector_registered_by_name(String name);
+ public synchronized static native boolean H5VLis_connector_registered_by_value(int connector_value);
public synchronized static native long H5VLget_connector_id(long object_id);
public synchronized static native long H5VLget_connector_id_by_name(String name);
+ public synchronized static native long H5VLget_connector_id_by_value(int connector_value);
public synchronized static native String H5VLget_connector_name(long object_id);
public synchronized static native void H5VLclose(long connector_id);
public synchronized static native void H5VLunregister_connector(long connector_id);
diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c
index def27f4..e24fc2a 100644
--- a/java/src/jni/h5rImp.c
+++ b/java/src/jni/h5rImp.c
@@ -50,7 +50,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1object
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)))
+ if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_object: failed to allocate reference buffer");
if ((status = H5Rcreate_object((hid_t)loc_id, refName, (hid_t)aid, (const H5R_ref_t *)refBuf)) < 0)
@@ -93,7 +93,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1region
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)))
+ if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_region: failed to allocate reference buffer");
if ((status = H5Rcreate_region((hid_t)loc_id, refName, space_id, (hid_t)aid, (const H5R_ref_t *)refBuf)) < 0)
@@ -140,7 +140,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1attr
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)))
+ if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_attr: failed to allocate reference buffer");
if ((status = H5Rcreate_attr((hid_t)loc_id, refName, attrName, (hid_t)aid, (const H5R_ref_t *)refBuf)) < 0)
@@ -314,7 +314,7 @@ Java_hdf_hdf5lib_H5_H5Rcopy
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)))
+ if (NULL == (dst_refBuf = HDcalloc(1, H5R_REF_BUF_SIZE)))
H5_OUT_OF_MEMORY_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)
@@ -504,7 +504,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1file_1name
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)))
+ if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_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)
@@ -550,7 +550,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1obj_1name
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)))
+ if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_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)
@@ -596,7 +596,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1attr_1name
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)))
+ if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_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)
@@ -862,7 +862,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1name
PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_name: reference buffer not pinned");
- if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)size + 1)))
+ if (NULL == (aName = HDmalloc(sizeof(char) * (size_t)size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_name: failed to allocate referenced object name buffer");
if ((ret_val = (jlong)H5Rget_name((hid_t)loc_id, (H5R_type_t)ref_type, refBuf, aName, (size_t)size + 1)) < 0)
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 55f7571..f45902f 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -28,6 +28,8 @@ 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 */
@@ -52,8 +54,10 @@ 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_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);
@@ -708,7 +712,6 @@ h5str_sprintf
unsigned char *ucptr = (unsigned char *) in_buf;
static char fmt_llong[8], fmt_ullong[8];
H5T_class_t tclass = H5T_NO_CLASS;
- H5T_str_t pad;
size_t typeSize = 0;
H5T_sign_t nsign = H5T_SGN_ERROR;
hid_t mtid = H5I_INVALID_HID;
@@ -814,7 +817,6 @@ h5str_sprintf
else {
tmp_str = cptr;
}
- pad = H5Tget_strpad(tid);
/* Check for NULL pointer for string */
if (!tmp_str) {
@@ -1482,6 +1484,7 @@ done:
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)
@@ -1569,6 +1572,7 @@ done:
return ret_value;
} /* end h5str_dump_region_blocks */
+#endif
/*-------------------------------------------------------------------------
* Purpose: Print the data values from a dataset referenced by region points.
@@ -1701,6 +1705,7 @@ done:
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)
@@ -1776,6 +1781,7 @@ done:
return ret_value;
} /* end h5str_dump_region_points */
+#endif
static int
h5str_is_zero
diff --git a/java/src/jni/h5vlImp.c b/java/src/jni/h5vlImp.c
index 0fee343..1ead30b 100644
--- a/java/src/jni/h5vlImp.c
+++ b/java/src/jni/h5vlImp.c
@@ -78,11 +78,11 @@ done:
/*
* Class: hdf_hdf5lib_H5
- * Method: H5VLis_connector_registered
+ * Method: H5VLis_connector_registered_by_name
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL
-Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered
+Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1name
(JNIEnv *env, jclass clss, jobject connector_name)
{
const char *volName = NULL;
@@ -91,11 +91,11 @@ Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered
UNUSED(clss);
if (NULL == connector_name)
- H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5VLis_connector_registered: VOL connector name is NULL");
+ H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5VLis_connector_registered_by_name: VOL connector name is NULL");
- PIN_JAVA_STRING(ENVONLY, connector_name, volName, NULL, "H5VLis_connector_registered: VOL connector name not pinned");
+ PIN_JAVA_STRING(ENVONLY, connector_name, volName, NULL, "H5VLis_connector_registered_by_name: VOL connector name not pinned");
- if ((bval = H5VLis_connector_registered(volName)) < 0)
+ if ((bval = H5VLis_connector_registered_by_name(volName)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
@@ -105,7 +105,32 @@ done:
UNPIN_JAVA_STRING(ENVONLY, connector_name, volName);
return (jboolean)bval;
-} /* end Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered */
+} /* end Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1name */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5VLis_connector_registered_by_value
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1value
+ (JNIEnv *env, jclass clss, jint connector_value)
+{
+ htri_t bval = JNI_FALSE;
+
+ UNUSED(clss);
+
+ if (connector_value < 0)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5VLis_connector_registered_by_value: VOL connector value < 0");
+
+ if ((bval = H5VLis_connector_registered_by_value((H5VL_class_value_t)connector_value)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
+
+done:
+ return (jboolean)bval;
+} /* end Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1value */
/*
* Class: hdf_hdf5lib_H5
@@ -158,6 +183,29 @@ done:
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5VLget_connector_id_by_value
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1value
+ (JNIEnv *env, jclass clss, jint connector_value)
+{
+ hid_t status = H5I_INVALID_HID;
+
+ UNUSED(clss);
+
+ if (connector_value < 0)
+ H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5VLget_connector_id_by_value: VOL connector value < 0");
+
+ if ((status = H5VLget_connector_id_by_value((H5VL_class_value_t)connector_value)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return (jlong)status;
+} /* end Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1value */
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5VLget_connector_name
* Signature: (J)Ljava/lang/String;
*/
diff --git a/java/src/jni/h5vlImp.h b/java/src/jni/h5vlImp.h
index 6dd7529..a58abef 100644
--- a/java/src/jni/h5vlImp.h
+++ b/java/src/jni/h5vlImp.h
@@ -40,15 +40,24 @@ Java_hdf_hdf5lib_H5_H5VLregister_1connector_1by_1value
/*
* Class: hdf_hdf5lib_H5
- * Method: H5VLis_connector_registered
+ * Method: H5VLis_connector_registered_by_name
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL
-Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered
+Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1name
(JNIEnv *, jclass, jobject);
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5VLis_connector_registered_by_value
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_hdf_hdf5lib_H5_H5VLis_1connector_1registered_1by_1value
+ (JNIEnv *, jclass, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5VLget_connector_id
* Signature: (J)J
*/
@@ -67,6 +76,15 @@ Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1name
/*
* Class: hdf_hdf5lib_H5
+ * Method: H5VLget_connector_id_by_value
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL
+Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1value
+ (JNIEnv *, jclass, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
* Method: H5VLget_connector_name
* Signature: (J)Ljava/lang/String;
*/