diff options
Diffstat (limited to 'src/H5Stest.c')
-rw-r--r-- | src/H5Stest.c | 99 |
1 files changed, 68 insertions, 31 deletions
diff --git a/src/H5Stest.c b/src/H5Stest.c index a7bee2b..60c5679 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -17,30 +17,65 @@ * Purpose: Dataspace selection testing functions. */ +/****************/ +/* Module Setup */ +/****************/ + #include "H5Smodule.h" /* This source code file is part of the H5S module */ #define H5S_TESTING /*suppress warning about H5S testing funcs*/ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Spkg.h" /* Dataspaces */ +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + /*-------------------------------------------------------------------------- NAME - H5S_select_shape_same_test + H5S__get_rebuild_status_test PURPOSE - Determine if two dataspace selections are the same shape + Determine the status of hyperslab rebuild 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 + 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 - Checks to see if the current selection in the dataspaces are the same - dimensionality and shape. + Query the status of rebuilding the hyperslab GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING @@ -48,41 +83,38 @@ REVISION LOG --------------------------------------------------------------------------*/ htri_t -H5S_select_shape_same_test(hid_t sid1, hid_t sid2) +H5S__get_rebuild_status_test(hid_t space_id) { - H5S_t *space1; /* Pointer to 1st dataspace */ - H5S_t *space2; /* Pointer to 2nd dataspace */ - htri_t ret_value = FAIL; /* Return value */ + H5S_t *space; /* Pointer to 1st dataspace */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - /* Get dataspace structures */ - if(NULL == (space1 = (H5S_t *)H5I_object_verify(sid1, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - if(NULL == (space2 = (H5S_t *)H5I_object_verify(sid2, H5I_DATASPACE))) + /* Get dataspace structures */ + if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - /* Check if the dataspace selections are the same shape */ - if((ret_value = H5S_select_shape_same(space1, space2)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "unable to compare dataspace selections") + ret_value = (htri_t)space->select.sel_info.hslab->diminfo_valid; done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_select_shape_same_test() */ +} /* H5S__get_rebuild_status_test() */ /*-------------------------------------------------------------------------- NAME - H5S_get_rebuild_status_test + H5S_select_shape_same_test PURPOSE - Determine the status of hyperslab rebuild + Determine if two dataspace selections are the same shape USAGE - htri_t H5S_inquiry_rebuild_status(hid_t space_id) - hid_t space_id; IN: dataspace id + 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 - Query the status of rebuilding the hyperslab + Checks to see if the current selection in the dataspaces are the same + dimensionality and shape. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING @@ -90,20 +122,25 @@ done: REVISION LOG --------------------------------------------------------------------------*/ htri_t -H5S_get_rebuild_status_test(hid_t space_id) +H5S_select_shape_same_test(hid_t sid1, hid_t sid2) { - H5S_t *space; /* Pointer to 1st dataspace */ - htri_t ret_value = FAIL; /* Return value */ + H5S_t *space1; /* Pointer to 1st dataspace */ + H5S_t *space2; /* Pointer to 2nd dataspace */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - /* Get dataspace structures */ - if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) + /* Get dataspace structures */ + if(NULL == (space1 = (H5S_t *)H5I_object_verify(sid1, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + if(NULL == (space2 = (H5S_t *)H5I_object_verify(sid2, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") - ret_value = (htri_t)space->select.sel_info.hslab->diminfo_valid; + /* Check if the dataspace selections are the same shape */ + if((ret_value = H5S_select_shape_same(space1, space2)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "unable to compare dataspace selections") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_get_rebuild_status_test() */ +} /* H5S_select_shape_same_test() */ |