summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-08-15 00:09:11 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-08-15 00:09:11 (GMT)
commitc490fefbc3199d45fa4d3af09dd567671a244e8d (patch)
treeaf3cf5cd0d0965ca3277a654601a28ec86a229af /src/H5Shyper.c
parent396edbe6bf053b9acc432b45eb47c3bfbdbbefed (diff)
downloadhdf5-c490fefbc3199d45fa4d3af09dd567671a244e8d.zip
hdf5-c490fefbc3199d45fa4d3af09dd567671a244e8d.tar.gz
hdf5-c490fefbc3199d45fa4d3af09dd567671a244e8d.tar.bz2
Added public H5Sselect_adjust_u and H5Shyper_adjust_s calls.
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 492cd9e..153f4be 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -7025,6 +7025,47 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_hyper_adjust_s() */
+/*--------------------------------------------------------------------------
+ NAME
+ H5Shyper_adjust_s
+ PURPOSE
+ Adjust a hyperslab selection by subtracting an offset
+ USAGE
+ herr_t H5Shyper_adjust_s(space_id,offset)
+ hid_t space_id; IN: ID of the dataspace to adjust
+ const hssize_t *offset; IN: Offset to subtract
+ RETURNS
+ Non-negative on success, negative on failure
+ DESCRIPTION
+ Moves a hyperslab selection by subtracting an offset from it.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+herr_t
+H5Shyper_adjust_s(hid_t space_id, const hssize_t *offset)
+{
+ H5S_t *space;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*Hs", 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(H5S_GET_SELECT_TYPE(space) != H5S_SEL_HYPERSLABS)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a hyperslab selection")
+ if(NULL == offset)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "NULL offset pointer")
+
+ if(H5S_hyper_adjust_s(space, offset) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't adjust selection")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Shyper_adjust_s() */
+
/*--------------------------------------------------------------------------
NAME