diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2019-08-15 00:33:19 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2019-08-15 00:33:19 (GMT) |
commit | 300372ce33ce22794f24301bc29008eb4ee2b661 (patch) | |
tree | 4fb1df5695a2f34f8ce4bdc2bef87ebbb4e9a8dd /src/H5Sselect.c | |
parent | 23483411983438c799f91161b0c1b2033574c7d9 (diff) | |
parent | c490fefbc3199d45fa4d3af09dd567671a244e8d (diff) | |
download | hdf5-300372ce33ce22794f24301bc29008eb4ee2b661.zip hdf5-300372ce33ce22794f24301bc29008eb4ee2b661.tar.gz hdf5-300372ce33ce22794f24301bc29008eb4ee2b661.tar.bz2 |
Merge pull request #1874 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:h5s_api_for_daos to develop
* commit 'c490fefbc3199d45fa4d3af09dd567671a244e8d':
Added public H5Sselect_adjust_u and H5Shyper_adjust_s calls.
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r-- | src/H5Sselect.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c index e632b11..1a13f2c 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -971,6 +971,45 @@ H5S_select_adjust_u(H5S_t *space, const hsize_t *offset) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_adjust_u() */ +/*-------------------------------------------------------------------------- + NAME + H5Sselect_adjust_u + PURPOSE + Adjust a selection by subtracting an offset + USAGE + herr_t H5Sselect_adjust_u(space_id, offset) + hid_t space_id; IN: ID of dataspace to adjust + const hsize_t *offset; IN: Offset to subtract + RETURNS + Non-negative on success, negative on failure + DESCRIPTION + Moves a selection by subtracting an offset from it. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5Sselect_adjust_u(hid_t space_id, const hsize_t *offset) +{ + H5S_t *space; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*h", space_id, offset); + + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "not a dataspace") + if(NULL == offset) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "NULL offset pointer") + + if(H5S_select_adjust_u(space, offset) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't adjust selection"); + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Sselect_adjust_u() */ + /*-------------------------------------------------------------------------- NAME |