summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-01-23 20:46:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-01-23 20:46:34 (GMT)
commit56e3f667d6e3e265ac044f3faf1b17137556e0f7 (patch)
tree70f04688f0596ca5be22dd4e9260f601ee77bbd8 /tools/h5repack
parentb09695738a95d8f1fb823894d1880f28dc16669c (diff)
downloadhdf5-56e3f667d6e3e265ac044f3faf1b17137556e0f7.zip
hdf5-56e3f667d6e3e265ac044f3faf1b17137556e0f7.tar.gz
hdf5-56e3f667d6e3e265ac044f3faf1b17137556e0f7.tar.bz2
[svn-r11886] Purpose:
Code cleanup Description: Check in some of the code cleanups from working on the external link support. (This doesn't include any of the external link features) Platforms tested: FreeBSD 4.11 (sleipnir) Mac OSX.4 (amazon) Linux 2.4
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/h5repack.h82
-rw-r--r--tools/h5repack/h5repack_copy.c2
-rw-r--r--tools/h5repack/h5repack_main.c22
-rw-r--r--tools/h5repack/h5repack_parse.c8
-rw-r--r--tools/h5repack/testh5repack.h97
-rw-r--r--tools/h5repack/testh5repack_attr.c1
-rw-r--r--tools/h5repack/testh5repack_detect_szip.c1
-rw-r--r--tools/h5repack/testh5repack_dset.c1
-rw-r--r--tools/h5repack/testh5repack_main.c1
-rw-r--r--tools/h5repack/testh5repack_make.c3
-rw-r--r--tools/h5repack/testh5repack_util.c1
11 files changed, 124 insertions, 95 deletions
diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h
index 1554039..3647d43 100644
--- a/tools/h5repack/h5repack.h
+++ b/tools/h5repack/h5repack.h
@@ -16,7 +16,6 @@
#ifndef H5REPACK_H__
#define H5REPACK_H__
-#include <string.h>
#include "hdf5.h"
#include "h5trav.h"
#include "h5diff.h"
@@ -44,11 +43,11 @@ typedef struct {
the type of filter and additional parameter
type can be one of the filters
H5Z_FILTER_NONE 0, uncompress if compressed
- H5Z_FILTER_DEFLATE 1 , deflation like gzip
+ H5Z_FILTER_DEFLATE 1 , deflation like gzip
H5Z_FILTER_SHUFFLE 2 , shuffle the data
H5Z_FILTER_FLETCHER32 3 , letcher32 checksum of EDC
H5Z_FILTER_SZIP 4 , szip compression
- H5Z_FILTER_NBIT 5 , nbit compression
+ H5Z_FILTER_NBIT 5 , nbit compression
H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression
*/
@@ -244,82 +243,7 @@ obj_list_t* parse_layout(const char *str,
const char* get_sfilter (H5Z_filter_t filtn);
int parse_number(char *str);
-/*-------------------------------------------------------------------------
- * tests
- *-------------------------------------------------------------------------
- */
-
-#define FNAME0 "test0.h5"
-#define FNAME0OUT "test0out.h5"
-#define FNAME1 "test1.h5"
-#define FNAME1OUT "test1out.h5"
-#define FNAME2 "test2.h5"
-#define FNAME2OUT "test2out.h5"
-#define FNAME3 "test3.h5"
-#define FNAME3OUT "test3out.h5"
-#define FNAME4 "test4.h5"
-#define FNAME4OUT "test4out.h5"
-#define FNAME5 "test5.h5"
-#define FNAME5OUT "test5out.h5"
-#define FNAME6 "test6.h5"
-#define FNAME7 "test_szip.h5"
-#define FNAME8 "test_deflate.h5"
-#define FNAME9 "test_shuffle.h5"
-#define FNAME10 "test_fletcher32.h5"
-#define FNAME11 "test_all.h5"
-#define FNAME7OUT "test_szipout.h5"
-#define FNAME8OUT "test_deflateout.h5"
-#define FNAME9OUT "test_shuffleout.h5"
-#define FNAME10OUT "test_fletcher32out.h5"
-#define FNAME11OUT "test_allout.h5"
-#define FNAME12 "test_nbit.h5"
-#define FNAME12OUT "test_nbitout.h5"
-#define FNAME13 "test_scaleoffset.h5"
-#define FNAME13OUT "test_scaleoffsetout.h5"
-
-int make_testfiles(void);
-
-int write_dset( hid_t loc_id,
- int rank,
- hsize_t *dims,
- const char *dset_name,
- hid_t type_id,
- void *buf );
-int write_attr(hid_t loc_id,
- int rank,
- hsize_t *dims,
- const char *attr_name,
- hid_t type_id,
- void *buf);
-void write_attr_in(hid_t loc_id,
- const char* dset_name, /* for saving reference to dataset*/
- hid_t fid, /* for reference create */
- int make_diffs /* flag to modify data buffers */);
-void write_dset_in(hid_t loc_id,
- const char* dset_name, /* for saving reference to dataset*/
- hid_t file_id,
- int make_diffs /* flag to modify data buffers */);
-
-
-
-/*-------------------------------------------------------------------------
- * tests utils
- *-------------------------------------------------------------------------
- */
-int make_dset(hid_t loc_id,
- const char *name,
- hid_t sid,
- hid_t dcpl,
- void *buf);
-
-int make_attr(hid_t loc_id,
- int rank,
- hsize_t *dims,
- const char *attr_name,
- hid_t type_id,
- void *buf);
-
-
#endif /* H5REPACK_H__ */
+
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index fee7440..e5d962a 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -527,7 +527,7 @@ int do_copy_objects(hid_t fidin,
default:
if (options->verbose)
printf(" %-10s %s\n","User defined object",travt->objs[i].name);
- break;
+ goto error;
}
}
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index 96eb787..efedd95 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -137,11 +137,11 @@ void usage(void)
printf("-o output Output HDF5 File\n");
printf("[-h] Print usage message\n");
printf("[-v] Verbose mode. Print more output (list of objects,\n");
- printf(" filters, warnings)\n");
+ printf(" filters, warnings)\n");
printf("[-f 'filter'] Filter type: 'filter' is a string with the format\n");
- printf("\n");
+ printf("\n");
printf(" <list of objects> : <name of filter> = <filter parameters>\n");
- printf("\n");
+ printf("\n");
printf(" <list of objects> is a comma separated list of object names\n");
printf(" meaning apply compression only to those objects.\n");
printf(" if no object names are specified, the filter is applied to all objects\n");
@@ -151,7 +151,7 @@ void usage(void)
printf(" SHUF, to apply the HDF5 shuffle filter\n");
printf(" FLET, to apply the HDF5 checksum filter\n");
printf(" NBIT, to apply the HDF5 NBIT filter (NBIT compression)\n");
- printf(" SOFF, to apply the HDF5 Scale/Offset filter\n");
+ printf(" SOFF, to apply the HDF5 Scale/Offset filter\n");
printf(" NONE, to remove the filter\n");
printf(" <filter parameters> is optional compression info\n");
printf(" SHUF (no parameter)\n");
@@ -159,12 +159,12 @@ void usage(void)
printf(" NBIT (no parameter)\n");
printf(" GZIP=<deflation level> from 1-9\n");
printf(" SZIP=<pixels per block,coding>\n");
- printf(" (pixels per block is a even number in 2-32 and coding method\n");
- printf(" is 'EC' or 'NN')\n");
- printf(" SOFF=<scale_factor,scale_type>\n");
- printf(" (scale_factor is an integer and scale_type is either 'IN'\n");
- printf(" for integer type, or 'DS', for floating point type\n");
- printf(" using the D-scaling method)\n");
+ printf(" (pixels per block is a even number in 2-32 and coding method\n");
+ printf(" is 'EC' or 'NN')\n");
+ printf(" SOFF=<scale_factor,scale_type>\n");
+ printf(" (scale_factor is an integer and scale_type is either 'IN'\n");
+ printf(" for integer type, or 'DS', for floating point type\n");
+ printf(" using the D-scaling method)\n");
printf("[-l 'layout'] Layout type. 'layout' is a string with the format\n");
printf("\n");
printf(" <list of objects> : <layout type>\n");
@@ -182,7 +182,7 @@ void usage(void)
printf("\n");
printf("-e file File with the -f and -l options (only filter and layout flags)\n");
printf("-m size Do not apply the filter to objects which size in bytes\n");
- printf(" is smaller than number. If no size is specified a minimum of\n");
+ printf(" is smaller than number. If no size is specified a minimum of\n");
printf(" 1024 bytes is assumed.\n");
printf("\n");
printf("Examples of use:\n");
diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c
index 1c67216..9760fa2 100644
--- a/tools/h5repack/h5repack_parse.c
+++ b/tools/h5repack/h5repack_parse.c
@@ -137,9 +137,9 @@ obj_list_t* parse_filter(const char *str,
/*-------------------------------------------------------------------------
* H5Z_FILTER_SZIP
- * szip has the format SZIP=<pixels per block,coding>
+ * szip has the format SZIP=<pixels per block,coding>
* pixels per block is a even number in 2-32 and coding method is 'EC' or 'NN'
- * example SZIP=8,NN
+ * example SZIP=8,NN
*-------------------------------------------------------------------------
*/
if (strcmp(scomp,"SZIP")==0)
@@ -171,9 +171,9 @@ obj_list_t* parse_filter(const char *str,
i=len-1; /* end */
(*n_objs)--; /* we counted an extra ',' */
if (strcmp(smask,"NN")==0)
- filt->cd_values[j++]=H5_SZIP_NN_OPTION_MASK;
+ filt->cd_values[j++]=H5_SZIP_NN_OPTION_MASK;
else if (strcmp(smask,"EC")==0)
- filt->cd_values[j++]=H5_SZIP_EC_OPTION_MASK;
+ filt->cd_values[j++]=H5_SZIP_EC_OPTION_MASK;
else
{
printf("Input Error: szip mask must be 'NN' or 'EC' \n");
diff --git a/tools/h5repack/testh5repack.h b/tools/h5repack/testh5repack.h
new file mode 100644
index 0000000..c367009
--- /dev/null
+++ b/tools/h5repack/testh5repack.h
@@ -0,0 +1,97 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+
+#ifndef TESTH5REPACK_H__
+#define TESTH5REPACK_H__
+
+/*-------------------------------------------------------------------------
+ * tests
+ *-------------------------------------------------------------------------
+ */
+
+#define FNAME0 "test0.h5"
+#define FNAME0OUT "test0out.h5"
+#define FNAME1 "test1.h5"
+#define FNAME1DST "test1_dst.h5"
+#define FNAME1OUT "test1out.h5"
+#define FNAME2 "test2.h5"
+#define FNAME2OUT "test2out.h5"
+#define FNAME3 "test3.h5"
+#define FNAME3OUT "test3out.h5"
+#define FNAME4 "test4.h5"
+#define FNAME4OUT "test4out.h5"
+#define FNAME5 "test5.h5"
+#define FNAME5OUT "test5out.h5"
+#define FNAME6 "test6.h5"
+#define FNAME7 "test_szip.h5"
+#define FNAME8 "test_deflate.h5"
+#define FNAME9 "test_shuffle.h5"
+#define FNAME10 "test_fletcher32.h5"
+#define FNAME11 "test_all.h5"
+#define FNAME7OUT "test_szipout.h5"
+#define FNAME8OUT "test_deflateout.h5"
+#define FNAME9OUT "test_shuffleout.h5"
+#define FNAME10OUT "test_fletcher32out.h5"
+#define FNAME11OUT "test_allout.h5"
+#define FNAME12 "test_nbit.h5"
+#define FNAME12OUT "test_nbitout.h5"
+#define FNAME13 "test_scaleoffset.h5"
+#define FNAME13OUT "test_scaleoffsetout.h5"
+
+int make_testfiles(void);
+
+int write_dset( hid_t loc_id,
+ int rank,
+ hsize_t *dims,
+ const char *dset_name,
+ hid_t type_id,
+ void *buf );
+int write_attr(hid_t loc_id,
+ int rank,
+ hsize_t *dims,
+ const char *attr_name,
+ hid_t type_id,
+ void *buf);
+void write_attr_in(hid_t loc_id,
+ const char* dset_name, /* for saving reference to dataset*/
+ hid_t fid, /* for reference create */
+ int make_diffs /* flag to modify data buffers */);
+void write_dset_in(hid_t loc_id,
+ const char* dset_name, /* for saving reference to dataset*/
+ hid_t file_id,
+ int make_diffs /* flag to modify data buffers */);
+
+
+
+/*-------------------------------------------------------------------------
+ * tests utils
+ *-------------------------------------------------------------------------
+ */
+int make_dset(hid_t loc_id,
+ const char *name,
+ hid_t sid,
+ hid_t dcpl,
+ void *buf);
+
+int make_attr(hid_t loc_id,
+ int rank,
+ hsize_t *dims,
+ const char *attr_name,
+ hid_t type_id,
+ void *buf);
+
+
+#endif /* TESTH5REPACK_H__ */
+
diff --git a/tools/h5repack/testh5repack_attr.c b/tools/h5repack/testh5repack_attr.c
index f18bbc2..7635cf2 100644
--- a/tools/h5repack/testh5repack_attr.c
+++ b/tools/h5repack/testh5repack_attr.c
@@ -15,6 +15,7 @@
#include "hdf5.h"
#include "h5test.h"
#include "h5repack.h"
+#include "testh5repack.h"
/*-------------------------------------------------------------------------
* Function: write_attr_in
diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c
index 16962af..095910e 100644
--- a/tools/h5repack/testh5repack_detect_szip.c
+++ b/tools/h5repack/testh5repack_detect_szip.c
@@ -16,6 +16,7 @@
#include "hdf5.h"
#include "h5test.h"
#include "h5repack.h"
+#include "testh5repack.h"
/*-------------------------------------------------------------------------
diff --git a/tools/h5repack/testh5repack_dset.c b/tools/h5repack/testh5repack_dset.c
index 862257a..c345028 100644
--- a/tools/h5repack/testh5repack_dset.c
+++ b/tools/h5repack/testh5repack_dset.c
@@ -15,6 +15,7 @@
#include "hdf5.h"
#include "h5test.h"
#include "h5repack.h"
+#include "testh5repack.h"
static void make_dset_reg_ref(hid_t loc_id);
diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c
index ab6c09e..42beb76 100644
--- a/tools/h5repack/testh5repack_main.c
+++ b/tools/h5repack/testh5repack_main.c
@@ -15,6 +15,7 @@
#include "hdf5.h"
#include "h5test.h"
#include "h5repack.h"
+#include "testh5repack.h"
#include "h5diff.h"
#if 0
diff --git a/tools/h5repack/testh5repack_make.c b/tools/h5repack/testh5repack_make.c
index 247d606..43b68b1 100644
--- a/tools/h5repack/testh5repack_make.c
+++ b/tools/h5repack/testh5repack_make.c
@@ -15,6 +15,7 @@
#include "hdf5.h"
#include "h5test.h"
#include "h5repack.h"
+#include "testh5repack.h"
#define DIM1 40
#define DIM2 20
@@ -851,8 +852,10 @@ int make_all(hid_t loc_id)
{
hid_t dcpl; /* dataset creation property list */
hid_t sid; /* dataspace ID */
+#if defined (H5_HAVE_FILTER_NBIT)
hid_t dtid;
hid_t dsid;
+#endif /* H5_HAVE_FILTER_NBIT */
#if defined (H5_HAVE_FILTER_SZIP)
unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block=8;
diff --git a/tools/h5repack/testh5repack_util.c b/tools/h5repack/testh5repack_util.c
index cad52d3..63b8b1d 100644
--- a/tools/h5repack/testh5repack_util.c
+++ b/tools/h5repack/testh5repack_util.c
@@ -14,6 +14,7 @@
#include "hdf5.h"
#include "h5repack.h"
+#include "testh5repack.h"
/*-------------------------------------------------------------------------
* Function: make_dset