diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-07-30 20:18:27 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-07-30 20:18:27 (GMT) |
commit | 4d080e50f6bde9746d2dc12ced01d7f5758965cb (patch) | |
tree | 778c7a6ec441bcf5dfc0fa75570b5ec6288cebde /src/H5I.c | |
parent | 8e9a3a200bd58bb4a98f32452a60cd2eb23fa26c (diff) | |
download | hdf5-4d080e50f6bde9746d2dc12ced01d7f5758965cb.zip hdf5-4d080e50f6bde9746d2dc12ced01d7f5758965cb.tar.gz hdf5-4d080e50f6bde9746d2dc12ced01d7f5758965cb.tar.bz2 |
[svn-r23946] Bring revisions #23597 - #23670 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'src/H5I.c')
-rw-r--r-- | src/H5I.c | 42 |
1 files changed, 38 insertions, 4 deletions
@@ -2079,21 +2079,55 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) if(H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") + if((ret_value = H5I_search(type, func, key)) == NULL) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Isearch() */ + + +/*------------------------------------------------------------------------- + * Function: H5I_search + * + * Purpose: Private function for H5Isearch + * + * Return: Success: The first object in the type for which FUNC + * returns non-zero. NULL if FUNC returned zero + * for every object in the type. + * + * Failure: NULL + * + * Programmer: James Laird + * Nathaniel Furrer + * Friday, April 23, 2004 + * + *------------------------------------------------------------------------- + */ +void * +H5I_search(H5I_type_t _type, H5I_search_func_t _func, void *_key) +{ + H5I_search_ud_t udata; /* Context for iteration */ + void *ret_value; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + /* Set up udata struct */ - udata.app_cb = func; - udata.app_key = key; + udata.app_cb = _func; + udata.app_key = _key; udata.ret_obj = NULL; /* Note that H5I_iterate returns an error code. We ignore it * here, as we can't do anything with it without revising the API. */ - H5I_iterate(type, H5I_search_cb, &udata, TRUE); + if(H5I_iterate(_type, H5I_search_cb, &udata, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") /* Set return value */ ret_value = udata.ret_obj; done: - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5Isearch() */ |