diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-02-27 20:10:18 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-02-27 20:10:18 (GMT) |
commit | 009522483ee23aabc44ca5bed03ff5288ea7048c (patch) | |
tree | 566a4da61e496f4325685554ca74d8d69344ad60 | |
parent | 3a713f80759f030279fce816b524880dd5c77752 (diff) | |
download | hdf5-009522483ee23aabc44ca5bed03ff5288ea7048c.zip hdf5-009522483ee23aabc44ca5bed03ff5288ea7048c.tar.gz hdf5-009522483ee23aabc44ca5bed03ff5288ea7048c.tar.bz2 |
[svn-r21994] Add tools_init to main
-rw-r--r-- | tools/h5jam/getub.c | 27 | ||||
-rw-r--r-- | tools/h5jam/tellub.c | 25 | ||||
-rw-r--r-- | tools/h5repack/h5repacktst.c | 5 |
3 files changed, 34 insertions, 23 deletions
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 293aa17..39a78ae 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -32,9 +32,9 @@ void parse_command_line (int argc, const char *argv[]); #define PROGRAMNAME "getub" char *nbytes = NULL; -static const char *s_opts = "c:"; /* add more later ? */ +static const char *s_opts = "c:"; /* add more later ? */ static struct long_options l_opts[] = { - {"c", require_arg, 'c'}, /* input file */ + {"c", require_arg, 'c'}, /* input file */ {NULL, 0, '\0'} }; @@ -84,15 +84,15 @@ parse_command_line (int argc, const char *argv[]) while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'c': - nbytes = HDstrdup (opt_arg); - break; - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'c': + nbytes = HDstrdup (opt_arg); + break; + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } if (argc <= opt_ind) @@ -115,6 +115,9 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + parse_command_line (argc, argv); if (nbytes == NULL) @@ -161,7 +164,7 @@ main (int argc, const char *argv[]) if (res < (long)size) { if (buf) - free (buf); + free (buf); HDclose (fd); exit (EXIT_FAILURE); } diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index f1b6756..2ffcbda 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -60,7 +60,7 @@ usage (const char *prog) fflush (stdout); fprintf (stdout, "usage: %s h5_file\n", prog); fprintf (stdout, - " Check that h5_fil is HDF5 file and print size of user block \n"); + " Check that h5_fil is HDF5 file and print size of user block \n"); fprintf (stdout, " %s -h\n", prog); fprintf (stdout, " Print a usage message and exit\n"); } @@ -90,15 +90,15 @@ parse_command_line (int argc, const char *argv[]) while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'h': - usage (h5tools_getprogname()); - exit (EXIT_SUCCESS); - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'h': + usage (h5tools_getprogname()); + exit (EXIT_SUCCESS); + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } /* check for file name to be processed */ @@ -139,6 +139,9 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -174,7 +177,7 @@ main (int argc, const char *argv[]) if (plist < 0) { error_msg("Can't get file creation plist for file \"%s\"\n", - ifname); + ifname); return (EXIT_FAILURE); } diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 156038c..0ea70ae 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -168,6 +168,11 @@ static int make_complex_attr_references(hid_t loc_id); int main (void) { + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + + /* Initialize h5tools lib */ + h5tools_init(); pack_opt_t pack_options; diff_opt_t diff_options; hsize_t fs_size = 0; /* free space section threshold */ |