summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>2000-02-17 15:28:55 (GMT)
committerPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>2000-02-17 15:28:55 (GMT)
commit232a032d54fb20304b9a2fd6961cfbc7fd3b6ff8 (patch)
tree72daea1679963fa787ef4d410e802cd7ea32761b /tools
parent3c0df63acd58ca15bf9cc6774d7dba83f35a5f47 (diff)
downloadhdf5-232a032d54fb20304b9a2fd6961cfbc7fd3b6ff8.zip
hdf5-232a032d54fb20304b9a2fd6961cfbc7fd3b6ff8.tar.gz
hdf5-232a032d54fb20304b9a2fd6961cfbc7fd3b6ff8.tar.bz2
[svn-r1969] fixed a bug with the objrefs. added a format string to the dump struct to
display the format for the obj refs.
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump.c11
-rw-r--r--tools/h5tools.c16
-rw-r--r--tools/h5tools.h4
3 files changed, 26 insertions, 5 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c
index 833ff46..4bb3bcd 100644
--- a/tools/h5dump.c
+++ b/tools/h5dump.c
@@ -1075,7 +1075,13 @@ dump_data (hid_t obj_id, int obj_data) {
info.fmt_float = "%g";
info.fmt_schar = "%d";
info.fmt_int = "%d";
-
+ info.fmt_uint = "%u";
+ info.fmt_uchar = "%u";
+ info.fmt_short = "%d";
+ info.fmt_ushort = "%u";
+ info.fmt_long = "%ld";
+ info.fmt_ulong = "%lu";
+
info.str_repeat = 0;
info.raw = 0;
@@ -1087,6 +1093,9 @@ dump_data (hid_t obj_id, int obj_data) {
info.arr_linebreak = 1;
info.skip_first = 1;
+
+ info.obj_hidefileno = 1;
+ info.obj_format = " %lu:%lu";
indent += COL;
/*the depth will tell us how far we need to indent extra. we use to just
use indent but with the merging of the tools lib we have to do something different
diff --git a/tools/h5tools.c b/tools/h5tools.c
index 0f55fa4..f26ea34 100644
--- a/tools/h5tools.c
+++ b/tools/h5tools.c
@@ -610,7 +610,6 @@ h5dump_sprint(h5dump_str_t *str/*in,out*/, const h5dump_t *info,
static char fmt_llong[8], fmt_ullong[8];
H5T_str_t pad;
H5G_stat_t sb;
-
/* Build default formats for long long types */
if (!fmt_llong[0]) {
@@ -974,9 +973,15 @@ h5dump_sprint(h5dump_str_t *str/*in,out*/, const h5dump_t *info,
}
/* Print OID */
- h5dump_str_append(str, "-%lu:%lu:%lu:%lu",
- sb.fileno[1], sb.fileno[0],
- sb.objno[1], sb.objno[0]);
+ if (info->obj_hidefileno){
+ h5dump_str_append(str, info->obj_format,
+ sb.objno[1], sb.objno[0]);
+ }
+ else {
+ h5dump_str_append(str, info->obj_format,
+ sb.fileno[1], sb.fileno[0],
+ sb.objno[1], sb.objno[0]);
+ }
}
} else {
@@ -1052,6 +1057,9 @@ h5dump_simple_prefix(FILE *stream, const h5dump_t *info,
/* Terminate previous line, if any */
if (ctx->cur_column) {
fputs(OPT(info->line_suf, ""), stream);
+ /*if (info->line_ncols != ctx->cur_column) {
+ putc('\n', stream);
+ }*/
putc('\n',stream);
fputs(OPT(info->line_sep, ""), stream);
}
diff --git a/tools/h5tools.h b/tools/h5tools.h
index e3e30a1..eb92dab 100644
--- a/tools/h5tools.h
+++ b/tools/h5tools.h
@@ -262,6 +262,10 @@ typedef struct h5dump_t {
int skip_first; /*used to skip the first set of checks for line length*/
+ int obj_hidefileno; /*flag used to hide or show the file number for obj refs*/
+ const char *obj_format; /*string used to format the output for the obje refs*/
+
+
} h5dump_t;