summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-04-09 02:16:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-04-09 02:16:17 (GMT)
commit4956cd61f380951b70887281971e0f91687eabeb (patch)
treec797bdeb335cd5c11a3b29843c1bfab5d83e3aac /src/H5S.c
parent8ba880027ff5ffd574ee2500b1aabd4d6bfb9fee (diff)
downloadhdf5-4956cd61f380951b70887281971e0f91687eabeb.zip
hdf5-4956cd61f380951b70887281971e0f91687eabeb.tar.gz
hdf5-4956cd61f380951b70887281971e0f91687eabeb.tar.bz2
[svn-r6608] Purpose:
New feature Description: Added new internal API function: H5S_create_simple() for creating simple dataspaces inside the library. Solution: Platforms tested: FreeBSD 4.8 (sleipnir) w/szip Linux 2.4 (sleipnir) w/szip Solaris 2.7 (arabica) w/FORTRAN IRIX64 6.5 (modi4) w/szip, FORTRAN & parallel Misc. update:
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/src/H5S.c b/src/H5S.c
index d18a259..d5eb588 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1780,14 +1780,12 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/],
}
/* Create the space and set the extent */
- if(NULL==(space=H5S_create(H5S_SIMPLE)))
+ if(NULL==(space=H5S_create_simple(rank,dims,maxdims)))
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace");
- if(H5S_set_extent_simple(space,(unsigned)rank,dims,maxdims)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions");
/* Atomize */
if ((ret_value=H5I_register (H5I_DATASPACE, space))<0)
- HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space atom");
+ HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID");
done:
if (ret_value<0) {
@@ -1800,6 +1798,47 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5S_create_simple
+ *
+ * Purpose: Internal function to create simple dataspace
+ *
+ * Return: Success: The ID for the new simple data space object.
+ * Failure: Negative
+ *
+ * Errors:
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, April 3, 2003
+ *
+ * Modifications:
+ * Extracted from H5Screate_simple
+ * Quincey Koziol, Thursday, April 3, 2003
+ *
+ *-------------------------------------------------------------------------
+ */
+H5S_t *
+H5S_create_simple(int rank, const hsize_t dims[/*rank*/],
+ const hsize_t maxdims[/*rank*/])
+{
+ H5S_t *ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5S_create_simple, NULL);
+
+ /* Check arguments */
+ assert(rank>=0 && rank <=H5S_MAX_RANK);
+
+ /* Create the space and set the extent */
+ if(NULL==(ret_value=H5S_create(H5S_SIMPLE)))
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace");
+ if(H5S_set_extent_simple(ret_value,(unsigned)rank,dims,maxdims)<0)
+ HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, NULL, "can't set dimensions");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5S_create_simple() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5S_get_simple_extent_type
*
* Purpose: Internal function for retrieving the type of extent for a dataspace object