summaryrefslogtreecommitdiffstats
path: root/src/H5Snone.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2019-08-04 23:38:36 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2019-08-04 23:38:36 (GMT)
commit5fe1216a4e6af8feef0551f7bece8a0e193310a9 (patch)
tree357b147c218af566ce2cf8c6ef9c210d98b7829f /src/H5Snone.c
parentab1ce69900caa0b249e07db8992e66f95b0af1dc (diff)
parent905d40aa6f6eb603c5507e7967130760e3a2e43c (diff)
downloadhdf5-5fe1216a4e6af8feef0551f7bece8a0e193310a9.zip
hdf5-5fe1216a4e6af8feef0551f7bece8a0e193310a9.tar.gz
hdf5-5fe1216a4e6af8feef0551f7bece8a0e193310a9.tar.bz2
Merge pull request #1819 in HDFFV/hdf5 from ~KOZIOL/hdf5:develop to develop
* commit '905d40aa6f6eb603c5507e7967130760e3a2e43c': Fix return type for H5Sselect_intersect_block(). Updated H5TRACE macro. Add H5Sselect_shape_same and H5Sselect_intersect_block API routines, along with tests and minor cleanups and refactorings.
Diffstat (limited to 'src/H5Snone.c')
-rw-r--r--src/H5Snone.c51
1 files changed, 45 insertions, 6 deletions
diff --git a/src/H5Snone.c b/src/H5Snone.c
index 9d64e9d..c262d18 100644
--- a/src/H5Snone.c
+++ b/src/H5Snone.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,9 +63,12 @@ static htri_t H5S__none_is_contiguous(const H5S_t *space);
static htri_t H5S__none_is_single(const H5S_t *space);
static htri_t H5S__none_is_regular(const H5S_t *space);
static htri_t H5S__none_shape_same(const H5S_t *space1, const H5S_t *space2);
+static htri_t H5S__none_intersect_block(const H5S_t *space, const hsize_t *start,
+ const hsize_t *end);
static herr_t H5S__none_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S__none_project_scalar(const H5S_t *space, hsize_t *offset);
-static herr_t H5S__none_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
+static herr_t H5S__none_project_simple(const H5S_t *space, H5S_t *new_space,
+ hsize_t *offset);
static herr_t H5S__none_iter_init(const H5S_t *space, H5S_sel_iter_t *iter);
/* Selection iteration callbacks */
@@ -108,6 +111,7 @@ const H5S_select_class_t H5S_sel_none[1] = {{
H5S__none_is_single,
H5S__none_is_regular,
H5S__none_shape_same,
+ H5S__none_intersect_block,
H5S__none_adjust_u,
H5S__none_project_scalar,
H5S__none_project_simple,
@@ -886,6 +890,41 @@ H5S__none_shape_same(const H5S_t H5_ATTR_UNUSED *space1,
/*--------------------------------------------------------------------------
NAME
+ H5S__none_intersect_block
+ PURPOSE
+ Detect intersections of selection with block
+ USAGE
+ htri_t H5S__none_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__none_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_NONE == H5S_GET_SELECT_TYPE(space));
+ HDassert(start);
+ HDassert(end);
+
+ FUNC_LEAVE_NOAPI(FALSE)
+} /* end H5S__none_intersect_block() */
+
+
+/*--------------------------------------------------------------------------
+ NAME
H5S__none_adjust_u
PURPOSE
Adjust an "none" selection by subtracting an offset