summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools_error.h18
-rw-r--r--tools/lib/h5tools_utils.c169
-rw-r--r--tools/lib/h5tools_utils.h52
-rw-r--r--tools/lib/io_timer.h9
-rw-r--r--tools/libtest/h5tools_test_utils.c2
-rw-r--r--tools/src/h5copy/h5copy.c48
-rw-r--r--tools/src/h5diff/h5diff_common.c108
-rw-r--r--tools/src/h5dump/h5dump.c340
-rw-r--r--tools/src/h5format_convert/h5format_convert.c60
-rw-r--r--tools/src/h5import/h5import.c162
-rw-r--r--tools/src/h5jam/h5jam.c12
-rw-r--r--tools/src/h5jam/h5unjam.c12
-rw-r--r--tools/src/h5repack/h5repack_main.c162
-rw-r--r--tools/src/h5stat/h5stat.c226
-rw-r--r--tools/src/misc/h5clear.c80
-rw-r--r--tools/src/misc/h5mkgrp.c28
-rw-r--r--tools/test/h5copy/CMakeLists.txt2
-rw-r--r--tools/test/h5copy/h5copygentest.c54
-rw-r--r--tools/test/h5diff/CMakeLists.txt2
-rw-r--r--tools/test/h5diff/h5diffgentest.c2
-rw-r--r--tools/test/h5dump/CMakeLists.txt2
-rw-r--r--tools/test/h5jam/getub.c18
-rw-r--r--tools/test/h5jam/tellub.c12
-rw-r--r--tools/test/h5ls/CMakeLists.txt2
-rw-r--r--tools/test/h5repack/CMakeLists.txt4
-rw-r--r--tools/test/h5repack/h5repacktst.c108
-rw-r--r--tools/test/misc/vds/UC_common.h11
-rw-r--r--tools/test/perform/direct_write_perf.c24
-rw-r--r--tools/test/perform/iopipe.c2
-rw-r--r--tools/test/perform/perf.c37
-rw-r--r--tools/test/perform/pio_perf.c296
-rw-r--r--tools/test/perform/pio_standalone.c58
-rw-r--r--tools/test/perform/pio_standalone.h72
-rw-r--r--tools/test/perform/sio_perf.c356
-rw-r--r--tools/test/perform/sio_standalone.c58
-rw-r--r--tools/test/perform/sio_standalone.h72
-rw-r--r--tools/test/perform/zip_perf.c132
37 files changed, 1269 insertions, 1543 deletions
diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h
index 5840a98..b1ca00f 100644
--- a/tools/lib/h5tools_error.h
+++ b/tools/lib/h5tools_error.h
@@ -29,15 +29,6 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g;
H5TOOLS_DLLVAR hid_t H5E_tools_min_info_id_g;
H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
-/* Use FUNC to safely handle variations of C99 __func__ keyword handling */
-#ifdef H5_HAVE_C99_FUNC
-#define FUNC __func__
-#elif defined(H5_HAVE_FUNCTION)
-#define FUNC __FUNCTION__
-#else
-#error "We need __func__ or __FUNCTION__ to test function names!"
-#endif
-
/*
* H5TOOLS_INIT_ERROR macro, used to initialize error reporting.
*/
@@ -105,7 +96,8 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
do { \
if (enable_error_stack > 0) { \
if (estack_id >= 0 && err_cls >= 0) \
- H5Epush2(estack_id, __FILE__, FUNC, __LINE__, err_cls, maj_err_id, min_err_id, __VA_ARGS__); \
+ H5Epush2(estack_id, __FILE__, __func__, __LINE__, err_cls, maj_err_id, min_err_id, \
+ __VA_ARGS__); \
else { \
HDfprintf(stderr, __VA_ARGS__); \
HDfprintf(stderr, "\n"); \
@@ -175,7 +167,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
#define H5TOOLS_START_DEBUG(...) \
do { \
H5tools_INDENT_g += 2; \
- HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \
HDfprintf(stderr, __VA_ARGS__); \
HDfprintf(stderr, "\n"); \
HDfflush(stderr); \
@@ -183,7 +175,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
#define H5TOOLS_DEBUG(...) \
do { \
- HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \
HDfprintf(stderr, __VA_ARGS__); \
HDfprintf(stderr, "\n"); \
HDfflush(stderr); \
@@ -191,7 +183,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g;
#define H5TOOLS_ENDDEBUG(...) \
do { \
- HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \
HDfprintf(stderr, __VA_ARGS__); \
HDfprintf(stderr, "\n"); \
H5tools_INDENT_g -= 2; \
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 6aec6b8..f2407bf 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -25,12 +25,8 @@
#include "H5FDros3.h"
#endif
-/* global variables */
-unsigned h5tools_nCols = 80;
-/* ``get_option'' variables */
-int opt_err = 1; /*get_option prints errors if this is on */
-int opt_ind = 1; /*token pointer */
-const char * opt_arg; /*flag argument (or value) */
+/* Global variables */
+unsigned h5tools_nCols = 80;
static int h5tools_d_status = 0;
static const char *h5tools_progname = "h5tools";
@@ -162,167 +158,6 @@ help_ref_msg(FILE *output)
HDfprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n", h5tools_getprogname());
}
-/*-------------------------------------------------------------------------
- * Function: get_option
- *
- * Purpose: Determine the command-line options a user specified. We can
- * accept both short and long type command-lines.
- *
- * Return: Success: The short valued "name" of the command line
- * parameter or EOF if there are no more
- * parameters to process.
- *
- * Failure: A question mark.
- *-------------------------------------------------------------------------
- */
-int
-get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts)
-{
- static int sp = 1; /* character index in current token */
- int opt_opt = '?'; /* option character passed back to user */
-
- if (sp == 1) {
- /* check for more flag-like tokens */
- if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') {
- return EOF;
- }
- else if (HDstrcmp(argv[opt_ind], "--") == 0) {
- opt_ind++;
- return EOF;
- }
- }
-
- if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') {
- /* long command line option */
- int i;
- const char ch = '=';
- char * arg = HDstrdup(&argv[opt_ind][2]);
- size_t arg_len = 0;
-
- opt_arg = strchr(&argv[opt_ind][2], ch);
- arg_len = HDstrlen(&argv[opt_ind][2]);
- if (opt_arg) {
- arg_len -= HDstrlen(opt_arg);
- opt_arg++; /* skip the equal sign */
- }
- arg[arg_len] = 0;
-
- for (i = 0; l_opts && l_opts[i].name; i++) {
- if (HDstrcmp(arg, l_opts[i].name) == 0) {
- /* we've found a matching long command line flag */
- opt_opt = l_opts[i].shortval;
-
- if (l_opts[i].has_arg != no_arg) {
- if (opt_arg == NULL) {
- if (l_opts[i].has_arg != optional_arg) {
- if (opt_ind < (argc - 1))
- if (argv[opt_ind + 1][0] != '-')
- opt_arg = argv[++opt_ind];
- }
- else if (l_opts[i].has_arg == require_arg) {
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: option required for \"--%s\" flag\n", argv[0],
- arg);
-
- opt_opt = '?';
- }
- }
- }
- else {
- if (opt_arg) {
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: no option required for \"%s\" flag\n", argv[0],
- arg);
-
- opt_opt = '?';
- }
- }
- break;
- }
- }
-
- if (l_opts[i].name == NULL) {
- /* exhausted all of the l_opts we have and still didn't match */
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: unknown option \"%s\"\n", argv[0], arg);
-
- opt_opt = '?';
- }
-
- opt_ind++;
- sp = 1;
-
- HDfree(arg);
- }
- else {
- register char *cp; /* pointer into current token */
-
- /* short command line option */
- opt_opt = argv[opt_ind][sp];
-
- if (opt_opt == ':' || (cp = HDstrchr(opts, opt_opt)) == 0) {
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: unknown option \"%c\"\n", argv[0], opt_opt);
-
- /* if no chars left in this token, move to next token */
- if (argv[opt_ind][++sp] == '\0') {
- opt_ind++;
- sp = 1;
- }
- return '?';
- }
-
- if (*++cp == ':') {
- /* if a value is expected, get it */
- if (argv[opt_ind][sp + 1] != '\0') {
- /* flag value is rest of current token */
- opt_arg = &argv[opt_ind++][sp + 1];
- }
- else if (++opt_ind >= argc) {
- if (opt_err)
- HDfprintf(rawerrorstream, "%s: value expected for option \"%c\"\n", argv[0], opt_opt);
-
- opt_opt = '?';
- }
- else {
- /* flag value is next token */
- opt_arg = argv[opt_ind++];
- }
-
- sp = 1;
- }
- /* wildcard argument */
- else if (*cp == '*') {
- /* check the next argument */
- opt_ind++;
- /* we do have an extra argument, check if not last */
- if ((opt_ind + 1) < argc) {
- if (argv[opt_ind][0] != '-') {
- opt_arg = argv[opt_ind++];
- }
- else {
- opt_arg = NULL;
- }
- }
- else {
- opt_arg = NULL;
- }
- }
- else {
- /* set up to look at next char in token, next time */
- if (argv[opt_ind][++sp] == '\0') {
- /* no more in current token, so setup next token */
- opt_ind++;
- sp = 1;
- }
- opt_arg = NULL;
- }
- }
-
- /* return the current flag character found */
- return opt_opt;
-}
-
/*****************************************************************************
*
* Function: parse_tuple()
diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h
index 307ce20..095ad6c 100644
--- a/tools/lib/h5tools_utils.h
+++ b/tools/lib/h5tools_utils.h
@@ -40,58 +40,6 @@ H5TOOLS_DLLVAR FILE *overflow_file;
H5TOOLS_DLLVAR hsize_t H5TOOLS_MALLOCSIZE;
/* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */
H5TOOLS_DLLVAR hsize_t H5TOOLS_BUFSIZE;
-/*
- * begin get_option section
- */
-H5TOOLS_DLLVAR int opt_err; /* getoption prints errors if this is on */
-H5TOOLS_DLLVAR int opt_ind; /* token pointer */
-H5TOOLS_DLLVAR const char *opt_arg; /* flag argument (or value) */
-
-enum {
- no_arg = 0, /* doesn't take an argument */
- require_arg, /* requires an argument */
- optional_arg /* argument is optional */
-};
-
-/*
- * get_option determines which options are specified on the command line and
- * returns a pointer to any arguments possibly associated with the option in
- * the ``opt_arg'' variable. get_option returns the shortname equivalent of
- * the option. The long options are specified in the following way:
- *
- * struct long_options foo[] = {
- * { "filename", require_arg, 'f' },
- * { "append", no_arg, 'a' },
- * { "width", require_arg, 'w' },
- * { NULL, 0, 0 }
- * };
- *
- * Long named options can have arguments specified as either:
- *
- * ``--param=arg'' or ``--param arg''
- *
- * Short named options can have arguments specified as either:
- *
- * ``-w80'' or ``-w 80''
- *
- * and can have more than one short named option specified at one time:
- *
- * -aw80
- *
- * in which case those options which expect an argument need to come at the
- * end.
- */
-typedef struct long_options {
- const char *name; /* name of the long option */
- int has_arg; /* whether we should look for an arg */
- char shortval; /* the shortname equivalent of long arg
- * this gets returned from get_option */
-} long_options;
-
-H5TOOLS_DLL int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt);
-/*
- * end get_option section
- */
/*struct taken from the dumper. needed in table struct*/
typedef struct obj_t {
diff --git a/tools/lib/io_timer.h b/tools/lib/io_timer.h
index 0269b93..75db660 100644
--- a/tools/lib/io_timer.h
+++ b/tools/lib/io_timer.h
@@ -16,18 +16,15 @@
#include "hdf5.h"
-#if defined(H5_TIME_WITH_SYS_TIME)
-#include <sys/time.h>
#include <time.h>
-#elif defined(H5_HAVE_SYS_TIME_H)
+
+#ifdef H5_HAVE_SYS_TIME_H
#include <sys/time.h>
-#else
-#include <time.h>
#endif
#ifdef H5_HAVE_WINSOCK2_H
#include <winsock2.h>
-#endif /* H5_HAVE_WINSOCK2_H */
+#endif
/* The different types of timers we can have */
typedef enum timer_type_ {
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
index b27a399..ba3877e 100644
--- a/tools/libtest/h5tools_test_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -100,7 +100,7 @@ H5_GCC_DIAG_OFF("format")
*/
#define JSFAILED_AT() \
{ \
- HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \
+ HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \
}
/*----------------------------------------------------------------------------
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c
index f618914..4e9a25e 100644
--- a/tools/src/h5copy/h5copy.c
+++ b/tools/src/h5copy/h5copy.c
@@ -19,23 +19,23 @@
#define PROGRAMNAME "h5copy"
/* command-line options: short and long-named parameters */
-static const char * s_opts = "d:f:hi:o:ps:vVE";
-static struct long_options l_opts[] = {{"destination", require_arg, 'd'},
- {"flag", require_arg, 'f'},
- {"help", no_arg, 'h'},
- {"input", require_arg, 'i'},
- {"output", require_arg, 'o'},
- {"parents", no_arg, 'p'},
- {"source", require_arg, 's'},
- {"verbose", no_arg, 'v'},
- {"version", no_arg, 'V'},
- {"enable-error-stack", no_arg, 'E'},
- {NULL, 0, '\0'}};
-char * fname_src = NULL;
-char * fname_dst = NULL;
-char * oname_src = NULL;
-char * oname_dst = NULL;
-char * str_flag = NULL;
+static const char * s_opts = "d:f:hi:o:ps:vVE";
+static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'},
+ {"flag", require_arg, 'f'},
+ {"help", no_arg, 'h'},
+ {"input", require_arg, 'i'},
+ {"output", require_arg, 'o'},
+ {"parents", no_arg, 'p'},
+ {"source", require_arg, 's'},
+ {"verbose", no_arg, 'v'},
+ {"version", no_arg, 'V'},
+ {"enable-error-stack", no_arg, 'E'},
+ {NULL, 0, '\0'}};
+char * fname_src = NULL;
+char * fname_dst = NULL;
+char * oname_src = NULL;
+char * oname_dst = NULL;
+char * str_flag = NULL;
/*-------------------------------------------------------------------------
* Function: leave
@@ -242,19 +242,19 @@ main(int argc, const char *argv[])
} /* end if */
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'd':
- oname_dst = HDstrdup(opt_arg);
+ oname_dst = HDstrdup(H5_optarg);
break;
case 'f':
/* validate flag */
- if (parse_flag(opt_arg, &flag) < 0) {
+ if (parse_flag(H5_optarg, &flag) < 0) {
usage();
leave(EXIT_FAILURE);
}
- str_flag = HDstrdup(opt_arg);
+ str_flag = HDstrdup(H5_optarg);
break;
case 'h':
@@ -263,11 +263,11 @@ main(int argc, const char *argv[])
break;
case 'i':
- fname_src = HDstrdup(opt_arg);
+ fname_src = HDstrdup(H5_optarg);
break;
case 'o':
- fname_dst = HDstrdup(opt_arg);
+ fname_dst = HDstrdup(H5_optarg);
break;
case 'p':
@@ -275,7 +275,7 @@ main(int argc, const char *argv[])
break;
case 's':
- oname_src = HDstrdup(opt_arg);
+ oname_src = HDstrdup(H5_optarg);
break;
case 'V':
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index 1b81824..b669087 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -25,30 +25,30 @@ static int check_d_input(const char *);
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "hVrv*qn:d:p:NcelxE:A: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'},
- {"use-system-epsilon", no_arg, 'e'},
- {"follow-symlinks", no_arg, 'l'},
- {"no-dangling-links", no_arg, 'x'},
- {"exclude-path", require_arg, 'E'},
- {"exclude-attribute", require_arg, 'A'},
- {"enable-error-stack", no_arg, 'S'},
- {"vol-value-1", require_arg, '1'},
- {"vol-name-1", require_arg, '2'},
- {"vol-info-1", require_arg, '3'},
- {"vol-value-2", require_arg, '4'},
- {"vol-name-2", require_arg, '5'},
- {"vol-info-2", require_arg, '6'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S";
+static struct h5_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'},
+ {"use-system-epsilon", no_arg, 'e'},
+ {"follow-symlinks", no_arg, 'l'},
+ {"no-dangling-links", no_arg, 'x'},
+ {"exclude-path", require_arg, 'E'},
+ {"exclude-attribute", require_arg, 'A'},
+ {"enable-error-stack", no_arg, 'S'},
+ {"vol-value-1", require_arg, '1'},
+ {"vol-name-1", require_arg, '2'},
+ {"vol-info-1", require_arg, '3'},
+ {"vol-value-2", require_arg, '4'},
+ {"vol-name-2", require_arg, '5'},
+ {"vol-info-2", require_arg, '6'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: check_options
@@ -232,7 +232,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
exclude_attr_head = NULL;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
default:
usage();
@@ -256,20 +256,20 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
* special check for short opt
*/
if (!strcmp(argv[i], "-v")) {
- if (opt_arg != NULL)
- opt_ind--;
+ if (H5_optarg != NULL)
+ H5_optind--;
opts->mode_verbose_level = 0;
break;
}
else if (!strncmp(argv[i], "-v", (size_t)2)) {
- if (opt_arg != NULL)
- opt_ind--;
+ if (H5_optarg != NULL)
+ H5_optind--;
opts->mode_verbose_level = atoi(&argv[i][2]);
break;
}
else {
- if (opt_arg != NULL)
- opts->mode_verbose_level = HDatoi(opt_arg);
+ if (H5_optarg != NULL)
+ opts->mode_verbose_level = HDatoi(H5_optarg);
else
opts->mode_verbose_level = 0;
}
@@ -308,7 +308,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
}
/* init */
- exclude_node->obj_path = opt_arg;
+ exclude_node->obj_path = H5_optarg;
exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN;
exclude_prev = exclude_head;
@@ -336,7 +336,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
}
/* init */
- exclude_attr_node->obj_path = opt_arg;
+ exclude_attr_node->obj_path = H5_optarg;
exclude_attr_node->obj_type = H5TRAV_TYPE_UNKNOWN;
exclude_attr_prev = exclude_attr_head;
@@ -356,23 +356,23 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
case 'd':
opts->delta_bool = 1;
- if (check_d_input(opt_arg) == -1) {
- HDprintf("<-d %s> is not a valid option\n", opt_arg);
+ if (check_d_input(H5_optarg) == -1) {
+ HDprintf("<-d %s> is not a valid option\n", H5_optarg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- opts->delta = HDatof(opt_arg);
+ opts->delta = HDatof(H5_optarg);
/* do not check against default, the DBL_EPSILON is being replaced by user */
break;
case 'p':
opts->percent_bool = 1;
- if (check_p_input(opt_arg) == -1) {
- HDprintf("<-p %s> is not a valid option\n", opt_arg);
+ if (check_p_input(H5_optarg) == -1) {
+ HDprintf("<-p %s> is not a valid option\n", H5_optarg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- opts->percent = HDatof(opt_arg);
+ opts->percent = HDatof(H5_optarg);
/* -p 0 is the same as default */
if (H5_DBL_ABS_EQUAL(opts->percent, 0.0))
@@ -381,12 +381,12 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
case 'n':
opts->count_bool = 1;
- if (check_n_input(opt_arg) == -1) {
- HDprintf("<-n %s> is not a valid option\n", opt_arg);
+ if (check_n_input(H5_optarg) == -1) {
+ HDprintf("<-n %s> is not a valid option\n", H5_optarg);
usage();
h5diff_exit(EXIT_FAILURE);
}
- opts->count = HDstrtoull(opt_arg, NULL, 0);
+ opts->count = HDstrtoull(H5_optarg, NULL, 0);
break;
case 'N':
@@ -403,34 +403,34 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
case '1':
opts->vol_info[0].type = VOL_BY_VALUE;
- opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
opts->custom_vol[0] = TRUE;
break;
case '2':
opts->vol_info[0].type = VOL_BY_NAME;
- opts->vol_info[0].u.name = opt_arg;
+ opts->vol_info[0].u.name = H5_optarg;
opts->custom_vol[0] = TRUE;
break;
case '3':
- opts->vol_info[0].info_string = opt_arg;
+ opts->vol_info[0].info_string = H5_optarg;
break;
case '4':
opts->vol_info[1].type = VOL_BY_VALUE;
- opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
opts->custom_vol[1] = TRUE;
break;
case '5':
opts->vol_info[1].type = VOL_BY_NAME;
- opts->vol_info[1].u.name = opt_arg;
+ opts->vol_info[1].u.name = H5_optarg;
opts->custom_vol[1] = TRUE;
break;
case '6':
- opts->vol_info[1].info_string = opt_arg;
+ opts->vol_info[1].info_string = H5_optarg;
break;
}
}
@@ -447,15 +447,15 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
opts->exclude_attr = exclude_attr_head;
/* check for file names to be processed */
- if (argc <= opt_ind || argv[opt_ind + 1] == NULL) {
+ if (argc <= H5_optind || argv[H5_optind + 1] == NULL) {
error_msg("missing file names\n");
usage();
h5diff_exit(EXIT_FAILURE);
}
- *fname1 = argv[opt_ind];
- *fname2 = argv[opt_ind + 1];
- *objname1 = argv[opt_ind + 2];
+ *fname1 = argv[H5_optind];
+ *fname2 = argv[H5_optind + 1];
+ *objname1 = argv[H5_optind + 2];
H5TOOLS_DEBUG("file1 = %s", *fname1);
H5TOOLS_DEBUG("file2 = %s", *fname2);
@@ -466,8 +466,8 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
}
H5TOOLS_DEBUG("objname1 = %s", *objname1);
- if (argv[opt_ind + 3] != NULL) {
- *objname2 = argv[opt_ind + 3];
+ if (argv[H5_optind + 3] != NULL) {
+ *objname2 = argv[H5_optind + 3];
}
else {
*objname2 = *objname1;
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index 9f526da..70f03df 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -80,132 +80,132 @@ struct handler_t {
*/
/* The following initialization makes use of C language concatenating */
/* "xxx" "yyy" into "xxxyyy". */
-static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:";
-static struct long_options l_opts[] = {{"attribute", require_arg, 'a'},
- {"attribut", require_arg, 'a'},
- {"attribu", require_arg, 'a'},
- {"attrib", require_arg, 'a'},
- {"attri", require_arg, 'a'},
- {"attr", require_arg, 'a'},
- {"att", require_arg, 'a'},
- {"at", require_arg, 'a'},
- {"binary", optional_arg, 'b'},
- {"count", require_arg, 'c'},
- {"coun", require_arg, 'c'},
- {"cou", require_arg, 'c'},
- {"co", require_arg, 'c'},
- {"dataset", require_arg, 'd'},
- {"datase", require_arg, 'd'},
- {"datas", require_arg, 'd'},
- {"escape", no_arg, 'e'},
- {"filedriver", require_arg, 'f'},
- {"filedrive", require_arg, 'f'},
- {"filedriv", require_arg, 'f'},
- {"filedri", require_arg, 'f'},
- {"filedr", require_arg, 'f'},
- {"filed", require_arg, 'f'},
- {"file", require_arg, 'f'},
- {"fil", require_arg, 'f'},
- {"fi", require_arg, 'f'},
- {"group", require_arg, 'g'},
- {"grou", require_arg, 'g'},
- {"gro", require_arg, 'g'},
- {"gr", require_arg, 'g'},
- {"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"object-ids", no_arg, 'i'},
- {"object-id", no_arg, 'i'},
- {"object-i", no_arg, 'i'},
- {"object", no_arg, 'i'},
- {"objec", no_arg, 'i'},
- {"obje", no_arg, 'i'},
- {"obj", no_arg, 'i'},
- {"ob", no_arg, 'i'},
- {"block", require_arg, 'k'},
- {"bloc", require_arg, 'k'},
- {"blo", require_arg, 'k'},
- {"bl", require_arg, 'k'},
- {"soft-link", require_arg, 'l'},
- {"soft-lin", require_arg, 'l'},
- {"soft-li", require_arg, 'l'},
- {"soft-l", require_arg, 'l'},
- {"soft", require_arg, 'l'},
- {"sof", require_arg, 'l'},
- {"format", require_arg, 'm'},
- {"contents", optional_arg, 'n'},
- {"output", optional_arg, 'o'},
- {"outpu", optional_arg, 'o'},
- {"outp", optional_arg, 'o'},
- {"out", optional_arg, 'o'},
- {"ou", optional_arg, 'o'},
- {"properties", no_arg, 'p'},
- {"sort_by", require_arg, 'q'},
- {"string", no_arg, 'r'},
- {"strin", no_arg, 'r'},
- {"start", require_arg, 's'},
- {"star", require_arg, 's'},
- {"sta", require_arg, 's'},
- {"datatype", require_arg, 't'},
- {"datatyp", require_arg, 't'},
- {"dataty", require_arg, 't'},
- {"datat", require_arg, 't'},
- {"use-dtd", no_arg, 'u'},
- {"use-dt", no_arg, 'u'},
- {"use-d", no_arg, 'u'},
- {"use-", no_arg, 'u'},
- {"use", no_arg, 'u'},
- {"us", no_arg, 'u'},
- {"u", no_arg, 'u'},
- {"vds-view-first-missing", no_arg, 'v'},
- {"width", require_arg, 'w'},
- {"widt", require_arg, 'w'},
- {"wid", require_arg, 'w'},
- {"wi", require_arg, 'w'},
- {"xml", no_arg, 'x'},
- {"xm", no_arg, 'x'},
- {"noindex", no_arg, 'y'},
- {"sort_order", require_arg, 'z'},
- {"onlyattr", optional_arg, 'A'},
- {"superblock", no_arg, 'B'},
- {"boot-block", no_arg, 'B'},
- {"boot-bloc", no_arg, 'B'},
- {"boot-blo", no_arg, 'B'},
- {"boot-bl", no_arg, 'B'},
- {"boot-b", no_arg, 'B'},
- {"boot", no_arg, 'B'},
- {"boo", no_arg, 'B'},
- {"bo", no_arg, 'B'},
- {"no-compact-subset", no_arg, 'C'},
- {"xml-dtd", require_arg, 'D'},
- {"xml-dt", require_arg, 'D'},
- {"xml-d", require_arg, 'D'},
- {"enable-error-stack", optional_arg, 'E'},
- {"form", require_arg, 'F'},
- {"vds-gap-size", require_arg, 'G'},
- {"header", no_arg, 'H'},
- {"heade", no_arg, 'H'},
- {"head", no_arg, 'H'},
- {"hea", no_arg, 'H'},
- {"packed-bits", require_arg, 'M'},
- {"any_path", require_arg, 'N'},
- {"ddl", optional_arg, 'O'},
- {"region", no_arg, 'R'},
- {"stride", require_arg, 'S'},
- {"strid", require_arg, 'S'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"ver", no_arg, 'V'},
- {"ve", no_arg, 'V'},
- {"xml-ns", require_arg, 'X'},
- {"xml-n", require_arg, 'X'},
- {"s3-cred", require_arg, '$'},
- {"hdfs-attrs", require_arg, '#'},
- {"vol-value", require_arg, '1'},
- {"vol-name", require_arg, '2'},
- {"vol-info", require_arg, '3'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:";
+static struct h5_long_options l_opts[] = {{"attribute", require_arg, 'a'},
+ {"attribut", require_arg, 'a'},
+ {"attribu", require_arg, 'a'},
+ {"attrib", require_arg, 'a'},
+ {"attri", require_arg, 'a'},
+ {"attr", require_arg, 'a'},
+ {"att", require_arg, 'a'},
+ {"at", require_arg, 'a'},
+ {"binary", optional_arg, 'b'},
+ {"count", require_arg, 'c'},
+ {"coun", require_arg, 'c'},
+ {"cou", require_arg, 'c'},
+ {"co", require_arg, 'c'},
+ {"dataset", require_arg, 'd'},
+ {"datase", require_arg, 'd'},
+ {"datas", require_arg, 'd'},
+ {"escape", no_arg, 'e'},
+ {"filedriver", require_arg, 'f'},
+ {"filedrive", require_arg, 'f'},
+ {"filedriv", require_arg, 'f'},
+ {"filedri", require_arg, 'f'},
+ {"filedr", require_arg, 'f'},
+ {"filed", require_arg, 'f'},
+ {"file", require_arg, 'f'},
+ {"fil", require_arg, 'f'},
+ {"fi", require_arg, 'f'},
+ {"group", require_arg, 'g'},
+ {"grou", require_arg, 'g'},
+ {"gro", require_arg, 'g'},
+ {"gr", require_arg, 'g'},
+ {"help", no_arg, 'h'},
+ {"hel", no_arg, 'h'},
+ {"object-ids", no_arg, 'i'},
+ {"object-id", no_arg, 'i'},
+ {"object-i", no_arg, 'i'},
+ {"object", no_arg, 'i'},
+ {"objec", no_arg, 'i'},
+ {"obje", no_arg, 'i'},
+ {"obj", no_arg, 'i'},
+ {"ob", no_arg, 'i'},
+ {"block", require_arg, 'k'},
+ {"bloc", require_arg, 'k'},
+ {"blo", require_arg, 'k'},
+ {"bl", require_arg, 'k'},
+ {"soft-link", require_arg, 'l'},
+ {"soft-lin", require_arg, 'l'},
+ {"soft-li", require_arg, 'l'},
+ {"soft-l", require_arg, 'l'},
+ {"soft", require_arg, 'l'},
+ {"sof", require_arg, 'l'},
+ {"format", require_arg, 'm'},
+ {"contents", optional_arg, 'n'},
+ {"output", optional_arg, 'o'},
+ {"outpu", optional_arg, 'o'},
+ {"outp", optional_arg, 'o'},
+ {"out", optional_arg, 'o'},
+ {"ou", optional_arg, 'o'},
+ {"properties", no_arg, 'p'},
+ {"sort_by", require_arg, 'q'},
+ {"string", no_arg, 'r'},
+ {"strin", no_arg, 'r'},
+ {"start", require_arg, 's'},
+ {"star", require_arg, 's'},
+ {"sta", require_arg, 's'},
+ {"datatype", require_arg, 't'},
+ {"datatyp", require_arg, 't'},
+ {"dataty", require_arg, 't'},
+ {"datat", require_arg, 't'},
+ {"use-dtd", no_arg, 'u'},
+ {"use-dt", no_arg, 'u'},
+ {"use-d", no_arg, 'u'},
+ {"use-", no_arg, 'u'},
+ {"use", no_arg, 'u'},
+ {"us", no_arg, 'u'},
+ {"u", no_arg, 'u'},
+ {"vds-view-first-missing", no_arg, 'v'},
+ {"width", require_arg, 'w'},
+ {"widt", require_arg, 'w'},
+ {"wid", require_arg, 'w'},
+ {"wi", require_arg, 'w'},
+ {"xml", no_arg, 'x'},
+ {"xm", no_arg, 'x'},
+ {"noindex", no_arg, 'y'},
+ {"sort_order", require_arg, 'z'},
+ {"onlyattr", optional_arg, 'A'},
+ {"superblock", no_arg, 'B'},
+ {"boot-block", no_arg, 'B'},
+ {"boot-bloc", no_arg, 'B'},
+ {"boot-blo", no_arg, 'B'},
+ {"boot-bl", no_arg, 'B'},
+ {"boot-b", no_arg, 'B'},
+ {"boot", no_arg, 'B'},
+ {"boo", no_arg, 'B'},
+ {"bo", no_arg, 'B'},
+ {"no-compact-subset", no_arg, 'C'},
+ {"xml-dtd", require_arg, 'D'},
+ {"xml-dt", require_arg, 'D'},
+ {"xml-d", require_arg, 'D'},
+ {"enable-error-stack", optional_arg, 'E'},
+ {"form", require_arg, 'F'},
+ {"vds-gap-size", require_arg, 'G'},
+ {"header", no_arg, 'H'},
+ {"heade", no_arg, 'H'},
+ {"head", no_arg, 'H'},
+ {"hea", no_arg, 'H'},
+ {"packed-bits", require_arg, 'M'},
+ {"any_path", require_arg, 'N'},
+ {"ddl", optional_arg, 'O'},
+ {"region", no_arg, 'R'},
+ {"stride", require_arg, 'S'},
+ {"strid", require_arg, 'S'},
+ {"version", no_arg, 'V'},
+ {"versio", no_arg, 'V'},
+ {"versi", no_arg, 'V'},
+ {"vers", no_arg, 'V'},
+ {"ver", no_arg, 'V'},
+ {"ve", no_arg, 'V'},
+ {"xml-ns", require_arg, 'X'},
+ {"xml-n", require_arg, 'X'},
+ {"s3-cred", require_arg, '$'},
+ {"hdfs-attrs", require_arg, '#'},
+ {"vol-value", require_arg, '1'},
+ {"vol-name", require_arg, '2'},
+ {"vol-info", require_arg, '3'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: leave
@@ -917,7 +917,7 @@ parse_command_line(int argc, const char *argv[])
}
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
parse_start:
switch ((char)opt) {
case 'R':
@@ -931,8 +931,8 @@ parse_start:
case 'n':
dump_opts.display_fi = TRUE;
last_was_dset = FALSE;
- if (opt_arg != NULL)
- h5trav_set_verbose(HDatoi(opt_arg));
+ if (H5_optarg != NULL)
+ h5trav_set_verbose(HDatoi(H5_optarg));
break;
case 'p':
dump_opts.display_dcpl = TRUE;
@@ -949,8 +949,8 @@ parse_start:
last_was_dset = FALSE;
break;
case 'A':
- if (opt_arg != NULL) {
- if (0 == HDatoi(opt_arg))
+ if (H5_optarg != NULL) {
+ if (0 == HDatoi(H5_optarg))
dump_opts.include_attrs = FALSE;
}
else {
@@ -974,7 +974,7 @@ parse_start:
goto done;
break;
case 'w': {
- int sh5tools_nCols = HDatoi(opt_arg);
+ int sh5tools_nCols = HDatoi(H5_optarg);
if (sh5tools_nCols <= 0)
h5tools_nCols = 65535;
@@ -988,7 +988,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_paths;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1000,7 +1000,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_attributes;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1012,7 +1012,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_datasets;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
hand[i].subset_info = parse_subset_params(hand[i].obj);
last_dset = &hand[i];
break;
@@ -1021,7 +1021,7 @@ parse_start:
last_was_dset = TRUE;
break;
case 'f':
- driver_name_g = opt_arg;
+ driver_name_g = H5_optarg;
break;
case 'g':
dump_opts.display_all = 0;
@@ -1029,7 +1029,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_groups;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1041,7 +1041,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_links;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1053,7 +1053,7 @@ parse_start:
for (i = 0; i < argc; i++)
if (!hand[i].func) {
hand[i].func = handle_datatypes;
- hand[i].obj = HDstrdup(opt_arg);
+ hand[i].obj = HDstrdup(H5_optarg);
break;
}
@@ -1061,7 +1061,7 @@ parse_start:
break;
case 'O':
- if (h5tools_set_output_file(opt_arg, 0) < 0) {
+ if (h5tools_set_output_file(H5_optarg, 0) < 0) {
usage(h5tools_getprogname());
goto error;
}
@@ -1069,20 +1069,20 @@ parse_start:
case 'o':
if (bin_output) {
- if (h5tools_set_data_output_file(opt_arg, 1) < 0) {
+ if (h5tools_set_data_output_file(H5_optarg, 1) < 0) {
usage(h5tools_getprogname());
goto error;
}
}
else {
if (dump_opts.display_attr_data && !dump_opts.display_data) {
- if (h5tools_set_attr_output_file(opt_arg, 0) < 0) {
+ if (h5tools_set_attr_output_file(H5_optarg, 0) < 0) {
usage(h5tools_getprogname());
goto error;
}
}
if (dump_opts.display_data || dump_opts.display_all) {
- if (h5tools_set_data_output_file(opt_arg, 0) < 0) {
+ if (h5tools_set_data_output_file(H5_optarg, 0) < 0) {
usage(h5tools_getprogname());
goto error;
}
@@ -1091,12 +1091,12 @@ parse_start:
dump_opts.usingdasho = TRUE;
last_was_dset = FALSE;
- outfname_g = opt_arg;
+ outfname_g = H5_optarg;
break;
case 'b':
- if (opt_arg != NULL) {
- if ((bin_form = set_binary_form(opt_arg)) < 0) {
+ if (H5_optarg != NULL) {
+ if ((bin_form = set_binary_form(H5_optarg)) < 0) {
/* failed to set binary form */
usage(h5tools_getprogname());
goto error;
@@ -1115,7 +1115,7 @@ parse_start:
break;
case 'q':
- if ((sort_by = set_sort_by(opt_arg)) < 0) {
+ if ((sort_by = set_sort_by(H5_optarg)) < 0) {
/* failed to set "sort by" form */
usage(h5tools_getprogname());
goto error;
@@ -1123,7 +1123,7 @@ parse_start:
break;
case 'z':
- if ((sort_order = set_sort_order(opt_arg)) < 0) {
+ if ((sort_order = set_sort_order(H5_optarg)) < 0) {
/* failed to set "sort order" form */
usage(h5tools_getprogname());
goto error;
@@ -1135,7 +1135,7 @@ parse_start:
error_msg("option \"-%c\" can only be used after --dataset option\n", opt);
goto error;
}
- if (parse_mask_list(opt_arg) != SUCCEED) {
+ if (parse_mask_list(H5_optarg) != SUCCEED) {
usage(h5tools_getprogname());
goto error;
}
@@ -1145,7 +1145,7 @@ parse_start:
dump_opts.display_vds_first = TRUE;
break;
case 'G':
- dump_opts.vds_gap_size = HDatoi(opt_arg);
+ dump_opts.vds_gap_size = HDatoi(H5_optarg);
if (dump_opts.vds_gap_size < 0) {
usage(h5tools_getprogname());
goto error;
@@ -1172,13 +1172,13 @@ parse_start:
case 'D':
/* specify alternative XML DTD or schema */
/* To Do: check format of this value? */
- xml_dtd_uri_g = opt_arg;
+ xml_dtd_uri_g = H5_optarg;
h5tools_nCols = 0;
break;
case 'm':
/* specify alternative floating point printing format */
- fp_format = opt_arg;
+ fp_format = H5_optarg;
h5tools_nCols = 0;
break;
@@ -1189,10 +1189,10 @@ parse_start:
usage(h5tools_getprogname());
goto error;
}
- if (HDstrcmp(opt_arg, ":") == 0)
+ if (HDstrcmp(H5_optarg, ":") == 0)
xmlnsprefix = "";
else
- xmlnsprefix = opt_arg;
+ xmlnsprefix = H5_optarg;
h5tools_nCols = 0;
break;
/** end XML parameters **/
@@ -1238,33 +1238,33 @@ parse_start:
HDfree(s->start.data);
s->start.data = NULL;
}
- parse_hsize_list(opt_arg, &s->start);
+ parse_hsize_list(H5_optarg, &s->start);
break;
case 'S':
if (s->stride.data) {
HDfree(s->stride.data);
s->stride.data = NULL;
}
- parse_hsize_list(opt_arg, &s->stride);
+ parse_hsize_list(H5_optarg, &s->stride);
break;
case 'c':
if (s->count.data) {
HDfree(s->count.data);
s->count.data = NULL;
}
- parse_hsize_list(opt_arg, &s->count);
+ parse_hsize_list(H5_optarg, &s->count);
break;
case 'k':
if (s->block.data) {
HDfree(s->block.data);
s->block.data = NULL;
}
- parse_hsize_list(opt_arg, &s->block);
+ parse_hsize_list(H5_optarg, &s->block);
break;
default:
goto end_collect;
}
- } while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF);
+ } while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF);
end_collect:
last_was_dset = FALSE;
@@ -1277,8 +1277,8 @@ end_collect:
/** end subsetting parameters **/
case 'E':
- if (opt_arg != NULL)
- enable_error_stack = HDatoi(opt_arg);
+ if (H5_optarg != NULL)
+ enable_error_stack = HDatoi(H5_optarg);
else
enable_error_stack = 1;
break;
@@ -1294,7 +1294,7 @@ end_collect:
case '$':
#ifdef H5_HAVE_ROS3_VFD
- if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa_g) < 0) {
+ if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa_g) < 0) {
error_msg("failed to parse S3 VFD credential info\n");
usage(h5tools_getprogname());
free_handler(hand, argc);
@@ -1311,7 +1311,7 @@ end_collect:
case '#':
#ifdef H5_HAVE_LIBHDFS
- if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa_g) < 0) {
+ if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa_g) < 0) {
error_msg("failed to parse HDFS VFD configuration info\n");
usage(h5tools_getprogname());
free_handler(hand, argc);
@@ -1328,18 +1328,18 @@ end_collect:
case '1':
vol_info_g.type = VOL_BY_VALUE;
- vol_info_g.u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ vol_info_g.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
use_custom_vol_g = TRUE;
break;
case '2':
vol_info_g.type = VOL_BY_NAME;
- vol_info_g.u.name = opt_arg;
+ vol_info_g.u.name = H5_optarg;
use_custom_vol_g = TRUE;
break;
case '3':
- vol_info_g.info_string = opt_arg;
+ vol_info_g.info_string = H5_optarg;
break;
case '?':
@@ -1351,7 +1351,7 @@ end_collect:
parse_end:
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
goto error;
@@ -1443,7 +1443,7 @@ main(int argc, const char *argv[])
}
}
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
@@ -1496,8 +1496,8 @@ main(int argc, const char *argv[])
}
}
- while (opt_ind < argc) {
- fname = HDstrdup(argv[opt_ind++]);
+ while (H5_optind < argc) {
+ fname = HDstrdup(argv[H5_optind++]);
fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0);
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c
index 321f274..3430c55 100644
--- a/tools/src/h5format_convert/h5format_convert.c
+++ b/tools/src/h5format_convert/h5format_convert.c
@@ -38,28 +38,28 @@ static int verbose_g = 0;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-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'},
- {"version", 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'},
- {"verb", no_arg, 'v'},
- {"dname", require_arg, 'd'},
- {"dnam", require_arg, 'd'},
- {"dna", require_arg, 'd'},
- {"dn", require_arg, 'd'},
- {"noop", no_arg, 'n'},
- {"noo", no_arg, 'n'},
- {"no", no_arg, 'n'},
- {"enable-error-stack", no_arg, 'E'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "hVvd:n";
+static struct h5_long_options l_opts[] = {{"help", 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'},
+ {"verbose", no_arg, 'v'},
+ {"verbos", no_arg, 'v'},
+ {"verbo", no_arg, 'v'},
+ {"verb", no_arg, 'v'},
+ {"dname", require_arg, 'd'},
+ {"dnam", require_arg, 'd'},
+ {"dna", require_arg, 'd'},
+ {"dn", require_arg, 'd'},
+ {"noop", no_arg, 'n'},
+ {"noo", no_arg, 'n'},
+ {"no", no_arg, 'n'},
+ {"enable-error-stack", no_arg, 'E'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -123,7 +123,7 @@ parse_command_line(int argc, const char **argv)
}
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -140,11 +140,11 @@ parse_command_line(int argc, const char **argv)
break;
case 'd': /* -d dname */
- if (opt_arg != NULL && *opt_arg)
- dname_g = HDstrdup(opt_arg);
+ if (H5_optarg != NULL && *H5_optarg)
+ dname_g = HDstrdup(H5_optarg);
if (dname_g == NULL) {
h5tools_setstatus(EXIT_FAILURE);
- error_msg("No dataset name\n", opt_arg);
+ error_msg("No dataset name\n", H5_optarg);
usage(h5tools_getprogname());
goto error;
}
@@ -167,19 +167,19 @@ parse_command_line(int argc, const char **argv)
} /* switch */
} /* while */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
goto error;
}
- fname_g = HDstrdup(argv[opt_ind]);
+ fname_g = HDstrdup(argv[H5_optind]);
- return (0);
+ return 0;
error:
- return (-1);
+ return -1;
;
} /* parse_command_line() */
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 2a65591..04e1c35 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -489,7 +489,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 0: /* TEXTIN */
in08 = (H5DT_INT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (fscanf(strm, "%hd", &temp16) != 1) {
+ if (HDfscanf(strm, "%hd", &temp16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -521,7 +521,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in16++) {
- if (fscanf(strm, "%hd", in16) != 1) {
+ if (HDfscanf(strm, "%hd", in16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -558,7 +558,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in32++) {
- if (fscanf(strm, "%d", in32) != 1) {
+ if (HDfscanf(strm, "%d", in32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -595,7 +595,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in64++) {
- if (fscanf(strm, "%s", buffer) < 1) {
+ if (HDfscanf(strm, "%s", buffer) < 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -664,7 +664,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 6: /* TEXTUIN */
in08 = (H5DT_UINT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (fscanf(strm, "%hu", &temp16) != 1) {
+ if (HDfscanf(strm, "%hu", &temp16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -693,7 +693,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in16++) {
- if (fscanf(strm, "%hu", in16) != 1) {
+ if (HDfscanf(strm, "%hu", in16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -729,7 +729,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in32++) {
- if (fscanf(strm, "%u", in32) != 1) {
+ if (HDfscanf(strm, "%u", in32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -766,7 +766,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in64++) {
- if (fscanf(strm, "%s", buffer) < 1) {
+ if (HDfscanf(strm, "%s", buffer) < 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -832,7 +832,7 @@ readFloatData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp32++) {
- if (fscanf(strm, "%f", fp32) != 1) {
+ if (HDfscanf(strm, "%f", fp32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -845,7 +845,7 @@ readFloatData(FILE *strm, struct Input *in)
case 2: /*TEXTFPE */
for (i = 0; i < len; i++, fp32++) {
- if (fscanf(strm, "%f", fp32) != 1) {
+ if (HDfscanf(strm, "%f", fp32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -884,7 +884,7 @@ readFloatData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp64++) {
- if (fscanf(strm, "%lf", fp64) != 1) {
+ if (HDfscanf(strm, "%lf", fp64) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -897,7 +897,7 @@ readFloatData(FILE *strm, struct Input *in)
case 2: /*TEXTFPE */
for (i = 0; i < len; i++, fp64++) {
- if (fscanf(strm, "%lf", fp64) != 1) {
+ if (HDfscanf(strm, "%lf", fp64) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1469,16 +1469,16 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
if ((scanret == 1) && !HDstrcmp("HDF5", key)) {
#ifdef H5DEBUGIMPORT
int pndx;
HDprintf("\nh5dump file\n");
#endif
in->h5dumpInput = 1;
- scanret = fscanf(strm, "%254s", temp); /* filename */
- scanret = fscanf(strm, "%254s", temp); /* start bracket */
- scanret = fscanf(strm, "%254s", key); /* DATASET */
+ scanret = HDfscanf(strm, "%254s", temp); /* filename */
+ scanret = HDfscanf(strm, "%254s", temp); /* start bracket */
+ scanret = HDfscanf(strm, "%254s", key); /* DATASET */
while (scanret == 1) {
if (!HDstrcmp("DATASET", key)) { /* PATH */
#ifdef H5DEBUGIMPORT
@@ -1488,7 +1488,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err3a, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1500,7 +1500,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
in->configOptionVector[PATH] = 1;
- scanret = fscanf(strm, "%254s", temp); /* start bracket */
+ scanret = HDfscanf(strm, "%254s", temp); /* start bracket */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASET %s found\n", temp);
#endif
@@ -1514,7 +1514,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1550,20 +1550,20 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* string properties */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* string properties */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
while (get_next_prop) {
if (!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1582,8 +1582,8 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
}
}
- else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */
- if (fscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
+ else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1591,8 +1591,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
#endif
}
- else if (!HDstrcmp("CSET", key)) { /* CSET */
- if (fscanf(strm, "%254s", temp) != 1) { /* CSET type */
+ else if (!HDstrcmp("CSET", key)) { /* CSET */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CSET type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1600,8 +1600,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp);
#endif
}
- else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */
- if (fscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
+ else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1609,7 +1609,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
#endif
} /* if(!HDstrcmp("CSET", key)) */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1628,7 +1628,7 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1644,14 +1644,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1662,7 +1662,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1672,7 +1672,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1716,7 +1716,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5b, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1728,7 +1728,7 @@ processConfigurationFile(char *infile, struct Input *in)
(hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) {
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1742,7 +1742,7 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE process max dim values\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1762,7 +1762,7 @@ processConfigurationFile(char *infile, struct Input *in)
char *more = temp;
in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10);
}
- if (fscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1793,7 +1793,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
- scanret = fscanf(strm, "%254s", temp); /* end bracket */
+ scanret = HDfscanf(strm, "%254s", temp); /* end bracket */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
@@ -1808,14 +1808,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump STORAGE_LAYOUT key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1827,7 +1827,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, "Unable to allocate dynamic memory.\n");
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1838,7 +1838,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1848,7 +1848,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1880,7 +1880,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5b, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* SIZE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* SIZE */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1888,7 +1888,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if (!HDstrcmp("SIZE", temp)) { /* SIZE */
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1897,7 +1897,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
}
while (HDstrcmp("}", temp) != 0) {
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1912,14 +1912,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1930,28 +1930,28 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* LEVEL */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* LEVEL */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1959,7 +1959,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
#endif
in->compressionParam = ival;
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1981,7 +1981,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
in->configOptionVector[COMPRESS] = 0;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1995,14 +1995,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump SUBSET key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err20, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump SUBSET %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2012,7 +2012,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_prop) {
if (!HDstrcmp("COUNT", temp)) { /* COUNT */
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2023,7 +2023,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -2033,7 +2033,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2068,7 +2068,7 @@ processConfigurationFile(char *infile, struct Input *in)
} /* if(!HDstrcmp("COUNT", temp)) COUNT */
if (!HDstrcmp("BLOCK", temp)) { /* BLOCK */
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2079,7 +2079,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -2089,7 +2089,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2122,7 +2122,7 @@ processConfigurationFile(char *infile, struct Input *in)
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
} /* if(!HDstrcmp("BLOCK", temp)) BLOCK */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2141,7 +2141,7 @@ processConfigurationFile(char *infile, struct Input *in)
scanret = 0;
break;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump path");
@@ -2182,7 +2182,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err3a, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2199,7 +2199,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2226,7 +2226,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5a, infile);
goto error;
}
- if (fscanf(strm, "%254d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%254d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -2423,7 +2423,7 @@ processConfigurationFile(char *infile, struct Input *in)
default:
break;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
}
/*
@@ -2602,7 +2602,7 @@ getOutputClass(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output class.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -2637,7 +2637,7 @@ getOutputSize(struct Input *in, FILE *strm)
const char *err1 = "Unable to get integer value.\n";
const char *err2 = "Invalid value for output size.\n";
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3502,7 +3502,7 @@ getInputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for input byte-order.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3524,7 +3524,7 @@ getRank(struct Input *in, FILE *strm)
const char *err1 = "Unable to get integer value.\n";
const char *err2 = "Invalid value for rank.\n";
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3553,7 +3553,7 @@ getDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%llu", (&ullval)) == 1)
+ while (HDfscanf(strm, "%llu", (&ullval)) == 1)
in->sizeOfDimension[i++] = ullval;
if (in->rank != i) {
@@ -3579,7 +3579,7 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%llu", (&ullval)) == 1)
+ while (HDfscanf(strm, "%llu", (&ullval)) == 1)
in->sizeOfChunk[i++] = ullval;
if (in->rank != i) {
@@ -3612,7 +3612,7 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%lld", (&llval)) == 1) {
+ while (HDfscanf(strm, "%lld", (&llval)) == 1) {
if (llval == -1)
in->maxsizeOfDimension[i++] = H5S_UNLIMITED;
else
@@ -3642,7 +3642,7 @@ getOutputArchitecture(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output architecture.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3675,7 +3675,7 @@ getOutputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output byte-order.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3708,7 +3708,7 @@ getCompressionType(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for compression.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3750,7 +3750,7 @@ getCompressionParameter(struct Input *in, FILE *strm)
switch (in->compressionType) {
case 0: /* GZIP */
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3774,7 +3774,7 @@ getExternalFilename(struct Input *in, FILE *strm)
char temp[255];
const char *err1 = "Unable to get 'string' value.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 5bcbf45..0a2ea5d 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -34,8 +34,8 @@ char *ub_file = NULL;
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char * s_opts = "hi:u:o:c:V"; /* add more later ? */
-static struct long_options l_opts[] = {
+static const char * s_opts = "hi:u:o:c:V"; /* add more later ? */
+static struct h5_long_options l_opts[] = {
{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */
{"u", require_arg, 'u'}, /* user block file */
{"o", require_arg, 'o'}, /* output file */
@@ -113,16 +113,16 @@ 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 = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'o':
- output_file = HDstrdup(opt_arg);
+ output_file = HDstrdup(H5_optarg);
break;
case 'i':
- input_file = HDstrdup(opt_arg);
+ input_file = HDstrdup(H5_optarg);
break;
case 'u':
- ub_file = HDstrdup(opt_arg);
+ ub_file = HDstrdup(H5_optarg);
break;
case 'c':
do_clobber = TRUE;
diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c
index cde7ec7..38d1a5e 100644
--- a/tools/src/h5jam/h5unjam.c
+++ b/tools/src/h5jam/h5unjam.c
@@ -35,8 +35,8 @@ char *ub_file = NULL;
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char * s_opts = "hu:i:o:d:V";
-static struct long_options l_opts[] = {
+static const char * s_opts = "hu:i:o:d:V";
+static struct h5_long_options l_opts[] = {
{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */
{"u", require_arg, 'u'}, /* user block file */
{"o", require_arg, 'o'}, /* output file */
@@ -101,23 +101,23 @@ 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 = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'o':
- output_file = HDstrdup(opt_arg);
+ output_file = HDstrdup(H5_optarg);
if (output_file)
h5tools_set_data_output_file(output_file, 1);
break;
case 'i':
- input_file = HDstrdup(opt_arg);
+ input_file = HDstrdup(H5_optarg);
if (input_file)
h5tools_set_input_file(input_file, 1);
break;
;
case 'u':
- ub_file = HDstrdup(opt_arg);
+ ub_file = HDstrdup(H5_optarg);
if (ub_file)
h5tools_set_output_file(ub_file, 1);
else
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index 1f1b821..3526268 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -31,44 +31,44 @@ const char *outfile = NULL;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:";
-static struct long_options l_opts[] = {{"alignment", require_arg, 'a'},
- {"block", require_arg, 'b'},
- {"compact", require_arg, 'c'},
- {"indexed", require_arg, 'd'},
- {"file", require_arg, 'e'},
- {"filter", require_arg, 'f'},
- {"help", no_arg, 'h'},
- {"infile", require_arg, 'i'}, /* for backward compability */
- {"low", require_arg, 'j'},
- {"high", require_arg, 'k'},
- {"layout", require_arg, 'l'},
- {"minimum", require_arg, 'm'},
- {"native", no_arg, 'n'},
- {"outfile", require_arg, 'o'}, /* for backward compability */
- {"sort_by", require_arg, 'q'},
- {"ssize", require_arg, 's'},
- {"threshold", require_arg, 't'},
- {"ublock", require_arg, 'u'},
- {"verbose", no_arg, 'v'},
- {"sort_order", require_arg, 'z'},
- {"enable-error-stack", no_arg, 'E'},
- {"fs_pagesize", require_arg, 'G'},
- {"latest", no_arg, 'L'},
- {"metadata_block_size", require_arg, 'M'},
- {"fs_persist", require_arg, 'P'},
- {"fs_strategy", require_arg, 'S'},
- {"fs_threshold", require_arg, 'T'},
- {"version", no_arg, 'V'},
- {"merge", no_arg, 'X'},
- {"prune", no_arg, 'W'},
- {"src-vol-value", require_arg, '1'},
- {"src-vol-name", require_arg, '2'},
- {"src-vol-info", require_arg, '3'},
- {"dst-vol-value", require_arg, '4'},
- {"dst-vol-name", require_arg, '5'},
- {"dst-vol-info", require_arg, '6'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:";
+static struct h5_long_options l_opts[] = {{"alignment", require_arg, 'a'},
+ {"block", require_arg, 'b'},
+ {"compact", require_arg, 'c'},
+ {"indexed", require_arg, 'd'},
+ {"file", require_arg, 'e'},
+ {"filter", require_arg, 'f'},
+ {"help", no_arg, 'h'},
+ {"infile", require_arg, 'i'}, /* for backward compability */
+ {"low", require_arg, 'j'},
+ {"high", require_arg, 'k'},
+ {"layout", require_arg, 'l'},
+ {"minimum", require_arg, 'm'},
+ {"native", no_arg, 'n'},
+ {"outfile", require_arg, 'o'}, /* for backward compability */
+ {"sort_by", require_arg, 'q'},
+ {"ssize", require_arg, 's'},
+ {"threshold", require_arg, 't'},
+ {"ublock", require_arg, 'u'},
+ {"verbose", no_arg, 'v'},
+ {"sort_order", require_arg, 'z'},
+ {"enable-error-stack", no_arg, 'E'},
+ {"fs_pagesize", require_arg, 'G'},
+ {"latest", no_arg, 'L'},
+ {"metadata_block_size", require_arg, 'M'},
+ {"fs_persist", require_arg, 'P'},
+ {"fs_strategy", require_arg, 'S'},
+ {"fs_threshold", require_arg, 'T'},
+ {"version", no_arg, 'V'},
+ {"merge", no_arg, 'X'},
+ {"prune", no_arg, 'W'},
+ {"src-vol-value", require_arg, '1'},
+ {"src-vol-name", require_arg, '2'},
+ {"src-vol-info", require_arg, '3'},
+ {"dst-vol-value", require_arg, '4'},
+ {"dst-vol-name", require_arg, '5'},
+ {"dst-vol-info", require_arg, '6'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -363,7 +363,7 @@ read_info(const char *filename, pack_opt_t *options)
/* cycle until end of file reached */
while (1) {
- if (EOF == fscanf(fp, "%9s", stype))
+ if (EOF == HDfscanf(fp, "%9s", stype))
break;
/* Info indicator must be for layout or filter */
@@ -378,7 +378,7 @@ read_info(const char *filename, pack_opt_t *options)
i = 0;
c = '0';
while (c != ' ') {
- if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -390,7 +390,7 @@ read_info(const char *filename, pack_opt_t *options)
c = '0';
/* go until end */
while (c != ' ') {
- if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -497,18 +497,18 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
HDmemset(&out_vol_info, 0, sizeof(h5tools_vol_info_t));
/* parse command line options */
- while (EOF != (opt = get_option(argc, argv, s_opts, l_opts))) {
+ while (EOF != (opt = H5_get_option(argc, argv, s_opts, l_opts))) {
switch ((char)opt) {
/* -i for backward compatibility */
case 'i':
- infile = opt_arg;
+ infile = H5_optarg;
has_i++;
break;
/* -o for backward compatibility */
case 'o':
- outfile = opt_arg;
+ outfile = H5_optarg;
has_o++;
break;
@@ -530,7 +530,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 'f':
/* parse the -f filter option */
- if (h5repack_addfilter(opt_arg, options) < 0) {
+ if (h5repack_addfilter(H5_optarg, options) < 0) {
error_msg("in parsing filter\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
@@ -540,7 +540,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 'l':
/* parse the -l layout option */
- if (h5repack_addlayout(opt_arg, options) < 0) {
+ if (h5repack_addlayout(H5_optarg, options) < 0) {
error_msg("in parsing layout\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
@@ -549,9 +549,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'm':
- options->min_comp = HDstrtoull(opt_arg, NULL, 0);
+ options->min_comp = HDstrtoull(H5_optarg, NULL, 0);
if ((int)options->min_comp <= 0) {
- error_msg("invalid minimum compress size <%s>\n", opt_arg);
+ error_msg("invalid minimum compress size <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -559,8 +559,8 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'e':
- if ((ret_value = read_info(opt_arg, options)) < 0) {
- error_msg("failed to read from repack options file <%s>\n", opt_arg);
+ if ((ret_value = read_info(H5_optarg, options)) < 0) {
+ error_msg("failed to read from repack options file <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -576,7 +576,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'j':
- bound = HDatoi(opt_arg);
+ bound = HDatoi(H5_optarg);
if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) {
error_msg("in parsing low bound\n");
h5tools_setstatus(EXIT_FAILURE);
@@ -587,7 +587,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'k':
- bound = HDatoi(opt_arg);
+ bound = HDatoi(H5_optarg);
if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) {
error_msg("in parsing high bound\n");
h5tools_setstatus(EXIT_FAILURE);
@@ -606,13 +606,13 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'c':
- options->grp_compact = HDatoi(opt_arg);
+ options->grp_compact = HDatoi(H5_optarg);
if (options->grp_compact > 0)
options->latest = TRUE; /* must use latest format */
break;
case 'd':
- options->grp_indexed = HDatoi(opt_arg);
+ options->grp_indexed = HDatoi(H5_optarg);
if (options->grp_indexed > 0)
options->latest = TRUE; /* must use latest format */
break;
@@ -620,10 +620,10 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 's': {
int idx = 0;
int ssize = 0;
- char *msgPtr = HDstrchr(opt_arg, ':');
+ char *msgPtr = HDstrchr(H5_optarg, ':');
options->latest = TRUE; /* must use latest format */
if (msgPtr == NULL) {
- ssize = HDatoi(opt_arg);
+ ssize = HDatoi(H5_optarg);
for (idx = 0; idx < 5; idx++)
options->msg_size[idx] = ssize;
}
@@ -632,7 +632,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
HDstrcpy(msgType, msgPtr + 1);
msgPtr[0] = '\0';
- ssize = HDatoi(opt_arg);
+ ssize = HDatoi(H5_optarg);
if (!HDstrncmp(msgType, "dspace", 6))
options->msg_size[0] = ssize;
else if (!HDstrncmp(msgType, "dtype", 5))
@@ -647,25 +647,25 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
} break;
case 'u':
- options->ublock_filename = opt_arg;
+ options->ublock_filename = H5_optarg;
break;
case 'b':
- options->ublock_size = (hsize_t)HDatol(opt_arg);
+ options->ublock_size = (hsize_t)HDatol(H5_optarg);
break;
case 'M':
- options->meta_block_size = (hsize_t)HDatol(opt_arg);
+ options->meta_block_size = (hsize_t)HDatol(H5_optarg);
break;
case 't':
- options->threshold = (hsize_t)HDatol(opt_arg);
+ options->threshold = (hsize_t)HDatol(H5_optarg);
break;
case 'a':
- options->alignment = HDstrtoull(opt_arg, NULL, 0);
+ options->alignment = HDstrtoull(H5_optarg, NULL, 0);
if (options->alignment < 1) {
- error_msg("invalid alignment size\n", opt_arg);
+ error_msg("invalid alignment size\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -675,7 +675,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 'S': {
char strategy[MAX_NC_NAME];
- HDstrcpy(strategy, opt_arg);
+ HDstrcpy(strategy, H5_optarg);
if (!HDstrcmp(strategy, "FSM_AGGR"))
options->fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR;
else if (!HDstrcmp(strategy, "PAGE"))
@@ -685,7 +685,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
else if (!HDstrcmp(strategy, "NONE"))
options->fs_strategy = H5F_FSPACE_STRATEGY_NONE;
else {
- error_msg("invalid file space management strategy\n", opt_arg);
+ error_msg("invalid file space management strategy\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -696,29 +696,29 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
} break;
case 'P':
- options->fs_persist = HDatoi(opt_arg);
+ options->fs_persist = HDatoi(H5_optarg);
if (options->fs_persist == 0)
/* To distinguish the "specified" zero value */
options->fs_persist = -1;
break;
case 'T':
- options->fs_threshold = HDatol(opt_arg);
+ options->fs_threshold = HDatol(H5_optarg);
if (options->fs_threshold == 0)
/* To distinguish the "specified" zero value */
options->fs_threshold = -1;
break;
case 'G':
- options->fs_pagesize = HDstrtoll(opt_arg, NULL, 0);
+ options->fs_pagesize = HDstrtoll(H5_optarg, NULL, 0);
if (options->fs_pagesize == 0)
/* To distinguish the "specified" zero value */
options->fs_pagesize = -1;
break;
case 'q':
- if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(opt_arg))) {
- error_msg("failed to set sort by form <%s>\n", opt_arg);
+ if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(H5_optarg))) {
+ error_msg("failed to set sort by form <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -726,8 +726,8 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'z':
- if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(opt_arg))) {
- error_msg("failed to set sort order form <%s>\n", opt_arg);
+ if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(H5_optarg))) {
+ error_msg("failed to set sort order form <%s>\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -740,34 +740,34 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case '1':
in_vol_info.type = VOL_BY_VALUE;
- in_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ in_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
custom_in_fapl = TRUE;
break;
case '2':
in_vol_info.type = VOL_BY_NAME;
- in_vol_info.u.name = opt_arg;
+ in_vol_info.u.name = H5_optarg;
custom_in_fapl = TRUE;
break;
case '3':
- in_vol_info.info_string = opt_arg;
+ in_vol_info.info_string = H5_optarg;
break;
case '4':
out_vol_info.type = VOL_BY_VALUE;
- out_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ out_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
custom_out_fapl = TRUE;
break;
case '5':
out_vol_info.type = VOL_BY_NAME;
- out_vol_info.u.name = opt_arg;
+ out_vol_info.u.name = H5_optarg;
custom_out_fapl = TRUE;
break;
case '6':
- out_vol_info.info_string = opt_arg;
+ out_vol_info.info_string = H5_optarg;
break;
default:
@@ -777,9 +777,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
/* If neither -i nor -o given, get in and out files positionally */
if (0 == (has_i + has_o)) {
- if (argv[opt_ind] != NULL && argv[opt_ind + 1] != NULL) {
- infile = argv[opt_ind];
- outfile = argv[opt_ind + 1];
+ if (argv[H5_optind] != NULL && argv[H5_optind + 1] != NULL) {
+ infile = argv[H5_optind];
+ outfile = argv[H5_optind + 1];
if (!HDstrcmp(infile, outfile)) {
error_msg("file names cannot be the same\n");
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index 61f3365..b884b7e 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -171,106 +171,106 @@ struct handler_t {
static const char *s_opts = "Aa:Ddm:EFfhGgl:sSTO:Vw:H:";
/* e.g. "filemetadata" has to precede "file"; "groupmetadata" has to precede "group" etc. */
-static struct long_options l_opts[] = {{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"filemetadata", no_arg, 'F'},
- {"filemetadat", no_arg, 'F'},
- {"filemetada", no_arg, 'F'},
- {"filemetad", no_arg, 'F'},
- {"filemeta", no_arg, 'F'},
- {"filemet", no_arg, 'F'},
- {"fileme", no_arg, 'F'},
- {"filem", no_arg, 'F'},
- {"file", no_arg, 'f'},
- {"fil", no_arg, 'f'},
- {"fi", no_arg, 'f'},
- {"groupmetadata", no_arg, 'G'},
- {"groupmetadat", no_arg, 'G'},
- {"groupmetada", no_arg, 'G'},
- {"groupmetad", no_arg, 'G'},
- {"groupmeta", no_arg, 'G'},
- {"groupmet", no_arg, 'G'},
- {"groupme", no_arg, 'G'},
- {"groupm", no_arg, 'G'},
- {"group", no_arg, 'g'},
- {"grou", no_arg, 'g'},
- {"gro", no_arg, 'g'},
- {"gr", no_arg, 'g'},
- {"links", require_arg, 'l'},
- {"link", require_arg, 'l'},
- {"lin", require_arg, 'l'},
- {"li", require_arg, 'l'},
- {"dsetmetadata", no_arg, 'D'},
- {"dsetmetadat", no_arg, 'D'},
- {"dsetmetada", no_arg, 'D'},
- {"dsetmetad", no_arg, 'D'},
- {"dsetmeta", no_arg, 'D'},
- {"dsetmet", no_arg, 'D'},
- {"dsetme", no_arg, 'D'},
- {"dsetm", no_arg, 'D'},
- {"dset", no_arg, 'd'},
- {"dse", no_arg, 'd'},
- {"ds", no_arg, 'd'},
- {"dims", require_arg, 'm'},
- {"dim", require_arg, 'm'},
- {"di", require_arg, 'm'},
- {"dtypemetadata", no_arg, 'T'},
- {"dtypemetadat", no_arg, 'T'},
- {"dtypemetada", no_arg, 'T'},
- {"dtypemetad", no_arg, 'T'},
- {"dtypemeta", no_arg, 'T'},
- {"dtypemet", no_arg, 'T'},
- {"dtypeme", no_arg, 'T'},
- {"dtypem", no_arg, 'T'},
- {"dtype", no_arg, 'T'},
- {"dtyp", no_arg, 'T'},
- {"dty", no_arg, 'T'},
- {"dt", no_arg, 'T'},
- {"object", require_arg, 'O'},
- {"objec", require_arg, 'O'},
- {"obje", require_arg, 'O'},
- {"obj", require_arg, 'O'},
- {"ob", require_arg, 'O'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"ver", no_arg, 'V'},
- {"ve", no_arg, 'V'},
- {"attribute", no_arg, 'A'},
- {"attribut", no_arg, 'A'},
- {"attribu", no_arg, 'A'},
- {"attrib", no_arg, 'A'},
- {"attri", no_arg, 'A'},
- {"attr", no_arg, 'A'},
- {"att", no_arg, 'A'},
- {"at", no_arg, 'A'},
- {"enable-error-stack", no_arg, 'E'},
- {"numattrs", require_arg, 'a'},
- {"numattr", require_arg, 'a'},
- {"numatt", require_arg, 'a'},
- {"numat", require_arg, 'a'},
- {"numa", require_arg, 'a'},
- {"num", require_arg, 'a'},
- {"nu", require_arg, 'a'},
- {"freespace", no_arg, 's'},
- {"freespac", no_arg, 's'},
- {"freespa", no_arg, 's'},
- {"freesp", no_arg, 's'},
- {"frees", no_arg, 's'},
- {"free", no_arg, 's'},
- {"fre", no_arg, 's'},
- {"fr", no_arg, 's'},
- {"summary", no_arg, 'S'},
- {"summar", no_arg, 'S'},
- {"summa", no_arg, 'S'},
- {"summ", no_arg, 'S'},
- {"sum", no_arg, 'S'},
- {"su", no_arg, 'S'},
- {"s3-cred", require_arg, 'w'},
- {"hdfs-attrs", require_arg, 'H'},
- {NULL, 0, '\0'}};
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
+ {"hel", no_arg, 'h'},
+ {"he", no_arg, 'h'},
+ {"filemetadata", no_arg, 'F'},
+ {"filemetadat", no_arg, 'F'},
+ {"filemetada", no_arg, 'F'},
+ {"filemetad", no_arg, 'F'},
+ {"filemeta", no_arg, 'F'},
+ {"filemet", no_arg, 'F'},
+ {"fileme", no_arg, 'F'},
+ {"filem", no_arg, 'F'},
+ {"file", no_arg, 'f'},
+ {"fil", no_arg, 'f'},
+ {"fi", no_arg, 'f'},
+ {"groupmetadata", no_arg, 'G'},
+ {"groupmetadat", no_arg, 'G'},
+ {"groupmetada", no_arg, 'G'},
+ {"groupmetad", no_arg, 'G'},
+ {"groupmeta", no_arg, 'G'},
+ {"groupmet", no_arg, 'G'},
+ {"groupme", no_arg, 'G'},
+ {"groupm", no_arg, 'G'},
+ {"group", no_arg, 'g'},
+ {"grou", no_arg, 'g'},
+ {"gro", no_arg, 'g'},
+ {"gr", no_arg, 'g'},
+ {"links", require_arg, 'l'},
+ {"link", require_arg, 'l'},
+ {"lin", require_arg, 'l'},
+ {"li", require_arg, 'l'},
+ {"dsetmetadata", no_arg, 'D'},
+ {"dsetmetadat", no_arg, 'D'},
+ {"dsetmetada", no_arg, 'D'},
+ {"dsetmetad", no_arg, 'D'},
+ {"dsetmeta", no_arg, 'D'},
+ {"dsetmet", no_arg, 'D'},
+ {"dsetme", no_arg, 'D'},
+ {"dsetm", no_arg, 'D'},
+ {"dset", no_arg, 'd'},
+ {"dse", no_arg, 'd'},
+ {"ds", no_arg, 'd'},
+ {"dims", require_arg, 'm'},
+ {"dim", require_arg, 'm'},
+ {"di", require_arg, 'm'},
+ {"dtypemetadata", no_arg, 'T'},
+ {"dtypemetadat", no_arg, 'T'},
+ {"dtypemetada", no_arg, 'T'},
+ {"dtypemetad", no_arg, 'T'},
+ {"dtypemeta", no_arg, 'T'},
+ {"dtypemet", no_arg, 'T'},
+ {"dtypeme", no_arg, 'T'},
+ {"dtypem", no_arg, 'T'},
+ {"dtype", no_arg, 'T'},
+ {"dtyp", no_arg, 'T'},
+ {"dty", no_arg, 'T'},
+ {"dt", no_arg, 'T'},
+ {"object", require_arg, 'O'},
+ {"objec", require_arg, 'O'},
+ {"obje", require_arg, 'O'},
+ {"obj", require_arg, 'O'},
+ {"ob", require_arg, 'O'},
+ {"version", no_arg, 'V'},
+ {"versio", no_arg, 'V'},
+ {"versi", no_arg, 'V'},
+ {"vers", no_arg, 'V'},
+ {"ver", no_arg, 'V'},
+ {"ve", no_arg, 'V'},
+ {"attribute", no_arg, 'A'},
+ {"attribut", no_arg, 'A'},
+ {"attribu", no_arg, 'A'},
+ {"attrib", no_arg, 'A'},
+ {"attri", no_arg, 'A'},
+ {"attr", no_arg, 'A'},
+ {"att", no_arg, 'A'},
+ {"at", no_arg, 'A'},
+ {"enable-error-stack", no_arg, 'E'},
+ {"numattrs", require_arg, 'a'},
+ {"numattr", require_arg, 'a'},
+ {"numatt", require_arg, 'a'},
+ {"numat", require_arg, 'a'},
+ {"numa", require_arg, 'a'},
+ {"num", require_arg, 'a'},
+ {"nu", require_arg, 'a'},
+ {"freespace", no_arg, 's'},
+ {"freespac", no_arg, 's'},
+ {"freespa", no_arg, 's'},
+ {"freesp", no_arg, 's'},
+ {"frees", no_arg, 's'},
+ {"free", no_arg, 's'},
+ {"fre", no_arg, 's'},
+ {"fr", no_arg, 's'},
+ {"summary", no_arg, 'S'},
+ {"summar", no_arg, 'S'},
+ {"summa", no_arg, 'S'},
+ {"summ", no_arg, 'S'},
+ {"sum", no_arg, 'S'},
+ {"su", no_arg, 'S'},
+ {"s3-cred", require_arg, 'w'},
+ {"hdfs-attrs", require_arg, 'H'},
+ {NULL, 0, '\0'}};
static void
leave(int ret)
@@ -920,7 +920,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
struct handler_t *hand = NULL;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -959,8 +959,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
break;
case 'l':
- if (opt_arg) {
- sgroups_threshold = HDatoi(opt_arg);
+ if (H5_optarg) {
+ sgroups_threshold = HDatoi(H5_optarg);
if (sgroups_threshold < 1) {
error_msg("Invalid threshold for small groups\n");
goto error;
@@ -982,8 +982,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
break;
case 'm':
- if (opt_arg) {
- sdsets_threshold = HDatoi(opt_arg);
+ if (H5_optarg) {
+ sdsets_threshold = HDatoi(H5_optarg);
if (sdsets_threshold < 1) {
error_msg("Invalid threshold for small datasets\n");
goto error;
@@ -1005,8 +1005,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
break;
case 'a':
- if (opt_arg) {
- sattrs_threshold = HDatoi(opt_arg);
+ if (H5_optarg) {
+ sattrs_threshold = HDatoi(H5_optarg);
if (sattrs_threshold < 1) {
error_msg("Invalid threshold for small # of attributes\n");
goto error;
@@ -1046,7 +1046,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
/* Store object names */
for (u = 0; u < hand->obj_count; u++)
- if (NULL == (hand->obj[u] = HDstrdup(opt_arg))) {
+ if (NULL == (hand->obj[u] = HDstrdup(H5_optarg))) {
error_msg("unable to allocate memory for object name\n");
goto error;
} /* end if */
@@ -1054,7 +1054,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
case 'w':
#ifdef H5_HAVE_ROS3_VFD
- if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa) < 0) {
+ if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa) < 0) {
error_msg("failed to parse S3 VFD credential info\n");
goto error;
}
@@ -1068,7 +1068,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
case 'H':
#ifdef H5_HAVE_LIBHDFS
- if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa) < 0) {
+ if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa) < 0) {
error_msg("failed to parse HDFS VFD configuration info\n");
goto error;
}
@@ -1087,7 +1087,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
} /* end while */
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
goto error;
@@ -1779,7 +1779,7 @@ main(int argc, const char *argv[])
if (parse_command_line(argc, argv, &hand) < 0)
goto done;
- fname = argv[opt_ind];
+ fname = argv[H5_optind];
/* enable error reporting if command line option */
h5tools_error_report();
@@ -1814,6 +1814,8 @@ main(int argc, const char *argv[])
}
}
+ fname = argv[H5_optind];
+
/* Check for filename given */
if (fname) {
hid_t fcpl;
diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c
index ac7c0ca..524ad03 100644
--- a/tools/src/misc/h5clear.c
+++ b/tools/src/misc/h5clear.c
@@ -44,40 +44,40 @@ static hsize_t increment = DEFAULT_INCREMENT;
/*
* Command-line options: only publicize long options
*/
-static const char * s_opts = "hVsmzi*";
-static struct long_options l_opts[] = {{"help", 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'},
- {"status", no_arg, 's'},
- {"statu", no_arg, 's'},
- {"stat", no_arg, 's'},
- {"sta", no_arg, 's'},
- {"st", no_arg, 's'},
- {"image", no_arg, 'm'},
- {"imag", no_arg, 'm'},
- {"ima", no_arg, 'm'},
- {"im", no_arg, 'm'},
- {"filesize", no_arg, 'z'},
- {"filesiz", no_arg, 'z'},
- {"filesi", no_arg, 'z'},
- {"files", no_arg, 'z'},
- {"file", no_arg, 'z'},
- {"fil", no_arg, 'z'},
- {"fi", no_arg, 'z'},
- {"increment", optional_arg, 'i'},
- {"incremen", optional_arg, 'i'},
- {"increme", optional_arg, 'i'},
- {"increm", optional_arg, 'i'},
- {"incre", optional_arg, 'i'},
- {"incr", optional_arg, 'i'},
- {"inc", optional_arg, 'i'},
- {"in", optional_arg, 'i'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "hVsmzi*";
+static struct h5_long_options l_opts[] = {{"help", 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'},
+ {"status", no_arg, 's'},
+ {"statu", no_arg, 's'},
+ {"stat", no_arg, 's'},
+ {"sta", no_arg, 's'},
+ {"st", no_arg, 's'},
+ {"image", no_arg, 'm'},
+ {"imag", no_arg, 'm'},
+ {"ima", no_arg, 'm'},
+ {"im", no_arg, 'm'},
+ {"filesize", no_arg, 'z'},
+ {"filesiz", no_arg, 'z'},
+ {"filesi", no_arg, 'z'},
+ {"files", no_arg, 'z'},
+ {"file", no_arg, 'z'},
+ {"fil", no_arg, 'z'},
+ {"fi", no_arg, 'z'},
+ {"increment", optional_arg, 'i'},
+ {"incremen", optional_arg, 'i'},
+ {"increme", optional_arg, 'i'},
+ {"increm", optional_arg, 'i'},
+ {"incre", optional_arg, 'i'},
+ {"incr", optional_arg, 'i'},
+ {"inc", optional_arg, 'i'},
+ {"in", optional_arg, 'i'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -150,7 +150,7 @@ parse_command_line(int argc, const char **argv)
}
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -176,12 +176,12 @@ parse_command_line(int argc, const char **argv)
case 'i':
increment_eoa_eof = TRUE;
- if (opt_arg != NULL) {
- if (HDatoi(opt_arg) < 0) {
+ if (H5_optarg != NULL) {
+ if (HDatoi(H5_optarg) < 0) {
usage(h5tools_getprogname());
goto done;
}
- increment = (hsize_t)HDatoi(opt_arg);
+ increment = (hsize_t)HDatoi(H5_optarg);
}
break;
@@ -193,14 +193,14 @@ parse_command_line(int argc, const char **argv)
} /* end while */
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
goto error;
} /* end if */
- fname_g = HDstrdup(argv[opt_ind]);
+ fname_g = HDstrdup(argv[H5_optind]);
done:
return (0);
diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c
index 516191c..a85ee4d 100644
--- a/tools/src/misc/h5mkgrp.c
+++ b/tools/src/misc/h5mkgrp.c
@@ -22,8 +22,8 @@
int d_status = EXIT_SUCCESS;
/* command-line options: short and long-named parameters */
-static const char * s_opts = "hlpvV";
-static struct long_options l_opts[] = {
+static const char * s_opts = "hlpvV";
+static struct h5_long_options l_opts[] = {
{"help", no_arg, 'h'}, {"latest", no_arg, 'l'}, {"parents", no_arg, 'p'},
{"verbose", no_arg, 'v'}, {"version", no_arg, 'V'}, {"vol-value", require_arg, '1'},
{"vol-name", require_arg, '2'}, {"vol-info", require_arg, '3'}, {NULL, 0, '\0'}};
@@ -140,7 +140,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t));
/* Parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
/* Display 'help' */
case 'h':
@@ -171,18 +171,18 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
case '1':
vol_info.type = VOL_BY_VALUE;
- vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg);
+ vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
custom_fapl = TRUE;
break;
case '2':
vol_info.type = VOL_BY_NAME;
- vol_info.u.name = opt_arg;
+ vol_info.u.name = H5_optarg;
custom_fapl = TRUE;
break;
case '3':
- vol_info.info_string = opt_arg;
+ vol_info.info_string = H5_optarg;
break;
/* Bad command line argument */
@@ -193,33 +193,33 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
} /* end while */
/* Check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
leave(EXIT_FAILURE);
}
/* Retrieve file name */
- options->fname = HDstrdup(argv[opt_ind]);
- opt_ind++;
+ options->fname = HDstrdup(argv[H5_optind]);
+ H5_optind++;
/* Check for group(s) to be created */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing group name(s)\n");
usage(h5tools_getprogname());
leave(EXIT_FAILURE);
}
/* Allocate space for the group name pointers */
- options->ngroups = (size_t)(argc - opt_ind);
+ options->ngroups = (size_t)(argc - H5_optind);
options->groups = (char **)HDmalloc(options->ngroups * sizeof(char *));
/* Retrieve the group names */
curr_group = 0;
- while (opt_ind < argc) {
- options->groups[curr_group] = HDstrdup(argv[opt_ind]);
+ while (H5_optind < argc) {
+ options->groups[curr_group] = HDstrdup(argv[H5_optind]);
curr_group++;
- opt_ind++;
+ H5_optind++;
}
/* Setup a custom fapl for file accesses */
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt
index f76a65e..f63eb84 100644
--- a/tools/test/h5copy/CMakeLists.txt
+++ b/tools/test/h5copy/CMakeLists.txt
@@ -32,7 +32,7 @@ if (BUILD_SHARED_LIBS)
add_library (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c)
target_include_directories (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5COPY_TOOL_PLUGIN_LIB_TARGET} ${H5COPY_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c
index 429ad42..6898839 100644
--- a/tools/test/h5copy/h5copygentest.c
+++ b/tools/test/h5copy/h5copygentest.c
@@ -513,21 +513,21 @@ gen_obj_ref(hid_t loc_id)
* add dataset */
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
oid = H5Dcreate2(loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -539,7 +539,7 @@ gen_obj_ref(hid_t loc_id)
* add group */
oid = H5Gcreate2(loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -547,34 +547,34 @@ gen_obj_ref(hid_t loc_id)
status = H5Rcreate(&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate(&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
sid = H5Screate_simple(1, dims2, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
oid = H5Dcreate2(loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -613,7 +613,7 @@ gen_region_ref(hid_t loc_id)
sid = H5Screate_simple(2, dims2, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -621,7 +621,7 @@ gen_region_ref(hid_t loc_id)
/* create normal dataset which is refered */
oid2 = H5Dcreate2(loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid2 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -629,7 +629,7 @@ gen_region_ref(hid_t loc_id)
/* write values to dataset */
status = H5Dwrite(oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -637,7 +637,7 @@ gen_region_ref(hid_t loc_id)
/* select elements space for reference */
status = H5Sselect_elements(sid, H5S_SELECT_SET, 4, coords[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -645,7 +645,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference from elements space */
status = H5Rcreate(&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -653,7 +653,7 @@ gen_region_ref(hid_t loc_id)
/* select hyperslab space for reference */
status = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -661,7 +661,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference from hyperslab space */
status = H5Rcreate(&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -671,7 +671,7 @@ gen_region_ref(hid_t loc_id)
/* Create dataspace. */
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -679,7 +679,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference dataset */
oid1 = H5Dcreate2(loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid1 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -687,7 +687,7 @@ gen_region_ref(hid_t loc_id)
/* write data as region references */
status = H5Dwrite(oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -816,7 +816,7 @@ gen_extlink_trg(hid_t loc_id)
* target file */
gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -831,7 +831,7 @@ gen_extlink_trg(hid_t loc_id)
tid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -864,7 +864,7 @@ gen_extlink_src(hid_t loc_id)
*------------------------------------------------------------------------*/
gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -875,7 +875,7 @@ gen_extlink_src(hid_t loc_id)
/* link to dataset */
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -883,7 +883,7 @@ gen_extlink_src(hid_t loc_id)
/* link to group */
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -892,7 +892,7 @@ gen_extlink_src(hid_t loc_id)
status =
H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -900,7 +900,7 @@ gen_extlink_src(hid_t loc_id)
/* dangling link - no obj*/
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -908,7 +908,7 @@ gen_extlink_src(hid_t loc_id)
/* dangling link - no file */
status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt
index 9349ace..f74db0f 100644
--- a/tools/test/h5diff/CMakeLists.txt
+++ b/tools/test/h5diff/CMakeLists.txt
@@ -32,7 +32,7 @@ if (BUILD_SHARED_LIBS)
add_library (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c)
target_include_directories (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} ${H5DIFF_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c
index f03254e..118a3a7 100644
--- a/tools/test/h5diff/h5diffgentest.c
+++ b/tools/test/h5diff/h5diffgentest.c
@@ -112,7 +112,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024);
#define SPACE1_DIM2 0
/* Error macros */
-#define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC);
+#define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, __func__);
#define PROGRAM_ERROR \
do { \
AT(); \
diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt
index 242465e..a7b4846 100644
--- a/tools/test/h5dump/CMakeLists.txt
+++ b/tools/test/h5dump/CMakeLists.txt
@@ -12,7 +12,7 @@ if (BUILD_SHARED_LIBS)
add_library (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c)
target_include_directories (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} ${H5DUMP_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c
index a9b4437..fd21d6c 100644
--- a/tools/test/h5jam/getub.c
+++ b/tools/test/h5jam/getub.c
@@ -21,9 +21,9 @@ void parse_command_line(int argc, const char *argv[]);
#define PROGRAM_NAME "getub"
char *nbytes = NULL;
-static const char * s_opts = "c:"; /* add more later ? */
-static struct long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file */
- {NULL, 0, '\0'}};
+static const char * s_opts = "c:"; /* add more later ? */
+static struct h5_long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file */
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -57,10 +57,10 @@ parse_command_line(int argc, const char *argv[])
int opt;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'c':
- nbytes = HDstrdup(opt_arg);
+ nbytes = HDstrdup(H5_optarg);
break;
case '?':
default:
@@ -69,7 +69,7 @@ parse_command_line(int argc, const char *argv[])
} /* end switch */
} /* end while */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
HDexit(EXIT_FAILURE);
@@ -100,16 +100,16 @@ main(int argc, const char *argv[])
goto error;
} /* end if */
- if (argc <= (opt_ind)) {
+ if (argc <= (H5_optind)) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
goto error;
} /* end if */
- filename = HDstrdup(argv[opt_ind]);
+ filename = HDstrdup(argv[H5_optind]);
size = 0;
- if (EOF == (res = sscanf(nbytes, "%u", &size))) {
+ if (EOF == (res = HDsscanf(nbytes, "%u", &size))) {
/* fail */
error_msg("missing file name\n");
usage(h5tools_getprogname());
diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c
index 45d4af4..e6769ec 100644
--- a/tools/test/h5jam/tellub.c
+++ b/tools/test/h5jam/tellub.c
@@ -24,8 +24,8 @@
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char * s_opts = "h";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {NULL, 0, '\0'}};
+static const char * s_opts = "h";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
@@ -61,7 +61,7 @@ parse_command_line(int argc, const char *argv[])
int opt;
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -75,7 +75,7 @@ parse_command_line(int argc, const char *argv[])
}
/* check for file name to be processed */
- if (argc <= opt_ind) {
+ if (argc <= H5_optind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
@@ -118,14 +118,14 @@ main(int argc, const char *argv[])
/* enable error reporting if command line option */
h5tools_error_report();
- if (argc <= (opt_ind)) {
+ if (argc <= (H5_optind)) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
h5tools_setstatus(EXIT_FAILURE);
goto done;
}
- ifname = HDstrdup(argv[opt_ind]);
+ ifname = HDstrdup(argv[H5_optind]);
testval = H5Fis_accessible(ifname, H5P_DEFAULT);
diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt
index ee223b8..ba6e468 100644
--- a/tools/test/h5ls/CMakeLists.txt
+++ b/tools/test/h5ls/CMakeLists.txt
@@ -12,7 +12,7 @@ if (BUILD_SHARED_LIBS)
add_library (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c)
target_include_directories (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5LS_TOOL_PLUGIN_LIB_TARGET} ${H5LS_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt
index 26db85a..0b90750 100644
--- a/tools/test/h5repack/CMakeLists.txt
+++ b/tools/test/h5repack/CMakeLists.txt
@@ -54,13 +54,13 @@ if (BUILD_SHARED_LIBS)
add_library (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c)
target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} ${H5REPACK_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
add_library (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c)
target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED)
- target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_LIBSH_TARGET})
H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} ${H5REPACK_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB")
#-----------------------------------------------------------------------------
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index 3396217..acad74e 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -6058,7 +6058,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id)
/* ref to dset */
status = H5Rcreate(&data_attr_objref[0], file_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6066,7 +6066,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id)
/* ref to group */
status = H5Rcreate(&data_attr_objref[1], file_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6074,7 +6074,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id)
/* ref to datatype */
status = H5Rcreate(&data_attr_objref[2], file_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6082,7 +6082,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id)
/* create attr with obj ref type */
status = make_attr(obj_id, 1, dim_attr_objref, "Attr_OBJREF", H5T_STD_REF_OBJ, data_attr_objref);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6122,7 +6122,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id)
*/
sid_regrefed_dset = H5Screate_simple(2, dim_regrefed_dset, NULL);
if (sid_regrefed_dset < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6130,7 +6130,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id)
/* select elements space for reference */
status = H5Sselect_elements(sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6138,7 +6138,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id)
/* create region reference from elements space */
status = H5Rcreate(&data_attr_regref[0], file_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_regrefed_dset);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6146,7 +6146,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id)
/* create attr with region ref type */
status = make_attr(obj_id, 1, dim_attr_regref, "Attr_REGREF", H5T_STD_REF_DSETREG, data_attr_regref);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6191,21 +6191,21 @@ gen_refered_objs(hid_t loc_id)
*/
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
did1 = H5Dcreate2(loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (did1 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6216,7 +6216,7 @@ gen_refered_objs(hid_t loc_id)
*/
gid = H5Gcreate2(loc_id, NAME_OBJ_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6228,7 +6228,7 @@ gen_refered_objs(hid_t loc_id)
tid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6239,7 +6239,7 @@ gen_refered_objs(hid_t loc_id)
*/
sid2 = H5Screate_simple(2, dims2, NULL);
if (sid2 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6247,7 +6247,7 @@ gen_refered_objs(hid_t loc_id)
/* create normal dataset which is refered */
did2 = H5Dcreate2(loc_id, NAME_OBJ_DS2, H5T_STD_I8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (did2 < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6255,7 +6255,7 @@ gen_refered_objs(hid_t loc_id)
/* write values to dataset */
status = H5Dwrite(did2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6311,7 +6311,7 @@ gen_obj_ref(hid_t loc_id)
/* obj ref to dataset */
status = H5Rcreate(&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6319,7 +6319,7 @@ gen_obj_ref(hid_t loc_id)
/* obj ref to group */
status = H5Rcreate(&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6327,7 +6327,7 @@ gen_obj_ref(hid_t loc_id)
/* obj ref to named-datatype */
status = H5Rcreate(&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6337,21 +6337,21 @@ gen_obj_ref(hid_t loc_id)
*/
sid = H5Screate_simple(1, dims_dset_objref, NULL);
if (sid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
oid = H5Dcreate2(loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, objref_buf);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6363,7 +6363,7 @@ gen_obj_ref(hid_t loc_id)
/* add attribute with obj ref */
status = add_attr_with_objref(loc_id, oid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6371,7 +6371,7 @@ gen_obj_ref(hid_t loc_id)
/* add attribute with region ref */
status = add_attr_with_regref(loc_id, oid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6423,7 +6423,7 @@ gen_region_ref(hid_t loc_id)
sid_trg = H5Screate_simple(2, dims_trg, NULL);
if (sid_trg < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6431,7 +6431,7 @@ gen_region_ref(hid_t loc_id)
/* select elements space for reference */
status = H5Sselect_elements(sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6439,7 +6439,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference from elements space */
status = H5Rcreate(&rr_data[0], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6447,7 +6447,7 @@ gen_region_ref(hid_t loc_id)
/* select hyperslab space for reference */
status = H5Sselect_hyperslab(sid_trg, H5S_SELECT_SET, start, stride, count, block);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6455,7 +6455,7 @@ gen_region_ref(hid_t loc_id)
/* create region reference from hyperslab space */
status = H5Rcreate(&rr_data[1], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6463,7 +6463,7 @@ gen_region_ref(hid_t loc_id)
/* Create dataspace. */
sid_ref = H5Screate_simple(1, dims1, NULL);
if (sid_ref < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6472,7 +6472,7 @@ gen_region_ref(hid_t loc_id)
oid_ref =
H5Dcreate2(loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid_ref, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid_ref < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6480,7 +6480,7 @@ gen_region_ref(hid_t loc_id)
/* write data as region references */
status = H5Dwrite(oid_ref, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6492,7 +6492,7 @@ gen_region_ref(hid_t loc_id)
/* add attribute with obj ref */
status = add_attr_with_objref(loc_id, oid_ref);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6500,7 +6500,7 @@ gen_region_ref(hid_t loc_id)
/* add attribute with region ref */
status = add_attr_with_regref(loc_id, oid_ref);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6667,7 +6667,7 @@ make_complex_attr_references(hid_t loc_id)
objdid = H5Dcreate2(loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, objsid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(objdid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6676,7 +6676,7 @@ make_complex_attr_references(hid_t loc_id)
objtid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, objtid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6687,7 +6687,7 @@ make_complex_attr_references(hid_t loc_id)
* compound type which contain obj and region reference */
main_gid = H5Gcreate2(loc_id, "group_main", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (main_gid < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6702,7 +6702,7 @@ make_complex_attr_references(hid_t loc_id)
status = H5Dwrite(main_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6725,7 +6725,7 @@ make_complex_attr_references(hid_t loc_id)
/* references to dataset */
status = H5Rcreate(&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6734,7 +6734,7 @@ make_complex_attr_references(hid_t loc_id)
/* references to group */
status = H5Rcreate(&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6743,7 +6743,7 @@ make_complex_attr_references(hid_t loc_id)
/* references to datatype */
status = H5Rcreate(&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6757,7 +6757,7 @@ make_complex_attr_references(hid_t loc_id)
H5Acreate2(main_did, "Comp_OBJREF", comp_objref_tid, comp_objref_attr_sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(comp_objref_aid, comp_objref_tid, comp_objref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6778,13 +6778,13 @@ make_complex_attr_references(hid_t loc_id)
*/
status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate(&(comp_regref_data[0].val_regref), loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6798,7 +6798,7 @@ make_complex_attr_references(hid_t loc_id)
H5Acreate2(main_did, "Comp_REGREF", comp_regref_tid, comp_regref_attr_sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(comp_regref_aid, comp_regref_tid, comp_regref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6823,7 +6823,7 @@ make_complex_attr_references(hid_t loc_id)
status =
H5Rcreate(&((hobj_ref_t *)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6831,7 +6831,7 @@ make_complex_attr_references(hid_t loc_id)
status =
H5Rcreate(&((hobj_ref_t *)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6839,7 +6839,7 @@ make_complex_attr_references(hid_t loc_id)
status =
H5Rcreate(&((hobj_ref_t *)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6857,7 +6857,7 @@ make_complex_attr_references(hid_t loc_id)
H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(vlen_objref_attr_id, vlen_objref_attr_tid, vlen_objref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6865,7 +6865,7 @@ make_complex_attr_references(hid_t loc_id)
/* close resource for vlen data */
status = H5Treclaim(vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6885,14 +6885,14 @@ make_complex_attr_references(hid_t loc_id)
*/
status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate(&((hdset_reg_ref_t *)vlen_regref_data[0].p)[0], loc_id, NAME_OBJ_DS1,
H5R_DATASET_REGION, objsid);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6910,7 +6910,7 @@ make_complex_attr_references(hid_t loc_id)
H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(vlen_regref_attr_id, vlen_regref_attr_tid, vlen_regref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
@@ -6918,7 +6918,7 @@ make_complex_attr_references(hid_t loc_id)
/* close resource for vlen data */
status = H5Treclaim(vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data);
if (status < 0) {
- HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__);
ret = FAIL;
goto out;
}
diff --git a/tools/test/misc/vds/UC_common.h b/tools/test/misc/vds/UC_common.h
index bfa1ed9..d84d545 100644
--- a/tools/test/misc/vds/UC_common.h
+++ b/tools/test/misc/vds/UC_common.h
@@ -14,15 +14,6 @@
#ifndef USE_CASE_COMMON_H
#define USE_CASE_COMMON_H
-/* Use FUNC to safely handle variations of C99 __func__ keyword handling */
-#ifdef H5_HAVE_C99_FUNC
-#define FUNC __func__
-#elif defined(H5_HAVE_FUNCTION)
-#define FUNC __FUNCTION__
-#else
-#error "We need __func__ or __FUNCTION__ to test function names!"
-#endif
-
/******************************************
* Symbols used across multiple use cases *
******************************************/
@@ -41,7 +32,7 @@
#define FALSE 0
/* Testing macros */
-#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC);
+#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__);
#define UC_ERROR \
{ \
puts("*ERROR*"); \
diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c
index 6537215..371c4f9 100644
--- a/tools/test/perform/direct_write_perf.c
+++ b/tools/test/perform/direct_write_perf.c
@@ -28,23 +28,22 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
-
-#ifdef H5_HAVE_UNISTD_H
-#include <sys/types.h>
-#include <unistd.h>
-#endif
+#include <time.h>
#ifdef H5_HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if defined(H5_TIME_WITH_SYS_TIME)
-#include <sys/time.h>
-#include <time.h>
-#elif defined(H5_HAVE_SYS_TIME_H)
+#ifdef H5_HAVE_SYS_TIME_H
#include <sys/time.h>
-#else
-#include <time.h>
+#endif
+
+#ifdef H5_HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef H5_HAVE_UNISTD_H
+#include <unistd.h>
#endif
const char *FILENAME[] = {"direct_write", "unix.raw", NULL};
@@ -52,8 +51,7 @@ const char *FILENAME[] = {"direct_write", "unix.raw", NULL};
/*
* Print the current location on the standard output stream.
*/
-#define FUNC __func__
-#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC);
+#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__);
#define H5_FAILED() \
{ \
puts("*FAILED*"); \
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index d0db06a..2aa9e25 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -95,7 +95,6 @@ print_stats(const char *prefix,
static void
synchronize(void)
{
-#ifdef H5_HAVE_SYSTEM
#if defined(H5_HAVE_WIN32_API) && !defined(__CYGWIN__)
_flushall();
#else
@@ -107,7 +106,6 @@ synchronize(void)
status = HDsystem("df >/dev/null");
HDassert(status >= 0);
#endif
-#endif
}
/*-------------------------------------------------------------------------
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index a06fb77..875f932 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -31,23 +31,22 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#ifdef H5_HAVE_UNISTD_H
-#include <sys/types.h>
-#include <unistd.h>
-#endif
+#include <time.h>
#ifdef H5_HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if defined(H5_TIME_WITH_SYS_TIME)
-#include <sys/time.h>
-#include <time.h>
-#elif defined(H5_HAVE_SYS_TIME_H)
+#ifdef H5_HAVE_SYS_TIME_H
#include <sys/time.h>
-#else
-#include <time.h>
+#endif
+
+#ifdef H5_HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef H5_HAVE_UNISTD_H
+#include <unistd.h>
#endif
#include <mpi.h>
@@ -136,12 +135,11 @@ main(int argc, char **argv)
if (mynod == 0)
printf("# Using hdf5-io calls.\n");
- /* kindof a weird hack- if the location of the pvfstab file was
- * specified on the command line, then spit out this location into
- * the appropriate environment variable: */
-
-#if H5_HAVE_SETENV
- /* no setenv or unsetenv */
+#ifdef H5_HAVE_UNISTD_H
+ /* Kind of a weird hack- if the location of the pvfstab file was
+ * specified on the command line, then spit out this location into
+ * the appropriate environment variable.
+ */
if (opt_pvfstab_set) {
if ((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0) {
perror("setenv");
@@ -372,9 +370,8 @@ main(int argc, char **argv)
die_jar_jar_die:
-#if H5_HAVE_SETENV
- /* no setenv or unsetenv */
- /* clear the environment variable if it was set earlier */
+#ifdef H5_HAVE_UNISTD
+ /* Clear the environment variable if it was set earlier */
if (opt_pvfstab_set) {
unsetenv("PVFSTAB_FILE");
}
diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c
index 6fb5043..d38c574 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/test/perform/pio_perf.c
@@ -123,12 +123,12 @@ static const char *s_opts = "a:A:B:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:";
#else
static const char *s_opts = "a:A:bB:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:";
#endif /* 1 */
-static struct long_options l_opts[] = {{"align", require_arg, 'a'},
- {"alig", require_arg, 'a'},
- {"ali", require_arg, 'a'},
- {"al", require_arg, 'a'},
- {"api", require_arg, 'A'},
- {"ap", require_arg, 'A'},
+static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'},
+ {"alig", require_arg, 'a'},
+ {"ali", require_arg, 'a'},
+ {"al", require_arg, 'a'},
+ {"api", require_arg, 'A'},
+ {"ap", require_arg, 'A'},
#if 0
/* a sighting of the elusive binary option */
{ "binary", no_arg, 'b' },
@@ -137,133 +137,133 @@ static struct long_options l_opts[] = {{"align", require_arg, 'a'},
{ "bin", no_arg, 'b' },
{ "bi", no_arg, 'b' },
#endif /* 0 */
- {"block-size", require_arg, 'B'},
- {"block-siz", require_arg, 'B'},
- {"block-si", require_arg, 'B'},
- {"block-s", require_arg, 'B'},
- {"block-", require_arg, 'B'},
- {"block", require_arg, 'B'},
- {"bloc", require_arg, 'B'},
- {"blo", require_arg, 'B'},
- {"bl", require_arg, 'B'},
- {"chunk", no_arg, 'c'},
- {"chun", no_arg, 'c'},
- {"chu", no_arg, 'c'},
- {"ch", no_arg, 'c'},
- {"collective", no_arg, 'C'},
- {"collectiv", no_arg, 'C'},
- {"collecti", no_arg, 'C'},
- {"collect", no_arg, 'C'},
- {"collec", no_arg, 'C'},
- {"colle", no_arg, 'C'},
- {"coll", no_arg, 'C'},
- {"col", no_arg, 'C'},
- {"co", no_arg, 'C'},
- {"debug", require_arg, 'D'},
- {"debu", require_arg, 'D'},
- {"deb", require_arg, 'D'},
- {"de", require_arg, 'D'},
- {"geometry", no_arg, 'g'},
- {"geometr", no_arg, 'g'},
- {"geomet", no_arg, 'g'},
- {"geome", no_arg, 'g'},
- {"geom", no_arg, 'g'},
- {"geo", no_arg, 'g'},
- {"ge", no_arg, 'g'},
- {"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"interleaved", require_arg, 'I'},
- {"interleave", require_arg, 'I'},
- {"interleav", require_arg, 'I'},
- {"interlea", require_arg, 'I'},
- {"interle", require_arg, 'I'},
- {"interl", require_arg, 'I'},
- {"inter", require_arg, 'I'},
- {"inte", require_arg, 'I'},
- {"int", require_arg, 'I'},
- {"in", require_arg, 'I'},
- {"max-num-processes", require_arg, 'P'},
- {"max-num-processe", require_arg, 'P'},
- {"max-num-process", require_arg, 'P'},
- {"max-num-proces", require_arg, 'P'},
- {"max-num-proce", require_arg, 'P'},
- {"max-num-proc", require_arg, 'P'},
- {"max-num-pro", require_arg, 'P'},
- {"max-num-pr", require_arg, 'P'},
- {"max-num-p", require_arg, 'P'},
- {"min-num-processes", require_arg, 'p'},
- {"min-num-processe", require_arg, 'p'},
- {"min-num-process", require_arg, 'p'},
- {"min-num-proces", require_arg, 'p'},
- {"min-num-proce", require_arg, 'p'},
- {"min-num-proc", require_arg, 'p'},
- {"min-num-pro", require_arg, 'p'},
- {"min-num-pr", require_arg, 'p'},
- {"min-num-p", require_arg, 'p'},
- {"max-xfer-size", require_arg, 'X'},
- {"max-xfer-siz", require_arg, 'X'},
- {"max-xfer-si", require_arg, 'X'},
- {"max-xfer-s", require_arg, 'X'},
- {"max-xfer", require_arg, 'X'},
- {"max-xfe", require_arg, 'X'},
- {"max-xf", require_arg, 'X'},
- {"max-x", require_arg, 'X'},
- {"min-xfer-size", require_arg, 'x'},
- {"min-xfer-siz", require_arg, 'x'},
- {"min-xfer-si", require_arg, 'x'},
- {"min-xfer-s", require_arg, 'x'},
- {"min-xfer", require_arg, 'x'},
- {"min-xfe", require_arg, 'x'},
- {"min-xf", require_arg, 'x'},
- {"min-x", require_arg, 'x'},
- {"num-bytes", require_arg, 'e'},
- {"num-byte", require_arg, 'e'},
- {"num-byt", require_arg, 'e'},
- {"num-by", require_arg, 'e'},
- {"num-b", require_arg, 'e'},
- {"num-dsets", require_arg, 'd'},
- {"num-dset", require_arg, 'd'},
- {"num-dse", require_arg, 'd'},
- {"num-ds", require_arg, 'd'},
- {"num-d", require_arg, 'd'},
- {"num-files", require_arg, 'F'},
- {"num-file", require_arg, 'F'},
- {"num-fil", require_arg, 'F'},
- {"num-fi", require_arg, 'F'},
- {"num-f", require_arg, 'F'},
- {"num-iterations", require_arg, 'i'},
- {"num-iteration", require_arg, 'i'},
- {"num-iteratio", require_arg, 'i'},
- {"num-iterati", require_arg, 'i'},
- {"num-iterat", require_arg, 'i'},
- {"num-itera", require_arg, 'i'},
- {"num-iter", require_arg, 'i'},
- {"num-ite", require_arg, 'i'},
- {"num-it", require_arg, 'i'},
- {"num-i", require_arg, 'i'},
- {"output", require_arg, 'o'},
- {"outpu", require_arg, 'o'},
- {"outp", require_arg, 'o'},
- {"out", require_arg, 'o'},
- {"ou", require_arg, 'o'},
- {"threshold", require_arg, 'T'},
- {"threshol", require_arg, 'T'},
- {"thresho", require_arg, 'T'},
- {"thresh", require_arg, 'T'},
- {"thres", require_arg, 'T'},
- {"thre", require_arg, 'T'},
- {"thr", require_arg, 'T'},
- {"th", require_arg, 'T'},
- {"write-only", require_arg, 'w'},
- {"write-onl", require_arg, 'w'},
- {"write-on", require_arg, 'w'},
- {"write-o", require_arg, 'w'},
- {"write", require_arg, 'w'},
- {"writ", require_arg, 'w'},
- {"wri", require_arg, 'w'},
- {"wr", require_arg, 'w'},
- {NULL, 0, '\0'}};
+ {"block-size", require_arg, 'B'},
+ {"block-siz", require_arg, 'B'},
+ {"block-si", require_arg, 'B'},
+ {"block-s", require_arg, 'B'},
+ {"block-", require_arg, 'B'},
+ {"block", require_arg, 'B'},
+ {"bloc", require_arg, 'B'},
+ {"blo", require_arg, 'B'},
+ {"bl", require_arg, 'B'},
+ {"chunk", no_arg, 'c'},
+ {"chun", no_arg, 'c'},
+ {"chu", no_arg, 'c'},
+ {"ch", no_arg, 'c'},
+ {"collective", no_arg, 'C'},
+ {"collectiv", no_arg, 'C'},
+ {"collecti", no_arg, 'C'},
+ {"collect", no_arg, 'C'},
+ {"collec", no_arg, 'C'},
+ {"colle", no_arg, 'C'},
+ {"coll", no_arg, 'C'},
+ {"col", no_arg, 'C'},
+ {"co", no_arg, 'C'},
+ {"debug", require_arg, 'D'},
+ {"debu", require_arg, 'D'},
+ {"deb", require_arg, 'D'},
+ {"de", require_arg, 'D'},
+ {"geometry", no_arg, 'g'},
+ {"geometr", no_arg, 'g'},
+ {"geomet", no_arg, 'g'},
+ {"geome", no_arg, 'g'},
+ {"geom", no_arg, 'g'},
+ {"geo", no_arg, 'g'},
+ {"ge", no_arg, 'g'},
+ {"help", no_arg, 'h'},
+ {"hel", no_arg, 'h'},
+ {"he", no_arg, 'h'},
+ {"interleaved", require_arg, 'I'},
+ {"interleave", require_arg, 'I'},
+ {"interleav", require_arg, 'I'},
+ {"interlea", require_arg, 'I'},
+ {"interle", require_arg, 'I'},
+ {"interl", require_arg, 'I'},
+ {"inter", require_arg, 'I'},
+ {"inte", require_arg, 'I'},
+ {"int", require_arg, 'I'},
+ {"in", require_arg, 'I'},
+ {"max-num-processes", require_arg, 'P'},
+ {"max-num-processe", require_arg, 'P'},
+ {"max-num-process", require_arg, 'P'},
+ {"max-num-proces", require_arg, 'P'},
+ {"max-num-proce", require_arg, 'P'},
+ {"max-num-proc", require_arg, 'P'},
+ {"max-num-pro", require_arg, 'P'},
+ {"max-num-pr", require_arg, 'P'},
+ {"max-num-p", require_arg, 'P'},
+ {"min-num-processes", require_arg, 'p'},
+ {"min-num-processe", require_arg, 'p'},
+ {"min-num-process", require_arg, 'p'},
+ {"min-num-proces", require_arg, 'p'},
+ {"min-num-proce", require_arg, 'p'},
+ {"min-num-proc", require_arg, 'p'},
+ {"min-num-pro", require_arg, 'p'},
+ {"min-num-pr", require_arg, 'p'},
+ {"min-num-p", require_arg, 'p'},
+ {"max-xfer-size", require_arg, 'X'},
+ {"max-xfer-siz", require_arg, 'X'},
+ {"max-xfer-si", require_arg, 'X'},
+ {"max-xfer-s", require_arg, 'X'},
+ {"max-xfer", require_arg, 'X'},
+ {"max-xfe", require_arg, 'X'},
+ {"max-xf", require_arg, 'X'},
+ {"max-x", require_arg, 'X'},
+ {"min-xfer-size", require_arg, 'x'},
+ {"min-xfer-siz", require_arg, 'x'},
+ {"min-xfer-si", require_arg, 'x'},
+ {"min-xfer-s", require_arg, 'x'},
+ {"min-xfer", require_arg, 'x'},
+ {"min-xfe", require_arg, 'x'},
+ {"min-xf", require_arg, 'x'},
+ {"min-x", require_arg, 'x'},
+ {"num-bytes", require_arg, 'e'},
+ {"num-byte", require_arg, 'e'},
+ {"num-byt", require_arg, 'e'},
+ {"num-by", require_arg, 'e'},
+ {"num-b", require_arg, 'e'},
+ {"num-dsets", require_arg, 'd'},
+ {"num-dset", require_arg, 'd'},
+ {"num-dse", require_arg, 'd'},
+ {"num-ds", require_arg, 'd'},
+ {"num-d", require_arg, 'd'},
+ {"num-files", require_arg, 'F'},
+ {"num-file", require_arg, 'F'},
+ {"num-fil", require_arg, 'F'},
+ {"num-fi", require_arg, 'F'},
+ {"num-f", require_arg, 'F'},
+ {"num-iterations", require_arg, 'i'},
+ {"num-iteration", require_arg, 'i'},
+ {"num-iteratio", require_arg, 'i'},
+ {"num-iterati", require_arg, 'i'},
+ {"num-iterat", require_arg, 'i'},
+ {"num-itera", require_arg, 'i'},
+ {"num-iter", require_arg, 'i'},
+ {"num-ite", require_arg, 'i'},
+ {"num-it", require_arg, 'i'},
+ {"num-i", require_arg, 'i'},
+ {"output", require_arg, 'o'},
+ {"outpu", require_arg, 'o'},
+ {"outp", require_arg, 'o'},
+ {"out", require_arg, 'o'},
+ {"ou", require_arg, 'o'},
+ {"threshold", require_arg, 'T'},
+ {"threshol", require_arg, 'T'},
+ {"thresho", require_arg, 'T'},
+ {"thresh", require_arg, 'T'},
+ {"thres", require_arg, 'T'},
+ {"thre", require_arg, 'T'},
+ {"thr", require_arg, 'T'},
+ {"th", require_arg, 'T'},
+ {"write-only", require_arg, 'w'},
+ {"write-onl", require_arg, 'w'},
+ {"write-on", require_arg, 'w'},
+ {"write-o", require_arg, 'w'},
+ {"write", require_arg, 'w'},
+ {"writ", require_arg, 'w'},
+ {"wri", require_arg, 'w'},
+ {"wr", require_arg, 'w'},
+ {NULL, 0, '\0'}};
struct options {
long io_types; /* bitmask of which I/O types to test */
@@ -1286,13 +1286,13 @@ parse_command_line(int argc, char *argv[])
cl_opts->h5_write_only = FALSE; /* Do both read and write by default */
cl_opts->verify = FALSE; /* No Verify data correctness by default */
- while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'a':
- cl_opts->h5_alignment = parse_size_directive(opt_arg);
+ cl_opts->h5_alignment = parse_size_directive(H5_optarg);
break;
case 'A': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
while (end && *end != '\0') {
char buf[10];
@@ -1332,7 +1332,7 @@ parse_command_line(int argc, char *argv[])
break;
#endif /* 0 */
case 'B':
- cl_opts->blk_size = (size_t)parse_size_directive(opt_arg);
+ cl_opts->blk_size = (size_t)parse_size_directive(H5_optarg);
break;
case 'c':
/* Turn on chunked HDF5 dataset creation */
@@ -1342,10 +1342,10 @@ parse_command_line(int argc, char *argv[])
cl_opts->collective = 1;
break;
case 'd':
- cl_opts->num_dsets = atoi(opt_arg);
+ cl_opts->num_dsets = atoi(H5_optarg);
break;
case 'D': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
while (end && *end != '\0') {
char buf[10];
@@ -1402,40 +1402,40 @@ parse_command_line(int argc, char *argv[])
break;
case 'e':
- cl_opts->num_bpp = parse_size_directive(opt_arg);
+ cl_opts->num_bpp = parse_size_directive(H5_optarg);
break;
case 'F':
- cl_opts->num_files = HDatoi(opt_arg);
+ cl_opts->num_files = HDatoi(H5_optarg);
break;
case 'g':
cl_opts->dim2d = 1;
break;
case 'i':
- cl_opts->num_iters = HDatoi(opt_arg);
+ cl_opts->num_iters = HDatoi(H5_optarg);
break;
case 'I':
cl_opts->interleaved = 1;
break;
case 'o':
- cl_opts->output_file = opt_arg;
+ cl_opts->output_file = H5_optarg;
break;
case 'p':
- cl_opts->min_num_procs = HDatoi(opt_arg);
+ cl_opts->min_num_procs = HDatoi(H5_optarg);
break;
case 'P':
- cl_opts->max_num_procs = HDatoi(opt_arg);
+ cl_opts->max_num_procs = HDatoi(H5_optarg);
break;
case 'T':
- cl_opts->h5_threshold = parse_size_directive(opt_arg);
+ cl_opts->h5_threshold = parse_size_directive(H5_optarg);
break;
case 'w':
cl_opts->h5_write_only = TRUE;
break;
case 'x':
- cl_opts->min_xfer_size = (size_t)parse_size_directive(opt_arg);
+ cl_opts->min_xfer_size = (size_t)parse_size_directive(H5_optarg);
break;
case 'X':
- cl_opts->max_xfer_size = (size_t)parse_size_directive(opt_arg);
+ cl_opts->max_xfer_size = (size_t)parse_size_directive(H5_optarg);
break;
case 'h':
case '?':
diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c
index 0a9bfc0..db8633e 100644
--- a/tools/test/perform/pio_standalone.c
+++ b/tools/test/perform/pio_standalone.c
@@ -27,30 +27,30 @@ MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */
int nCols = 80;
/* ``get_option'' variables */
-int opt_err = 1; /*get_option prints errors if this is on */
-int opt_ind = 1; /*token pointer */
-const char *opt_arg; /*flag argument (or value) */
+int H5_opterr = 1; /*get_option prints errors if this is on */
+int H5_optind = 1; /*token pointer */
+const char *H5_optarg; /*flag argument (or value) */
int
-get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts)
+get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts)
{
static int sp = 1; /* character index in current token */
int opt_opt = '?'; /* option character passed back to user */
if (sp == 1) {
/* check for more flag-like tokens */
- if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') {
+ if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') {
return EOF;
}
- else if (HDstrcmp(argv[opt_ind], "--") == 0) {
- opt_ind++;
+ else if (HDstrcmp(argv[H5_optind], "--") == 0) {
+ H5_optind++;
return EOF;
}
}
- if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') {
+ if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') {
/* long command line option */
- const char *arg = &argv[opt_ind][2];
+ const char *arg = &argv[H5_optind][2];
int i;
for (i = 0; l_opts && l_opts[i].name; i++) {
@@ -62,13 +62,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].has_arg != no_arg) {
if (arg[len] == '=') {
- opt_arg = &arg[len + 1];
+ H5_optarg = &arg[len + 1];
}
- else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') {
- opt_arg = argv[++opt_ind];
+ else if (H5_optind < (argc - 1) && argv[H5_optind + 1][0] != '-') {
+ H5_optarg = argv[++H5_optind];
}
else if (l_opts[i].has_arg == require_arg) {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg);
opt_opt = '?';
@@ -76,13 +76,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
}
else {
if (arg[len] == '=') {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg);
opt_opt = '?';
}
- opt_arg = NULL;
+ H5_optarg = NULL;
}
break;
@@ -91,29 +91,29 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].name == NULL) {
/* exhausted all of the l_opts we have and still didn't match */
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg);
opt_opt = '?';
}
- opt_ind++;
+ H5_optind++;
sp = 1;
}
else {
register char *cp; /* pointer into current token */
/* short command line option */
- opt_opt = argv[opt_ind][sp];
+ opt_opt = argv[H5_optind][sp];
if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt);
/* if no chars left in this token, move to next token */
- if (argv[opt_ind][++sp] == '\0') {
- opt_ind++;
+ if (argv[H5_optind][++sp] == '\0') {
+ H5_optind++;
sp = 1;
}
@@ -122,32 +122,32 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (*++cp == ':') {
/* if a value is expected, get it */
- if (argv[opt_ind][sp + 1] != '\0') {
+ if (argv[H5_optind][sp + 1] != '\0') {
/* flag value is rest of current token */
- opt_arg = &argv[opt_ind++][sp + 1];
+ H5_optarg = &argv[H5_optind++][sp + 1];
}
- else if (++opt_ind >= argc) {
- if (opt_err)
+ else if (++H5_optind >= argc) {
+ if (H5_opterr)
HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt);
opt_opt = '?';
}
else {
/* flag value is next token */
- opt_arg = argv[opt_ind++];
+ H5_optarg = argv[H5_optind++];
}
sp = 1;
}
else {
/* set up to look at next char in token, next time */
- if (argv[opt_ind][++sp] == '\0') {
+ if (argv[H5_optind][++sp] == '\0') {
/* no more in current token, so setup next token */
- opt_ind++;
+ H5_optind++;
sp = 1;
}
- opt_arg = NULL;
+ H5_optarg = NULL;
}
}
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index 82fabdc..4b5c7b2 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -90,28 +90,20 @@
#define HDctermid(S) ctermid(S)
#define HDctime(T) ctime(T)
#define HDcuserid(S) cuserid(S)
-#ifdef H5_HAVE_DIFFTIME
-#define HDdifftime(X, Y) difftime(X, Y)
-#else
-#define HDdifftime(X, Y) ((double)(X) - (double)(Y))
-#endif
-#define HDdiv(X, Y) div(X, Y)
-#define HDdup(F) dup(F)
-#define HDdup2(F, I) dup2(F, I)
-/* execl() variable arguments */
-/* execle() variable arguments */
-/* execlp() variable arguments */
-#define HDexecv(S, AV) execv(S, AV)
-#define HDexecve(S, AV, E) execve(S, AV, E)
-#define HDexecvp(S, AV) execvp(S, AV)
-#define HDexit(N) exit(N)
-#define HD_exit(N) _exit(N)
-#define HDexp(X) exp(X)
-#define HDfabs(X) fabs(X)
-/* use ABS() because fabsf() fabsl() are not common yet. */
-#define HDfabsf(X) ABS(X)
-#define HDfabsl(X) ABS(X)
-#define HDfclose(F) fclose(F)
+#define HDdifftime(X, Y) difftime(X, Y)
+#define HDdiv(X, Y) div(X, Y)
+#define HDdup(F) dup(F)
+#define HDdup2(F, I) dup2(F, I)
+#define HDexecv(S, AV) execv(S, AV)
+#define HDexecve(S, AV, E) execve(S, AV, E)
+#define HDexecvp(S, AV) execvp(S, AV)
+#define HDexit(N) exit(N)
+#define HD_exit(N) _exit(N)
+#define HDexp(X) exp(X)
+#define HDfabs(X) fabs(X)
+#define HDfabsf(X) fabsf(X)
+#define HDfabsl(X) fabsl(X)
+#define HDfclose(F) fclose(F)
/* fcntl() variable arguments */
#define HDfdopen(N, S) fdopen(N, S)
#define HDfeof(F) feof(F)
@@ -137,17 +129,8 @@
#define HDfree(M) free(M)
#define HDfreopen(S, M, F) freopen(S, M, F)
#define HDfrexp(X, N) frexp(X, N)
-/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
-#ifdef H5_HAVE_FREXPF
-#define HDfrexpf(X, N) frexpf(X, N)
-#else /* H5_HAVE_FREXPF */
-#define HDfrexpf(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPF */
-#ifdef H5_HAVE_FREXPL
-#define HDfrexpl(X, N) frexpl(X, N)
-#else /* H5_HAVE_FREXPL */
-#define HDfrexpl(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPL */
+#define HDfrexpf(X, N) frexpf(X, N)
+#define HDfrexpl(X, N) frexpl(X, N)
/* fscanf() variable arguments */
#ifdef H5_HAVE_FSEEKO
#define HDfseek(F, O, W) fseeko(F, O, W)
@@ -471,24 +454,25 @@ void h5_dump_info_object(MPI_Info info);
/** From h5tools_utils.h **/
-extern int opt_err; /* getoption prints errors if this is on */
-extern int opt_ind; /* token pointer */
-extern const char *opt_arg; /* flag argument (or value) */
+extern int H5_opterr; /* getoption prints errors if this is on */
+extern int H5_optind; /* token pointer */
+extern const char *H5_optarg; /* flag argument (or value) */
-enum {
+enum h5_arg_level {
no_arg = 0, /* doesn't take an argument */
require_arg, /* requires an argument */
optional_arg /* argument is optional */
};
-typedef struct long_options {
- const char *name; /* name of the long option */
- int has_arg; /* whether we should look for an arg */
- char shortval; /* the shortname equivalent of long arg
- * this gets returned from get_option */
-} long_options;
+struct h5_long_options {
+ const char * name; /* Name of the long option */
+ enum h5_arg_level has_arg; /* Whether we should look for an arg */
+ char shortval; /* The shortname equivalent of long arg
+ * this gets returned from get_option
+ */
+};
-extern int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt);
+extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt);
extern int nCols; /*max number of columns for outputting */
diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c
index fe4e7e7..51a7825 100644
--- a/tools/test/perform/sio_perf.c
+++ b/tools/test/perform/sio_perf.c
@@ -97,13 +97,13 @@ static const char *progname = "h5perf_serial";
* It seems that only the options that accept additional information
* such as dataset size (-e) require the colon next to it.
*/
-static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:";
-static struct long_options l_opts[] = {{"align", require_arg, 'a'},
- {"alig", require_arg, 'a'},
- {"ali", require_arg, 'a'},
- {"al", require_arg, 'a'},
- {"api", require_arg, 'A'},
- {"ap", require_arg, 'A'},
+static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:";
+static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'},
+ {"alig", require_arg, 'a'},
+ {"ali", require_arg, 'a'},
+ {"al", require_arg, 'a'},
+ {"api", require_arg, 'A'},
+ {"ap", require_arg, 'A'},
#if 0
/* a sighting of the elusive binary option */
{ "binary", no_arg, 'b' },
@@ -112,156 +112,156 @@ static struct long_options l_opts[] = {{"align", require_arg, 'a'},
{ "bin", no_arg, 'b' },
{ "bi", no_arg, 'b' },
#endif /* 0 */
- {"block-size", require_arg, 'B'},
- {"block-siz", require_arg, 'B'},
- {"block-si", require_arg, 'B'},
- {"block-s", require_arg, 'B'},
- {"block-", require_arg, 'B'},
- {"block", require_arg, 'B'},
- {"bloc", require_arg, 'B'},
- {"blo", require_arg, 'B'},
- {"bl", require_arg, 'B'},
- {"chunk", no_arg, 'c'},
- {"chun", no_arg, 'c'},
- {"chu", no_arg, 'c'},
- {"ch", no_arg, 'c'},
- {"collective", no_arg, 'C'},
- {"collectiv", no_arg, 'C'},
- {"collecti", no_arg, 'C'},
- {"collect", no_arg, 'C'},
- {"collec", no_arg, 'C'},
- {"colle", no_arg, 'C'},
- {"coll", no_arg, 'C'},
- {"col", no_arg, 'C'},
- {"co", no_arg, 'C'},
- {"debug", require_arg, 'D'},
- {"debu", require_arg, 'D'},
- {"deb", require_arg, 'D'},
- {"de", require_arg, 'D'},
- {"file-driver", require_arg, 'v'},
- {"file-drive", require_arg, 'v'},
- {"file-driv", require_arg, 'v'},
- {"file-dri", require_arg, 'v'},
- {"file-dr", require_arg, 'v'},
- {"file-d", require_arg, 'v'},
- {"file-", require_arg, 'v'},
- {"file", require_arg, 'v'},
- {"fil", require_arg, 'v'},
- {"fi", require_arg, 'v'},
- {"geometry", no_arg, 'g'},
- {"geometr", no_arg, 'g'},
- {"geomet", no_arg, 'g'},
- {"geome", no_arg, 'g'},
- {"geom", no_arg, 'g'},
- {"geo", no_arg, 'g'},
- {"ge", no_arg, 'g'},
- {"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"interleaved", require_arg, 'I'},
- {"interleave", require_arg, 'I'},
- {"interleav", require_arg, 'I'},
- {"interlea", require_arg, 'I'},
- {"interle", require_arg, 'I'},
- {"interl", require_arg, 'I'},
- {"inter", require_arg, 'I'},
- {"inte", require_arg, 'I'},
- {"int", require_arg, 'I'},
- {"in", require_arg, 'I'},
- {"max-num-processes", require_arg, 'P'},
- {"max-num-processe", require_arg, 'P'},
- {"max-num-process", require_arg, 'P'},
- {"max-num-proces", require_arg, 'P'},
- {"max-num-proce", require_arg, 'P'},
- {"max-num-proc", require_arg, 'P'},
- {"max-num-pro", require_arg, 'P'},
- {"max-num-pr", require_arg, 'P'},
- {"max-num-p", require_arg, 'P'},
- {"min-num-processes", require_arg, 'p'},
- {"min-num-processe", require_arg, 'p'},
- {"min-num-process", require_arg, 'p'},
- {"min-num-proces", require_arg, 'p'},
- {"min-num-proce", require_arg, 'p'},
- {"min-num-proc", require_arg, 'p'},
- {"min-num-pro", require_arg, 'p'},
- {"min-num-pr", require_arg, 'p'},
- {"min-num-p", require_arg, 'p'},
- {"max-xfer-size", require_arg, 'X'},
- {"max-xfer-siz", require_arg, 'X'},
- {"max-xfer-si", require_arg, 'X'},
- {"max-xfer-s", require_arg, 'X'},
- {"max-xfer", require_arg, 'X'},
- {"max-xfe", require_arg, 'X'},
- {"max-xf", require_arg, 'X'},
- {"max-x", require_arg, 'X'},
- {"min-xfer-size", require_arg, 'x'},
- {"min-xfer-siz", require_arg, 'x'},
- {"min-xfer-si", require_arg, 'x'},
- {"min-xfer-s", require_arg, 'x'},
- {"min-xfer", require_arg, 'x'},
- {"min-xfe", require_arg, 'x'},
- {"min-xf", require_arg, 'x'},
- {"min-x", require_arg, 'x'},
- {"num-bytes", require_arg, 'e'},
- {"num-byte", require_arg, 'e'},
- {"num-byt", require_arg, 'e'},
- {"num-by", require_arg, 'e'},
- {"num-b", require_arg, 'e'},
- {"num-dsets", require_arg, 'd'},
- {"num-dset", require_arg, 'd'},
- {"num-dse", require_arg, 'd'},
- {"num-ds", require_arg, 'd'},
- {"num-d", require_arg, 'd'},
- {"num-files", require_arg, 'F'},
- {"num-file", require_arg, 'F'},
- {"num-fil", require_arg, 'F'},
- {"num-fi", require_arg, 'F'},
- {"num-f", require_arg, 'F'},
- {"num-iterations", require_arg, 'i'},
- {"num-iteration", require_arg, 'i'},
- {"num-iteratio", require_arg, 'i'},
- {"num-iterati", require_arg, 'i'},
- {"num-iterat", require_arg, 'i'},
- {"num-itera", require_arg, 'i'},
- {"num-iter", require_arg, 'i'},
- {"num-ite", require_arg, 'i'},
- {"num-it", require_arg, 'i'},
- {"num-i", require_arg, 'i'},
- {"order", require_arg, 'r'},
- {"orde", require_arg, 'r'},
- {"ord", require_arg, 'r'},
- {"or", require_arg, 'r'},
- {"output", require_arg, 'o'},
- {"outpu", require_arg, 'o'},
- {"outp", require_arg, 'o'},
- {"out", require_arg, 'o'},
- {"ou", require_arg, 'o'},
- {"extendable", no_arg, 't'},
- {"extendabl", no_arg, 't'},
- {"extendab", no_arg, 't'},
- {"extenda", no_arg, 't'},
- {"extend", no_arg, 't'},
- {"exten", no_arg, 't'},
- {"exte", no_arg, 't'},
- {"ext", no_arg, 't'},
- {"ex", no_arg, 't'},
- {"threshold", require_arg, 'T'},
- {"threshol", require_arg, 'T'},
- {"thresho", require_arg, 'T'},
- {"thresh", require_arg, 'T'},
- {"thres", require_arg, 'T'},
- {"thre", require_arg, 'T'},
- {"thr", require_arg, 'T'},
- {"th", require_arg, 'T'},
- {"write-only", require_arg, 'w'},
- {"write-onl", require_arg, 'w'},
- {"write-on", require_arg, 'w'},
- {"write-o", require_arg, 'w'},
- {"write", require_arg, 'w'},
- {"writ", require_arg, 'w'},
- {"wri", require_arg, 'w'},
- {"wr", require_arg, 'w'},
- {NULL, 0, '\0'}};
+ {"block-size", require_arg, 'B'},
+ {"block-siz", require_arg, 'B'},
+ {"block-si", require_arg, 'B'},
+ {"block-s", require_arg, 'B'},
+ {"block-", require_arg, 'B'},
+ {"block", require_arg, 'B'},
+ {"bloc", require_arg, 'B'},
+ {"blo", require_arg, 'B'},
+ {"bl", require_arg, 'B'},
+ {"chunk", no_arg, 'c'},
+ {"chun", no_arg, 'c'},
+ {"chu", no_arg, 'c'},
+ {"ch", no_arg, 'c'},
+ {"collective", no_arg, 'C'},
+ {"collectiv", no_arg, 'C'},
+ {"collecti", no_arg, 'C'},
+ {"collect", no_arg, 'C'},
+ {"collec", no_arg, 'C'},
+ {"colle", no_arg, 'C'},
+ {"coll", no_arg, 'C'},
+ {"col", no_arg, 'C'},
+ {"co", no_arg, 'C'},
+ {"debug", require_arg, 'D'},
+ {"debu", require_arg, 'D'},
+ {"deb", require_arg, 'D'},
+ {"de", require_arg, 'D'},
+ {"file-driver", require_arg, 'v'},
+ {"file-drive", require_arg, 'v'},
+ {"file-driv", require_arg, 'v'},
+ {"file-dri", require_arg, 'v'},
+ {"file-dr", require_arg, 'v'},
+ {"file-d", require_arg, 'v'},
+ {"file-", require_arg, 'v'},
+ {"file", require_arg, 'v'},
+ {"fil", require_arg, 'v'},
+ {"fi", require_arg, 'v'},
+ {"geometry", no_arg, 'g'},
+ {"geometr", no_arg, 'g'},
+ {"geomet", no_arg, 'g'},
+ {"geome", no_arg, 'g'},
+ {"geom", no_arg, 'g'},
+ {"geo", no_arg, 'g'},
+ {"ge", no_arg, 'g'},
+ {"help", no_arg, 'h'},
+ {"hel", no_arg, 'h'},
+ {"he", no_arg, 'h'},
+ {"interleaved", require_arg, 'I'},
+ {"interleave", require_arg, 'I'},
+ {"interleav", require_arg, 'I'},
+ {"interlea", require_arg, 'I'},
+ {"interle", require_arg, 'I'},
+ {"interl", require_arg, 'I'},
+ {"inter", require_arg, 'I'},
+ {"inte", require_arg, 'I'},
+ {"int", require_arg, 'I'},
+ {"in", require_arg, 'I'},
+ {"max-num-processes", require_arg, 'P'},
+ {"max-num-processe", require_arg, 'P'},
+ {"max-num-process", require_arg, 'P'},
+ {"max-num-proces", require_arg, 'P'},
+ {"max-num-proce", require_arg, 'P'},
+ {"max-num-proc", require_arg, 'P'},
+ {"max-num-pro", require_arg, 'P'},
+ {"max-num-pr", require_arg, 'P'},
+ {"max-num-p", require_arg, 'P'},
+ {"min-num-processes", require_arg, 'p'},
+ {"min-num-processe", require_arg, 'p'},
+ {"min-num-process", require_arg, 'p'},
+ {"min-num-proces", require_arg, 'p'},
+ {"min-num-proce", require_arg, 'p'},
+ {"min-num-proc", require_arg, 'p'},
+ {"min-num-pro", require_arg, 'p'},
+ {"min-num-pr", require_arg, 'p'},
+ {"min-num-p", require_arg, 'p'},
+ {"max-xfer-size", require_arg, 'X'},
+ {"max-xfer-siz", require_arg, 'X'},
+ {"max-xfer-si", require_arg, 'X'},
+ {"max-xfer-s", require_arg, 'X'},
+ {"max-xfer", require_arg, 'X'},
+ {"max-xfe", require_arg, 'X'},
+ {"max-xf", require_arg, 'X'},
+ {"max-x", require_arg, 'X'},
+ {"min-xfer-size", require_arg, 'x'},
+ {"min-xfer-siz", require_arg, 'x'},
+ {"min-xfer-si", require_arg, 'x'},
+ {"min-xfer-s", require_arg, 'x'},
+ {"min-xfer", require_arg, 'x'},
+ {"min-xfe", require_arg, 'x'},
+ {"min-xf", require_arg, 'x'},
+ {"min-x", require_arg, 'x'},
+ {"num-bytes", require_arg, 'e'},
+ {"num-byte", require_arg, 'e'},
+ {"num-byt", require_arg, 'e'},
+ {"num-by", require_arg, 'e'},
+ {"num-b", require_arg, 'e'},
+ {"num-dsets", require_arg, 'd'},
+ {"num-dset", require_arg, 'd'},
+ {"num-dse", require_arg, 'd'},
+ {"num-ds", require_arg, 'd'},
+ {"num-d", require_arg, 'd'},
+ {"num-files", require_arg, 'F'},
+ {"num-file", require_arg, 'F'},
+ {"num-fil", require_arg, 'F'},
+ {"num-fi", require_arg, 'F'},
+ {"num-f", require_arg, 'F'},
+ {"num-iterations", require_arg, 'i'},
+ {"num-iteration", require_arg, 'i'},
+ {"num-iteratio", require_arg, 'i'},
+ {"num-iterati", require_arg, 'i'},
+ {"num-iterat", require_arg, 'i'},
+ {"num-itera", require_arg, 'i'},
+ {"num-iter", require_arg, 'i'},
+ {"num-ite", require_arg, 'i'},
+ {"num-it", require_arg, 'i'},
+ {"num-i", require_arg, 'i'},
+ {"order", require_arg, 'r'},
+ {"orde", require_arg, 'r'},
+ {"ord", require_arg, 'r'},
+ {"or", require_arg, 'r'},
+ {"output", require_arg, 'o'},
+ {"outpu", require_arg, 'o'},
+ {"outp", require_arg, 'o'},
+ {"out", require_arg, 'o'},
+ {"ou", require_arg, 'o'},
+ {"extendable", no_arg, 't'},
+ {"extendabl", no_arg, 't'},
+ {"extendab", no_arg, 't'},
+ {"extenda", no_arg, 't'},
+ {"extend", no_arg, 't'},
+ {"exten", no_arg, 't'},
+ {"exte", no_arg, 't'},
+ {"ext", no_arg, 't'},
+ {"ex", no_arg, 't'},
+ {"threshold", require_arg, 'T'},
+ {"threshol", require_arg, 'T'},
+ {"thresho", require_arg, 'T'},
+ {"thresh", require_arg, 'T'},
+ {"thres", require_arg, 'T'},
+ {"thre", require_arg, 'T'},
+ {"thr", require_arg, 'T'},
+ {"th", require_arg, 'T'},
+ {"write-only", require_arg, 'w'},
+ {"write-onl", require_arg, 'w'},
+ {"write-on", require_arg, 'w'},
+ {"write-o", require_arg, 'w'},
+ {"write", require_arg, 'w'},
+ {"writ", require_arg, 'w'},
+ {"wri", require_arg, 'w'},
+ {"wr", require_arg, 'w'},
+ {NULL, 0, '\0'}};
struct options {
long io_types; /* bitmask of which I/O types to test */
@@ -993,19 +993,19 @@ parse_command_line(int argc, const char *argv[])
cl_opts->h5_extendable = FALSE; /* Use extendable dataset */
cl_opts->verify = FALSE; /* No Verify data correctness by default */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'a':
- cl_opts->h5_alignment = parse_size_directive(opt_arg);
+ cl_opts->h5_alignment = parse_size_directive(H5_optarg);
break;
case 'G':
- cl_opts->page_size = parse_size_directive(opt_arg);
+ cl_opts->page_size = parse_size_directive(H5_optarg);
break;
case 'b':
- cl_opts->page_buffer_size = parse_size_directive(opt_arg);
+ cl_opts->page_buffer_size = parse_size_directive(H5_optarg);
break;
case 'A': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
while (end && *end != '\0') {
char buf[10];
@@ -1043,7 +1043,7 @@ parse_command_line(int argc, const char *argv[])
/* Turn on chunked HDF5 dataset creation */
cl_opts->h5_use_chunks = 1;
{
- const char *end = opt_arg;
+ const char *end = H5_optarg;
int j = 0;
while (end && *end != '\0') {
@@ -1070,7 +1070,7 @@ parse_command_line(int argc, const char *argv[])
break;
case 'D': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
while (end && *end != '\0') {
char buf[10];
@@ -1126,7 +1126,7 @@ parse_command_line(int argc, const char *argv[])
break;
case 'e': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
int j = 0;
while (end && *end != '\0') {
@@ -1153,38 +1153,38 @@ parse_command_line(int argc, const char *argv[])
break;
case 'i':
- cl_opts->num_iters = HDatoi(opt_arg);
+ cl_opts->num_iters = HDatoi(H5_optarg);
break;
case 'o':
- cl_opts->output_file = opt_arg;
+ cl_opts->output_file = H5_optarg;
break;
case 'T':
- cl_opts->h5_threshold = parse_size_directive(opt_arg);
+ cl_opts->h5_threshold = parse_size_directive(H5_optarg);
break;
case 'v':
- if (!HDstrcasecmp(opt_arg, "sec2")) {
+ if (!HDstrcasecmp(H5_optarg, "sec2")) {
cl_opts->vfd = sec2;
}
- else if (!HDstrcasecmp(opt_arg, "stdio")) {
+ else if (!HDstrcasecmp(H5_optarg, "stdio")) {
cl_opts->vfd = stdio;
}
- else if (!HDstrcasecmp(opt_arg, "core")) {
+ else if (!HDstrcasecmp(H5_optarg, "core")) {
cl_opts->vfd = core;
}
- else if (!HDstrcasecmp(opt_arg, "split")) {
+ else if (!HDstrcasecmp(H5_optarg, "split")) {
cl_opts->vfd = split;
}
- else if (!HDstrcasecmp(opt_arg, "multi")) {
+ else if (!HDstrcasecmp(H5_optarg, "multi")) {
cl_opts->vfd = multi;
}
- else if (!HDstrcasecmp(opt_arg, "family")) {
+ else if (!HDstrcasecmp(H5_optarg, "family")) {
cl_opts->vfd = family;
}
- else if (!HDstrcasecmp(opt_arg, "direct")) {
+ else if (!HDstrcasecmp(H5_optarg, "direct")) {
cl_opts->vfd = direct;
}
else {
- HDfprintf(stderr, "sio_perf: invalid --api option %s\n", opt_arg);
+ HDfprintf(stderr, "sio_perf: invalid --api option %s\n", H5_optarg);
HDexit(EXIT_FAILURE);
}
break;
@@ -1195,7 +1195,7 @@ parse_command_line(int argc, const char *argv[])
cl_opts->h5_extendable = TRUE;
break;
case 'x': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
int j = 0;
while (end && *end != '\0') {
@@ -1222,7 +1222,7 @@ parse_command_line(int argc, const char *argv[])
break;
case 'r': {
- const char *end = opt_arg;
+ const char *end = H5_optarg;
int j = 0;
while (end && *end != '\0') {
diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c
index abc0777..2e793fb 100644
--- a/tools/test/perform/sio_standalone.c
+++ b/tools/test/perform/sio_standalone.c
@@ -23,30 +23,30 @@
int nCols = 80;
/* ``get_option'' variables */
-int opt_err = 1; /*get_option prints errors if this is on */
-int opt_ind = 1; /*token pointer */
-const char *opt_arg; /*flag argument (or value) */
+int H5_opterr = 1; /*get_option prints errors if this is on */
+int H5_optind = 1; /*token pointer */
+const char *H5_optarg; /*flag argument (or value) */
int
-get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts)
+get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts)
{
static int sp = 1; /* character index in current token */
int opt_opt = '?'; /* option character passed back to user */
if (sp == 1) {
/* check for more flag-like tokens */
- if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') {
+ if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') {
return EOF;
}
- else if (HDstrcmp(argv[opt_ind], "--") == 0) {
- opt_ind++;
+ else if (HDstrcmp(argv[H5_optind], "--") == 0) {
+ H5_optind++;
return EOF;
}
}
- if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') {
+ if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') {
/* long command line option */
- const char *arg = &argv[opt_ind][2];
+ const char *arg = &argv[H5_optind][2];
int i;
for (i = 0; l_opts && l_opts[i].name; i++) {
@@ -58,13 +58,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].has_arg != no_arg) {
if (arg[len] == '=') {
- opt_arg = &arg[len + 1];
+ H5_optarg = &arg[len + 1];
}
- else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') {
- opt_arg = argv[++opt_ind];
+ else if (H5_optind < (argc - 1) && argv[H5_optind + 1][0] != '-') {
+ H5_optarg = argv[++H5_optind];
}
else if (l_opts[i].has_arg == require_arg) {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg);
opt_opt = '?';
@@ -72,13 +72,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
}
else {
if (arg[len] == '=') {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg);
opt_opt = '?';
}
- opt_arg = NULL;
+ H5_optarg = NULL;
}
break;
@@ -87,29 +87,29 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (l_opts[i].name == NULL) {
/* exhausted all of the l_opts we have and still didn't match */
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg);
opt_opt = '?';
}
- opt_ind++;
+ H5_optind++;
sp = 1;
}
else {
register char *cp; /* pointer into current token */
/* short command line option */
- opt_opt = argv[opt_ind][sp];
+ opt_opt = argv[H5_optind][sp];
if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) {
- if (opt_err)
+ if (H5_opterr)
HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt);
/* if no chars left in this token, move to next token */
- if (argv[opt_ind][++sp] == '\0') {
- opt_ind++;
+ if (argv[H5_optind][++sp] == '\0') {
+ H5_optind++;
sp = 1;
}
@@ -118,32 +118,32 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
if (*++cp == ':') {
/* if a value is expected, get it */
- if (argv[opt_ind][sp + 1] != '\0') {
+ if (argv[H5_optind][sp + 1] != '\0') {
/* flag value is rest of current token */
- opt_arg = &argv[opt_ind++][sp + 1];
+ H5_optarg = &argv[H5_optind++][sp + 1];
}
- else if (++opt_ind >= argc) {
- if (opt_err)
+ else if (++H5_optind >= argc) {
+ if (H5_opterr)
HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt);
opt_opt = '?';
}
else {
/* flag value is next token */
- opt_arg = argv[opt_ind++];
+ H5_optarg = argv[H5_optind++];
}
sp = 1;
}
else {
/* set up to look at next char in token, next time */
- if (argv[opt_ind][++sp] == '\0') {
+ if (argv[H5_optind][++sp] == '\0') {
/* no more in current token, so setup next token */
- opt_ind++;
+ H5_optind++;
sp = 1;
}
- opt_arg = NULL;
+ H5_optarg = NULL;
}
}
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index 54e82fa..098b98a 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -105,28 +105,20 @@
#define HDctermid(S) ctermid(S)
#define HDctime(T) ctime(T)
#define HDcuserid(S) cuserid(S)
-#ifdef H5_HAVE_DIFFTIME
-#define HDdifftime(X, Y) difftime(X, Y)
-#else
-#define HDdifftime(X, Y) ((double)(X) - (double)(Y))
-#endif
-#define HDdiv(X, Y) div(X, Y)
-#define HDdup(F) dup(F)
-#define HDdup2(F, I) dup2(F, I)
-/* execl() variable arguments */
-/* execle() variable arguments */
-/* execlp() variable arguments */
-#define HDexecv(S, AV) execv(S, AV)
-#define HDexecve(S, AV, E) execve(S, AV, E)
-#define HDexecvp(S, AV) execvp(S, AV)
-#define HDexit(N) exit(N)
-#define HD_exit(N) _exit(N)
-#define HDexp(X) exp(X)
-#define HDfabs(X) fabs(X)
-/* use ABS() because fabsf() fabsl() are not common yet. */
-#define HDfabsf(X) ABS(X)
-#define HDfabsl(X) ABS(X)
-#define HDfclose(F) fclose(F)
+#define HDdifftime(X, Y) difftime(X, Y)
+#define HDdiv(X, Y) div(X, Y)
+#define HDdup(F) dup(F)
+#define HDdup2(F, I) dup2(F, I)
+#define HDexecv(S, AV) execv(S, AV)
+#define HDexecve(S, AV, E) execve(S, AV, E)
+#define HDexecvp(S, AV) execvp(S, AV)
+#define HDexit(N) exit(N)
+#define HD_exit(N) _exit(N)
+#define HDexp(X) exp(X)
+#define HDfabs(X) fabs(X)
+#define HDfabsf(X) fabsf(X)
+#define HDfabsl(X) fabsl(X)
+#define HDfclose(F) fclose(F)
/* fcntl() variable arguments */
#define HDfdopen(N, S) fdopen(N, S)
#define HDfeof(F) feof(F)
@@ -152,17 +144,8 @@
#define HDfree(M) free(M)
#define HDfreopen(S, M, F) freopen(S, M, F)
#define HDfrexp(X, N) frexp(X, N)
-/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
-#ifdef H5_HAVE_FREXPF
-#define HDfrexpf(X, N) frexpf(X, N)
-#else /* H5_HAVE_FREXPF */
-#define HDfrexpf(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPF */
-#ifdef H5_HAVE_FREXPL
-#define HDfrexpl(X, N) frexpl(X, N)
-#else /* H5_HAVE_FREXPL */
-#define HDfrexpl(X, N) frexp(X, N)
-#endif /* H5_HAVE_FREXPL */
+#define HDfrexpf(X, N) frexpf(X, N)
+#define HDfrexpl(X, N) frexpl(X, N)
/* fscanf() variable arguments */
#ifdef H5_HAVE_FSEEKO
#define HDfseek(F, O, W) fseeko(F, O, W)
@@ -486,24 +469,25 @@ void h5_dump_info_object(MPI_Info info);
/** From h5tools_utils.h **/
-extern int opt_err; /* getoption prints errors if this is on */
-extern int opt_ind; /* token pointer */
-extern const char *opt_arg; /* flag argument (or value) */
+extern int H5_opterr; /* getoption prints errors if this is on */
+extern int H5_optind; /* token pointer */
+extern const char *H5_optarg; /* flag argument (or value) */
-enum {
+enum h5_arg_level {
no_arg = 0, /* doesn't take an argument */
require_arg, /* requires an argument */
optional_arg /* argument is optional */
};
-typedef struct long_options {
- const char *name; /* name of the long option */
- int has_arg; /* whether we should look for an arg */
- char shortval; /* the shortname equivalent of long arg
- * this gets returned from get_option */
-} long_options;
+struct h5_long_options {
+ const char * name; /* Name of the long option */
+ enum h5_arg_level has_arg; /* Whether we should look for an arg */
+ char shortval; /* The shortname equivalent of long arg
+ * this gets returned from get_option
+ */
+};
-extern int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt);
+extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt);
extern int nCols; /*max number of columns for outputting */
diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c
index 517866b..6231587 100644
--- a/tools/test/perform/zip_perf.c
+++ b/tools/test/perform/zip_perf.c
@@ -64,66 +64,66 @@ static void error(const char *fmt, ...);
static void compress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
/* commandline options : long and short form */
-static const char * s_opts = "hB:b:c:p:rs:0123456789";
-static struct long_options l_opts[] = {{"help", no_arg, 'h'},
- {"compressability", require_arg, 'c'},
- {"compressabilit", require_arg, 'c'},
- {"compressabili", require_arg, 'c'},
- {"compressabil", require_arg, 'c'},
- {"compressabi", require_arg, 'c'},
- {"compressab", require_arg, 'c'},
- {"compressa", require_arg, 'c'},
- {"compress", require_arg, 'c'},
- {"compres", require_arg, 'c'},
- {"compre", require_arg, 'c'},
- {"compr", require_arg, 'c'},
- {"comp", require_arg, 'c'},
- {"com", require_arg, 'c'},
- {"co", require_arg, 'c'},
- {"file-size", require_arg, 's'},
- {"file-siz", require_arg, 's'},
- {"file-si", require_arg, 's'},
- {"file-s", require_arg, 's'},
- {"file", require_arg, 's'},
- {"fil", require_arg, 's'},
- {"fi", require_arg, 's'},
- {"max-buffer-size", require_arg, 'B'},
- {"max-buffer-siz", require_arg, 'B'},
- {"max-buffer-si", require_arg, 'B'},
- {"max-buffer-s", require_arg, 'B'},
- {"max-buffer", require_arg, 'B'},
- {"max-buffe", require_arg, 'B'},
- {"max-buff", require_arg, 'B'},
- {"max-buf", require_arg, 'B'},
- {"max-bu", require_arg, 'B'},
- {"max-b", require_arg, 'B'},
- {"max", require_arg, 'B'},
- {"min-buffer-size", require_arg, 'b'},
- {"min-buffer-siz", require_arg, 'b'},
- {"min-buffer-si", require_arg, 'b'},
- {"min-buffer-s", require_arg, 'b'},
- {"min-buffer", require_arg, 'b'},
- {"min-buffe", require_arg, 'b'},
- {"min-buff", require_arg, 'b'},
- {"min-buf", require_arg, 'b'},
- {"min-bu", require_arg, 'b'},
- {"min-b", require_arg, 'b'},
- {"min", require_arg, 'b'},
- {"prefix", require_arg, 'p'},
- {"prefi", require_arg, 'p'},
- {"pref", require_arg, 'p'},
- {"pre", require_arg, 'p'},
- {"pr", require_arg, 'p'},
- {"random-test", no_arg, 'r'},
- {"random-tes", no_arg, 'r'},
- {"random-te", no_arg, 'r'},
- {"random-t", no_arg, 'r'},
- {"random", no_arg, 'r'},
- {"rando", no_arg, 'r'},
- {"rand", no_arg, 'r'},
- {"ran", no_arg, 'r'},
- {"ra", no_arg, 'r'},
- {NULL, 0, '\0'}};
+static const char * s_opts = "hB:b:c:p:rs:0123456789";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
+ {"compressability", require_arg, 'c'},
+ {"compressabilit", require_arg, 'c'},
+ {"compressabili", require_arg, 'c'},
+ {"compressabil", require_arg, 'c'},
+ {"compressabi", require_arg, 'c'},
+ {"compressab", require_arg, 'c'},
+ {"compressa", require_arg, 'c'},
+ {"compress", require_arg, 'c'},
+ {"compres", require_arg, 'c'},
+ {"compre", require_arg, 'c'},
+ {"compr", require_arg, 'c'},
+ {"comp", require_arg, 'c'},
+ {"com", require_arg, 'c'},
+ {"co", require_arg, 'c'},
+ {"file-size", require_arg, 's'},
+ {"file-siz", require_arg, 's'},
+ {"file-si", require_arg, 's'},
+ {"file-s", require_arg, 's'},
+ {"file", require_arg, 's'},
+ {"fil", require_arg, 's'},
+ {"fi", require_arg, 's'},
+ {"max-buffer-size", require_arg, 'B'},
+ {"max-buffer-siz", require_arg, 'B'},
+ {"max-buffer-si", require_arg, 'B'},
+ {"max-buffer-s", require_arg, 'B'},
+ {"max-buffer", require_arg, 'B'},
+ {"max-buffe", require_arg, 'B'},
+ {"max-buff", require_arg, 'B'},
+ {"max-buf", require_arg, 'B'},
+ {"max-bu", require_arg, 'B'},
+ {"max-b", require_arg, 'B'},
+ {"max", require_arg, 'B'},
+ {"min-buffer-size", require_arg, 'b'},
+ {"min-buffer-siz", require_arg, 'b'},
+ {"min-buffer-si", require_arg, 'b'},
+ {"min-buffer-s", require_arg, 'b'},
+ {"min-buffer", require_arg, 'b'},
+ {"min-buffe", require_arg, 'b'},
+ {"min-buff", require_arg, 'b'},
+ {"min-buf", require_arg, 'b'},
+ {"min-bu", require_arg, 'b'},
+ {"min-b", require_arg, 'b'},
+ {"min", require_arg, 'b'},
+ {"prefix", require_arg, 'p'},
+ {"prefi", require_arg, 'p'},
+ {"pref", require_arg, 'p'},
+ {"pre", require_arg, 'p'},
+ {"pr", require_arg, 'p'},
+ {"random-test", no_arg, 'r'},
+ {"random-tes", no_arg, 'r'},
+ {"random-te", no_arg, 'r'},
+ {"random-t", no_arg, 'r'},
+ {"random", no_arg, 'r'},
+ {"rando", no_arg, 'r'},
+ {"rand", no_arg, 'r'},
+ {"ran", no_arg, 'r'},
+ {"ra", no_arg, 'r'},
+ {NULL, 0, '\0'}};
/*
* Function: error
@@ -551,7 +551,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- while ((opt = get_option(argc, argv, s_opts, l_opts)) > 0) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) > 0) {
switch ((char)opt) {
case '0':
case '1':
@@ -566,13 +566,13 @@ main(int argc, const char *argv[])
compress_level = opt - '0';
break;
case 'B':
- max_buf_size = parse_size_directive(opt_arg);
+ max_buf_size = parse_size_directive(H5_optarg);
break;
case 'b':
- min_buf_size = parse_size_directive(opt_arg);
+ min_buf_size = parse_size_directive(H5_optarg);
break;
case 'c':
- compress_percent = (int)HDstrtol(opt_arg, NULL, 10);
+ compress_percent = (int)HDstrtol(H5_optarg, NULL, 10);
if (compress_percent < 0)
compress_percent = 0;
@@ -581,13 +581,13 @@ main(int argc, const char *argv[])
break;
case 'p':
- option_prefix = opt_arg;
+ option_prefix = H5_optarg;
break;
case 'r':
random_test = TRUE;
break;
case 's':
- file_size = parse_size_directive(opt_arg);
+ file_size = parse_size_directive(H5_optarg);
break;
case '?':
usage();