summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-03-17 21:50:32 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-03-17 21:50:32 (GMT)
commit4494348eb229ae0661754c974695d8a293c6168b (patch)
treea5e98a61dbfc55ab9556a602ba3288ef33e2a1e4 /src/H5P.c
parent31a709a6b24f4cf80f9cd99a3e55f56e81cf3066 (diff)
downloadhdf5-4494348eb229ae0661754c974695d8a293c6168b.zip
hdf5-4494348eb229ae0661754c974695d8a293c6168b.tar.gz
hdf5-4494348eb229ae0661754c974695d8a293c6168b.tar.bz2
[svn-r323] Changes since 19980316
---------------------- ./src/H5D.c ./src/H5T.c ./src/H5Tprivate.h Fixed a bug found by Kevin Powell regarding preservation of existing data during a read or write when the source and destination data types are the same. Thanks Kevin! Fixed a couple warnings on Irix64. ./src/H5D.c ./src/H5Dprivate.h ./src/H5P.c ./src/H5Ppublic.c ./src/H5Tconv.c ./src/H5Tpublic.h ./test/cmpd_dset.c The application can now turn on/off the part of the I/O pipeline that deals with preservation of initialized data. The default is off since this will be the usual case and turning it on slows down the pipe. Use H5Pset_preserve() and H5Pget_preserve(). ./src/H5Fistore.c Added an optimization for reading/writing a single chunk of chunked storage. ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Osdspace.c ./src/H5Ostab.c Fixed warnings reported by marek@iiasa.ac.at. Thanks Marek. ./src/H5Odtype.c Fixed a failing assert() wrt reading compound types (not present in hdf5-1.0.0a).
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c84
1 files changed, 80 insertions, 4 deletions
diff --git a/src/H5P.c b/src/H5P.c
index e990675..9f5ddc7 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -1727,8 +1727,8 @@ H5Pset_buffer (hid_t plist_id, size_t size, void *tconv, void *bkg)
/* Update property list */
plist->buf_size = size;
- plist->tconv = tconv;
- plist->bkg = bkg;
+ plist->tconv_buf = tconv;
+ plist->bkg_buf = bkg;
FUNC_LEAVE (SUCCEED);
}
@@ -1765,14 +1765,90 @@ H5Pget_buffer (hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/)
}
/* Return values */
- if (tconv) *tconv = plist->tconv;
- if (bkg) *bkg = plist->bkg;
+ if (tconv) *tconv = plist->tconv_buf;
+ if (bkg) *bkg = plist->bkg_buf;
FUNC_LEAVE (plist->buf_size);
}
/*-------------------------------------------------------------------------
+ * Function: H5Pset_preserve
+ *
+ * Purpose: When reading or writing compound data types and the
+ * destination is partially initialized and the read/write is
+ * intended to initialize the other members, one must set this
+ * property to TRUE. Otherwise the I/O pipeline treats the
+ * destination datapoints as completely uninitialized.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, March 17, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_preserve (hid_t plist_id, hbool_t status)
+{
+ H5D_xfer_t *plist = NULL;
+
+ FUNC_ENTER (H5Pset_preserve, FAIL);
+
+ /* Check arguments */
+ if (H5P_DATASET_XFER != H5Pget_class (plist_id) ||
+ NULL == (plist = H5A_object (plist_id))) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a dataset transfer property list");
+ }
+
+ /* Update property list */
+ plist->need_bkg = status ? H5T_BKG_YES : H5T_BKG_NO;
+
+ FUNC_LEAVE (SUCCEED);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_preserve
+ *
+ * Purpose: The inverse of H5Pset_preserve()
+ *
+ * Return: Success: TRUE or FALSE
+ *
+ * Failure: -1
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, March 17, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+H5Pget_preserve (hid_t plist_id)
+{
+ H5D_xfer_t *plist = NULL;
+
+ FUNC_ENTER (H5Pset_preserve, FAIL);
+
+ /* Check arguments */
+ if (H5P_DATASET_XFER != H5Pget_class (plist_id) ||
+ NULL == (plist = H5A_object (plist_id))) {
+ HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a dataset transfer property list");
+ }
+
+ FUNC_LEAVE (plist->need_bkg?TRUE:FALSE);
+}
+
+
+
+/*-------------------------------------------------------------------------
* Function: H5Pset_mpi
*
* Signature: herr_t H5Pset_mpi(hid_t tid, MPI_Comm comm, MPI_Info info,