summaryrefslogtreecommitdiffstats
path: root/tools/src/h5stat/h5stat.c
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-02-21 16:37:04 (GMT)
committerGitHub <noreply@github.com>2022-02-21 16:37:04 (GMT)
commitc7d800e5e526e2dcc2fd19cd0c75d2ef92f184bc (patch)
treeaa6df876c2d6da6f35f531fd025589e60f9e2b8d /tools/src/h5stat/h5stat.c
parent1c9f219463e236487a27cee6cb839379d670cda4 (diff)
downloadhdf5-c7d800e5e526e2dcc2fd19cd0c75d2ef92f184bc.zip
hdf5-c7d800e5e526e2dcc2fd19cd0c75d2ef92f184bc.tar.gz
hdf5-c7d800e5e526e2dcc2fd19cd0c75d2ef92f184bc.tar.bz2
1.12 Fix tools incompatibility (#1448)
* fix tools incompatibility with get_option #1443 * Fix get_option function * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'tools/src/h5stat/h5stat.c')
-rw-r--r--tools/src/h5stat/h5stat.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index 900e4ba..81acb89 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -171,23 +171,23 @@ 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 h5_long_options l_opts[] = {{"help", no_arg, 'h'},
- {"filemetadata", no_arg, 'F'},
- {"groupmetadata", no_arg, 'G'},
- {"links", require_arg, 'l'},
- {"dsetmetadata", no_arg, 'D'},
- {"dims", require_arg, 'm'},
- {"dtypemetadata", no_arg, 'T'},
- {"object", require_arg, 'O'},
- {"version", no_arg, 'V'},
- {"attribute", no_arg, 'A'},
- {"enable-error-stack", no_arg, 'E'},
- {"numattrs", require_arg, 'a'},
- {"freespace", no_arg, 's'},
- {"summary", no_arg, 'S'},
- {"s3-cred", require_arg, 'w'},
- {"hdfs-attrs", require_arg, 'H'},
- {NULL, 0, '\0'}};
+static struct long_options l_opts[] = {{"help", no_arg, 'h'},
+ {"filemetadata", no_arg, 'F'},
+ {"groupmetadata", no_arg, 'G'},
+ {"links", require_arg, 'l'},
+ {"dsetmetadata", no_arg, 'D'},
+ {"dims", require_arg, 'm'},
+ {"dtypemetadata", no_arg, 'T'},
+ {"object", require_arg, 'O'},
+ {"version", no_arg, 'V'},
+ {"attribute", no_arg, 'A'},
+ {"enable-error-stack", no_arg, 'E'},
+ {"numattrs", require_arg, 'a'},
+ {"freespace", no_arg, 's'},
+ {"summary", no_arg, 'S'},
+ {"s3-cred", require_arg, 'w'},
+ {"hdfs-attrs", require_arg, 'H'},
+ {NULL, 0, '\0'}};
static void
leave(int ret)
@@ -837,7 +837,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re
struct handler_t *hand = NULL;
/* parse command line options */
- while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'h':
usage(h5tools_getprogname());
@@ -876,8 +876,8 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re
break;
case 'l':
- if (H5_optarg) {
- sgroups_threshold = HDatoi(H5_optarg);
+ if (opt_arg) {
+ sgroups_threshold = HDatoi(opt_arg);
if (sgroups_threshold < 1) {
error_msg("Invalid threshold for small groups\n");
goto error;
@@ -899,8 +899,8 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re
break;
case 'm':
- if (H5_optarg) {
- sdsets_threshold = HDatoi(H5_optarg);
+ if (opt_arg) {
+ sdsets_threshold = HDatoi(opt_arg);
if (sdsets_threshold < 1) {
error_msg("Invalid threshold for small datasets\n");
goto error;
@@ -922,8 +922,8 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re
break;
case 'a':
- if (H5_optarg) {
- sattrs_threshold = HDatoi(H5_optarg);
+ if (opt_arg) {
+ sattrs_threshold = HDatoi(opt_arg);
if (sattrs_threshold < 1) {
error_msg("Invalid threshold for small # of attributes\n");
goto error;
@@ -963,7 +963,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re
/* Store object names */
for (u = 0; u < hand->obj_count; u++)
- if (NULL == (hand->obj[u] = HDstrdup(H5_optarg))) {
+ if (NULL == (hand->obj[u] = HDstrdup(opt_arg))) {
error_msg("unable to allocate memory for object name\n");
goto error;
} /* end if */
@@ -971,7 +971,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re
case 'w':
#ifdef H5_HAVE_ROS3_VFD
- if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa) < 0) {
+ if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa) < 0) {
error_msg("failed to parse S3 VFD credential info\n");
goto error;
}
@@ -985,7 +985,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re
case 'H':
#ifdef H5_HAVE_LIBHDFS
- if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa) < 0) {
+ if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa) < 0) {
error_msg("failed to parse HDFS VFD configuration info\n");
goto error;
}
@@ -1004,7 +1004,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re
} /* end while */
/* check for file name to be processed */
- if (argc <= H5_optind) {
+ if (argc <= opt_ind) {
error_msg("missing file name\n");
usage(h5tools_getprogname());
goto error;
@@ -1728,7 +1728,7 @@ main(int argc, char *argv[])
}
}
- fname = argv[H5_optind];
+ fname = argv[opt_ind];
/* Check for filename given */
if (fname) {