diff options
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r-- | src/H5Sselect.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c index e9c03c2..669cb94 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -1631,3 +1631,55 @@ H5Sget_select_bounds(hid_t spaceid, hsize_t *start, hsize_t *end) FUNC_LEAVE (ret_value); } /* H5Sget_select_bounds() */ + +/*-------------------------------------------------------------------------- + NAME + H5S_select_contiguous + PURPOSE + Check if the selection is contiguous within the dataspace extent. + USAGE + htri_t H5S_select_contiguous(space) + H5S_t *space; IN: Dataspace pointer to check + RETURNS + TRUE/FALSE/FAIL + DESCRIPTION + Checks to see if the current selection in the dataspace is contiguous. + This is primarily used for reading the entire selection in one swoop. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +htri_t +H5S_select_contiguous(const H5S_t *space) +{ + htri_t ret_value=FAIL; /* return value */ + + FUNC_ENTER (H5S_select_contiguous, FAIL); + + assert(space); + + switch(space->select.type) { + case H5S_SEL_POINTS: /* Sequence of points selected */ + ret_value=H5S_point_select_contiguous(space); + break; + + case H5S_SEL_HYPERSLABS: /* Hyperslab selection defined */ + ret_value=H5S_hyper_select_contiguous(space); + break; + + case H5S_SEL_ALL: /* Entire extent selected */ + ret_value=TRUE; + break; + + case H5S_SEL_NONE: /* Nothing selected */ + ret_value=FALSE; + break; + + case H5S_SEL_ERROR: + case H5S_SEL_N: + break; + } + + FUNC_LEAVE (ret_value); +} /* H5S_select_contiguous() */ |