summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_str.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-06-10 17:35:48 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-06-10 17:35:48 (GMT)
commit78ca05e040c21cf79fe09da5269204f64bf6d967 (patch)
tree3f03841c935006d1d103b4e1063c6448a0456edc /tools/lib/h5tools_str.c
parent29f91cd95d7ab067e46cad06d4cf48b03aabc834 (diff)
downloadhdf5-78ca05e040c21cf79fe09da5269204f64bf6d967.zip
hdf5-78ca05e040c21cf79fe09da5269204f64bf6d967.tar.gz
hdf5-78ca05e040c21cf79fe09da5269204f64bf6d967.tar.bz2
[svn-r8644] Purpose: h5dump new features
Description: added the code for print strings with new line and display the path of references (new source files h5tools_ref.c and .h ) added a test suite in testh5dump.sh.in for ( note : to create testh5dump.sh , one must redo ./configure; this detects the availability of filters and generates testh5dump.sh accordingly) 1) storage layout 2) fill value 3) print reference with path 4) print strings with new lines 5) filters Solution: Platforms tested: linux solaris AIX Misc. update:
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r--tools/lib/h5tools_str.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 5398d76..fb1d0c2 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -27,6 +27,9 @@
#include "h5tools.h" /*for h5dump_t structure */
#include "h5tools_str.h" /*function prototypes */
+extern char* lookup_ref_path(hobj_ref_t ref);
+
+
/*
* If REPEAT_VERBOSE is defined then character strings will be printed so
* that repeated character sequences like "AAAAAAAAAA" are displayed as
@@ -452,8 +455,13 @@ h5tools_print_char(h5tools_str_t *str, const h5dump_t *info, unsigned char ch)
h5tools_str_append(str, "\\f");
break;
case '\n':
- h5tools_str_append(str, "\\n");
- break;
+ if (info->do_lf) {
+ h5tools_str_append(str, "\n");
+ h5tools_str_append(str, " ");
+ }
+ else
+ h5tools_str_append(str, "\\n");
+ break;
case '\r':
h5tools_str_append(str, "\\r");
break;
@@ -794,6 +802,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container,
if (h5tools_is_zero(vp, H5Tget_size(type))) {
h5tools_str_append(str, "NULL");
} else {
+ char *path=NULL;
otype = H5Rget_obj_type(container, H5R_OBJECT, vp);
obj = H5Rdereference(container, H5R_OBJECT, vp);
H5Gget_objinfo(obj, ".", FALSE, &sb);
@@ -822,6 +831,14 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container,
h5tools_str_append(str, info->obj_format, sb.objno);
else
h5tools_str_append(str, info->obj_format, sb.fileno,sb.objno);
+
+ /* Print name */
+ path = lookup_ref_path(*(hobj_ref_t *)vp);
+ if (path) {
+ h5tools_str_append(str, " ");
+ h5tools_str_append(str, path);
+ h5tools_str_append(str, " ");
+ }
}
} else if (H5Tget_class(type) == H5T_ARRAY) {
int k, ndims;