summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-10-01 18:56:51 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-10-01 18:56:51 (GMT)
commit849d36019d929c409c50cce08842354139dca2f8 (patch)
tree360639325199a5d2a59ea02d3a9e4ee2662016f9 /src/H5D.c
parentd809c9309b7fa204ed9f94409228d01087f8b00a (diff)
downloadhdf5-849d36019d929c409c50cce08842354139dca2f8.zip
hdf5-849d36019d929c409c50cce08842354139dca2f8.tar.gz
hdf5-849d36019d929c409c50cce08842354139dca2f8.tar.bz2
[svn-r733]
Changes since 19980930 ---------------------- ./MANIFEST ./doc/html/H5.format.html ./src/H5D.c ./src/H5Dprivate.h ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5O.c ./src/H5Ofill.c [NEW] ./src/H5Oprivate.h ./src/H5P.c ./src/H5Ppublic.h ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Spoint.c ./src/H5Sprivate.h ./src/Makefile.in Added fill values as documented in previous e-mails. They only work for chunked datasets so far. ./src/H5E.c ./src/H5Epublic.h ./src/H5P.c Changed H5E_TEMPLATE to H5E_PLIST. ./src/H5Omtime.c ./src/H5V.c Fixed a typo in a comment. ./src/H5Tconv.c Fixed a bug in compound type conversions that caused an assertion to fail.
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/H5D.c b/src/H5D.c
index e4c9c2c..a4d21dd 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -56,6 +56,9 @@ const H5D_create_t H5D_create_dflt = {
1, 1, 1, 1, 1, 1, 1, 1, /*...produce fewer, but larger I/O......*/
1, 1, 1, 1, 1, 1, 1, 1}, /*...requests. */
+ /* Fill value */
+ {NULL, 0, NULL}, /* No fill value */
+
/* External file list */
{H5F_ADDR_UNDEF, /* External file list heap address */
0, /*...slots allocated */
@@ -531,6 +534,14 @@ H5Dget_create_plist(hid_t dset_id)
"unable to copy the creation property list");
}
+ /* Copy the dataset type into the fill value message */
+ if (!copied_parms->fill.type &&
+ NULL==(copied_parms->fill.type=H5T_copy(dset->type,
+ H5T_COPY_TRANSIENT))) {
+ HRETURN_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
+ "unable to copy dataset data type for fill value");
+ }
+
/* Create an atom */
if ((ret_value=H5I_register ((H5I_group_t)(H5_TEMPLATE_0+
H5P_DATASET_CREATE),
@@ -944,6 +955,17 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
"unable to create dataset object header");
}
+ /* Convert the fill value to the dataset type and write the message */
+ if (H5O_fill_convert(&(new_dset->create_parms->fill), new_dset->type)<0) {
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL,
+ "unable to convert fill value to dataset type");
+ }
+ if (H5O_modify(&(new_dset->ent), H5O_FILL, 0, H5O_FLAG_CONSTANT,
+ &(new_dset->create_parms->fill))<0) {
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL,
+ "unable to update fill value header message");
+ }
+
/* Update the type and space header messages */
if (H5O_modify(&(new_dset->ent), H5O_DTYPE, 0,
H5O_FLAG_CONSTANT|H5O_FLAG_SHARED, new_dset->type)<0 ||
@@ -1105,6 +1127,14 @@ H5D_open(H5G_entry_t *loc, const char *name)
"unable to read data space info from dataset header");
}
+ /* Get the optional fill value message */
+ if (NULL==H5O_read(&(dataset->ent), H5O_FILL, 0,
+ &(dataset->create_parms->fill))) {
+ H5E_clear();
+ HDmemset(&(dataset->create_parms->fill), 0,
+ sizeof(dataset->create_parms->fill));
+ }
+
/* Get the optional filters message */
if (NULL==H5O_read (&(dataset->ent), H5O_PLINE, 0,
&(dataset->create_parms->pline))) {
@@ -1513,6 +1543,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#endif
n = (sconv->f->gath)(dataset->ent.file, &(dataset->layout),
&(dataset->create_parms->pline),
+ &(dataset->create_parms->fill),
&(dataset->create_parms->efl), src_type_size,
file_space, &file_iter, smine_nelmts,
xfer_parms, tconv_buf/*out*/);
@@ -1913,6 +1944,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#endif
n = (sconv->f->gath)(dataset->ent.file, &(dataset->layout),
&(dataset->create_parms->pline),
+ &(dataset->create_parms->fill),
&(dataset->create_parms->efl), dst_type_size,
file_space, &bkg_iter, smine_nelmts,
xfer_parms, bkg_buf/*out*/);
@@ -1955,6 +1987,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#endif
status = (sconv->f->scat)(dataset->ent.file, &(dataset->layout),
&(dataset->create_parms->pline),
+ &(dataset->create_parms->fill),
&(dataset->create_parms->efl), dst_type_size,
file_space, &file_iter, smine_nelmts,
xfer_parms, tconv_buf);