From 563e686505caf68956751f9e0e46ceeaf4a47982 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 21 Oct 2021 05:41:21 -0700 Subject: Adds H5VLfapl_is_native public API call --- java/src/jni/h5jni_test.c | 2 +- src/H5VL.c | 36 ++++++++++++++++++++++++++++++++++++ src/H5VLpublic.h | 12 ++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/java/src/jni/h5jni_test.c b/java/src/jni/h5jni_test.c index 02f6a78..9374f8d 100644 --- a/java/src/jni/h5jni_test.c +++ b/java/src/jni/h5jni_test.c @@ -39,7 +39,7 @@ Java_test_H5TestUtils_H5VLfapl_1is_1native(JNIEnv *env, jclass clss, jlong fapl_ UNUSED(clss); - if (H5VL_fapl_is_native((hid_t)fapl_id, &bval) < 0) + if (H5VLfapl_is_native((hid_t)fapl_id, &bval) < 0) H5_LIBRARY_ERROR(ENVONLY); bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; diff --git a/src/H5VL.c b/src/H5VL.c index d3e7c94..80afb3e 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -1077,3 +1077,39 @@ H5VLunregister_opt_operation(H5VL_subclass_t subcls, const char *op_name) done: FUNC_LEAVE_API(ret_value) } /* H5VLunregister_opt_operation() */ + +/*------------------------------------------------------------------------- + * Function: H5VLfapl_is_native + * + * Purpose: Query if a FAPL will use the native VOL connector. + * + * Return: Success: Non-negative + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +herr_t +H5VLfapl_is_native(hid_t fapl_id, hbool_t *is_native) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*b", fapl_id, is_native); + + /* Check args */ + if (NULL == is_native) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid is_native pointer") + + /* Check for default property list value */ + if (H5P_DEFAULT == fapl_id) + fapl_id = H5P_FILE_ACCESS_DEFAULT; + + /* Invoke the private API call */ + if (H5VL_fapl_is_native(fapl_id, is_native) < 0) + HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get VOL connector info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5VLfapl_is_native() */ + + diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index 78e39e3..92e0dee 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -357,6 +357,18 @@ H5_DLL herr_t H5VLunregister_connector(hid_t connector_id); */ H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, uint64_t *flags); +/** + * \ingroup H5VL + * \brief Determine if a fapl is set to use the native VOL connector. + * + * \fapl_id + * \param[out] is_native Whether the fapl uses the native VOL connector. + * \return \herr_t + * + * \since 1.13.0 + */ +H5_DLL herr_t H5VLfapl_is_native(hid_t fapl_id, hbool_t *is_native); + #ifdef __cplusplus } #endif -- cgit v0.12