diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2016-09-28 18:06:02 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2016-09-28 18:06:02 (GMT) |
commit | 208cfdc941bd911253051dc496c087dae6012241 (patch) | |
tree | a91d11ade122596d7e7eb44f8468efd2a50d7d38 /tools/lib/h5tools_filters.c | |
parent | 50d3fc7a61f4b1dbe2ead376b778f5743060cc6e (diff) | |
download | hdf5-208cfdc941bd911253051dc496c087dae6012241.zip hdf5-208cfdc941bd911253051dc496c087dae6012241.tar.gz hdf5-208cfdc941bd911253051dc496c087dae6012241.tar.bz2 |
Merge/align from trunk(develop)
Diffstat (limited to 'tools/lib/h5tools_filters.c')
-rw-r--r-- | tools/lib/h5tools_filters.c | 76 |
1 files changed, 41 insertions, 35 deletions
diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index ccdba26..0b42124 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "hdf5.h" +#include "H5private.h" #include "h5tools.h" /*------------------------------------------------------------------------- @@ -151,54 +151,60 @@ int h5tools_can_encode(H5Z_filter_t filtn) { switch (filtn) { /* user defined filter */ default: - return 0; + return 0; case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - return 0; + return 0; #endif - break; + break; + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - return 0; + return 0; #else { - unsigned int filter_config_flags; + unsigned int filter_config_flags; - if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) - return -1; - if ((filter_config_flags - & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { - /* filter present but neither encode nor decode is supported (???) */ - return -1; - } - else if ((filter_config_flags - & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { - /* decoder only: read but not write */ - return 0; - } - else if ((filter_config_flags - & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { - /* encoder only: write but not read (???) */ - return -1; - } - else if ((filter_config_flags - & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) - == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { - return 1; - } + if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) + return -1; + if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { + /* filter present but neither encode nor decode is supported (???) */ + return -1; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { + /* decoder only: read but not write */ + return 0; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { + /* encoder only: write but not read (???) */ + return -1; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) + == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { + return 1; + } } #endif - break; + break; + case H5Z_FILTER_SHUFFLE: - break; + break; + case H5Z_FILTER_FLETCHER32: - break; + break; + case H5Z_FILTER_NBIT: - break; + break; + case H5Z_FILTER_SCALEOFFSET: - break; - }/*switch*/ + break; + }/*switch*/ - return 1; + return 1; } + |