summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-09-25 19:09:08 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-09-25 19:09:08 (GMT)
commit7eac8b84b0cfe87bb9e8efa1a7339e1c5117d1a0 (patch)
treea4a26e87efa945deb48a22b023b1a1bcd0ceee20 /src/H5Fint.c
parent593a6d6c66051675be6565bd7987f9a36863c28d (diff)
parent392b7d32492eb61da3e3a90ceeeae1eaf06d8b6f (diff)
downloadhdf5-7eac8b84b0cfe87bb9e8efa1a7339e1c5117d1a0.zip
hdf5-7eac8b84b0cfe87bb9e8efa1a7339e1c5117d1a0.tar.gz
hdf5-7eac8b84b0cfe87bb9e8efa1a7339e1c5117d1a0.tar.bz2
[svn-r22809] - bring in plist encode decode changes from trunk
- remove hardocded error comparing tests for now because those will fail - regenerate Makefile.in s due to conflicting versions of autotools
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 538a22a..bc196a9 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -2089,3 +2089,42 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_set_store_msg_crt_idx() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F_get_id
+ *
+ * Purpose: Get the file ID, incrementing it, or "resurrecting" it as
+ * appropriate.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * Oct 29, 2003
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5F_get_id(H5F_t *file, hbool_t app_ref)
+{
+ hid_t ret_value;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HDassert(file);
+
+ if (FAIL == (ret_value = H5I_get_id(file, H5I_FILE))) {
+ /* resurrect the ID - Register an ID with the native plugin */
+ if((ret_value = H5VL_native_register(H5I_FILE, file, app_ref)) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group")
+ file->id_exists = TRUE;
+ }
+ else {
+ /* Increment ref count on existing ID */
+ if(H5I_inc_ref(ret_value, app_ref) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed")
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F_get_id() */