[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:
Albert Cheng 1998-06-18 11:12:52 -05:00
parent dd23059807
commit d6f7fda058
2 changed files with 9 additions and 8 deletions

View File

@ -657,8 +657,8 @@ H5S_get_ndims(const H5S_t *ds)
/*-------------------------------------------------------------------------
* Function: H5Sget_dims
*
* Purpose: Returns the size in each dimension of a data space DS through
* the DIMS argument.
* Purpose: Returns the size and maximum sizes in each dimension of
* a data space DS through the DIMS and MAXDIMS arguments.
*
* Return: Success: Number of dimensions, the same value as
* returned by H5Sget_ndims().
@ -669,11 +669,15 @@ H5S_get_ndims(const H5S_t *ds)
* Thursday, December 11, 1997
*
* 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
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;
intn ret_value = 0;
@ -686,10 +690,7 @@ H5Sget_dims (hid_t space_id, hsize_t dims[]/*out*/)
NULL == (ds = H5I_object(space_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
}
if (!dims) {
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer");
}
ret_value = H5S_get_dims(ds, dims, NULL);
ret_value = H5S_get_dims(ds, dims, maxdims);
FUNC_LEAVE(ret_value);
}

View File

@ -43,7 +43,7 @@ hid_t H5Scopy (hid_t space_id);
herr_t H5Sclose (hid_t space_id);
hsize_t H5Sget_npoints (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);
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,