summaryrefslogtreecommitdiffstats
path: root/tools/h5jam/getub.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2012-03-02 14:21:13 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2012-03-02 14:21:13 (GMT)
commit68d93b7f4e458ace2ac255c1c7d9dd8873132b51 (patch)
tree5e8429affabf4e90eee15cc85119820b3afc36a8 /tools/h5jam/getub.c
parentc714d9ef43e8b442bd271867c7afab0487fc0c0a (diff)
downloadhdf5-68d93b7f4e458ace2ac255c1c7d9dd8873132b51.zip
hdf5-68d93b7f4e458ace2ac255c1c7d9dd8873132b51.tar.gz
hdf5-68d93b7f4e458ace2ac255c1c7d9dd8873132b51.tar.bz2
[svn-r22013] HDFFV-7560:
Merge 1.8 and h5dump/tools and tests based on tools library from trunk. Reduced warnings. HDFFV-7949: Remove duplicated functions in h5ls Tested: local linux,h5committest
Diffstat (limited to 'tools/h5jam/getub.c')
-rw-r--r--tools/h5jam/getub.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c
index 293aa17..f536605 100644
--- a/tools/h5jam/getub.c
+++ b/tools/h5jam/getub.c
@@ -21,6 +21,7 @@
#endif
#include "H5private.h"
+#include "h5tools.h"
#include "h5tools_utils.h"
void parse_command_line (int argc, const char *argv[]);
@@ -32,9 +33,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 +85,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 +116,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 +165,7 @@ main (int argc, const char *argv[])
if (res < (long)size)
{
if (buf)
- free (buf);
+ free (buf);
HDclose (fd);
exit (EXIT_FAILURE);
}