2003-06-04 23:47:17 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* Copyright by The HDF Group. *
|
2003-06-04 23:47:17 +08:00
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
|
* All rights reserved. *
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2003-06-04 23:47:17 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
|
|
/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
|
|
|
|
|
* Saturday, May 31, 2003
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Dataspace selection testing functions.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define H5S_PACKAGE /*suppress error about including H5Spkg */
|
|
|
|
|
#define H5S_TESTING /*suppress warning about H5S testing funcs*/
|
|
|
|
|
|
2003-06-27 23:59:48 +08:00
|
|
|
|
|
2005-11-15 10:55:39 +08:00
|
|
|
|
#include "H5private.h" /* Generic Functions */
|
|
|
|
|
#include "H5Eprivate.h" /* Error handling */
|
|
|
|
|
#include "H5Iprivate.h" /* IDs */
|
|
|
|
|
#include "H5Spkg.h" /* Dataspaces */
|
2003-06-04 23:47:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
NAME
|
|
|
|
|
H5S_select_shape_same_test
|
|
|
|
|
PURPOSE
|
|
|
|
|
Determine if two dataspace selections are the same shape
|
|
|
|
|
USAGE
|
|
|
|
|
htri_t H5S_select_shape_same_test(sid1, sid2)
|
|
|
|
|
hid_t sid1; IN: 1st dataspace to compare
|
|
|
|
|
hid_t sid2; IN: 2nd dataspace to compare
|
|
|
|
|
RETURNS
|
|
|
|
|
Non-negative TRUE/FALSE on success, negative on failure
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
Checks to see if the current selection in the dataspaces are the same
|
|
|
|
|
dimensionality and shape.
|
|
|
|
|
GLOBAL VARIABLES
|
|
|
|
|
COMMENTS, BUGS, ASSUMPTIONS
|
2006-02-27 11:30:22 +08:00
|
|
|
|
DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING
|
2003-06-04 23:47:17 +08:00
|
|
|
|
EXAMPLES
|
|
|
|
|
REVISION LOG
|
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
htri_t
|
|
|
|
|
H5S_select_shape_same_test(hid_t sid1, hid_t sid2)
|
|
|
|
|
{
|
2008-08-22 04:30:19 +08:00
|
|
|
|
H5S_t *space1; /* Pointer to 1st dataspace */
|
|
|
|
|
H5S_t *space2; /* Pointer to 2nd dataspace */
|
2006-02-27 11:30:22 +08:00
|
|
|
|
htri_t ret_value; /* Return value */
|
2003-06-04 23:47:17 +08:00
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI(FAIL)
|
2003-06-04 23:47:17 +08:00
|
|
|
|
|
|
|
|
|
/* Get dataspace structures */
|
2008-08-22 04:30:19 +08:00
|
|
|
|
if(NULL == (space1 = (H5S_t *)H5I_object_verify(sid1, H5I_DATASPACE)))
|
2006-02-27 11:30:22 +08:00
|
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
|
2008-08-22 04:30:19 +08:00
|
|
|
|
if(NULL == (space2 = (H5S_t *)H5I_object_verify(sid2, H5I_DATASPACE)))
|
2006-02-27 11:30:22 +08:00
|
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
|
2003-06-04 23:47:17 +08:00
|
|
|
|
|
|
|
|
|
/* Check if the dataspace selections are the same shape */
|
2006-02-27 11:30:22 +08:00
|
|
|
|
if((ret_value = H5S_select_shape_same(space1, space2)) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "unable to compare dataspace selections")
|
2003-06-04 23:47:17 +08:00
|
|
|
|
|
|
|
|
|
done:
|
2006-02-27 11:30:22 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
|
|
|
|
} /* H5S_select_shape_same_test() */
|
2003-06-04 23:47:17 +08:00
|
|
|
|
|
2005-11-15 10:55:39 +08:00
|
|
|
|
|
2005-10-14 05:39:51 +08:00
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
NAME
|
2006-02-27 11:30:22 +08:00
|
|
|
|
H5S_get_rebuild_status_test
|
2005-10-14 05:39:51 +08:00
|
|
|
|
PURPOSE
|
2006-02-27 11:30:22 +08:00
|
|
|
|
Determine the status of hyperslab rebuild
|
2005-10-14 05:39:51 +08:00
|
|
|
|
USAGE
|
|
|
|
|
htri_t H5S_inquiry_rebuild_status(hid_t space_id)
|
|
|
|
|
hid_t space_id; IN: dataspace id
|
|
|
|
|
RETURNS
|
|
|
|
|
Non-negative TRUE/FALSE on success, negative on failure
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
Query the status of rebuilding the hyperslab
|
|
|
|
|
GLOBAL VARIABLES
|
|
|
|
|
COMMENTS, BUGS, ASSUMPTIONS
|
2006-02-27 11:30:22 +08:00
|
|
|
|
DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING
|
2005-10-14 05:39:51 +08:00
|
|
|
|
EXAMPLES
|
|
|
|
|
REVISION LOG
|
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
|
htri_t
|
2006-02-27 11:30:22 +08:00
|
|
|
|
H5S_get_rebuild_status_test(hid_t space_id)
|
2005-10-14 05:39:51 +08:00
|
|
|
|
{
|
2008-08-22 04:30:19 +08:00
|
|
|
|
H5S_t *space; /* Pointer to 1st dataspace */
|
2006-02-27 11:30:22 +08:00
|
|
|
|
htri_t ret_value; /* Return value */
|
2005-10-14 05:39:51 +08:00
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI(FAIL)
|
2005-10-14 05:39:51 +08:00
|
|
|
|
|
2006-06-27 22:45:06 +08:00
|
|
|
|
/* Get dataspace structures */
|
2008-08-22 04:30:19 +08:00
|
|
|
|
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
|
2006-02-27 11:30:22 +08:00
|
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
|
2005-10-14 05:39:51 +08:00
|
|
|
|
|
2009-01-09 01:27:15 +08:00
|
|
|
|
ret_value = (htri_t)space->select.sel_info.hslab->diminfo_valid;
|
2006-06-27 22:45:06 +08:00
|
|
|
|
|
2005-10-14 05:39:51 +08:00
|
|
|
|
done:
|
2006-02-27 11:30:22 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
|
|
|
|
} /* H5S_get_rebuild_status_test() */
|
|
|
|
|
|