mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-11 16:01:00 +08:00
[svn-r431] H5Sget_dims:
Added maxdims agrument to H5Sget_dims. Also removed the check of dims since H5Sget_dims can still return ndims even if both *dims and *maxdims are NULLs.
This commit is contained in:
parent
dd23059807
commit
d6f7fda058
15
src/H5S.c
15
src/H5S.c
@ -657,8 +657,8 @@ H5S_get_ndims(const H5S_t *ds)
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Function: H5Sget_dims
|
* Function: H5Sget_dims
|
||||||
*
|
*
|
||||||
* Purpose: Returns the size in each dimension of a data space DS through
|
* Purpose: Returns the size and maximum sizes in each dimension of
|
||||||
* the DIMS argument.
|
* a data space DS through the DIMS and MAXDIMS arguments.
|
||||||
*
|
*
|
||||||
* Return: Success: Number of dimensions, the same value as
|
* Return: Success: Number of dimensions, the same value as
|
||||||
* returned by H5Sget_ndims().
|
* returned by H5Sget_ndims().
|
||||||
@ -669,11 +669,15 @@ H5S_get_ndims(const H5S_t *ds)
|
|||||||
* Thursday, December 11, 1997
|
* Thursday, December 11, 1997
|
||||||
*
|
*
|
||||||
* Modifications:
|
* Modifications:
|
||||||
|
* June 18, 1998 Albert Cheng
|
||||||
|
* Added maxdims argument. Removed dims argument check
|
||||||
|
* since it can still return ndims even if both dims and
|
||||||
|
* maxdims are NULLs.
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
H5Sget_dims (hid_t space_id, hsize_t dims[]/*out*/)
|
H5Sget_dims(hid_t space_id, hsize_t dims[]/*out*/, hsize_t maxdims[]/*out*/)
|
||||||
{
|
{
|
||||||
H5S_t *ds = NULL;
|
H5S_t *ds = NULL;
|
||||||
intn ret_value = 0;
|
intn ret_value = 0;
|
||||||
@ -686,10 +690,7 @@ H5Sget_dims (hid_t space_id, hsize_t dims[]/*out*/)
|
|||||||
NULL == (ds = H5I_object(space_id))) {
|
NULL == (ds = H5I_object(space_id))) {
|
||||||
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
|
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
|
||||||
}
|
}
|
||||||
if (!dims) {
|
ret_value = H5S_get_dims(ds, dims, maxdims);
|
||||||
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer");
|
|
||||||
}
|
|
||||||
ret_value = H5S_get_dims(ds, dims, NULL);
|
|
||||||
|
|
||||||
FUNC_LEAVE(ret_value);
|
FUNC_LEAVE(ret_value);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ hid_t H5Scopy (hid_t space_id);
|
|||||||
herr_t H5Sclose (hid_t space_id);
|
herr_t H5Sclose (hid_t space_id);
|
||||||
hsize_t H5Sget_npoints (hid_t space_id);
|
hsize_t H5Sget_npoints (hid_t space_id);
|
||||||
int H5Sget_ndims (hid_t space_id);
|
int H5Sget_ndims (hid_t space_id);
|
||||||
int H5Sget_dims (hid_t space_id, hsize_t dims[]);
|
int H5Sget_dims (hid_t space_id, hsize_t dims[], hsize_t maxdims[]);
|
||||||
hbool_t H5Sis_simple (hid_t space_id);
|
hbool_t H5Sis_simple (hid_t space_id);
|
||||||
herr_t H5Sset_space (hid_t space_id, int rank, const hsize_t *dims);
|
herr_t H5Sset_space (hid_t space_id, int rank, const hsize_t *dims);
|
||||||
herr_t H5Sset_hyperslab(hid_t sid, const hssize_t *start, const hsize_t *count,
|
herr_t H5Sset_hyperslab(hid_t sid, const hssize_t *start, const hsize_t *count,
|
||||||
|
Loading…
Reference in New Issue
Block a user