summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dumpgentest.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 /tools/h5dump/h5dumpgentest.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 'tools/h5dump/h5dumpgentest.c')
-rw-r--r--tools/h5dump/h5dumpgentest.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 03ef95a..fdd4e5a 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -26,6 +26,10 @@
#include "hdf5.h"
#include "H5private.h"
+#ifdef H5_HAVE_FILTER_SZIP
+#include "szlib.h"
+#endif
+
#define FILE1 "tgroup.h5"
#define FILE2 "tdset.h5"
#define FILE3 "tattr.h5"
@@ -103,8 +107,10 @@ set_local_myfilter(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id);
/* This message derives from H5Z */
const H5Z_class_t H5Z_MYFILTER[1] = {{
- MYFILTER_ID, /* Filter id number */
- "myfilter", /* Filter name for debugging */
+ H5Z_CLASS_T_VERS,
+ MYFILTER_ID, /* Filter id number */
+ 1, 1,
+ "myfilter", /* Filter name for debugging */
NULL, /* The "can apply" callback */
set_local_myfilter, /* The "set local" callback */
myfilter, /* The actual filter function */
@@ -4543,17 +4549,17 @@ static void gent_filters(void)
* SZIP
*-------------------------------------------------------------------------
*/
-#if defined (H5_HAVE_FILTER_SZIP)
- /* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+ /* remove the filters from the dcpl */
+ ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret>=0);
- /* set szip data */
- ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
- assert(ret>=0);
+ /* set szip data */
+ ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
+ assert(ret>=0);
- ret=make_dset(fid,"szip",sid,dcpl,buf1);
- assert(ret>=0);
+ ret=make_dset(fid,"szip",sid,dcpl,buf1);
+ assert(ret>=0);
#endif
/*-------------------------------------------------------------------------
@@ -4623,11 +4629,11 @@ static void gent_filters(void)
assert(ret>=0);
#endif
-#if defined (H5_HAVE_FILTER_SZIP)
- szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK;
- /* set szip data */
- ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
- assert(ret>=0);
+#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+ szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK;
+ /* set szip data */
+ ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
+ assert(ret>=0);
#endif
#if defined (H5_HAVE_FILTER_DEFLATE)
@@ -4917,7 +4923,11 @@ set_local_myfilter(hid_t dcpl_id, hid_t UNUSED type_id, hid_t UNUSED space_id)
unsigned cd_values[2]={5,6}; /* Filter parameters */
/* Get the filter's current parameters */
+#ifdef H5_WANT_H5_V1_6_COMPAT
if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL)<0)
+#else
+ if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL,NULL)<0)
+#endif /* H5_WANT_H5_V1_6_COMPAT */
return(FAIL);
cd_nelmts=2;