summaryrefslogtreecommitdiffstats
path: root/tools/src/h5dump/h5dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/h5dump/h5dump.c')
-rw-r--r--tools/src/h5dump/h5dump.c340
1 files changed, 170 insertions, 170 deletions
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);