diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-07-31 23:49:47 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-07-31 23:49:47 (GMT) |
commit | e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18 (patch) | |
tree | e3b6e42b691c6ddf7ef9714c132cb922ae28b096 /tools/h5dump | |
parent | 3146ddb5c2fc5e57b72eb2ecce697a7016f92b3a (diff) | |
download | hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.zip hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.tar.gz hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.tar.bz2 |
[svn-r23959] Bring revisions #23745 - 23862 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/CMakeLists.txt | 17 | ||||
-rw-r--r-- | tools/h5dump/errfiles/tall-2A0.err | 25 | ||||
-rw-r--r-- | tools/h5dump/h5dump.c | 25 | ||||
-rw-r--r-- | tools/h5dump/h5dump.h | 1 | ||||
-rw-r--r-- | tools/h5dump/h5dump_ddl.c | 31 | ||||
-rw-r--r-- | tools/h5dump/h5dump_extern.h | 1 | ||||
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 5 |
7 files changed, 69 insertions, 36 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 7726d4e..b13bab5 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -52,6 +52,7 @@ IF (BUILD_TESTING) ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A0.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2B.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-3.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-4s.ddl @@ -304,6 +305,7 @@ IF (BUILD_TESTING) ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2B.err ${PROJECT_SOURCE_DIR}/errfiles/tarray1_big.err ${PROJECT_SOURCE_DIR}/errfiles/tattrregR.err @@ -1071,6 +1073,8 @@ IF (BUILD_TESTING) tall-2.out.err tall-2A.out tall-2A.out.err + tall-2A0.out + tall-2A0.out.err tall-2B.out tall-2B.out.err tall-3.out @@ -1505,6 +1509,9 @@ IF (BUILD_TESTING) # test '-A' to suppress data but print attr's ADD_H5ERR_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) + # test '-A' to suppress attr's but print data + ADD_H5ERR_MASK_TEST (tall-2A0 0 --enable-error-stack -A 0 tall.h5) + # test '-r' to print attributes in ASCII instead of decimal ADD_H5ERR_MASK_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5) @@ -1638,20 +1645,14 @@ IF (BUILD_TESTING) ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-tbin2-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out2.bin) - SET_TESTS_PROPERTIES (H5DUMP-tbin2-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) - SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-tbin2-bin-clear-objects) + ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-tbin4-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out4.bin) - SET_TESTS_PROPERTIES (H5DUMP-tbin4-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) - SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-tbin4-bin-clear-objects) + ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references diff --git a/tools/h5dump/errfiles/tall-2A0.err b/tools/h5dump/errfiles/tall-2A0.err new file mode 100644 index 0000000..ba691d0 --- /dev/null +++ b/tools/h5dump/errfiles/tall-2A0.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index d89202c..9b304bd 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -30,7 +30,7 @@ static const char *xml_dtd_uri = NULL; /* module-scoped variables for XML option */ #define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" -#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd" +#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/DTD/HDF5-File.dtd" /* Standard DDL output */ static const dump_functions ddl_function_table = { @@ -71,7 +71,7 @@ struct handler_t { */ /* The following initialization makes use of C language cancatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:Aq:z:m:RECM:O*"; +static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -175,7 +175,7 @@ static struct long_options l_opts[] = { { "xml-n", require_arg, 'X' }, { "xml", no_arg, 'x' }, { "xm", no_arg, 'x' }, - { "onlyattr", no_arg, 'A' }, + { "onlyattr", optional_arg, 'A' }, { "escape", no_arg, 'e' }, { "noindex", no_arg, 'y' }, { "binary", optional_arg, 'b' }, @@ -221,11 +221,6 @@ leave(int ret) * Purpose: Print the usage message about dumper * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * Pedro Vicente, October 5, 2007. Add -q and -z flags *------------------------------------------------------------------------- */ static void @@ -240,6 +235,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " -B, --superblock Print the content of the super block\n"); PRINTVALSTREAM(rawoutstream, " -H, --header Print the header only; no data is displayed\n"); PRINTVALSTREAM(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n"); + PRINTVALSTREAM(rawoutstream, " Optional value 0 suppresses printing attributes.\n"); PRINTVALSTREAM(rawoutstream, " -i, --object-ids Print the object ids\n"); PRINTVALSTREAM(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n"); PRINTVALSTREAM(rawoutstream, " -e, --escape Escape non printing characters\n"); @@ -1093,9 +1089,14 @@ parse_start: last_was_dset = FALSE; break; case 'A': - display_data = FALSE; - display_attr_data = TRUE; - last_was_dset = FALSE; + if ( opt_arg != NULL) { + if(0 == HDatoi(opt_arg)) include_attrs = FALSE; + } + else { + display_data = FALSE; + display_attr_data = TRUE; + last_was_dset = FALSE; + } break; case 'i': display_oid = TRUE; @@ -1649,7 +1650,7 @@ main(int argc, const char *argv[]) indx = HDstrrchr(ns,(int)':'); if (indx) *indx = '\0'; - PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " + PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\" " "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File " "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); diff --git a/tools/h5dump/h5dump.h b/tools/h5dump/h5dump.h index 7d4f460..7bfead7 100644 --- a/tools/h5dump/h5dump.h +++ b/tools/h5dump/h5dump.h @@ -76,6 +76,7 @@ int display_region = FALSE; /*print region reference data */ int enable_error_stack= FALSE; /* re-enable error stack */ int disable_compact_subset= FALSE; /* disable compact form of subset notation */ int display_packed_bits = FALSE; /*print 1-8 byte numbers as packed bits*/ +int include_attrs = TRUE; /* Display attributes */ /* sort parameters */ H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index c4a9ecb..bb54e3f 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -556,19 +556,20 @@ attr_iteration(hid_t gid, unsigned attr_crt_order_flags) { /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set in the group for attributes, then, sort by creation order, otherwise by name */ - - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); + if(include_attrs) { + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ } /* end if */ - } /* end else */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + } } /*------------------------------------------------------------------------- @@ -1178,9 +1179,9 @@ dump_fcpl(hid_t fid) indentation(dump_indent + COL); PRINTSTREAM(rawoutstream, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version); indentation(dump_indent + COL); - PRINTSTREAM(rawoutstream,"%s %Hd\n","OFFSET_SIZE", (long long)off_size); + PRINTSTREAM(rawoutstream,"%s %zu\n","OFFSET_SIZE", off_size); indentation(dump_indent + COL); - PRINTSTREAM(rawoutstream,"%s %Hd\n","LENGTH_SIZE", (long long)len_size); + PRINTSTREAM(rawoutstream,"%s %zu\n","LENGTH_SIZE", len_size); indentation(dump_indent + COL); PRINTSTREAM(rawoutstream, "%s %u\n","BTREE_RANK", sym_ik); indentation(dump_indent + COL); @@ -1360,8 +1361,6 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe string_dataformat.do_escape = display_escape; outputformat = &string_dataformat; - //attr_name = attr + j + 1; - // need to replace escape characters attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/"); diff --git a/tools/h5dump/h5dump_extern.h b/tools/h5dump/h5dump_extern.h index 5a0f2bd..08f9e36 100644 --- a/tools/h5dump/h5dump_extern.h +++ b/tools/h5dump/h5dump_extern.h @@ -76,6 +76,7 @@ extern int display_region; /*print region reference data */ extern int enable_error_stack; /* re-enable error stack */ extern int disable_compact_subset; /* disable compact form of subset notation */ extern int display_packed_bits; /*print 1-8 byte numbers as packed bits*/ +extern int include_attrs; /* Display attributes */ /* sort parameters */ extern H5_index_t sort_by; /*sort_by [creation_order | name] */ diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index f55ecf8..0e3cfda 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -175,6 +175,7 @@ $SRC_H5DUMP_TESTFILES/packedbits.ddl $SRC_H5DUMP_TESTFILES/tall-1.ddl $SRC_H5DUMP_TESTFILES/tall-2.ddl $SRC_H5DUMP_TESTFILES/tall-2A.ddl +$SRC_H5DUMP_TESTFILES/tall-2A0.ddl $SRC_H5DUMP_TESTFILES/tall-2B.ddl $SRC_H5DUMP_TESTFILES/tall-3.ddl $SRC_H5DUMP_TESTFILES/tall-4s.ddl @@ -335,6 +336,7 @@ LIST_ERROR_TEST_FILES=" ${SRC_H5DUMP_ERRORFILES}/filter_fail.err ${SRC_H5DUMP_ERRORFILES}/tall-1.err ${SRC_H5DUMP_ERRORFILES}/tall-2A.err +${SRC_H5DUMP_ERRORFILES}/tall-2A0.err ${SRC_H5DUMP_ERRORFILES}/tall-2B.err ${SRC_H5DUMP_ERRORFILES}/tarray1_big.err ${SRC_H5DUMP_ERRORFILES}/tattr-3.err @@ -1005,6 +1007,9 @@ TOOLTEST tlarge_objname.ddl --enable-error-stack -w157 tlarge_objname.h5 # test '-A' to suppress data but print attr's TOOLTEST4 tall-2A.ddl --enable-error-stack -A tall.h5 +# test '-A' to suppress attr's but print data +TOOLTEST4 tall-2A0.ddl --enable-error-stack -A 0 tall.h5 + # test '-r' to print attributes in ASCII instead of decimal TOOLTEST4 tall-2B.ddl --enable-error-stack -A -r tall.h5 |