summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/h5dump.c23
-rw-r--r--tools/h5dump/h5dumpgentest.c42
2 files changed, 49 insertions, 16 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 2f31dde..ed41369 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -2241,6 +2241,7 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
for (i=0; i<nfilters; i++)
{
cd_nelmts = NELMTS(cd_values);
+#ifdef H5_WANT_H5_V1_6_COMPAT
filtn = H5Pget_filter(dcpl_id,
(unsigned)i,
&filt_flags,
@@ -2248,6 +2249,16 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
cd_values,
sizeof(f_name),
f_name);
+#else
+ filtn = H5Pget_filter(dcpl_id,
+ (unsigned)i,
+ &filt_flags,
+ &cd_nelmts,
+ cd_values,
+ sizeof(f_name),
+ f_name,
+ NULL);
+#endif /* H5_WANT_H5_V1_6_COMPAT */
switch (filtn)
{
@@ -5572,9 +5583,15 @@ check_compression(hid_t dcpl)
if (nfilt <= 0)
return;
for (i = 0; i < nfilt; i++) {
+#ifdef H5_WANT_H5_V1_6_COMPAT
filter = H5Pget_filter(dcpl, i, &flags,
(size_t *) &cd_nelmts,
&cd_values, 20, namebuf);
+#else
+ filter = H5Pget_filter(dcpl, i, &flags,
+ (size_t *) &cd_nelmts,
+ &cd_values, 20, namebuf, NULL);
+#endif /* H5_WANT_H5_V1_6_COMPAT */
if (filter == H5Z_FILTER_DEFLATE) {
indentation(indent + COL);
printf("<%sCompression />\n",xmlnsprefix);
@@ -5614,9 +5631,15 @@ check_filters(hid_t dcpl)
if (nfilt <= 0)
return;
for (i = 0; i < nfilt; i++) {
+#ifdef H5_WANT_H5_V1_6_COMPAT
filter = H5Pget_filter(dcpl, (unsigned)i, &flags,
(size_t *) &cd_nelmts,
cd_values, 120, namebuf);
+#else
+ filter = H5Pget_filter(dcpl, (unsigned)i, &flags,
+ (size_t *) &cd_nelmts,
+ cd_values, 120, namebuf, NULL);
+#endif /* H5_WANT_H5_V1_6_COMPAT */
if (filter == H5Z_FILTER_DEFLATE) {
indentation(indent + COL);
printf("<%sDeflate Level=\"",xmlnsprefix);
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;