diff options
Diffstat (limited to 'src/H5Sall.c')
-rw-r--r-- | src/H5Sall.c | 396 |
1 files changed, 194 insertions, 202 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c index 98d7319..d933f3c 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -15,7 +15,7 @@ * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> * Tuesday, June 16, 1998 * - * Purpose: "All" selection data space I/O functions. + * Purpose: "All" selection dataspace I/O functions. */ #include "H5Smodule.h" /* This source code file is part of the H5S module */ @@ -30,59 +30,59 @@ /* Static function prototypes */ /* Selection callbacks */ -static herr_t H5S_all_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); -static herr_t H5S_all_get_seq_list(const H5S_t *space, unsigned flags, +static herr_t H5S__all_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +static herr_t H5S__all_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); -static herr_t H5S_all_release(H5S_t *space); -static htri_t H5S_all_is_valid(const H5S_t *space); -static hssize_t H5S_all_serial_size(const H5S_t *space, H5F_t *f); -static herr_t H5S_all_serialize(const H5S_t *space, uint8_t **p, H5F_t *f); -static herr_t H5S_all_deserialize(H5S_t *space, uint32_t version, uint8_t flags, +static herr_t H5S__all_release(H5S_t *space); +static htri_t H5S__all_is_valid(const H5S_t *space); +static hssize_t H5S__all_serial_size(const H5S_t *space, H5F_t *f); +static herr_t H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t *f); +static herr_t H5S__all_deserialize(H5S_t *space, uint32_t version, uint8_t flags, const uint8_t **p); -static herr_t H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); -static herr_t H5S_all_offset(const H5S_t *space, hsize_t *off); +static herr_t H5S__all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); +static herr_t H5S__all_offset(const H5S_t *space, hsize_t *off); static int H5S__all_unlim_dim(const H5S_t *space); -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 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); -static herr_t H5S_all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space); +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 void 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); +static herr_t H5S__all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space); /* Selection iteration callbacks */ -static herr_t H5S_all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); -static herr_t H5S_all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); -static hsize_t H5S_all_iter_nelmts(const H5S_sel_iter_t *iter); -static htri_t H5S_all_iter_has_next_block(const H5S_sel_iter_t *iter); -static herr_t H5S_all_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem); -static herr_t H5S_all_iter_next_block(H5S_sel_iter_t *sel_iter); -static herr_t H5S_all_iter_release(H5S_sel_iter_t *sel_iter); +static herr_t H5S__all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); +static herr_t H5S__all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); +static hsize_t H5S__all_iter_nelmts(const H5S_sel_iter_t *iter); +static htri_t H5S__all_iter_has_next_block(const H5S_sel_iter_t *iter); +static herr_t H5S__all_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem); +static herr_t H5S__all_iter_next_block(H5S_sel_iter_t *sel_iter); +static herr_t H5S__all_iter_release(H5S_sel_iter_t *sel_iter); /* Selection properties for "all" selections */ const H5S_select_class_t H5S_sel_all[1] = {{ H5S_SEL_ALL, /* Methods on selection */ - H5S_all_copy, - H5S_all_get_seq_list, - H5S_all_release, - H5S_all_is_valid, - H5S_all_serial_size, - H5S_all_serialize, - H5S_all_deserialize, - H5S_all_bounds, - H5S_all_offset, + H5S__all_copy, + H5S__all_get_seq_list, + H5S__all_release, + H5S__all_is_valid, + H5S__all_serial_size, + H5S__all_serialize, + H5S__all_deserialize, + H5S__all_bounds, + H5S__all_offset, H5S__all_unlim_dim, NULL, - H5S_all_is_contiguous, - H5S_all_is_single, - H5S_all_is_regular, - H5S_all_adjust_u, - H5S_all_project_scalar, - H5S_all_project_simple, - H5S_all_iter_init, + H5S__all_is_contiguous, + H5S__all_is_single, + H5S__all_is_regular, + H5S__all_adjust_u, + H5S__all_project_scalar, + H5S__all_project_simple, + H5S__all_iter_init, }}; /* Iteration properties for "all" selections */ @@ -90,18 +90,18 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{ H5S_SEL_ALL, /* Methods on selection iterator */ - H5S_all_iter_coords, - H5S_all_iter_block, - H5S_all_iter_nelmts, - H5S_all_iter_has_next_block, - H5S_all_iter_next, - H5S_all_iter_next_block, - H5S_all_iter_release, + H5S__all_iter_coords, + H5S__all_iter_block, + H5S__all_iter_nelmts, + H5S__all_iter_has_next_block, + H5S__all_iter_next, + H5S__all_iter_next_block, + H5S__all_iter_release, }}; /*------------------------------------------------------------------------- - * Function: H5S_all_iter_init + * Function: H5S__all_iter_init * * Purpose: Initializes iteration information for "all" selection. * @@ -110,35 +110,33 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{ * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space) +H5S__all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ - HDassert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space)); - HDassert (iter); + HDassert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); + HDassert(iter); /* Initialize the number of elements to iterate over */ - iter->elmt_left=H5S_GET_SELECT_NPOINTS(space); + iter->elmt_left = H5S_GET_SELECT_NPOINTS(space); /* Start at the upper left location */ - iter->u.all.elmt_offset=0; - iter->u.all.byte_offset=0; + iter->u.all.elmt_offset = 0; + iter->u.all.byte_offset = 0; /* Initialize type of selection iterator */ - iter->type=H5S_sel_iter_all; + iter->type = H5S_sel_iter_all; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_iter_init() */ +} /* H5S__all_iter_init() */ /*------------------------------------------------------------------------- - * Function: H5S_all_iter_coords + * Function: H5S__all_iter_coords * * Purpose: Retrieve the current coordinates of iterator for current * selection @@ -148,32 +146,30 @@ H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space) * Programmer: Quincey Koziol * Tuesday, April 22, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) +H5S__all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ - HDassert (iter); - HDassert (coords); + HDassert(iter); + HDassert(coords); /* Calculate the coordinates for the current iterator offset */ - if(H5VM_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve coordinates"); + if(H5VM_array_calc(iter->u.all.elmt_offset, iter->rank, iter->dims, coords) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve coordinates") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_all_iter_coords() */ +} /* H5S__all_iter_coords() */ /*------------------------------------------------------------------------- - * Function: H5S_all_iter_block + * Function: H5S__all_iter_block * * Purpose: Retrieve the current block of iterator for current * selection @@ -183,38 +179,36 @@ done: * Programmer: Quincey Koziol * Monday, June 2, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) +H5S__all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ - HDassert (iter); - HDassert (start); - HDassert (end); + HDassert(iter); + HDassert(start); + HDassert(end); - for(u=0; u<iter->rank; u++) { + for(u = 0; u < iter->rank; u++) { /* Set the start of the 'all' block */ /* (Always '0' coordinates for now) */ - start[u]=0; + start[u] = 0; /* Compute the end of the 'all' block */ /* (Always size of the extent for now) */ - end[u]=iter->dims[u]-1; + end[u] = iter->dims[u] - 1; } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_iter_coords() */ +} /* H5S__all_iter_block() */ /*------------------------------------------------------------------------- - * Function: H5S_all_iter_nelmts + * Function: H5S__all_iter_nelmts * * Purpose: Return number of elements left to process in iterator * @@ -223,29 +217,27 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static hsize_t -H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) +H5S__all_iter_nelmts(const H5S_sel_iter_t *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ - HDassert (iter); + HDassert(iter); FUNC_LEAVE_NOAPI(iter->elmt_left) -} /* H5S_all_iter_nelmts() */ +} /* H5S__all_iter_nelmts() */ /*-------------------------------------------------------------------------- NAME - H5S_all_iter_next + H5S__all_iter_has_next_block PURPOSE Check if there is another block left in the current iterator USAGE - htri_t H5S_all_iter_has_next_block(iter) + htri_t H5S__all_iter_has_next_block(iter) const H5S_sel_iter_t *iter; IN: Pointer to selection iterator RETURNS Non-negative (TRUE/FALSE) on success/Negative on failure @@ -257,24 +249,24 @@ H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_iter_has_next_block (const H5S_sel_iter_t H5_ATTR_UNUSED *iter) +H5S__all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ - HDassert (iter); + HDassert(iter); FUNC_LEAVE_NOAPI(FALSE) -} /* H5S_all_iter_has_next_block() */ +} /* H5S__all_iter_has_next_block() */ /*-------------------------------------------------------------------------- NAME - H5S_all_iter_next + H5S__all_iter_next PURPOSE Increment selection iterator USAGE - herr_t H5S_all_iter_next(iter, nelem) + herr_t H5S__all_iter_next(iter, nelem) H5S_sel_iter_t *iter; IN: Pointer to selection iterator hsize_t nelem; IN: Number of elements to advance by RETURNS @@ -287,29 +279,29 @@ H5S_all_iter_has_next_block (const H5S_sel_iter_t H5_ATTR_UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_iter_next(H5S_sel_iter_t *iter, hsize_t nelem) +H5S__all_iter_next(H5S_sel_iter_t *iter, hsize_t nelem) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ - HDassert (iter); - HDassert (nelem>0); + HDassert(iter); + HDassert(nelem > 0); /* Increment the iterator */ - iter->u.all.elmt_offset+=nelem; - iter->u.all.byte_offset+=(nelem*iter->elmt_size); + iter->u.all.elmt_offset += nelem; + iter->u.all.byte_offset += (nelem * iter->elmt_size); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_iter_next() */ +} /* H5S__all_iter_next() */ /*-------------------------------------------------------------------------- NAME - H5S_all_iter_next_block + H5S__all_iter_next_block PURPOSE Increment selection iterator to next block USAGE - herr_t H5S_all_iter_next_block(iter) + herr_t H5S__all_iter_next_block(iter) H5S_sel_iter_t *iter; IN: Pointer to selection iterator RETURNS Non-negative on success/Negative on failure @@ -321,24 +313,24 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, hsize_t nelem) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) +H5S__all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ - HDassert (iter); + HDassert(iter); FUNC_LEAVE_NOAPI(FAIL) -} /* H5S_all_iter_next_block() */ +} /* H5S__all_iter_next_block() */ /*-------------------------------------------------------------------------- NAME - H5S_all_iter_release + H5S__all_iter_release PURPOSE Release "all" selection iterator information for a dataspace USAGE - herr_t H5S_all_iter_release(iter) + herr_t H5S__all_iter_release(iter) H5S_sel_iter_t *iter; IN: Pointer to selection iterator RETURNS Non-negative on success/Negative on failure @@ -350,24 +342,24 @@ H5S_all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_iter_release (H5S_sel_iter_t H5_ATTR_UNUSED * iter) +H5S__all_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED * iter) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ - HDassert (iter); + HDassert(iter); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_iter_release() */ +} /* H5S__all_iter_release() */ /*-------------------------------------------------------------------------- NAME - H5S_all_release + H5S__all_release PURPOSE Release all selection information for a dataspace USAGE - herr_t H5S_all_release(space) + herr_t H5S__all_release(space) H5S_t *space; IN: Pointer to dataspace RETURNS Non-negative on success/Negative on failure @@ -379,9 +371,9 @@ H5S_all_iter_release (H5S_sel_iter_t H5_ATTR_UNUSED * iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_release(H5S_t *space) +H5S__all_release(H5S_t *space) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(space); @@ -390,16 +382,16 @@ H5S_all_release(H5S_t *space) space->select.num_elem = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_release() */ +} /* H5S__all_release() */ /*-------------------------------------------------------------------------- NAME - H5S_all_copy + H5S__all_copy PURPOSE Copy a selection from one dataspace to another USAGE - herr_t H5S_all_copy(dst, src) + herr_t H5S__all_copy(dst, src) H5S_t *dst; OUT: Pointer to the destination dataspace H5S_t *src; IN: Pointer to the source dataspace RETURNS @@ -413,9 +405,9 @@ H5S_all_release(H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection) +H5S__all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(src); HDassert(dst); @@ -424,17 +416,17 @@ H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED dst->select.num_elem = (hsize_t)H5S_GET_EXTENT_NPOINTS(dst); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5S_all_copy() */ +} /* end H5S__all_copy() */ /*-------------------------------------------------------------------------- NAME - H5S_all_is_valid + H5S__all_is_valid PURPOSE Check whether the selection fits within the extent, with the current offset defined. USAGE - htri_t H5S_all_is_valid(space); + htri_t H5S__all_is_valid(space); H5S_t *space; IN: Dataspace pointer to query RETURNS TRUE if the selection fits within the extent, FALSE if it does not and @@ -448,19 +440,19 @@ H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_valid (const H5S_t H5_ATTR_UNUSED *space) +H5S__all_is_valid(const H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(space); FUNC_LEAVE_NOAPI(TRUE) -} /* end H5S_all_is_valid() */ +} /* end H5S__all_is_valid() */ /*-------------------------------------------------------------------------- NAME - H5S_all_serial_size + H5S__all_serial_size PURPOSE Determine the number of bytes needed to store the serialized "all" selection information. @@ -479,9 +471,9 @@ H5S_all_is_valid (const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f) +H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(space); @@ -490,16 +482,16 @@ H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f) * <length (4 bytes)> = 16 bytes */ FUNC_LEAVE_NOAPI(16) -} /* end H5S_all_serial_size() */ +} /* end H5S__all_serial_size() */ /*-------------------------------------------------------------------------- NAME - H5S_all_serialize + H5S__all_serialize PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S_all_serialize(space, p, f) + herr_t H5S__all_serialize(space, p, f) const H5S_t *space; IN: Dataspace with selection to serialize uint8_t **p; OUT: Pointer to buffer to put serialized selection. Will be advanced to end of @@ -516,11 +508,11 @@ H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f) +H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f) { uint8_t *pp = (*p); /* Local pointer for decoding */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(space); @@ -537,12 +529,12 @@ H5S_all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f) *p = pp; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_serialize() */ +} /* H5S__all_serialize() */ /*-------------------------------------------------------------------------- NAME - H5S_all_deserialize + H5S__all_deserialize PURPOSE Deserialize the current selection from a user-provided buffer. USAGE @@ -565,12 +557,12 @@ H5S_all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED flags, +H5S__all_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED flags, const uint8_t H5_ATTR_UNUSED **p) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(space); HDassert(p); @@ -582,16 +574,16 @@ H5S_all_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_AT done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_all_deserialize() */ +} /* H5S__all_deserialize() */ /*-------------------------------------------------------------------------- NAME - H5S_all_bounds + H5S__all_bounds PURPOSE Gets the bounding box containing the selection. USAGE - herr_t H5S_all_bounds(space, start, end) + herr_t H5S__all_bounds(space, start, end) H5S_t *space; IN: Dataspace pointer of selection to query hsize_t *start; OUT: Starting coordinate of bounding box hsize_t *end; OUT: Opposite coordinate of bounding box @@ -611,12 +603,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) +H5S__all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) { unsigned rank; /* Dataspace rank */ unsigned i; /* index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(space); HDassert(start); @@ -632,16 +624,16 @@ H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_bounds() */ +} /* H5S__all_bounds() */ /*-------------------------------------------------------------------------- NAME - H5S_all_offset + H5S__all_offset PURPOSE Gets the linear offset of the first element for the selection. USAGE - herr_t H5S_all_offset(space, offset) + herr_t H5S__all_offset(space, offset) const H5S_t *space; IN: Dataspace pointer of selection to query hsize_t *offset; OUT: Linear offset of first element in selection RETURNS @@ -656,9 +648,9 @@ H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) +H5S__all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(space); HDassert(offset); @@ -667,7 +659,7 @@ H5S_all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) *offset = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_offset() */ +} /* H5S__all_offset() */ /*-------------------------------------------------------------------------- @@ -702,11 +694,11 @@ H5S__all_unlim_dim(const H5S_t H5_ATTR_UNUSED *space) /*-------------------------------------------------------------------------- NAME - H5S_all_is_contiguous + H5S__all_is_contiguous PURPOSE Check if a "all" selection is contiguous within the dataspace extent. USAGE - htri_t H5S_all_is_contiguous(space) + htri_t H5S__all_is_contiguous(space) H5S_t *space; IN: Dataspace pointer to check RETURNS TRUE/FALSE/FAIL @@ -719,23 +711,23 @@ H5S__all_unlim_dim(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) +H5S__all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(space); FUNC_LEAVE_NOAPI(TRUE) -} /* H5S_all_is_contiguous() */ +} /* H5S__all_is_contiguous() */ /*-------------------------------------------------------------------------- NAME - H5S_all_is_single + H5S__all_is_single PURPOSE Check if a "all" selection is a single block within the dataspace extent. USAGE - htri_t H5S_all_is_single(space) + htri_t H5S__all_is_single(space) H5S_t *space; IN: Dataspace pointer to check RETURNS TRUE/FALSE/FAIL @@ -748,23 +740,23 @@ H5S_all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_single(const H5S_t H5_ATTR_UNUSED *space) +H5S__all_is_single(const H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(space); FUNC_LEAVE_NOAPI(TRUE) -} /* H5S_all_is_single() */ +} /* H5S__all_is_single() */ /*-------------------------------------------------------------------------- NAME - H5S_all_is_regular + H5S__all_is_regular PURPOSE Check if a "all" selection is "regular" USAGE - htri_t H5S_all_is_regular(space) + htri_t H5S__all_is_regular(space) const H5S_t *space; IN: Dataspace pointer to check RETURNS TRUE/FALSE/FAIL @@ -778,28 +770,28 @@ H5S_all_is_single(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_all_is_regular(const H5S_t H5_ATTR_UNUSED *space) +H5S__all_is_regular(const H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(space); FUNC_LEAVE_NOAPI(TRUE) -} /* H5S_all_is_regular() */ +} /* H5S__all_is_regular() */ /*-------------------------------------------------------------------------- NAME - H5S_all_adjust_u + H5S__all_adjust_u PURPOSE Adjust an "all" selection by subtracting an offset USAGE - herr_t H5S_all_adjust_u(space, offset) + void H5S__all_adjust_u(space, offset) H5S_t *space; IN/OUT: Pointer to dataspace to adjust const hsize_t *offset; IN: Offset to subtract RETURNS - Non-negative on success, negative on failure + None DESCRIPTION Moves selection by subtracting an offset from it. GLOBAL VARIABLES @@ -807,21 +799,21 @@ H5S_all_is_regular(const H5S_t H5_ATTR_UNUSED *space) EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static herr_t -H5S_all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offset) +static void +H5S__all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offset) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(space); HDassert(offset); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_adjust_u() */ + FUNC_LEAVE_NOAPI_VOID +} /* H5S__all_adjust_u() */ /*------------------------------------------------------------------------- - * Function: H5S_all_project_scalar + * Function: H5S__all_project_scalar * * Purpose: Projects a single element 'all' selection into a scalar * dataspace @@ -834,9 +826,9 @@ H5S_all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offs *------------------------------------------------------------------------- */ static herr_t -H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) +H5S__all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); @@ -846,11 +838,11 @@ H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) *offset = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_all_project_scalar() */ +} /* H5S__all_project_scalar() */ /*------------------------------------------------------------------------- - * Function: H5S_all_project_simple + * Function: H5S__all_project_simple * * Purpose: Projects an 'all' selection onto/into a simple dataspace * of a different rank @@ -863,11 +855,11 @@ H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) *------------------------------------------------------------------------- */ static herr_t -H5S_all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offset) +H5S__all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offset) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(base_space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(base_space)); @@ -880,7 +872,7 @@ H5S_all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offse done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_all_project_simple() */ +} /* H5S__all_project_simple() */ /*-------------------------------------------------------------------------- @@ -955,7 +947,7 @@ H5Sselect_all(hid_t spaceid) /* Check args */ if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Call internal routine to do the work */ if(H5S_select_all(space, TRUE) < 0) @@ -968,11 +960,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5S_all_get_seq_list + H5S__all_get_seq_list PURPOSE Create a list of offsets & lengths for a selection USAGE - herr_t H5S_all_get_seq_list(space,flags,iter,maxseq,maxelem,nseq,nelem,off,len) + herr_t H5S__all_get_seq_list(space,flags,iter,maxseq,maxelem,nseq,nelem,off,len) H5S_t *space; IN: Dataspace containing selection to use. unsigned flags; IN: Flags for extra information about operation H5S_sel_iter_t *iter; IN/OUT: Selection iterator describing last @@ -998,44 +990,44 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_get_seq_list(const H5S_t H5_ATTR_UNUSED *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter, +H5S__all_get_seq_list(const H5S_t H5_ATTR_UNUSED *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter, size_t H5_ATTR_UNUSED maxseq, size_t maxelem, size_t *nseq, size_t *nelem, hsize_t *off, size_t *len) { size_t elem_used; /* The number of elements used */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(space); HDassert(iter); - HDassert(maxseq>0); - HDassert(maxelem>0); + HDassert(maxseq > 0); + HDassert(maxelem > 0); HDassert(nseq); HDassert(nelem); HDassert(off); HDassert(len); /* Determine the actual number of elements to use */ - H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t); - elem_used=MIN(maxelem,(size_t)iter->elmt_left); + H5_CHECK_OVERFLOW(iter->elmt_left, hsize_t, size_t); + elem_used = MIN(maxelem, (size_t)iter->elmt_left); HDassert(elem_used > 0); /* Compute the offset in the dataset */ - off[0]=iter->u.all.byte_offset; - len[0]=elem_used*iter->elmt_size; + off[0] = iter->u.all.byte_offset; + len[0] = elem_used * iter->elmt_size; /* Should only need one sequence for 'all' selections */ - *nseq=1; + *nseq = 1; /* Set the number of elements used */ - *nelem=elem_used; + *nelem = elem_used; /* Update the iterator */ - iter->elmt_left-=elem_used; - iter->u.all.elmt_offset+=elem_used; - iter->u.all.byte_offset+=len[0]; + iter->elmt_left -= elem_used; + iter->u.all.elmt_offset += elem_used; + iter->u.all.byte_offset += len[0]; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5S_all_get_seq_list() */ +} /* end H5S__all_get_seq_list() */ |