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-10-11 02:46:22 (GMT)
commit71f36b343ac758029de343c0afa2d6269eb56468 (patch)
treeb47bfab236ac7886308d1d6c09f6bb1effacdb42 /src/H5I.c
parent75bb8add458930420b1d0856605ecc55ff2e12de (diff)
downloadhdf5-71f36b343ac758029de343c0afa2d6269eb56468.zip
hdf5-71f36b343ac758029de343c0afa2d6269eb56468.tar.gz
hdf5-71f36b343ac758029de343c0afa2d6269eb56468.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