summaryrefslogtreecommitdiffstats
path: root/src/H5Zdeflate.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-04-09 02:34:21 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-04-09 02:34:21 (GMT)
commit92b6e817897817df03ad9f9b171ea4e11b901834 (patch)
tree5dc8befddaa0341a8380f80b55756ba1801ad110 /src/H5Zdeflate.c
parent099a9f4e74078691a79874638b9aeeebb3bc1996 (diff)
downloadhdf5-92b6e817897817df03ad9f9b171ea4e11b901834.zip
hdf5-92b6e817897817df03ad9f9b171ea4e11b901834.tar.gz
hdf5-92b6e817897817df03ad9f9b171ea4e11b901834.tar.bz2
[svn-r6611] Purpose:
Code cleanup/new features Description: Switch over to a new style for registering filters with the library - instead passing in an ID, a string and a callback function to H5Zregister, the client should pass in a single pointer to a H5Z_claass_t struct which contains the ID, the description string and all the function callbacks as fields. Added support for a new "can apply" callback for each filter, which is called when a dataset is created to check whether the parameters for that filter apply correctly to the combination of the datatype and the chunk size (i.e. dataspace) for the dataset. Added support for a new "set local" callback for each filter, which is called when a dataset is created (after the "can apply" filter callback) and sets filter parameters that are specific to that particular dataset. Switched the filters we ship over to use the new H5Z_class_t struct for their internal registrations and also added "set local" callbacks to the szip and shuffle filters and a "can apply" callback to the szip filter. Lots of other code cleanups, etc. also Solution: Platforms tested: FreeBSD 4.8 (sleipnir) w/szip Linux 2.4 (sleipnir) w/szip Solaris 2.7 (arabica) w/FORTRAN IRIX64 6.5 (modi4) w/szip, FORTRAN & parallel Misc. update:
Diffstat (limited to 'src/H5Zdeflate.c')
-rw-r--r--src/H5Zdeflate.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c
index 144c873..89f15cc 100644
--- a/src/H5Zdeflate.c
+++ b/src/H5Zdeflate.c
@@ -17,10 +17,12 @@
* Friday, August 27, 1999
*/
+#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
+
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Zprivate.h" /* Data filters */
+#include "H5Zpkg.h" /* Data filters */
#ifdef H5_HAVE_FILTER_DEFLATE
@@ -33,6 +35,19 @@
#define INTERFACE_INIT NULL
static int interface_initialize_g = 0;
+/* Local function prototypes */
+static size_t H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
+ const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf);
+
+/* This message derives from H5Z */
+const H5Z_class_t H5Z_DEFLATE[1] = {{
+ H5Z_FILTER_DEFLATE, /* Filter id number */
+ "deflate", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ H5Z_filter_deflate, /* The actual filter function */
+}};
+
#define H5Z_DEFLATE_SIZE_ADJUST(s) (HDceil((double)((s)*1.001))+12)
@@ -52,7 +67,7 @@ static int interface_initialize_g = 0;
*
*-------------------------------------------------------------------------
*/
-size_t
+static size_t
H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
const unsigned cd_values[], size_t nbytes,
size_t *buf_size, void **buf)