diff options
Diffstat (limited to 'src/H5Snone.c')
-rw-r--r-- | src/H5Snone.c | 335 |
1 files changed, 164 insertions, 171 deletions
diff --git a/src/H5Snone.c b/src/H5Snone.c index c262d18..7ffd643 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -6,13 +6,13 @@ * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> + * Programmer: Quincey Koziol * Tuesday, November 10, 1998 * * Purpose: "None" selection dataspace I/O functions. @@ -22,72 +22,65 @@ /* Module Setup */ /****************/ -#include "H5Smodule.h" /* This source code file is part of the H5S module */ - +#include "H5Smodule.h" /* This source code file is part of the H5S module */ /***********/ /* 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 */ /****************/ /* Local Macros */ /****************/ - /******************/ /* Local Typedefs */ /******************/ - /********************/ /* Local Prototypes */ /********************/ /* Selection callbacks */ -static herr_t H5S__none_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); -static herr_t H5S__none_release(H5S_t *space); -static htri_t H5S__none_is_valid(const H5S_t *space); -static hssize_t H5S__none_serial_size(const H5S_t *space); -static herr_t H5S__none_serialize(const H5S_t *space, uint8_t **p); -static herr_t H5S__none_deserialize(H5S_t **space, const uint8_t **p); -static herr_t H5S__none_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); -static herr_t H5S__none_offset(const H5S_t *space, hsize_t *off); -static int H5S__none_unlim_dim(const H5S_t *space); -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_iter_init(const H5S_t *space, H5S_sel_iter_t *iter); +static herr_t H5S__none_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection); +static herr_t H5S__none_release(H5S_t *space); +static htri_t H5S__none_is_valid(const H5S_t *space); +static hssize_t H5S__none_serial_size(H5S_t *space); +static herr_t H5S__none_serialize(H5S_t *space, uint8_t **p); +static herr_t H5S__none_deserialize(H5S_t **space, const uint8_t **p); +static herr_t H5S__none_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); +static herr_t H5S__none_offset(const H5S_t *space, hsize_t *off); +static int H5S__none_unlim_dim(const H5S_t *space); +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(H5S_t *space); +static htri_t H5S__none_shape_same(H5S_t *space1, H5S_t *space2); +static htri_t H5S__none_intersect_block(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_adjust_s(H5S_t *space, const hssize_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_iter_init(H5S_t *space, H5S_sel_iter_t *iter); /* Selection iteration callbacks */ -static herr_t H5S__none_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); -static herr_t H5S__none_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); +static herr_t H5S__none_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); +static herr_t H5S__none_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); static hsize_t H5S__none_iter_nelmts(const H5S_sel_iter_t *iter); -static htri_t H5S__none_iter_has_next_block(const H5S_sel_iter_t *iter); -static herr_t H5S__none_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); -static herr_t H5S__none_iter_next_block(H5S_sel_iter_t *sel_iter); -static herr_t H5S__none_iter_get_seq_list(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__none_iter_release(H5S_sel_iter_t *sel_iter); - +static htri_t H5S__none_iter_has_next_block(const H5S_sel_iter_t *iter); +static herr_t H5S__none_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); +static herr_t H5S__none_iter_next_block(H5S_sel_iter_t *sel_iter); +static herr_t H5S__none_iter_get_seq_list(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__none_iter_release(H5S_sel_iter_t *sel_iter); /*****************************/ /* Library Private Variables */ /*****************************/ - /*********************/ /* Package Variables */ /*********************/ @@ -113,12 +106,12 @@ const H5S_select_class_t H5S_sel_none[1] = {{ H5S__none_shape_same, H5S__none_intersect_block, H5S__none_adjust_u, + H5S__none_adjust_s, H5S__none_project_scalar, H5S__none_project_simple, H5S__none_iter_init, }}; - /*******************/ /* Local Variables */ /*******************/ @@ -138,24 +131,22 @@ static const H5S_sel_iter_class_t H5S_sel_iter_none[1] = {{ H5S__none_iter_release, }}; - - /*------------------------------------------------------------------------- - * Function: H5S__none_iter_init + * Function: H5S__none_iter_init * - * Purpose: Initializes iteration information for "none" selection. + * Purpose: Initializes iteration information for "none" selection. * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * *------------------------------------------------------------------------- */ static herr_t -H5S__none_iter_init(const H5S_t H5_ATTR_UNUSED *space, H5S_sel_iter_t *iter) +H5S__none_iter_init(H5S_t H5_ATTR_UNUSED *space, H5S_sel_iter_t *iter) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); @@ -167,25 +158,23 @@ H5S__none_iter_init(const H5S_t H5_ATTR_UNUSED *space, H5S_sel_iter_t *iter) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_iter_init() */ - /*------------------------------------------------------------------------- - * Function: H5S__none_iter_coords + * Function: H5S__none_iter_coords * - * Purpose: Retrieve the current coordinates of iterator for current + * Purpose: Retrieve the current coordinates of iterator for current * selection * - * Return: Non-negative on success, negative on failure + * Return: Non-negative on success, negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 22, 2003 * *------------------------------------------------------------------------- */ static herr_t -H5S__none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, - hsize_t H5_ATTR_UNUSED *coords) +H5S__none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_UNUSED *coords) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(iter); @@ -194,25 +183,24 @@ H5S__none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_iter_coords() */ - /*------------------------------------------------------------------------- - * Function: H5S__none_iter_block + * Function: H5S__none_iter_block * - * Purpose: Retrieve the current block of iterator for current + * Purpose: Retrieve the current block of iterator for current * selection * - * Return: Non-negative on success, negative on failure + * Return: Non-negative on success, negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 2, 2003 * *------------------------------------------------------------------------- */ static herr_t -H5S__none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, - hsize_t H5_ATTR_UNUSED *start, hsize_t H5_ATTR_UNUSED *end) +H5S__none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_UNUSED *start, + hsize_t H5_ATTR_UNUSED *end) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(iter); @@ -222,15 +210,14 @@ H5S__none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_iter_block() */ - /*------------------------------------------------------------------------- - * Function: H5S__none_iter_nelmts + * Function: H5S__none_iter_nelmts * - * Purpose: Return number of elements left to process in iterator + * Purpose: Return number of elements left to process in iterator * - * Return: Non-negative number of elements on success, zero on failure + * Return: Non-negative number of elements on success, zero on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 16, 1998 * *------------------------------------------------------------------------- @@ -238,7 +225,7 @@ H5S__none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, static hsize_t H5S__none_iter_nelmts(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(iter); @@ -246,7 +233,6 @@ H5S__none_iter_nelmts(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_LEAVE_NOAPI(0) } /* end H5S__none_iter_nelmts() */ - /*-------------------------------------------------------------------------- NAME H5S__none_iter_has_next_block @@ -267,7 +253,7 @@ H5S__none_iter_nelmts(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) static htri_t H5S__none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(iter); @@ -275,7 +261,6 @@ H5S__none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_iter_has_next_block() */ - /*-------------------------------------------------------------------------- NAME H5S__none_iter_next @@ -297,7 +282,7 @@ H5S__none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) static herr_t H5S__none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_UNUSED nelem) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(iter); @@ -306,7 +291,6 @@ H5S__none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_UNUSED n FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_iter_next() */ - /*-------------------------------------------------------------------------- NAME H5S__none_iter_next_block @@ -327,7 +311,7 @@ H5S__none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_UNUSED n static herr_t H5S__none_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(iter); @@ -335,7 +319,6 @@ H5S__none_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_iter_next_block() */ - /*-------------------------------------------------------------------------- NAME H5S__none_iter_get_seq_list @@ -366,11 +349,11 @@ H5S__none_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__none_iter_get_seq_list(H5S_sel_iter_t H5_ATTR_UNUSED *iter, - size_t H5_ATTR_UNUSED maxseq, size_t H5_ATTR_UNUSED maxelem, size_t *nseq, - size_t *nelem, hsize_t H5_ATTR_UNUSED *off, size_t H5_ATTR_UNUSED *len) +H5S__none_iter_get_seq_list(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_UNUSED maxseq, + size_t H5_ATTR_UNUSED maxelem, size_t *nseq, size_t *nelem, + hsize_t H5_ATTR_UNUSED *off, size_t H5_ATTR_UNUSED *len) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(iter); @@ -390,7 +373,6 @@ H5S__none_iter_get_seq_list(H5S_sel_iter_t H5_ATTR_UNUSED *iter, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_iter_get_seq_list() */ - /*-------------------------------------------------------------------------- NAME H5S__none_iter_release @@ -411,7 +393,7 @@ H5S__none_iter_get_seq_list(H5S_sel_iter_t H5_ATTR_UNUSED *iter, static herr_t H5S__none_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED *iter) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(iter); @@ -419,7 +401,6 @@ H5S__none_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_iter_release() */ - /*-------------------------------------------------------------------------- NAME H5S__none_release @@ -440,7 +421,7 @@ H5S__none_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED *iter) static herr_t H5S__none_release(H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(space); @@ -448,7 +429,6 @@ H5S__none_release(H5S_t H5_ATTR_UNUSED *space) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_release() */ - /*-------------------------------------------------------------------------- NAME H5S__none_copy @@ -470,10 +450,9 @@ H5S__none_release(H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, - hbool_t H5_ATTR_UNUSED share_selection) +H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(src); HDassert(dst); @@ -484,7 +463,6 @@ H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_copy() */ - /*-------------------------------------------------------------------------- NAME H5S__none_is_valid @@ -508,14 +486,13 @@ H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, static htri_t H5S__none_is_valid(const H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__none_is_valid() */ - /*-------------------------------------------------------------------------- NAME H5S__none_serial_size @@ -536,9 +513,9 @@ H5S__none_is_valid(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S__none_serial_size(const H5S_t H5_ATTR_UNUSED *space) +H5S__none_serial_size(H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(space); @@ -549,7 +526,6 @@ H5S__none_serial_size(const H5S_t H5_ATTR_UNUSED *space) FUNC_LEAVE_NOAPI(16) } /* end H5S__none_serial_size() */ - /*-------------------------------------------------------------------------- NAME H5S__none_serialize @@ -557,7 +533,7 @@ H5S__none_serial_size(const H5S_t H5_ATTR_UNUSED *space) Serialize the current selection into a user-provided buffer. USAGE herr_t H5S__none_serialize(space, p) - const H5S_t *space; IN: Dataspace with selection to serialize + 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 serialized selection. @@ -572,11 +548,11 @@ H5S__none_serial_size(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__none_serialize(const H5S_t *space, uint8_t **p) +H5S__none_serialize(H5S_t *space, uint8_t **p) { - uint8_t *pp = (*p); /* Local pointer for decoding */ + uint8_t *pp = (*p); /* Local pointer for decoding */ - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(space); @@ -584,10 +560,10 @@ H5S__none_serialize(const H5S_t *space, uint8_t **p) HDassert(pp); /* Store the preamble information */ - UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(pp, (uint32_t)H5S_NONE_VERSION_1); /* Store the version number */ - UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */ - UINT32ENCODE(pp, (uint32_t)0); /* Store the additional information length */ + UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(pp, (uint32_t)H5S_NONE_VERSION_1); /* Store the version number */ + UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */ + UINT32ENCODE(pp, (uint32_t)0); /* Store the additional information length */ /* Update encoding pointer */ *p = pp; @@ -595,7 +571,6 @@ H5S__none_serialize(const H5S_t *space, uint8_t **p) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_serialize() */ - /*-------------------------------------------------------------------------- NAME H5S__none_deserialize @@ -621,12 +596,12 @@ H5S__none_serialize(const H5S_t *space, uint8_t **p) static herr_t H5S__none_deserialize(H5S_t **space, const uint8_t **p) { - H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, - either *space or a newly allocated one */ - uint32_t version; /* Version number */ - herr_t ret_value = SUCCEED; /* return value */ + H5S_t *tmp_space = NULL; /* Pointer to actual dataspace to use, + either *space or a newly allocated one */ + uint32_t version; /* Version number */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_PACKAGE HDassert(p); HDassert(*p); @@ -636,8 +611,8 @@ H5S__none_deserialize(H5S_t **space, const uint8_t **p) is moved from H5S_select_deserialize() in H5Sselect.c to here. This is needed for decoding virtual layout in H5O__layout_decode() */ /* Allocate space if not provided */ - if(!*space) { - if(NULL == (tmp_space = H5S_create(H5S_SIMPLE))) + if (!*space) { + if (NULL == (tmp_space = H5S_create(H5S_SIMPLE))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace") } /* end if */ else @@ -646,27 +621,29 @@ H5S__none_deserialize(H5S_t **space, const uint8_t **p) /* Decode version */ UINT32DECODE(*p, version); + if (version < H5S_NONE_VERSION_1 || version > H5S_NONE_VERSION_LATEST) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "bad version number for none selection") + /* Skip over the remainder of the header */ *p += 8; /* Change to "none" selection */ - if(H5S_select_none(tmp_space) < 0) + if (H5S_select_none(tmp_space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") /* Return space to the caller if allocated */ - if(!*space) + if (!*space) *space = tmp_space; done: /* Free temporary space if not passed to caller (only happens on error) */ - if(!*space && tmp_space) - if(H5S_close(tmp_space) < 0) + if (!*space && tmp_space) + if (H5S_close(tmp_space) < 0) HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__none_deserialize() */ - /*-------------------------------------------------------------------------- NAME H5S__none_bounds @@ -694,18 +671,17 @@ done: --------------------------------------------------------------------------*/ static herr_t H5S__none_bounds(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *start, - hsize_t H5_ATTR_UNUSED *end) + hsize_t H5_ATTR_UNUSED *end) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(space); HDassert(start); HDassert(end); FUNC_LEAVE_NOAPI(FAIL) -} /* end H5Sget_none_bounds() */ +} /* end H5S_none_bounds() */ - /*-------------------------------------------------------------------------- NAME H5S__none_offset @@ -729,7 +705,7 @@ H5S__none_bounds(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *star static herr_t H5S__none_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *offset) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(space); HDassert(offset); @@ -737,7 +713,6 @@ H5S__none_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *offs FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_offset() */ - /*-------------------------------------------------------------------------- NAME H5S__none_unlim_dim @@ -760,12 +735,11 @@ H5S__none_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *offs static int H5S__none_unlim_dim(const H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR FUNC_LEAVE_NOAPI(-1) } /* end H5S__none_unlim_dim() */ - /*-------------------------------------------------------------------------- NAME H5S__none_is_contiguous @@ -787,14 +761,13 @@ H5S__none_unlim_dim(const H5S_t H5_ATTR_UNUSED *space) static htri_t H5S__none_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(space); FUNC_LEAVE_NOAPI(FALSE) } /* end H5S__none_is_contiguous() */ - /*-------------------------------------------------------------------------- NAME H5S__none_is_single @@ -816,14 +789,13 @@ H5S__none_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) static htri_t H5S__none_is_single(const H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(space); FUNC_LEAVE_NOAPI(FALSE) } /* end H5S__none_is_single() */ - /*-------------------------------------------------------------------------- NAME H5S__none_is_regular @@ -831,7 +803,7 @@ H5S__none_is_single(const H5S_t H5_ATTR_UNUSED *space) Check if a "none" selection is "regular" USAGE htri_t H5S__none_is_regular(space) - const H5S_t *space; IN: Dataspace pointer to check + H5S_t *space; IN: Dataspace pointer to check RETURNS TRUE/FALSE/FAIL DESCRIPTION @@ -844,9 +816,9 @@ H5S__none_is_single(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S__none_is_regular(const H5S_t H5_ATTR_UNUSED *space) +H5S__none_is_regular(H5S_t H5_ATTR_UNUSED *space) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(space); @@ -854,7 +826,6 @@ H5S__none_is_regular(const H5S_t H5_ATTR_UNUSED *space) FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__none_is_regular() */ - /*-------------------------------------------------------------------------- NAME H5S__none_shape_same @@ -862,8 +833,8 @@ H5S__none_is_regular(const H5S_t H5_ATTR_UNUSED *space) Check if a two "none" selections are the same shape USAGE htri_t H5S__none_shape_same(space1, space2) - const H5S_t *space1; IN: First dataspace to check - const H5S_t *space2; IN: Second dataspace to check + H5S_t *space1; IN: First dataspace to check + H5S_t *space2; IN: Second dataspace to check RETURNS TRUE / FALSE / FAIL DESCRIPTION @@ -875,10 +846,9 @@ H5S__none_is_regular(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S__none_shape_same(const H5S_t H5_ATTR_UNUSED *space1, - const H5S_t H5_ATTR_UNUSED *space2) +H5S__none_shape_same(H5S_t H5_ATTR_UNUSED *space1, H5S_t H5_ATTR_UNUSED *space2) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(space1); @@ -887,7 +857,6 @@ H5S__none_shape_same(const H5S_t H5_ATTR_UNUSED *space1, FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__none_shape_same() */ - /*-------------------------------------------------------------------------- NAME H5S__none_intersect_block @@ -895,7 +864,7 @@ H5S__none_shape_same(const H5S_t H5_ATTR_UNUSED *space1, 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 + 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 @@ -908,10 +877,10 @@ H5S__none_shape_same(const H5S_t H5_ATTR_UNUSED *space1, 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) +H5S__none_intersect_block(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *start, + const hsize_t H5_ATTR_UNUSED *end) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(space); @@ -922,7 +891,6 @@ H5S__none_intersect_block(const H5S_t H5_ATTR_UNUSED *space, FUNC_LEAVE_NOAPI(FALSE) } /* end H5S__none_intersect_block() */ - /*-------------------------------------------------------------------------- NAME H5S__none_adjust_u @@ -944,7 +912,7 @@ H5S__none_intersect_block(const H5S_t H5_ATTR_UNUSED *space, static herr_t H5S__none_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offset) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(space); @@ -953,13 +921,42 @@ H5S__none_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *of FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_adjust_u() */ - +/*-------------------------------------------------------------------------- + NAME + H5S__none_adjust_s + PURPOSE + Adjust an "none" selection by subtracting an offset + USAGE + herr_t H5S__none_adjust_u(space, offset) + H5S_t *space; IN/OUT: Pointer to dataspace to adjust + const hssize_t *offset; IN: Offset to subtract + RETURNS + Non-negative on success, negative on failure + DESCRIPTION + Moves selection by subtracting an offset from it. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +static herr_t +H5S__none_adjust_s(H5S_t H5_ATTR_UNUSED *space, const hssize_t H5_ATTR_UNUSED *offset) +{ + FUNC_ENTER_PACKAGE_NOERR + + /* Check args */ + HDassert(space); + HDassert(offset); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5S__none_adjust_s() */ + /*------------------------------------------------------------------------- - * Function: H5S__none_project_scalar + * Function: H5S__none_project_scalar * - * Purpose: Projects a 'none' selection into a scalar dataspace + * Purpose: Projects a 'none' selection into a scalar dataspace * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * * Programmer: Quincey Koziol * Sunday, July 18, 2010 @@ -969,7 +966,7 @@ H5S__none_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *of static herr_t H5S__none_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *offset) { - FUNC_ENTER_STATIC_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); @@ -978,27 +975,26 @@ H5S__none_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUS FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_project_scalar() */ - /*------------------------------------------------------------------------- - * Function: H5S__none_project_simple + * Function: H5S__none_project_simple * - * Purpose: Projects an 'none' selection onto/into a simple dataspace + * Purpose: Projects an 'none' selection onto/into a simple dataspace * of a different rank * - * Return: Non-negative on success, negative on failure. + * Return: Non-negative on success, negative on failure. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, July 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5S__none_project_simple(const H5S_t H5_ATTR_UNUSED *base_space, - H5S_t *new_space, hsize_t H5_ATTR_UNUSED *offset) +H5S__none_project_simple(const H5S_t H5_ATTR_UNUSED *base_space, H5S_t *new_space, + hsize_t H5_ATTR_UNUSED *offset) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_PACKAGE /* Check args */ HDassert(base_space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(base_space)); @@ -1006,14 +1002,13 @@ H5S__none_project_simple(const H5S_t H5_ATTR_UNUSED *base_space, HDassert(offset); /* Select the entire new space */ - if(H5S_select_none(new_space) < 0) + if (H5S_select_none(new_space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "unable to set none selection") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__none_project_simple() */ - /*-------------------------------------------------------------------------- NAME H5S_select_none @@ -1034,7 +1029,7 @@ done: herr_t H5S_select_none(H5S_t *space) { - herr_t ret_value = SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1042,7 +1037,7 @@ H5S_select_none(H5S_t *space) HDassert(space); /* Remove current selection first */ - if(H5S_SELECT_RELEASE(space) < 0) + if (H5S_SELECT_RELEASE(space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't release hyperslab") /* Set number of elements in selection */ @@ -1055,7 +1050,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_none() */ - /*-------------------------------------------------------------------------- NAME H5Sselect_none @@ -1076,21 +1070,20 @@ done: herr_t H5Sselect_none(hid_t spaceid) { - H5S_t *space; /* Dataspace to modify selection of */ - herr_t ret_value = SUCCEED; /* return value */ + H5S_t *space; /* Dataspace to modify selection of */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", spaceid); /* Check args */ - if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) + if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Change to "none" selection */ - if(H5S_select_none(space) < 0) + if (H5S_select_none(space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") done: FUNC_LEAVE_API(ret_value) } /* end H5Sselect_none() */ - |