diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2020-01-29 00:18:38 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2020-01-29 00:18:38 (GMT) |
commit | e41f671d2ff3c7bb797ea0246e6289b0bac5a0e5 (patch) | |
tree | 9b0af1ccf350a14b2165c1db1579b2434144aaf8 /java/src | |
parent | 71c050f837149a0c11e0936e661047c091deaa2f (diff) | |
download | hdf5-e41f671d2ff3c7bb797ea0246e6289b0bac5a0e5.zip hdf5-e41f671d2ff3c7bb797ea0246e6289b0bac5a0e5.tar.gz hdf5-e41f671d2ff3c7bb797ea0246e6289b0bac5a0e5.tar.bz2 |
Introduce new H5VL _by_value routines
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/hdf/hdf5lib/H5.java | 4 | ||||
-rw-r--r-- | java/src/jni/h5vlImp.c | 60 | ||||
-rw-r--r-- | java/src/jni/h5vlImp.h | 22 |
3 files changed, 77 insertions, 9 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/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; */ |