summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-12-29 14:26:20 (GMT)
commit427ff7da2848042f68ecfadf5a321b1d8077e9db (patch)
tree73024b1954031fbb724c2d96a485590348e5cc22 /src/H5I.c
parent9b96fd2003ae74cca389cc4c2216b4371d6eb173 (diff)
downloadhdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.zip
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.gz
hdf5-427ff7da2848042f68ecfadf5a321b1d8077e9db.tar.bz2
[svn-r9727] Purpose:
Bug Fix/Code Cleanup/Doc Cleanup/Optimization/Branch Sync :-) Description: Generally speaking, this is the "signed->unsigned" change to selections. However, in the process of merging code back, things got stickier and stickier until I ended up doing a big "sync the two branches up" operation. So... I brought back all the "infrastructure" fixes from the development branch to the release branch (which I think were actually making some improvement in performance) as well as fixed several bugs which had been fixed in one branch, but not the other. I've also tagged the repository before making this checkin with the label "before_signed_unsigned_changes". Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel & fphdf5 FreeBSD 4.10 (sleipnir) w/threadsafe FreeBSD 4.10 (sleipnir) w/backward compatibility Solaris 2.7 (arabica) w/"purify options" Solaris 2.8 (sol) w/FORTRAN & C++ AIX 5.x (copper) w/parallel & FORTRAN IRIX64 6.5 (modi4) w/FORTRAN Linux 2.4 (heping) w/FORTRAN & C++ Misc. update:
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c175
1 files changed, 86 insertions, 89 deletions
diff --git a/src/H5I.c b/src/H5I.c
index aaa1e54..e30cdc0 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -1099,95 +1099,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Iget_file_id
- *
- * Purpose: The public version of H5I_get_file_id(), obtains the file
- * ID given an object ID. User has to close this ID.
- *
- * Return: Success: file ID
- *
- * Failure: a negative value
- *
- * Programmer: Raymond Lu
- * Oct 27, 2003
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-hid_t
-H5Iget_file_id(hid_t obj_id)
-{
- hid_t ret_value;
-
- FUNC_ENTER_API(H5Iget_file_id, FAIL);
- H5TRACE1("i","i",obj_id);
-
- if((ret_value = H5I_get_file_id(obj_id))<0)
- HGOTO_ERROR (H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve file ID");
-
-done:
- FUNC_LEAVE_API(ret_value);
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: H5I_get_file_id
- *
- * Purpose: The private version of H5Iget_file_id(), obtains the file
- * ID given an object ID.
- *
- * Return: Success: file ID
- *
- * Failure: a negative value
- *
- * Programmer: Raymond Lu
- * Oct 27, 2003
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static hid_t
-H5I_get_file_id(hid_t obj_id)
-{
- H5G_entry_t *ent;
- hid_t ret_value;
- H5I_type_t type;
-
- FUNC_ENTER_NOAPI_NOINIT(H5I_get_file_id);
-
- /* Get object type */
- type = H5I_TYPE(obj_id);
- if(type == H5I_FILE)
- {
- ret_value = obj_id;
-
- /* Increment reference count on atom. */
- if (H5I_inc_ref(ret_value)<0)
- HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed");
- }
- else if(type == H5I_DATATYPE)
- {
- if((ent = H5G_loc(obj_id))==NULL)
- HGOTO_ERROR (H5E_ATOM, H5E_CANTGET, FAIL, "not a named datatype");
- ret_value = H5F_get_id(ent->file);
- }
- else if(type == H5I_GROUP || type == H5I_DATASET || type == H5I_ATTR)
- {
- if((ent = H5G_loc(obj_id))==NULL)
- HGOTO_ERROR (H5E_ATOM, H5E_CANTGET, FAIL, "can't get symbol table info");
- ret_value = H5F_get_id(ent->file);
- }
- else
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid object ID");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
-
-
-/*-------------------------------------------------------------------------
* Function: H5Iremove_verify
*
* Purpose: Removes the specified ID from its type, first checking that the
@@ -2219,3 +2130,89 @@ done:
}
#endif /* H5I_DEBUG_OUTPUT */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Iget_file_id
+ *
+ * Purpose: The public version of H5I_get_file_id(), obtains the file
+ * ID given an object ID. User has to close this ID.
+ *
+ * Return: Success: file ID
+ *
+ * Failure: a negative value
+ *
+ * Programmer: Raymond Lu
+ * Oct 27, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5Iget_file_id(hid_t obj_id)
+{
+ hid_t ret_value;
+
+ FUNC_ENTER_API(H5Iget_file_id, FAIL);
+ H5TRACE1("i","i",obj_id);
+
+ if((ret_value = H5I_get_file_id(obj_id))<0)
+ HGOTO_ERROR (H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve file ID");
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5I_get_file_id
+ *
+ * Purpose: The private version of H5Iget_file_id(), obtains the file
+ * ID given an object ID.
+ *
+ * Return: Success: file ID
+ *
+ * Failure: a negative value
+ *
+ * Programmer: Raymond Lu
+ * Oct 27, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static hid_t
+H5I_get_file_id(hid_t obj_id)
+{
+ H5G_entry_t *ent;
+ H5I_type_t type;
+ hid_t ret_value;
+
+ FUNC_ENTER_NOAPI_NOINIT(H5I_get_file_id);
+
+ /* Get object type */
+ type = H5I_TYPE(obj_id);
+ if(type == H5I_FILE) {
+ ret_value = obj_id;
+
+ /* Increment reference count on atom. */
+ if (H5I_inc_ref(ret_value)<0)
+ HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed");
+ }
+ else if(type == H5I_DATATYPE) {
+ if((ent = H5G_loc(obj_id))==NULL)
+ HGOTO_ERROR (H5E_ATOM, H5E_CANTGET, FAIL, "not a named datatype");
+ ret_value = H5F_get_id(ent->file);
+ }
+ else if(type == H5I_GROUP || type == H5I_DATASET || type == H5I_ATTR) {
+ if((ent = H5G_loc(obj_id))==NULL)
+ HGOTO_ERROR (H5E_ATOM, H5E_CANTGET, FAIL, "can't get symbol table info");
+ ret_value = H5F_get_id(ent->file);
+ }
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid object ID");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+