summaryrefslogtreecommitdiffstats
path: root/src/H5VLint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-04-21 19:45:54 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-04-21 19:45:54 (GMT)
commit62198c2436ac3787afb49fa990d1ba8204264dba (patch)
treece6f47307d75ffa61f49de88fdf72a014adfd1fb /src/H5VLint.c
parent500f6cccbd4bfe01b67f2bd02f74df58edef045f (diff)
downloadhdf5-62198c2436ac3787afb49fa990d1ba8204264dba.zip
hdf5-62198c2436ac3787afb49fa990d1ba8204264dba.tar.gz
hdf5-62198c2436ac3787afb49fa990d1ba8204264dba.tar.bz2
Add an 'unwrap' VOL callback, so that connectors can unwrap an underlying
object without closing it. (Especially needed for pass-through connectors)
Diffstat (limited to 'src/H5VLint.c')
-rw-r--r--src/H5VLint.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/H5VLint.c b/src/H5VLint.c
index fda4443..1b735f5 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -1358,6 +1358,32 @@ H5VL_object_data(const H5VL_object_t *vol_obj)
/*-------------------------------------------------------------------------
+ * Function: H5VL_object_unwrap
+ *
+ * Purpose: Correctly unwrap the 'data' field for a VOL object (H5VL_object),
+ * even for nested / stacked VOL connectors.
+ *
+ * Return: Success: Object pointer
+ * Failure: NULL
+ *
+ *-------------------------------------------------------------------------
+ */
+void *
+H5VL_object_unwrap(const H5VL_object_t *vol_obj)
+{
+ void *ret_value = NULL;
+
+ FUNC_ENTER_NOAPI(NULL)
+
+ if(NULL == (ret_value = H5VL_unwrap_object(vol_obj->connector->cls, vol_obj->data)))
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't unwrap object")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5VL_object_unwrap() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5VL__object
*
* Purpose: Internal function to return the VOL object pointer associated
@@ -1444,7 +1470,7 @@ H5VL_object(hid_t id)
/* Get the underlying object */
if(NULL == (ret_value = H5VL__object(id, H5I_get_type(id))))
- HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, NULL, "can't retrieve object for ID")
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't retrieve object for ID")
done:
FUNC_LEAVE_NOAPI(ret_value)