diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2020-09-21 23:39:35 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2020-09-21 23:39:35 (GMT) |
commit | febc343e7ebd8469fbbd87f2f727d9e42a6be589 (patch) | |
tree | af7953452b3a9886671ad41587f705e17aa05ef0 /src/H5Sselect.c | |
parent | 9eaeac2e1bb660d9b19a766e38764a6895ae22c4 (diff) | |
parent | 9b3a3445dbb72a95b2b9355e0196efdaa5b0f452 (diff) | |
download | hdf5-febc343e7ebd8469fbbd87f2f727d9e42a6be589.zip hdf5-febc343e7ebd8469fbbd87f2f727d9e42a6be589.tar.gz hdf5-febc343e7ebd8469fbbd87f2f727d9e42a6be589.tar.bz2 |
Merge pull request #2891 in HDFFV/hdf5 from ~JHENDERSON/hdf52:develop to develop
* commit '9b3a3445dbb72a95b2b9355e0196efdaa5b0f452':
Add release note for new H5Ssel_iter_reset function
Add H5Ssel_iter_init API call to reset a selection iterator
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r-- | src/H5Sselect.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c index eb5cf1c..d021f0c 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -3116,6 +3116,52 @@ done: } /* end H5Ssel_iter_get_seq_list() */ +/*-------------------------------------------------------------------------- + NAME + H5Ssel_iter_reset + PURPOSE + Resets a dataspace selection iterator back to an initial state. + USAGE + herr_t H5Ssel_iter_reset(sel_iter_id) + hid_t sel_iter_id; IN: ID of the dataspace selection iterator to + reset + hid_t space_id; IN: ID of the dataspace with selection to + iterate over + RETURNS + Non-negative on success / Negative on failure + DESCRIPTION + Resets a dataspace selection iterator back to an initial state so that + the iterator may be used for iteration once again. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5Ssel_iter_reset(hid_t sel_iter_id, hid_t space_id) +{ + H5S_sel_iter_t *sel_iter; + H5S_t *space; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ii", sel_iter_id, space_id); + + /* Check args */ + if(NULL == (sel_iter = (H5S_sel_iter_t *)H5I_object_verify(sel_iter_id, H5I_SPACE_SEL_ITER))) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace selection iterator") + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace") + + /* Simply re-initialize iterator */ + if(H5S_select_iter_init(sel_iter, space, sel_iter->elmt_size, sel_iter->flags) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to re-initialize selection iterator") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Ssel_iter_reset() */ + + /*------------------------------------------------------------------------- * Function: H5S_sel_iter_close * |