summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/H5I.c b/src/H5I.c
index bfcef6b..00b8dad 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -1825,29 +1825,25 @@ done:
* Failure: NULL
*
* Programmer: James Laird
- * Nathaniel Furrer
+ * Nathaniel Furrer
* Friday, April 23, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key)
{
- void * ret_value; /* Return value */
+ void * ret_value; /* Return value */
- FUNC_ENTER_API(H5Isearch, NULL);
+ FUNC_ENTER_API(H5Isearch, NULL)
- if( H5I_IS_LIB_TYPE( type ) )
- {
- HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type");
- }
+ if( H5I_IS_LIB_TYPE( type ) )
+ HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type")
- ret_value = H5I_search(type, func, key);
+ ret_value = H5I_search(type, func, key);
- done:
- FUNC_LEAVE_API(ret_value);
-}
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Isearch() */
/*-------------------------------------------------------------------------
@@ -1997,35 +1993,19 @@ H5I_find_id(hid_t id)
* If a zero is returned for the name's length, then there is no name
* associated with the ID.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
ssize_t
H5Iget_name(hid_t id, char *name/*out*/, size_t size)
{
- H5G_loc_t loc; /* Object location */
- size_t len = 0;
ssize_t ret_value;
FUNC_ENTER_API(H5Iget_name, FAIL)
H5TRACE3("Zs","ixz",id,name,size);
- /* get object location */
- if(H5G_loc(id, &loc) >= 0) {
- if(loc.path->user_path_r != NULL && loc.path->user_path_hidden == 0) {
- len = H5RS_len(loc.path->user_path_r);
-
- if(name) {
- HDstrncpy(name, H5RS_get_str(loc.path->user_path_r), MIN(len + 1, size));
- if(len >= size)
- name[size-1] = '\0';
- } /* end if */
- } /* end if */
- } /* end if */
-
- /* Set return value */
- ret_value = (ssize_t)len;
+ /* Call internal group routine to retrieve object's name */
+ if((ret_value = H5G_get_name(id, name, size)) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name")
done:
FUNC_LEAVE_API(ret_value)