summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-09-26 22:47:00 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-09-27 02:13:35 (GMT)
commit4fb64c89fe52a309150ca2d5bb97eb4763e598e9 (patch)
treeaf158b041bcbb357aca65fc0d780d1ed727d3d04 /src/H5I.c
parentfbb0728f5423ba88de5a7bbe4f4d06825ed82aaa (diff)
downloadhdf5-4fb64c89fe52a309150ca2d5bb97eb4763e598e9.zip
hdf5-4fb64c89fe52a309150ca2d5bb97eb4763e598e9.tar.gz
hdf5-4fb64c89fe52a309150ca2d5bb97eb4763e598e9.tar.bz2
Converted H5O MD cache cork calls to use the VOL.
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/H5I.c b/src/H5I.c
index ab68e38..201ad9a 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -1086,6 +1086,56 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5I_is_file_object
+ *
+ * Purpose: Convenience function to determine if an ID represents
+ * a file object.
+ *
+ * In H5O calls, you can't use object_verify to ensure
+ * the ID was of the correct class since there's no
+ * H5I_OBJECT ID class.
+ *
+ * Return: Success: TRUE/FALSE
+ * Failure: FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5I_is_file_object(hid_t id)
+{
+ H5I_type_t id_type = H5I_get_type(id);
+ htri_t ret_value = FAIL;
+
+ FUNC_ENTER_NOAPI(FAIL);
+
+ /* Fail if the ID type is out of range */
+ HDassert(id_type >= 1 && id_type < H5I_NTYPES);
+
+ /* Return TRUE if the ID is a file object (dataset, group, map, or committed
+ * datatype), FALSE otherwise.
+ */
+ if (H5I_DATASET == id_type || H5I_GROUP == id_type || H5I_MAP == id_type) {
+ ret_value = TRUE;
+ }
+ else if (H5I_DATATYPE == id_type) {
+
+ H5T_t *dt = NULL;
+
+ if(NULL == (dt = (H5T_t *)H5I_object(id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to get underlying datatype struct")
+
+ ret_value = H5T_is_named(dt);
+ }
+ else {
+ ret_value = FALSE;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5I_is_file_object() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5Iremove_verify
*
* Purpose: Removes the specified ID from its type, first checking that the