diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-01-06 17:49:00 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-01-06 17:49:00 (GMT) |
commit | 68607efcd10222ed1b1d19308d3586eb65fe3644 (patch) | |
tree | 3d676b7d4ddbf39751057c8572b0f01410e7a139 /tools/h5repack/h5repack.c | |
parent | 89f5220d6687aa1ff3c3d19c8b05859887ecadbd (diff) | |
download | hdf5-68607efcd10222ed1b1d19308d3586eb65fe3644.zip hdf5-68607efcd10222ed1b1d19308d3586eb65fe3644.tar.gz hdf5-68607efcd10222ed1b1d19308d3586eb65fe3644.tar.bz2 |
[svn-r8021] Purpose:
h5repack new features
Description:
added support/tests for multi filters
Solution:
Platforms tested:
linux
solaris
AIX
Misc. update:
Diffstat (limited to 'tools/h5repack/h5repack.c')
-rw-r--r-- | tools/h5repack/h5repack.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index e4a83a0..147b6db 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -23,6 +23,25 @@ static int check_options(pack_opt_t *options); + +/*------------------------------------------------------------------------- + * Function: aux_initglb_filter + * + * Purpose: auxiliary function, initialize the options global filter + * + * Return: void + * + *------------------------------------------------------------------------- + */ +static void aux_initglb_filter(pack_opt_t *options) +{ + int k; + options->filter_g.filtn = -1; + for ( k=0; k<CDVALUES; k++) + options->filter_g.cd_values[k] = -1; +} + + /*------------------------------------------------------------------------- * Function: h5repack * @@ -130,6 +149,7 @@ int h5repack_addfilter(const char* str, if (options->all_filter==1) { /* if we are compressing all set the global filter type */ + aux_initglb_filter(options); options->filter_g=filt; } @@ -294,24 +314,26 @@ static int check_options(pack_opt_t *options) { pack_info_t pack = options->op_tbl->objs[i]; char* name = pack.path; - if (pack.filter.filtn>0) + + for ( j=0; j<pack.nfilters; j++) { if (options->verbose) { printf("\t<%s> with %s filter", name, - get_sfilter(pack.filter.filtn)); + get_sfilter(pack.filter[j].filtn)); } + has_cp=1; /*check for invalid combination of options */ - switch (pack.filter.filtn) + switch (pack.filter[j].filtn) { default: break; case H5Z_FILTER_SZIP: - szip_pixels_per_block=pack.filter.cd_values[0]; + szip_pixels_per_block=pack.filter[j].cd_values[0]; /* check szip parameters */ if (check_szip(pack.chunk.rank, @@ -325,7 +347,7 @@ static int check_options(pack_opt_t *options) Reset this object filter info */ - options->op_tbl->objs[i].filter.filtn=-1; + options->op_tbl->objs[i].filter[j].filtn=-1; options->op_tbl->objs[i].chunk.rank=-1; printf("\tObject <%s> cannot be filtered\n",name); @@ -334,7 +356,7 @@ static int check_options(pack_opt_t *options) break; } /* switch */ - } /* filtn */ + } /* j */ } /* i */ if (options->all_filter==1 && has_cp){ |