summaryrefslogtreecommitdiffstats
path: root/src/H5Z.c
diff options
context:
space:
mode:
authorNat Furrer <nfurrer@ncsa.uiuc.edu>2004-06-28 19:46:03 (GMT)
committerNat Furrer <nfurrer@ncsa.uiuc.edu>2004-06-28 19:46:03 (GMT)
commit6d682a5a28f1ad599db5ad77e135b25a2efe7ae7 (patch)
tree678b86bf8d678460c0db11fa9cb9e09f40206775 /src/H5Z.c
parent903580837a2e43d2b72c39206746a20d840c54e8 (diff)
downloadhdf5-6d682a5a28f1ad599db5ad77e135b25a2efe7ae7.zip
hdf5-6d682a5a28f1ad599db5ad77e135b25a2efe7ae7.tar.gz
hdf5-6d682a5a28f1ad599db5ad77e135b25a2efe7ae7.tar.bz2
[svn-r8753]
Purpose: Handled SZIP without the encoder present. Description: It is now an error for a user to try to create, extend, or write to a dataset without the encoder present in their SZIP library. Added H5Zget_filter_info to provide users with a way to query HDF5 about the presence (or lack thereof) of the SZIP encoder. Platforms tested: Windows Verbena Arabica Copper Misc. update:
Diffstat (limited to 'src/H5Z.c')
-rw-r--r--src/H5Z.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/H5Z.c b/src/H5Z.c
index 0d0151a..849f671 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -574,8 +574,15 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
case H5Z_PRELUDE_CAN_APPLY:
/* Check if there is a "can apply" callback */
if(fclass->can_apply) {
+ herr_t status;
+#ifndef H5_SZIP_CAN_ENCODE
+ /* If this is the Szip filter, make sure it can encode */
+ if (dcpl_pline.filter[u].id == H5Z_FILTER_SZIP)
+ HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled");
+#endif
+
/* Make callback to filter's "can apply" function */
- herr_t status=(fclass->can_apply)(dcpl_id, type_id, space_id);
+ status=(fclass->can_apply)(dcpl_id, type_id, space_id);
/* Check return value */
if(status<=0) {
@@ -1210,3 +1217,47 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter)
done:
FUNC_LEAVE_NOAPI(ret_value)
}
+
+/*-------------------------------------------------------------------------
+ * Function: H5Zget_filter_info
+ *
+ * Purpose: Gets information about a pipeline data filter and stores it
+ * in filter_config_flags.
+ *
+ * Return: zero on success / negative on failure
+ *
+ * Programmer: James Laird and Nat Furrer
+ * Monday, June 7, 2004
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(H5Zget_filter_info, FAIL)
+
+ if (filter_config_flags != NULL)
+ {
+ if (filter == H5Z_FILTER_SZIP)
+ {
+ *filter_config_flags = 0;
+#ifdef H5_SZIP_CAN_ENCODE
+ *filter_config_flags |= H5Z_FILTER_CONFIG_ENCODE_ENABLED;
+#endif
+ *filter_config_flags |= H5Z_FILTER_CONFIG_DECODE_ENABLED;
+ }
+ else
+ *filter_config_flags = H5Z_FILTER_CONFIG_DECODE_ENABLED | H5Z_FILTER_CONFIG_ENCODE_ENABLED;
+
+ /* Make sure the filter exists */
+ if (H5Z_find(filter) == NULL)
+ *filter_config_flags = 0;
+ }
+
+done:
+ FUNC_LEAVE_API(ret_value)
+}
+