From 435c8b2d7d58f361b8a74ff5bf8e53333b5f6878 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Tue, 15 Jun 2004 09:26:41 -0500 Subject: [svn-r8688] Purpose: h5dump new feature Description: add processing of tab characters (in the context of the new option process CR/LF) Solution: Platforms tested: linux solaris AIX Misc. update: --- tools/h5dump/h5dumpgentest.c | 2 +- tools/lib/h5tools_str.c | 5 ++++- tools/testfiles/tfilters.h5 | Bin 48928 -> 48928 bytes tools/testfiles/tstring.ddl | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 75c5bd1..f540c25 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -4475,7 +4475,7 @@ static void gent_filters() hsize_t dims2[1]={2}; hvl_t buf2[2]; hsize_t dims3[1]={1}; - char buf3[]={"this is\n a string with three\n newline\n escape characters"}; + char buf3[]={"this is\n a string \twith three\n newline\n escape \tcharacters"}; hsize_t dims4[1]={6}; char buf4[6]={"abcdef"}; hobj_ref_t buf5[5]; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b717b3a..6656c81 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -466,7 +466,10 @@ h5tools_print_char(h5tools_str_t *str, const h5dump_t *info, unsigned char ch) h5tools_str_append(str, "\\r"); break; case '\t': - h5tools_str_append(str, "\\t"); + if (info->do_lf) + h5tools_str_append(str, "\t"); + else + h5tools_str_append(str, "\\t"); break; default: if (isprint(ch)) diff --git a/tools/testfiles/tfilters.h5 b/tools/testfiles/tfilters.h5 index 94c64bd..7f19ad4 100644 Binary files a/tools/testfiles/tfilters.h5 and b/tools/testfiles/tfilters.h5 differ diff --git a/tools/testfiles/tstring.ddl b/tools/testfiles/tstring.ddl index d6df34b..241f04e 100644 --- a/tools/testfiles/tstring.ddl +++ b/tools/testfiles/tstring.ddl @@ -4,7 +4,7 @@ Expected output for 'h5dump -e -d string tfilters.h5' HDF5 "tfilters.h5" { DATASET "string" { DATATYPE H5T_STRING { - STRSIZE 57; + STRSIZE 59; STRPAD H5T_STR_NULLTERM; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; @@ -12,9 +12,9 @@ DATASET "string" { DATASPACE SIMPLE { ( 1 ) / ( 1 ) } DATA { (0) "this is - a string with three + a string with three newline - escape characters" + escape characters" } } } -- cgit v0.12