summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-08 15:26:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-08 15:26:02 (GMT)
commitd3ee3988b68292524b3a893b9db55c074f4b9e87 (patch)
tree64395dd8ffd157ccd761ea54f7ee2c739e7b48ed /src/H5S.c
parenta6f5c793469cba3e0c1168e07bd6c7f833321623 (diff)
downloadhdf5-d3ee3988b68292524b3a893b9db55c074f4b9e87.zip
hdf5-d3ee3988b68292524b3a893b9db55c074f4b9e87.tar.gz
hdf5-d3ee3988b68292524b3a893b9db55c074f4b9e87.tar.bz2
[svn-r14192] Description:
Deprecate H5Dextend in favor of H5Dset_extent (without using API versioning, due to changed behavior) and switch internal usage to H5Dset_extent Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c130
1 files changed, 66 insertions, 64 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 45069c1..f990925 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1499,70 +1499,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5S_extend
- *
- * Purpose: Extend the dimensions of a data space.
- *
- * Return: Success: Number of dimensions whose size increased.
- *
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Friday, January 30, 1998
- *
- *-------------------------------------------------------------------------
- */
-int
-H5S_extend(H5S_t *space, const hsize_t *size)
-{
- unsigned u;
- int ret_value = 0;
-
- FUNC_ENTER_NOAPI(H5S_extend, FAIL)
-
- /* Check args */
- HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space));
- HDassert(size);
-
- /* Check through all the dimensions to see if modifying the dataspace is allowed */
- for(u = 0; u < space->extent.rank; u++) {
- if(space->extent.size[u]<size[u]) {
- if(space->extent.max && H5S_UNLIMITED!=space->extent.max[u] &&
- space->extent.max[u]<size[u])
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimension cannot be increased")
- ret_value++;
- } /* end if */
- } /* end for */
-
- /* Update */
- if(ret_value) {
- hsize_t nelem; /* Number of elements in extent */
-
- /* Change the dataspace size & re-compute the number of elements in the extent */
- for(u = 0, nelem = 1; u < space->extent.rank; u++) {
- if(space->extent.size[u] < size[u])
- space->extent.size[u] = size[u];
-
- nelem *= space->extent.size[u];
- } /* end for */
- space->extent.nelem = nelem;
-
- /* If the selection is 'all', update the number of elements selected */
- if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL)
- if(H5S_select_all(space, FALSE) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
-
- /* Mark the dataspace as no longer shared if it was before */
- if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_extend() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5Screate_simple
*
* Purpose: Creates a new simple data space object and opens it for
@@ -2355,3 +2291,69 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_set_latest_version() */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+/*-------------------------------------------------------------------------
+ * Function: H5S_extend
+ *
+ * Purpose: Extend the dimensions of a data space.
+ *
+ * Return: Success: Number of dimensions whose size increased.
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Friday, January 30, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5S_extend(H5S_t *space, const hsize_t *size)
+{
+ unsigned u;
+ int ret_value = 0;
+
+ FUNC_ENTER_NOAPI(H5S_extend, FAIL)
+
+ /* Check args */
+ HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space));
+ HDassert(size);
+
+ /* Check through all the dimensions to see if modifying the dataspace is allowed */
+ for(u = 0; u < space->extent.rank; u++) {
+ if(space->extent.size[u]<size[u]) {
+ if(space->extent.max && H5S_UNLIMITED!=space->extent.max[u] &&
+ space->extent.max[u]<size[u])
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimension cannot be increased")
+ ret_value++;
+ } /* end if */
+ } /* end for */
+
+ /* Update */
+ if(ret_value) {
+ hsize_t nelem; /* Number of elements in extent */
+
+ /* Change the dataspace size & re-compute the number of elements in the extent */
+ for(u = 0, nelem = 1; u < space->extent.rank; u++) {
+ if(space->extent.size[u] < size[u])
+ space->extent.size[u] = size[u];
+
+ nelem *= space->extent.size[u];
+ } /* end for */
+ space->extent.nelem = nelem;
+
+ /* If the selection is 'all', update the number of elements selected */
+ if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL)
+ if(H5S_select_all(space, FALSE) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+
+ /* Mark the dataspace as no longer shared if it was before */
+ if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace")
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_extend() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+