summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_main.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-03-29 10:49:38 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-03-29 10:49:38 (GMT)
commita3dcbef52b3cd8407ac57f148ded89eb2f4fdecb (patch)
tree6fd51971d513083394b67d2d17b2fdee8aa49187 /tools/h5repack/h5repack_main.c
parente13eb463e03e978a203f77cbaf8bc504e05b28f3 (diff)
downloadhdf5-a3dcbef52b3cd8407ac57f148ded89eb2f4fdecb.zip
hdf5-a3dcbef52b3cd8407ac57f148ded89eb2f4fdecb.tar.gz
hdf5-a3dcbef52b3cd8407ac57f148ded89eb2f4fdecb.tar.bz2
[svn-r22180] Description:
Add new "metadata block size" command line option ('-M <x>' or '--metadata_block_size=<x>') for h5repack. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug) (h5committest upcoming)
Diffstat (limited to 'tools/h5repack/h5repack_main.c')
-rw-r--r--tools/h5repack/h5repack_main.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index e1697ab..6004084 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -35,7 +35,7 @@ const char *outfile = NULL;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:t:a:i:o:S:T:";
+static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:T:";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "version", no_arg, 'V' },
@@ -51,6 +51,7 @@ static struct long_options l_opts[] = {
{ "ssize", require_arg, 's' },
{ "ublock", require_arg, 'u' },
{ "block", require_arg, 'b' },
+ { "metadata_block_size", require_arg, 'M' },
{ "threshold", require_arg, 't' },
{ "alignment", require_arg, 'a' },
{ "infile", require_arg, 'i' }, /* -i for backward compability */
@@ -78,24 +79,6 @@ static struct long_options l_opts[] = {
*
* Comments:
*
- * Modifications:
- * July 2004: Introduced the extra EC or NN option for SZIP
- * October 2006: Added a new switch -n, that allows to write the dataset
- * using a native type. The default to write is the file type.
- *
- * Modification:
- * Peter Cao, June 13, 2007
- * Add "-L, --latest" option to pack a file with the latest file format
- * PVN, November 19, 2007
- * adopted the syntax h5repack [OPTIONS] file1 file2
- * PVN, November 28, 2007
- * added support for multiple global filters
- * PVN, May 16, 2008
- * added backward compatibility for -i infile -o outfile
- * PVN, August 20, 2008
- * add a user block to repacked file (switches -u -b)
- * PVN, August 28, 2008
- * add options to set alignment (H5Pset_alignment) (switches -t -a)
*-------------------------------------------------------------------------
*/
int main(int argc, const char **argv)
@@ -115,7 +98,7 @@ int main(int argc, const char **argv)
HDexit(EXIT_FAILURE);
/* initialize options */
- h5repack_init(&options, 0, 0, (hsize_t)0);
+ h5repack_init(&options, 0, H5F_FILE_SPACE_DEFAULT, (hsize_t)0);
parse_command_line(argc, argv, &options);
@@ -187,6 +170,7 @@ static void usage(const char *prog)
printf(" -e E, --file=E Name of file E with the -f and -l options\n");
printf(" -u U, --ublock=U Name of file U with user block data to be added\n");
printf(" -b B, --block=B Size of user block to be added\n");
+ printf(" -M A, --metadata_block_size=A Metadata block size for H5Pset_meta_block_size\n");
printf(" -t T, --threshold=T Threshold value for H5Pset_alignment\n");
printf(" -a A, --alignment=A Alignment value for H5Pset_alignment\n");
printf(" -f FILT, --filter=FILT Filter type\n");
@@ -428,7 +412,6 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
break;
-
case 'u':
options->ublock_filename = opt_arg;
@@ -439,6 +422,11 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
options->ublock_size = (hsize_t)HDatol( opt_arg );
break;
+ case 'M':
+
+ options->meta_block_size = (hsize_t)HDatol( opt_arg );
+ break;
+
case 't':
options->threshold = (hsize_t)HDatol( opt_arg );
@@ -455,7 +443,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
break;
case 'S':
- {
+ {
char strategy[MAX_NC_NAME];
HDstrcpy(strategy, opt_arg);
@@ -472,7 +460,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
HDexit(EXIT_FAILURE);
}
break;
- }
+ }
case 'T':