From 12339b0759c5c7ddeebd59a7a1c0c7b7e6f9156d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 13 Feb 2012 09:18:09 -0500 Subject: [svn-r21931] HDFFV-7689 - could not not use a "[" character in a dataset name. A second problem also discovered was an if statement that should have comapered lengths of a string actually was comapring addreeses. Once thatt was fixed, The "[" character could be used but broke other functionality. Consultation with tools team resulted in the creation of a "--no-subset" option to disable interpretation of "[" character as a subsetting compact-form. This also eliminated and cleaned up the code containing the plomatic if statement. Tested: local linux and added test, CMake updated autotools test to be added next. --- MANIFEST | 2 + release_docs/RELEASE.txt | 6 +++ tools/h5dump/CMakeLists.txt | 5 +++ tools/h5dump/h5dump.c | 46 ++++++++++++----------- tools/testfiles/h5dump-help.txt | 2 + tools/testfiles/tno-subset.ddl | 9 +++++ tools/testfiles/tno-subset.h5 | Bin 0 -> 1400 bytes tools/testfiles/tnofilename-with-packed-bits.ddl | 2 + tools/testfiles/tnofilename.ddl | 4 +- tools/testfiles/tpbitsIncomplete.ddl | 2 + tools/testfiles/tpbitsLengthExceeded.ddl | 2 + tools/testfiles/tpbitsLengthPositive.ddl | 2 + tools/testfiles/tpbitsMaxExceeded.ddl | 2 + tools/testfiles/tpbitsOffsetExceeded.ddl | 2 + tools/testfiles/tpbitsOffsetNegative.ddl | 2 + 15 files changed, 65 insertions(+), 23 deletions(-) create mode 100644 tools/testfiles/tno-subset.ddl create mode 100644 tools/testfiles/tno-subset.h5 diff --git a/MANIFEST b/MANIFEST index 6e9f002..1bc50d3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1404,6 +1404,8 @@ ./tools/testfiles/tnestcomp-1.ddl ./tools/testfiles/tnestedcomp.h5 ./tools/testfiles/tnofilename.ddl +./tools/testfiles/tno-subset.h5 +./tools/testfiles/tno-subset.ddl ./tools/testfiles/tnullspace.h5 ./tools/testfiles/tnullspace.ddl ./tools/testfiles/tobjref.h5 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index ffa82be..49dd0bd 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -239,6 +239,12 @@ New Features Tools: ------ + - h5dump: Added new option --no-compact-subset. This option will not + interpret the '[' character as starting the compact form of + subsetting. This is useful when the "h5dump error: unable to + open dataset "datset_name"" message is output because a dataset + name contains a '[' character.(JIRA HDFFV-7689). + (ADB - 2012/01/31) - h5dump: Corrected schema location: slash) { - *brace++ = '\0'; + s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); + parse_hsize_list(brace, &s->start); - s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); - parse_hsize_list(brace, &s->start); + while (*brace && *brace != ';') + brace++; - while (*brace && *brace != ';') - brace++; + if (*brace) brace++; - if (*brace) brace++; + parse_hsize_list(brace, &s->stride); - parse_hsize_list(brace, &s->stride); + while (*brace && *brace != ';') + brace++; - while (*brace && *brace != ';') - brace++; + if (*brace) brace++; - if (*brace) brace++; + parse_hsize_list(brace, &s->count); - parse_hsize_list(brace, &s->count); + while (*brace && *brace != ';') + brace++; - while (*brace && *brace != ';') - brace++; + if (*brace) brace++; - if (*brace) brace++; - - parse_hsize_list(brace, &s->block); - } + parse_hsize_list(brace, &s->block); } return s; @@ -4541,6 +4540,9 @@ end_collect: case 'E': enable_error_stack = TRUE; break; + case 'C': + disable_compact_subset = TRUE; + break; case 'h': usage(h5tools_getprogname()); free_handler(hand, argc); diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index 9083782..ca16c42 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -40,6 +40,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tno-subset.ddl b/tools/testfiles/tno-subset.ddl new file mode 100644 index 0000000..11aa264 --- /dev/null +++ b/tools/testfiles/tno-subset.ddl @@ -0,0 +1,9 @@ +HDF5 "tno-subset.h5" { +DATASET "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 1, 1 ) / ( 1, 1 ) } + DATA { + (0,0): 0 + } +} +} diff --git a/tools/testfiles/tno-subset.h5 b/tools/testfiles/tno-subset.h5 new file mode 100644 index 0000000..e6b6f57 Binary files /dev/null and b/tools/testfiles/tno-subset.h5 differ diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index 9083782..ca16c42 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -40,6 +40,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tnofilename.ddl b/tools/testfiles/tnofilename.ddl index da79fbc..f9bd972 100644 --- a/tools/testfiles/tnofilename.ddl +++ b/tools/testfiles/tnofilename.ddl @@ -34,6 +34,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. @@ -71,7 +73,7 @@ usage: h5dump [OPTIONS] file 1) Attribute foo of the group /bar_none in file quux.h5 - h5dump -a /bar_none/foo quux.h5 + h5dump -a /bar_none/foo quux.h5 2) Selecting a subset from dataset /foo in file quux.h5 diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl index 4307bed..88dac0a 100644 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -40,6 +40,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl index 4b50e70..35055f4 100644 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -40,6 +40,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl index c648c02..3daeab4 100644 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -40,6 +40,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl index 8c6e8e1..2b3b68f 100644 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -40,6 +40,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl index e594d27..6ccdc26 100644 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -40,6 +40,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl index 833e47a..eb41bd7 100644 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -40,6 +40,8 @@ usage: h5dump [OPTIONS] file E.g., to dump a file called `-f', use h5dump -- -f --enable-error-stack Prints messages from the HDF5 error stack as they occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. -- cgit v0.12