summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-26 16:02:44 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-26 16:02:44 (GMT)
commit23cd7c534be3305ef4886866befa3a4fdceab654 (patch)
tree908ed15602c1a30d182f1b91af120ec8d7d0d153 /tools/h5repack/h5repack.c
parentcb166460d03ebace16b39ad3af5f61cef2464b74 (diff)
downloadhdf5-23cd7c534be3305ef4886866befa3a4fdceab654.zip
hdf5-23cd7c534be3305ef4886866befa3a4fdceab654.tar.gz
hdf5-23cd7c534be3305ef4886866befa3a4fdceab654.tar.bz2
[svn-r15533] #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.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index 954f3e7..73f78f6 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -45,7 +45,7 @@ static int have_request(pack_opt_t *options);
* Purpose: locate all high-level HDF5 objects in the file
* and compress/chunk them using options
*
- * Algorythm: 2 traversals are made to the file; the 1st builds a list of
+ * Algorithm: 2 traversals are made to the file; the 1st builds a list of
* the objects, the 2nd makes a copy of them, using the options;
* the reason for the 1st traversal is to check for invalid
* object name requests
@@ -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; 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;
+ }
+
return 0;
}