summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_str.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-06-22 14:29:21 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-06-22 14:29:21 (GMT)
commita5f1d15035deb7b400f6228da936f1b96664aa35 (patch)
tree5ec7c5cab2035ef00a38bce95ad43cfaebf3fc22 /tools/lib/h5tools_str.c
parent18a656663a73a693cabf49d6f4858f7af311e6f5 (diff)
downloadhdf5-a5f1d15035deb7b400f6228da936f1b96664aa35.zip
hdf5-a5f1d15035deb7b400f6228da936f1b96664aa35.tar.gz
hdf5-a5f1d15035deb7b400f6228da936f1b96664aa35.tar.bz2
[svn-r8715] Purpose:
h5dump output change, new tests Description: the storage layout output format the storage layout output format had some changes same for the user defined filter add an option (-y) for not printing the array indices (default is print indices ) the option for escaping non printable characters covers all characters (default is not escape) (this might be not very portable, the test files are tstring.ddl and tstringe.ddl ) add tests for the new options Solution: Platforms tested: linux solaris AIX Misc. update:
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r--tools/lib/h5tools_str.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 9faba55..9214b89 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -475,33 +475,50 @@ h5tools_print_char(h5tools_str_t *str, const h5dump_t *info, unsigned char ch)
} else {
switch (ch) {
case '"':
+ if (!info->do_escape)
+ h5tools_str_append(str, "\"");
+ else
h5tools_str_append(str, "\\\"");
break;
case '\\':
+ if (!info->do_escape)
+ h5tools_str_append(str, "\\");
+ else
h5tools_str_append(str, "\\\\");
break;
case '\b':
+ if (!info->do_escape)
+ h5tools_str_append(str, "\b");
+ else
h5tools_str_append(str, "\\b");
break;
case '\f':
- h5tools_str_append(str, "\\f");
+ if (!info->do_escape)
+ h5tools_str_append(str, "\f");
+ else
+ h5tools_str_append(str, "\\f");
break;
case '\n':
- if (info->do_lf) {
- h5tools_str_append(str, "\n");
- h5tools_str_append(str, " ");
- }
- else
- h5tools_str_append(str, "\\n");
+ if (!info->do_escape) {
+ h5tools_str_append(str, "\n");
+ h5tools_str_append(str, " ");
+ }
+ else
+ h5tools_str_append(str, "\\n");
break;
case '\r':
+ if (!info->do_escape) {
+ h5tools_str_append(str, "\r");
+ h5tools_str_append(str, " ");
+ }
+ else
h5tools_str_append(str, "\\r");
break;
case '\t':
- if (info->do_lf)
- h5tools_str_append(str, "\t");
- else
- h5tools_str_append(str, "\\t");
+ if (!info->do_escape)
+ h5tools_str_append(str, "\t");
+ else
+ h5tools_str_append(str, "\\t");
break;
default:
if (isprint(ch))
@@ -514,6 +531,7 @@ h5tools_print_char(h5tools_str_t *str, const h5dump_t *info, unsigned char ch)
}
}
+
/*-------------------------------------------------------------------------
* Function: h5tools_str_sprint
*