summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5repack/h5repack_main.c')
-rw-r--r--tools/h5repack/h5repack_main.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index d512923..db0a87b 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -37,7 +37,7 @@ static int has_i_o = 0;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char *s_opts = "hVvf:l:m:e:nLc:d:s:";
+static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "version", no_arg, 'V' },
@@ -51,6 +51,8 @@ static struct long_options l_opts[] = {
{ "compact", require_arg, 'c' },
{ "indexed", require_arg, 'd' },
{ "ssize", require_arg, 's' },
+ { "ublock", require_arg, 'u' },
+ { "block", require_arg, 'b' },
{ NULL, 0, '\0' }
};
@@ -84,14 +86,16 @@ static struct long_options l_opts[] = {
* 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 file if requested (new switches -u -b)
+ *-------------------------------------------------------------------------
*/
int main(int argc, char **argv)
{
char *infile = NULL;
char *outfile = NULL;
pack_opt_t options; /*the global options */
- int ret;
+ int ret=-1;
int i;
/* initialize options */
@@ -284,7 +288,8 @@ int main(int argc, char **argv)
}
-
+
+
/* pack it */
ret=h5repack(infile,outfile,&options);
@@ -324,6 +329,8 @@ static void usage(const char *prog)
printf(" -s S[:F], --ssize=S[:F] Shared object header message minimum size\n");
printf(" -m T, --threshold=T Do not apply the filter to datasets smaller than T\n");
printf(" -e M, --file=M Name of file M 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 D, --block=D Size of user block to be added\n");
printf(" -f FILT, --filter=FILT Filter type\n");
printf(" -l LAYT, --layout=LAYT Layout type\n");
@@ -331,7 +338,9 @@ static void usage(const char *prog)
printf(" T - is an integer greater than 1, size of dataset in bytes \n");
printf(" M - is a filename.\n");
+ printf(" U - is a filename.\n");
printf(" S - is an integer\n");
+ printf(" D - is the user block size (any power of 2 equal to 512 or greater)\n");
printf(" F - is the shared object header message type, any of <dspace|dtype|fill|\n");
printf(" pline|attr>. If F is not specified, S applies to all messages\n");
@@ -530,6 +539,17 @@ static void parse_command_line(int argc, const char* argv[], pack_opt_t* options
break;
+
+ case 'u':
+
+ options->ublock_filename = opt_arg;
+ break;
+
+ case 'b':
+
+ options->ublock_size = atoi( opt_arg );
+ break;
+
} /* switch */