summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-22 15:53:07 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-22 15:53:07 (GMT)
commita72dc6c92c78650589a9f13d7221318dd1032efe (patch)
tree761d5b07a4814de36d88adc5bfebc161e29adabe /tools/h5repack/h5repack.c
parente9f3b20b64d3c2ffe2e134a5c4bf974c916472b8 (diff)
downloadhdf5-a72dc6c92c78650589a9f13d7221318dd1032efe.zip
hdf5-a72dc6c92c78650589a9f13d7221318dd1032efe.tar.gz
hdf5-a72dc6c92c78650589a9f13d7221318dd1032efe.tar.bz2
[svn-r15521] #1184
Add a userblock to an HDF5 file during the repack. The user gives give a filename and userblock size as command line parameters to h5repack and the contents of that file are stored in the userblock for the HDF5 file created by h5repack. New flags to handle this -u and -b Tested : windows, linux
Diffstat (limited to 'tools/h5repack/h5repack.c')
-rw-r--r--tools/h5repack/h5repack.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index febf7d7..3809377 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -384,8 +384,12 @@ static int check_options(pack_opt_t *options)
is present with other objects\n");
return -1;
}
-
- /* check options for the latest format */
+
+ /*-------------------------------------------------------------------------
+ * check options for the latest format
+ *-------------------------------------------------------------------------
+ */
+
if (options->grp_compact < 0) {
error_msg(progname, "invalid maximum number of links to store as header messages\n");
return -1;
@@ -404,6 +408,26 @@ static int check_options(pack_opt_t *options)
return -1;
}
}
+
+
+ /*-------------------------------------------------------------------------
+ * verify new user userblock options
+ *-------------------------------------------------------------------------
+ */
+ if ( options->ublock_filename != NULL && options->ublock_size == 0 )
+ {
+ error_msg(progname, "user block size missing for file %s\n",
+ options->ublock_filename);
+ return -1;
+ }
+
+ if ( options->ublock_filename == NULL && options->ublock_size != 0 )
+ {
+ error_msg(progname, "file name missing for user block\n",
+ options->ublock_filename);
+ return -1;
+ }
+
return 0;
}