summaryrefslogtreecommitdiffstats
path: root/src/H5Sall.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-07-30 20:34:53 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-07-30 20:34:53 (GMT)
commit605889fde8a92ed902bb4c5207912d1d687f7a99 (patch)
tree40aa43620205049ea3c3473ee32a588bf42539ec /src/H5Sall.c
parentd3fdcd8a680ad0f8b21304b35e8564b774a88ef0 (diff)
downloadhdf5-605889fde8a92ed902bb4c5207912d1d687f7a99.zip
hdf5-605889fde8a92ed902bb4c5207912d1d687f7a99.tar.gz
hdf5-605889fde8a92ed902bb4c5207912d1d687f7a99.tar.bz2
Add H5Sselect_shape_same and H5Sselect_intersect_block API routines, along
with tests and minor cleanups and refactorings.
Diffstat (limited to 'src/H5Sall.c')
-rw-r--r--src/H5Sall.c48
1 files changed, 43 insertions, 5 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c
index fbe7041..9d0a65a 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -28,11 +28,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* ID Functions */
-#include "H5Spkg.h" /* Dataspace functions */
-#include "H5VMprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* ID Functions */
+#include "H5Spkg.h" /* Dataspace functions */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -63,6 +63,8 @@ static htri_t H5S__all_is_contiguous(const H5S_t *space);
static htri_t H5S__all_is_single(const H5S_t *space);
static htri_t H5S__all_is_regular(const H5S_t *space);
static htri_t H5S__all_shape_same(const H5S_t *space1, const H5S_t *space2);
+static htri_t H5S__all_intersect_block(const H5S_t *space, const hsize_t *start,
+ const hsize_t *end);
static herr_t H5S__all_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S__all_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S__all_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
@@ -108,6 +110,7 @@ const H5S_select_class_t H5S_sel_all[1] = {{
H5S__all_is_single,
H5S__all_is_regular,
H5S__all_shape_same,
+ H5S__all_intersect_block,
H5S__all_adjust_u,
H5S__all_project_scalar,
H5S__all_project_simple,
@@ -976,6 +979,41 @@ done:
/*--------------------------------------------------------------------------
NAME
+ H5S__all_intersect_block
+ PURPOSE
+ Detect intersections of selection with block
+ USAGE
+ htri_t H5S__all_intersect_block(space, start, end)
+ const H5S_t *space; IN: Dataspace with selection to use
+ const hsize_t *start; IN: Starting coordinate for block
+ const hsize_t *end; IN: Ending coordinate for block
+ RETURNS
+ Non-negative TRUE / FALSE on success, negative on failure
+ DESCRIPTION
+ Quickly detect intersections with a block
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+htri_t
+H5S__all_intersect_block(const H5S_t H5_ATTR_UNUSED *space,
+ const hsize_t H5_ATTR_UNUSED *start, const hsize_t H5_ATTR_UNUSED *end)
+{
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Sanity check */
+ HDassert(space);
+ HDassert(H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space));
+ HDassert(start);
+ HDassert(end);
+
+ FUNC_LEAVE_NOAPI(TRUE)
+} /* end H5S__all_intersect_block() */
+
+
+/*--------------------------------------------------------------------------
+ NAME
H5S__all_adjust_u
PURPOSE
Adjust an "all" selection by subtracting an offset