diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-01-16 21:29:34 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:31:50 (GMT) |
commit | 3e6a192e9cef92ee1e0cf1842d05995da83efd27 (patch) | |
tree | 3cd0e18b9a50af6fc00a30a7da24d016b07efbb7 /java/src/jni/h5vlImp.c | |
parent | 335fc0096c4287c1121c45c85085e67e5735c47d (diff) | |
download | hdf5-3e6a192e9cef92ee1e0cf1842d05995da83efd27.zip hdf5-3e6a192e9cef92ee1e0cf1842d05995da83efd27.tar.gz hdf5-3e6a192e9cef92ee1e0cf1842d05995da83efd27.tar.bz2 |
Squashed commit of the token_refactoring branch:
Diffstat (limited to 'java/src/jni/h5vlImp.c')
-rw-r--r-- | java/src/jni/h5vlImp.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/java/src/jni/h5vlImp.c b/java/src/jni/h5vlImp.c index 92e456e..0fee343 100644 --- a/java/src/jni/h5vlImp.c +++ b/java/src/jni/h5vlImp.c @@ -110,10 +110,30 @@ done: /* * Class: hdf_hdf5lib_H5 * Method: H5VLget_connector_id - * Signature: (Ljava/lang/String;)J + * Signature: (J)J */ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5VLget_1connector_1id + (JNIEnv *env, jclass clss, jlong obj_id) +{ + hid_t status = H5I_INVALID_HID; + + UNUSED(clss); + + if ((status = H5VLget_connector_id((hid_t)obj_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return (jlong)status; +} /* end Java_hdf_hdf5lib_H5_H5VLget_1connector_1id */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5VLget_connector_id_by_name + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1name (JNIEnv *env, jclass clss, jobject connector_name) { const char *volName = NULL; @@ -122,11 +142,11 @@ Java_hdf_hdf5lib_H5_H5VLget_1connector_1id UNUSED(clss); if (NULL == connector_name) - H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5VLget_connector_id: VOL connector name is NULL"); + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5VLget_connector_id_by_name: VOL connector name is NULL"); - PIN_JAVA_STRING(ENVONLY, connector_name, volName, NULL, "H5VLget_connector_id: VOL connector name not pinned"); + PIN_JAVA_STRING(ENVONLY, connector_name, volName, NULL, "H5VLget_connector_id_by_name: VOL connector name not pinned"); - if ((status = H5VLget_connector_id(volName)) < 0) + if ((status = H5VLget_connector_id_by_name(volName)) < 0) H5_LIBRARY_ERROR(ENVONLY); done: @@ -134,7 +154,7 @@ done: UNPIN_JAVA_STRING(ENVONLY, connector_name, volName); return (jlong)status; -} /* end Java_hdf_hdf5lib_H5_H5VLget_1connector_1id */ +} /* end Java_hdf_hdf5lib_H5_H5VLget_1connector_1id_1by_1name */ /* * Class: hdf_hdf5lib_H5 @@ -158,7 +178,7 @@ Java_hdf_hdf5lib_H5_H5VLget_1connector_1name if (buf_size > 0) { if (NULL == (volName = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1))) - H5_JNI_FATAL_ERROR(ENVONLY, "H5VLget_connector_name: failed to allocated VOL connector name buffer"); + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5VLget_connector_name: failed to allocated VOL connector name buffer"); if ((status = H5VLget_connector_name((hid_t)object_id, volName, (size_t)buf_size + 1)) < 0) H5_LIBRARY_ERROR(ENVONLY); |