summaryrefslogtreecommitdiffstats
path: root/src/H5Dio.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2004-07-01 17:38:04 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2004-07-01 17:38:04 (GMT)
commiteab58732d86e9219fa9f41f9ab2e30fae94e4a7d (patch)
tree333b5f2c50c267c14611e042724a7f28d5156ab7 /src/H5Dio.c
parent3f500747fa0f4379e8e03b82f6d679628d55a8c3 (diff)
downloadhdf5-eab58732d86e9219fa9f41f9ab2e30fae94e4a7d.zip
hdf5-eab58732d86e9219fa9f41f9ab2e30fae94e4a7d.tar.gz
hdf5-eab58732d86e9219fa9f41f9ab2e30fae94e4a7d.tar.bz2
[svn-r8781]
Purpose: HDF5 now supports SZIP with no encoder. Description: SZIP can be configured to have both encoder and decoder or just to have the decoder. HDF5 can now query the configuration of any filter, and will throw errors if users try to write using a filter with encoding disabled. Solution: Added H5Zget_filter_info function, changed API for H5Pget_filter and H5P_get_filter_by_id. See SZIP RFC. Platforms tested: Copper (fortran, C++, parallel), Sleipnir (C++), Arabica (fortran, C++), Verbena (fortran, C++) Misc. update:
Diffstat (limited to 'src/H5Dio.c')
-rw-r--r--src/H5Dio.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 9cecda7..9585cd8 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -836,6 +836,8 @@ done:
* Removed the must_convert parameter and move preconditions to
* H5S_<foo>_opt_possible() routine
*
+ * Nat Furrer and James Laird, 2004/6/7
+ * Added check for filter encode capability
*-------------------------------------------------------------------------
*/
static herr_t
@@ -863,6 +865,27 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
assert(mem_type);
assert(buf);
+ /* All filters in the DCPL must have encoding enabled. */
+ if(! dataset->checked_filters)
+ {
+ hid_t type_id;
+
+ type_id = H5I_register(H5I_DATATYPE, dataset->type);
+ if(type_id < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data type")
+
+ if(H5Z_can_apply(dataset->dcpl_id, type_id) <0)
+ {
+ H5I_remove(type_id);
+ HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "can't apply filters")
+ }
+
+ if(H5I_remove(type_id) == NULL)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to release data type id")
+
+ dataset->checked_filters = TRUE;
+ }
+
/* If MPI based VFD is used, no VL datatype support yet. */
/* This is because they use the global heap in the file and we don't */
/* support parallel access of that yet */