summaryrefslogtreecommitdiffstats
path: root/tools/src
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/Makefile.am2
-rw-r--r--tools/src/h5diff/h5diff_common.c42
-rw-r--r--tools/src/h5dump/h5dump.c4
-rw-r--r--tools/src/h5dump/h5dump.h1
-rw-r--r--tools/src/h5dump/h5dump_xml.c2
-rw-r--r--tools/src/h5format_convert/h5format_convert.c104
-rw-r--r--tools/src/h5jam/h5jam.c2
7 files changed, 78 insertions, 79 deletions
diff --git a/tools/src/Makefile.am b/tools/src/Makefile.am
index beceee5..93fcc1e 100644
--- a/tools/src/Makefile.am
+++ b/tools/src/Makefile.am
@@ -23,6 +23,6 @@ CONFIG=ordered
# All subdirectories
SUBDIRS=h5diff h5ls h5dump misc h5import h5repack h5jam h5copy \
- h5format_convert h5stat
+ h5format_convert h5stat
include $(top_srcdir)/config/conclude.am
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index e05a8e3..3b0fe1c 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -27,20 +27,20 @@ static int check_d_input(const char*);
*/
static const char *s_opts = "hVrv:qn:d:p:NcelxE:S";
static struct long_options l_opts[] = {
- { "help", no_arg, 'h' },
- { "version", no_arg, 'V' },
- { "report", no_arg, 'r' },
- { "verbose", optional_arg, 'v' },
- { "quiet", no_arg, 'q' },
- { "count", require_arg, 'n' },
- { "delta", require_arg, 'd' },
- { "relative", require_arg, 'p' },
- { "nan", no_arg, 'N' },
- { "compare", no_arg, 'c' },
+ { "help", no_arg, 'h' },
+ { "version", no_arg, 'V' },
+ { "report", no_arg, 'r' },
+ { "verbose", optional_arg, 'v' },
+ { "quiet", no_arg, 'q' },
+ { "count", require_arg, 'n' },
+ { "delta", require_arg, 'd' },
+ { "relative", require_arg, 'p' },
+ { "nan", no_arg, 'N' },
+ { "compare", no_arg, 'c' },
{ "use-system-epsilon", no_arg, 'e' },
- { "follow-symlinks", no_arg, 'l' },
- { "no-dangling-links", no_arg, 'x' },
- { "exclude-path", require_arg, 'E' },
+ { "follow-symlinks", no_arg, 'l' },
+ { "no-dangling-links", no_arg, 'x' },
+ { "exclude-path", require_arg, 'E' },
{ "enable-error-stack", no_arg, 'S' },
{ NULL, 0, '\0' }
};
@@ -78,13 +78,7 @@ static void check_options(diff_opt_t* opts)
*-------------------------------------------------------------------------
*/
-void parse_command_line(int argc,
- const char* argv[],
- const char** fname1,
- const char** fname2,
- const char** objname1,
- const char** objname2,
- diff_opt_t* opts)
+void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* opts)
{
int i;
int opt;
@@ -201,7 +195,7 @@ void parse_command_line(int argc,
}
else {
while(NULL != exclude_prev->next)
- exclude_prev=exclude_prev->next;
+ exclude_prev = exclude_prev->next;
exclude_node->next = NULL;
exclude_prev->next = exclude_node;
@@ -209,7 +203,7 @@ void parse_command_line(int argc,
break;
case 'd':
- opts->d=1;
+ opts->d = 1;
if (check_d_input(opt_arg) == - 1) {
HDprintf("<-d %s> is not a valid option\n", opt_arg);
@@ -224,7 +218,7 @@ void parse_command_line(int argc,
break;
case 'p':
- opts->p=1;
+ opts->p = 1;
if (check_p_input(opt_arg) == -1) {
HDprintf("<-p %s> is not a valid option\n", opt_arg);
usage();
@@ -238,7 +232,7 @@ void parse_command_line(int argc,
break;
case 'n':
- opts->n=1;
+ opts->n = 1;
if ( check_n_input(opt_arg) == -1) {
HDprintf("<-n %s> is not a valid option\n", opt_arg);
usage();
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index d97fdc0..d9ea4b0 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -861,14 +861,14 @@ parse_command_line(int argc, const char *argv[])
int opt;
int last_was_dset = FALSE;
- /* no arguments */
+ /* no arguments */
if (argc == 1) {
usage(h5tools_getprogname());
goto error;
}
/* this will be plenty big enough to hold the info */
- if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) {
+ if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t))) == NULL) {
goto error;
}
diff --git a/tools/src/h5dump/h5dump.h b/tools/src/h5dump/h5dump.h
index 801f60d..ca1fef6 100644
--- a/tools/src/h5dump/h5dump.h
+++ b/tools/src/h5dump/h5dump.h
@@ -43,6 +43,7 @@ typedef struct h5dump_table_items_t {
table_t *dset_table; /* Table of datasets */
table_t *type_table; /* Table of datatypes */
} h5dump_table_items_t;
+
typedef struct h5dump_table_list_t {
size_t nalloc;
size_t nused;
diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c
index d9f1f67..1a7c3ce 100644
--- a/tools/src/h5dump/h5dump_xml.c
+++ b/tools/src/h5dump/h5dump_xml.c
@@ -732,7 +732,7 @@ xml_escape_the_name(const char *str)
* Programmer: REMcG
*-------------------------------------------------------------------------
*/
-static char *
+static char *
xml_escape_the_string(const char *str, int slen)
{
size_t extra;
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c
index bb606ac..8e0d857 100644
--- a/tools/src/h5format_convert/h5format_convert.c
+++ b/tools/src/h5format_convert/h5format_convert.c
@@ -18,7 +18,7 @@
/*
* We include the private header file so we can get to the uniform
- * programming environment it declares.
+ * programming environment it declares.
* HDF5 API functions (except for H5G_basename())
*/
#include "H5private.h"
@@ -42,13 +42,13 @@ static int verbose_g = 0;
static const char *s_opts = "hVvd:n";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
- { "hel", no_arg, 'h'},
- { "he", no_arg, 'h'},
+ { "hel", no_arg, 'h'},
+ { "he", no_arg, 'h'},
{ "version", no_arg, 'V' },
- { "version", no_arg, 'V' },
- { "versio", no_arg, 'V' },
- { "versi", no_arg, 'V' },
- { "vers", no_arg, 'V' },
+ { "version", no_arg, 'V' },
+ { "versio", no_arg, 'V' },
+ { "versi", no_arg, 'V' },
+ { "vers", no_arg, 'V' },
{ "verbose", no_arg, 'v' },
{ "verbos", no_arg, 'v' },
{ "verbo", no_arg, 'v' },
@@ -73,7 +73,7 @@ static struct long_options l_opts[] = {
*
*-------------------------------------------------------------------------
*/
-static void usage(const char *prog)
+static void usage(const char *prog)
{
HDfprintf(stdout, "usage: %s [OPTIONS] file_name\n", prog);
HDfprintf(stdout, " OPTIONS\n");
@@ -113,62 +113,66 @@ static void usage(const char *prog)
*-------------------------------------------------------------------------
*/
static int
-parse_command_line(int argc, const char **argv)
+parse_command_line(int argc, const char **argv)
{
int opt;
/* no arguments */
if (argc == 1) {
usage(h5tools_getprogname());
- h5tools_setstatus(EXIT_FAILURE);
+ h5tools_setstatus(EXIT_FAILURE);
goto error;
}
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
- switch((char) opt) {
- case 'h':
- usage(h5tools_getprogname());
- h5tools_setstatus(EXIT_SUCCESS);
- goto error;
-
- case 'V':
- print_version(h5tools_getprogname());
- h5tools_setstatus(EXIT_SUCCESS);
- goto error;
-
- case 'v':
- verbose_g = TRUE;
- break;
-
- case 'd': /* -d dname */
- if(opt_arg != NULL && *opt_arg)
- dname_g = HDstrdup(opt_arg);
- if(dname_g == NULL) {
- h5tools_setstatus(EXIT_FAILURE);
- error_msg("No dataset name\n", opt_arg);
- usage(h5tools_getprogname());
- goto error;
- }
- dset_g = TRUE;
- break;
-
- case 'n': /* -n */
- noop_g = TRUE;
- break;
-
- default:
- h5tools_setstatus(EXIT_FAILURE);
- usage(h5tools_getprogname());
- goto error;
- break;
- } /* switch */
+ switch((char) opt) {
+ case 'h':
+ usage(h5tools_getprogname());
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto error;
+
+ case 'V':
+ print_version(h5tools_getprogname());
+ h5tools_setstatus(EXIT_SUCCESS);
+ goto error;
+
+ case 'v':
+ verbose_g = TRUE;
+ break;
+
+ case 'd': /* -d dname */
+ if(opt_arg != NULL && *opt_arg)
+ dname_g = HDstrdup(opt_arg);
+ if(dname_g == NULL) {
+ h5tools_setstatus(EXIT_FAILURE);
+ error_msg("No dataset name\n", opt_arg);
+ usage(h5tools_getprogname());
+ goto error;
+ }
+ dset_g = TRUE;
+ break;
+
+ case 'n': /* -n */
+ noop_g = TRUE;
+ break;
+
+ case 'E':
+ enable_error_stack = 1;
+ break;
+
+ default:
+ h5tools_setstatus(EXIT_FAILURE);
+ usage(h5tools_getprogname());
+ goto error;
+ break;
+ } /* switch */
} /* while */
if (argc <= opt_ind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
- h5tools_setstatus(EXIT_FAILURE);
+ h5tools_setstatus(EXIT_FAILURE);
goto error;
}
@@ -327,7 +331,7 @@ done:
}
else if(verbose_g)
HDfprintf(stdout, "Close the dataset\n");
-
+
/* Close the dataset creation property list */
if(H5Pclose(dcpl) < 0) {
error_msg("unable to close dataset creation property list\n");
@@ -470,7 +474,7 @@ done:
HDfree(fname_g);
if(dname_g)
HDfree(dname_g);
-
+
H5Eset_auto2(H5E_DEFAULT, func, edata);
leave(h5tools_getstatus());
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 07797c8..009e527 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -148,7 +148,7 @@ parse_command_line (int argc, const char *argv[])
int opt = FALSE;
/* parse command line options */
- while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF)
+ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
{
switch ((char) opt)
{