summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-27 15:18:34 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-27 15:18:34 (GMT)
commitdda858faf6b607a344370df5d578159d42a28882 (patch)
tree4abe2f7a6f8352285f95501d696bc573e563fe3a /tools/h5repack/h5repack.c
parent1e2cc2c9e3781c55eb35d54ad5f7433e14b7da64 (diff)
downloadhdf5-dda858faf6b607a344370df5d578159d42a28882.zip
hdf5-dda858faf6b607a344370df5d578159d42a28882.tar.gz
hdf5-dda858faf6b607a344370df5d578159d42a28882.tar.bz2
[svn-r15544] #1184
1) 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. 2) add a copy of userblock from HDF5 file New flags to handle this -u and -b tested: windows, linux
Diffstat (limited to 'tools/h5repack/h5repack.c')
-rw-r--r--tools/h5repack/h5repack.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index a934f1b..6f58516 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -377,6 +377,24 @@ static int check_options(pack_opt_t *options)
is present with other objects\n");
return -1;
}
+
+ /*--------------------------------------------------------------------------------
+ * verify new user userblock options; both file name and block size must be present
+ *---------------------------------------------------------------------------------
+ */
+ 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;
+ }