diff --git a/MANIFEST b/MANIFEST index fc5d3b69a6..5f6f6fabb1 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1124,3 +1124,60 @@ ./tools/testfiles/Expected/vg_nameclash.h5 ./tools/testfiles/Expected/vg_nameclash2.h5 ./tools/testfiles/Expected/vg_simple.h5 + +#additional test input and output for h5dump XML +./tools/testfiles/tall.h5.xml +./tools/testfiles/tarray1.h5.xml +./tools/testfiles/tarray2.h5.xml +./tools/testfiles/tarray3.h5.xml +./tools/testfiles/tarray6.h5.xml +./tools/testfiles/tarray7.h5.xml +./tools/testfiles/tattr.h5.xml +./tools/testfiles/tbitfields.h5.xml +./tools/testfiles/tcompound.h5.xml +./tools/testfiles/tcompound2.h5.xml +./tools/testfiles/tdatareg.h5.xml +./tools/testfiles/tdset.h5.xml +./tools/testfiles/tdset2.h5.xml +./tools/testfiles/tempty.h5.xml +./tools/testfiles/tenum.h5.xml +./tools/testfiles/tgroup.h5.xml +./tools/testfiles/thlink.h5.xml +./tools/testfiles/tloop.h5.xml +./tools/testfiles/tloop2.h5.xml +./tools/testfiles/tmany.h5.xml +./tools/testfiles/tname-amp.h5 +./tools/testfiles/tname-amp.h5.xml +./tools/testfiles/tname-apos.h5 +./tools/testfiles/tname-apos.h5.xml +./tools/testfiles/tname-gt.h5 +./tools/testfiles/tname-gt.h5.xml +./tools/testfiles/tname-lt.h5 +./tools/testfiles/tname-lt.h5.xml +./tools/testfiles/tname-quot.h5 +./tools/testfiles/tname-quot.h5.xml +./tools/testfiles/tname-sp.h5 +./tools/testfiles/tname-sp.h5.xml +./tools/testfiles/tnestedcomp.h5.xml +./tools/testfiles/tnodata.h5 +./tools/testfiles/tnodata.h5.xml +./tools/testfiles/tobjref.h5.xml +./tools/testfiles/topaque.h5.xml +./tools/testfiles/tref-escapes-at.h5 +./tools/testfiles/tref-escapes-at.h5.xml +./tools/testfiles/tref-escapes.h5 +./tools/testfiles/tref-escapes.h5.xml +./tools/testfiles/tref.h5 +./tools/testfiles/tref.h5.xml +./tools/testfiles/tsaf.h5.xml +./tools/testfiles/tslink.h5.xml +./tools/testfiles/tstr.h5.xml +./tools/testfiles/tstr2.h5.xml +./tools/testfiles/tstring-at.h5 +./tools/testfiles/tstring-at.h5.xml +./tools/testfiles/tstring.h5 +./tools/testfiles/tstring.h5.xml +./tools/testfiles/tvldtypes.h5.xml +./tools/testfiles/tvldtypes1.h5.xml +./tools/testfiles/tvldtypes2.h5.xml +./tools/testfiles/tvldtypes3.h5.xml diff --git a/doc/html/Tools.html b/doc/html/Tools.html index 5f404be503..e45cf21f85 100644 --- a/doc/html/Tools.html +++ b/doc/html/Tools.html @@ -1,627 +1,904 @@ + - -HDF5/Tools API Specification - - + + + + HDF5/Tools API Specification + + -
-
- - - -
-Introduction to HDF5 
-HDF5 User Guide 
-Other HDF5 documents and links 
- -
-And in this document, the -HDF5 Reference Manual   -
-H5   -H5A   -H5D   -H5E   -H5F   -H5G   -H5I   -H5P   -
-H5R   -H5S   -H5T   -H5Z   -Tools   -Datatypes   -
-
+--> + +And in this document, the HDF5 +Reference Manual +
H5  H5A +H5D  +H5E +H5F  H5G + +H5I  H5P +
H5R  H5S +H5T  +H5Z   Tools  Datatypes + + +
- -
-

HDF5 Tools

-
+

+HDF5 Tools

-

HDF5 Tool Interfaces

-

+

+HDF5 Tool Interfaces

These tools enable the user to examine HDF5 files interactively. - - - - + + + +
+ + + + +
    -
  • h5dump -- - A tool for displaying HDF5 file contents -
  • h5ls -- - A tool for listing specified features of HDF5 file contents -
  • h5repart -- - A tool for repartitioning a file, creating a family of files -
  • h5toh4 -- - A tool for converting an HDF5 file to an HDF4 file -
  • h4toh5 -- - A tool for converting an HDF4 file to an HDF5 file +
  • +h5dump -- A tool for displaying HDF5 file contents 
  • + +
  • +h5ls -- A tool for listing specified features of +HDF5 file contents 
  • + +
  • +h5repart -- A tool for repartitioning a file, +creating a family of files 
  • + +
  • +h5toh4 -- A tool for converting an HDF5 file +to an HDF4 file 
  • + +
  • +h4toh5 -- A tool for converting an HDF4 file +to an HDF5 file
-

- -


-
Tool Name: h5dump -
Syntax: -
h5dump - [OPTIONS] file -
Purpose: -
Displays HDF5 file contents. -
Description: -
h5dump enables the user to interactively examine - the contents of an HDF5 file and dump those contents, in human - readable form, to an ASCII file. -

- h5dump displays HDF5 file content on standard - output. It may display the content of the whole HDF5 file or - selected objects, which can be groups, datasets, links, - attributes, or data types. -

-

- The --header option displays object header - information only. -

-

- Names are the absolute names of the objects. h5dump - displays objects in the order same as the command order. If a - name does not start with a slash, h5dump begins - searching for the specified object starting at the root group. -

-

- If an object is hard linked with multiple names, - h5dump displays the content of the object in the - first occurrence. Only the link information is displayed in later - occurrences. -

-

- h5dump assigns a name for any unnamed data type in - the form of - #oid1:oid2, where - oid1 and oid2 are the object identifiers - assigned by the library. The unnamed types are displayed within - the root group. -

-

- Data types are displayed with standard type names. For example, - if a data set is created with H5T_NATIVE_INT type - and the standard type name for integer on that machine is - H5T_STD_I32BE, h5dump displays - H5T_STD_I32BE as the type of the data set. -

-

- The h5dump output is described in detail in the DDL for HDF5, the Data - Description Language document. -

-

- Note: It is no longer permissable to specify multiple - attributes, datasets, data types, groups, or soft links with one - flag. For example, before one could issue the command: -

-
- h5dump -a /attr1 /attr2 foo.h5 -
-

- and both /attr1 and /attr2 would be - dumped. In order to do this now, one must issue the command: -

-
- h5dump -a /attr1 -a /attr2 foo.h5 -
-
Options and Parameters: -
-
-h   or   - --help
-
Print a usage message and exit.
-
-B   or   - --bootblock
-
Print the content of the boot block.
- (This option is not yet implemented.)
-
-H   or   - --header
-
Print the header only; no data is displayed.
-
-i   or   - --object-ids
-
Print the object ids.
-
-V   or   - --version
-
Print version number and exit.
-
-a P   or   - --attribute=P
-
Print the specified attribute.
-
-d P   or   - --dataset=P
-
Print the specified dataset.
-
-g P   or   - --group=P
-
Print the specified group and all members.
-
-l P   or   - --soft-link=P
-
Print the value(s) of the specified soft link.
-
-o F   or   - --output=F
-
Output raw data into file F.
-
-t T   or   - --datatype=T
-
Print the specified named data type.
-
-w #   or   - --width=#
-
Set the number of columns of output.
-
file
-
The file to be examined.
-
-
    -
  • P - is the full path from the root group to the - object.
  • -
  • T - is the name of the data type.
  • -
  • F - is a filename.
  • -
  • # - is an integer greater than 1.
  • -
-
Examples: -
    -
  1. Dumping the group /GroupFoo/GroupBar in the file - quux.h5: -
    - h5dump -g /GroupFoo/GroupBar quux.h5 -
    -
  2. Dumping the dataset Fnord in the group - /GroupFoo/GroupBar in the file quux.h5: -
    - h5dump -d /GroupFoo/GroupBar/Fnord quux.h5 -
    -
  3. Dumping the attribute metadata of the dataset - Fnord which is in group - /GroupFoo/GroupBar in the file quux.h5: -
    - h5dump -a /GroupFoo/GroupBar/Fnord/metadata quux.h5 -
    -
  4. Dumping the attribute metadata which is an - attribute of the root group in the file quux.h5: -
    - h5dump -a /metadata quux.h5 -
    -
-
Current Status: -
The current version of h5dump displays the - following information: -
    -
  • Group -
      -
    • group attribute (see Attribute) -
    • group member -
    -
  • Dataset -
      -
    • dataset attribute (see Attribute) -
    • dataset type (see Data type) -
    • dataset space (see Data space) -
    • dataset data -
    -
  • Attribute -
      -
    • attribute type (see Data type) -
    • attribute space (see Data space) -
    • attribute data -
    -
  • Data type -
      -
    • integer type -
      - H5T_STD_I8BE, H5T_STD_I8LE, H5T_STD_I16BE, ... -
    • floating point type -
      - H5T_IEEE_F32BE, H5T_IEEE_F32LE, H5T_IEEE_F64BE, ... -
    • string type -
    • compound type -
      - named, unnamed and transient compound type -
      - integer, floating or string type member -
    • opaque types -
    • reference type -
      - object references -
      - data regions -
    • enum type -
    • variable-length datatypes -
      - atomic types only -
      - scalar or single dimensional array of variable-length - types supported -
    -
  • Data space -
      -
    • scalar and simple space -
    -
  • Soft link -
  • Hard link -
  • Loop detection -
- -
See Also: -
HDF5 Data Description Language syntax - (DDL for HDF5) +
+Tool Name: h5dump
+ +
+Syntax:
+ +
+h5dump [OPTIONS] file
+ +
+Purpose:
+ +
+Displays HDF5 file contents in HDF5 DDL or XML.
+ +
+Description:
+ +
+h5dump enables the user to interactively examine the contents +of an HDF5 file and dump those contents, in human readable form, to an +ASCII file.  Optionally, the contents of the file may be dumped as +XML.
+ +
  +

  +
  +
  +

h5dump displays HDF5 file content on standard output. It may +display the content of the whole HDF5 file or selected objects, which can +be groups, datasets, links, attributes, or data types. +

The --header option displays object header information only. +

Names are the absolute names of the objects. h5dump displays +objects in the order same as the command order. If a name does not start +with a slash, h5dump begins searching for the specified object +starting at the root group. +

If an object is hard linked with multiple names, h5dump displays +the content of the object in the first occurrence. Only the link information +is displayed in later occurrences. +

h5dump assigns a name for any unnamed data type in the form +of #oid1:oid2, where oid1 and oid2 +are the object identifiers assigned by the library. The unnamed types are +displayed within the root group. +

Data types are displayed with standard type names. For example, if a +data set is created with H5T_NATIVE_INT type and the standard +type name for integer on that machine is H5T_STD_I32BE, h5dump +displays H5T_STD_I32BE as the type of the data set. +

The h5dump output is described in detail in the DDL +for HDF5, the Data Description Language document. +

Note: It is no longer permissable to specify multiple attributes, +datasets, data types, groups, or soft links with one flag. For example, +before one could issue the command: +

h5dump -a /attr1 /attr2 foo.h5
+and both /attr1 and /attr2 would be dumped. In order +to do this now, one must issue the command: +
h5dump -a /attr1 -a /attr2 foo.h5
+ +
+XML Output
+ +
The --xml option selects output in XML. The XML output contains +a complete description of the file, marked up in XML. The XML conforms +to the HDF5 Document Type Definition (DTD), which is available at: +
http://hdf.ncsa.uiuc.edu/DTDs/HDF5-File.dtd
+ +


The XML output is suitable for use with other tools, including the +HDF5 +Java Tools. +
  +

+Options and Parameters:
+ +
+
+-h   or   --help
+ +
+Print a usage message and exit.
+ +
+-B   or   --bootblock
+ +
+Print the content of the boot block.
+ +
(This option is not yet implemented.) +
+-H   or   --header
+ +
+Print the header only; no data is displayed.
+ +
+-i   or   --object-ids
+ +
+Print the object ids.
+ +
+-V   or   --version
+ +
+Print version number and exit.
+ +
+-a P   or   --attribute=P
+ +
+Print the specified attribute.
+ +
+-d P   or   --dataset=P
+ +
+Print the specified dataset.
+ +
+-g P   or   --group=P
+ +
+Print the specified group and all members.
+ +
+-l P   or   --soft-link=P
+ +
+Print the value(s) of the specified soft link.
+ +
+-o F   or   --output=F
+ +
+Output raw data into file F.
+ +
+-t T   or   --datatype=T
+ +
+Print the specified named data type.
+ +
+-w #   or   --width=#
+ +
+Set the number of columns of output.
+ +
+-x #   or   --xml
+ +
+Output XML instead of DDL.
+ +
+-D #   or   --xml-dtd=URI
+ +
+In XML output, refer to the DTD at URI instead of the default DTD.
+ +
+file
+ +
+The file to be examined.
+
+ +
    +
  • +P - is the full path from the root group to the object.
  • + +
  • +T - is the name of the data type.
  • + +
  • +F - is a filename.
  • + +
  • +# - is an integer greater than 1.
  • + +
  • +URI - is a URI (as defined in [IETF +RFC 2396], updated by [IETF +RFC 2732]) that refers to the DTD to be used to validate the XML.
  • +
+ +
+Examples:
+ +
    +
  1. +Dumping the group /GroupFoo/GroupBar in the file quux.h5:
  2. + +
    h5dump -g /GroupFoo/GroupBar quux.h5
    + +
  3. +Dumping the dataset Fnord in the group /GroupFoo/GroupBar +in the file quux.h5:
  4. + +
    h5dump -d /GroupFoo/GroupBar/Fnord quux.h5
    + +
  5. +Dumping the attribute metadata of the dataset Fnord which +is in group /GroupFoo/GroupBar in the file quux.h5:
  6. + +
    h5dump -a /GroupFoo/GroupBar/Fnord/metadata quux.h5
    + +
  7. +Dumping the attribute metadata which is an attribute of the root +group in the file quux.h5:
  8. + +


        h5dump -a /metadata quux.h5 +
      +

  9. +Producing an XML listing of the file bobo.h5:
  10. + +
        h5dump --xml bobo.h5 > bobo.h5.xml
+ +
+
+ +
+Current Status:
+ +
+The current version of h5dump displays the following information:
+ +
    +
  • +Group
  • + +
      +
    • +group attribute (see Attribute)
    • + +
    • +group member
    • +
    + +
  • +Dataset
  • + +
      +
    • +dataset attribute (see Attribute)
    • + +
    • +dataset type (see Data type)
    • + +
    • +dataset space (see Data space)
    • + +
    • +dataset data
    • +
    + +
  • +Attribute
  • + +
      +
    • +attribute type (see Data type)
    • + +
    • +attribute space (see Data space)
    • + +
    • +attribute data
    • +
    + +
  • +Data type
  • + +
      +
    • +integer type
    • + +
      +- H5T_STD_I8BE, H5T_STD_I8LE, H5T_STD_I16BE, ...
      + +
    • +floating point type
    • + +
      +- H5T_IEEE_F32BE, H5T_IEEE_F32LE, H5T_IEEE_F64BE, ...
      + +
    • +string type
    • + +
    • +compound type
    • + +
      +- named, unnamed and transient compound type
      + +
      +- integer, floating or string type member
      + +
    • +opaque types
    • + +
    • +reference type
    • + +
      +- object references
      + +
      +- data regions
      + +
    • +enum type
    • + +
    • +variable-length datatypes
    • + +
      +- atomic types only
      + +
      +- scalar or single dimensional array of variable-length types supported
      +
    + +
  • +Data space
  • + +
      +
    • +scalar and simple space
    • +
    + +
  • +Soft link
  • + +
  • +Hard link
  • + +
  • +Loop detection
  • +
+ +
+See Also:
+ +
+HDF5 Data Description Language syntax (DDL for HDF5)
+ +
+HDF5 XML DTD:  http://hdf.ncsa.uiuc.edu/DTDs/HDF5-File.dtd
+ +
+HDF5 XML information: http://hdf.ncsa.uiuc.edu/HDF5/XML/

-
Tool Name: h5ls -
Syntax: -
h5ls - [OPTIONS] - file - [OBJECTS...] -
Purpose: -
Prints information about a file or dataset. -
Description: -
h5ls prints selected information about file objects - in the specified format. -
Options and Parameters: -
-
-h   or   - -?   or   - --help -
Print a usage message and exit. -
-a   or   - --address -
Print addresses for raw data. -
-d   or   --data -
Print the values of datasets. -
-e   or   - --errors -
Show all HDF5 error reporting. -
-f   or   - --full -
Print full path names instead of base names. -
-g   or   - --group -
Show information about a group, not its contents. -
-l   or   - --label -
Label members of compound datasets. -
-r   or   - --recursive -
List all groups recursively, avoiding cycles. -
-s   or   - --string -
Print 1-bytes integer datasets as ASCII. -
-S   or   - --simple -
Use a machine-readable output format. -
-wN   or   - --width=N -
Set the number of columns of output. -
-v   or   - --verbose -
Generate more verbose output. -
-V   or   - --version -
Print version number and exit. -
-x   or   - --hexdump -
Show raw data in hexadecimal format. -
file -
The file name may include a printf(3C) integer format - such as %%05d to open a file family. -
objects -
Each object consists of an HDF5 file name optionally - followed by a slash and an object name within the file - (if no object is specified within the file then the - contents of the root group are displayed). The file name - may include a printf(3C) integer format such - as "%05d" to open a file family. -
+
+Tool Name: h5ls
+ +
+Syntax:
+ +
+h5ls [OPTIONS] file [OBJECTS...]
+ +
+Purpose:
+ +
+Prints information about a file or dataset.
+ +
+Description:
+ +
+h5ls prints selected information about file objects in the specified +format.
+ +
+Options and Parameters:
+ +
+
+-h   or   -?   or  +--help
+ +
+Print a usage message and exit.
+ +
+-a   or   --address
+ +
+Print addresses for raw data.
+ +
+-d   or   --data
+ +
+Print the values of datasets.
+ +
+-e   or   --errors
+ +
+Show all HDF5 error reporting.
+ +
+-f   or   --full
+ +
+Print full path names instead of base names.
+ +
+-g   or   --group
+ +
+Show information about a group, not its contents.
+ +
+-l   or   --label
+ +
+Label members of compound datasets.
+ +
+-r   or   --recursive
+ +
+List all groups recursively, avoiding cycles.
+ +
+-s   or   --string
+ +
+Print 1-bytes integer datasets as ASCII.
+ +
+-S   or   --simple
+ +
+Use a machine-readable output format.
+ +
+-wN   or   --width=N
+ +
+Set the number of columns of output.
+ +
+-v   or   --verbose
+ +
+Generate more verbose output.
+ +
+-V   or   --version
+ +
+Print version number and exit.
+ +
+-x   or   --hexdump
+ +
+Show raw data in hexadecimal format.
+ +
+file
+ +
+The file name may include a printf(3C) integer format such as %%05d +to open a file family.
+ +
+objects
+ +
+Each object consists of an HDF5 file name optionally followed by a slash +and an object name within the file (if no object is specified within the +file then the contents of the root group are displayed). The file name +may include a printf(3C) integer format such as "%05d" to open +a file family.
+
-
+-->
-
Tool Name: h5repart -
Syntax: -
h5repart - [-v] - [-V] - [-[b|m]N[g|m|k]] - source_file - dest_file -
Purpose: -
Repartitions a file or family of files. -
Description: -
h5repart splits a single file into a family of - files, joins a family of files into a single file, or copies - one family of files to another while changing the size of the - family members. h5repart can also be used to - copy a single file to a single file with holes. -

- Sizes associated with the -b and -m - options may be suffixed with g for gigabytes, - m for megabytes, or k for kilobytes. -

- File family names include an integer printf - format such as %d. +

+Tool Name: h5repart
-
Options and Parameters: -
-
-v -
Produce verbose output. -
-V -
Print a version number and exit. -
-bN -
The I/O block size, defaults to 1kB -
-mN -
The destination member size or 1GB -
source_file -
The name of the source file -
dest_file -
The name of the destination files -
+
+Syntax:
+ +
+h5repart [-v] [-V] [-[b|m]N[g|m|k]] source_file +dest_file
+ +
+Purpose:
+ +
+Repartitions a file or family of files.
+ +
+Description:
+ +
+h5repart splits a single file into a family of files, joins a +family of files into a single file, or copies one family of files to another +while changing the size of the family members. h5repart can also +be used to copy a single file to a single file with holes.
+ +
  +

  +
  +
  +

Sizes associated with the -b and -m options may be +suffixed with g for gigabytes, m for megabytes, or +k +for kilobytes. +

File family names include an integer printf format such as +%d. +

+Options and Parameters:
+ +
+
+-v
+ +
+Produce verbose output.
+ +
+-V
+ +
+Print a version number and exit.
+ +
+-bN
+ +
+The I/O block size, defaults to 1kB
+ +
+-mN
+ +
+The destination member size or 1GB
+ +
+source_file
+ +
+The name of the source file
+ +
+dest_file
+ +
+The name of the destination files
+
-
- +-->
-
Tool Name: h5toh4 -
Syntax: -
h5toh4 -h
- h5toh4 - h5file - h4file
- h5toh4 - h5file
- h5toh4 -m - h5file1 - h5file2 - h5file3 ... -
Purpose: -
Converts an HDF5 file into an HDF4 file. -
Description: -
h5toh4 is an HDF5 utility which reads - an HDF5 file, h5file, and converts all - supported objects and pathways to produce an HDF4 file, - h4file. If h4file already exists, - it will be replaced. -

- If only one file name is given, the name must end in - .h5 and is assumed to represent the - HDF5 input file. h5toh4 replaces the - .h5 suffix with .hdf to form - the name of the resulting HDF4 file and proceeds as above. - If a file with the name of the intended HDF4 file already - exists, h5toh4 exits with an error without - changing the contents of any file. -

- The -m option allows multiple HDF5 file - arguments. Each file name is treated the same as the - single file name case above. -

- The -h option causes the following - syntax summary to be displayed: -

              h5toh4 file.h5 file.hdf
-              h5toh4 file.h5
-              h5toh4 -m file1.h5 file2.h5 ...
- -

+

+Tool Name: h5toh4
- The following HDF5 objects occurring in an HDF5 file are - converted to HDF4 objects in the HDF4 file: +
+Syntax:
-
    -
  • HDF5 group objects are converted into HDF4 Vgroup - objects. HDF5 hardlinks and softlinks pointing to - objects are converted to HDF4 Vgroup references. -
  • HDF5 dataset objects of integer datatype are - converted into HDF4 SDS objects. These datasets - may have up to 32 fixed dimensions. - The slowest varying dimension may be extendable. - 8-bit, 16-bit, and 32-bit integer datatypes are - supported. -
  • HDF5 dataset objects of floating point datatype - are converted into HDF4 SDS objects. - These datasets may have up to 32 fixed dimensions. - The slowest varying dimension may be extendable. - 32-bit and 64-bit floating point datatypes are - supported. -
  • HDF5 dataset objects of single dimension and - compound datatype are converted into HDF4 Vdata - objects. The length of that single dimension may - be fixed or extendable. The members of the - compound datatype are constrained to be no more - than rank 4. -
  • HDF5 dataset objects of single dimension and fixed length string - datatype are converted into HDF4 Vdata objects. The HDF4 Vdata - is a single field whose order is the length of the HDF5 string - type. The number of records of the Vdata is the length of the - single dimension which may be fixed or extendable. -
+
+h5toh4 -h
- Other objects are not converted and are not recorded - in the resulting h4file. -

- Attributes associated with any of the supported HDF5 - objects are carried over to the HDF4 objects. - Attributes may be of integer, floating point, or fixed length - string datatype and they may have up to 32 fixed dimensions. -

- All datatypes are converted to big-endian. - Floating point datatypes are converted to IEEE format. - +
h5toh4 h5file h4file +
h5toh4 h5file +
h5toh4 -m h5file1 h5file2 h5file3 ... +

+Purpose:
-
Options and Parameters: -
-
-h -
Displays a syntax summary. -
-m -
Converts multiple HDF5 files to multiple HDF4 files. -
h5file -
The HDF5 file to be converted. -
h4file -
The HDF4 file to be created. -
+
+Converts an HDF5 file into an HDF4 file.
+ +
+Description:
+ +
+h5toh4 is an HDF5 utility which reads an HDF5 file, h5file, +and converts all supported objects and pathways to produce an HDF4 file, +h4file. +If h4file already exists, it will be replaced.
+ +
  +

  +
  +
  +

If only one file name is given, the name must end in .h5 and +is assumed to represent the HDF5 input file. h5toh4 replaces the +.h5 +suffix with .hdf to form the name of the resulting HDF4 file and +proceeds as above. If a file with the name of the intended HDF4 file already +exists, h5toh4 exits with an error without changing the contents +of any file. +

The -m option allows multiple HDF5 file arguments. Each file +name is treated the same as the single file name case above. +

The -h option causes the following syntax summary to be displayed: +

              h5toh4 file.h5 file.hdf
+              h5toh4 file.h5
+              h5toh4 -m file1.h5 file2.h5 ...
+The following HDF5 objects occurring in an HDF5 file are converted to HDF4 +objects in the HDF4 file: +
    +
  • +HDF5 group objects are converted into HDF4 Vgroup objects. HDF5 hardlinks +and softlinks pointing to objects are converted to HDF4 Vgroup references.
  • + +
  • +HDF5 dataset objects of integer datatype are converted into HDF4 SDS objects. +These datasets may have up to 32 fixed dimensions. The slowest varying +dimension may be extendable. 8-bit, 16-bit, and 32-bit integer datatypes +are supported.
  • + +
  • +HDF5 dataset objects of floating point datatype are converted into HDF4 +SDS objects. These datasets may have up to 32 fixed dimensions. The slowest +varying dimension may be extendable. 32-bit and 64-bit floating point datatypes +are supported.
  • + +
  • +HDF5 dataset objects of single dimension and compound datatype are converted +into HDF4 Vdata objects. The length of that single dimension may be fixed +or extendable. The members of the compound datatype are constrained to +be no more than rank 4.
  • + +
  • +HDF5 dataset objects of single dimension and fixed length string datatype +are converted into HDF4 Vdata objects. The HDF4 Vdata is a single field +whose order is the length of the HDF5 string type. The number of records +of the Vdata is the length of the single dimension which may be fixed or +extendable.
  • +
+Other objects are not converted and are not recorded in the resulting h4file. +

Attributes associated with any of the supported HDF5 objects are carried +over to the HDF4 objects. Attributes may be of integer, floating point, +or fixed length string datatype and they may have up to 32 fixed dimensions. +

All datatypes are converted to big-endian. Floating point datatypes +are converted to IEEE format. +

+Options and Parameters:
+ +
+
+-h
+ +
+Displays a syntax summary.
+ +
+-m
+ +
+Converts multiple HDF5 files to multiple HDF4 files.
+ +
+h5file
+ +
+The HDF5 file to be converted.
+ +
+h4file
+ +
+The HDF4 file to be created.
+
-
- +-->
-
Tool Name: h4toh5 -
Syntax: -
h4toh5 -h
- h4toh5 - h4file - h5file
- h4toh5 - h4file
- -
Purpose: -
Converts an HDF4 file to an HDF5 file. -
Description: -
h4toh5 is a file conversion utility that reads - an HDF4 file, h4file (input.hdf for example), - and writes an HDF5 file, h5file (output.h5 - for example), containing the same data. -

- If no output file h5file is specified, - h4toh5 uses the input filename to designate - the output file, replacing the extension .hdf - with .h5. - For example, if the input file scheme3.hdf is - specified with no output filename, h4toh5 will - name the output file scheme3.h5. -

- - The -h option causes a syntax summary - similar to the following to be displayed: -

              h4toh5 inputfile.hdf outputfile.h5
-              h5toh4 inputfile.hdf                     
-

- Each object in the HDF4 file is converted to an equivalent - HDF5 object, according to the mapping described in - - Mapping HDF4 Objects to HDF5 Objects. - (If this mapping changes between HDF5 Library releases, a more up-to-date - version may be available at - - Mapping HDF4 Objects to HDF5 Objects on the HDF FTP server.) -

- In this inital version, h4toh5 converts the following - HDF4 objects: -

- - - - - - - - -
- HDF4 Object - - Resulting HDF5 Object -
- SDS - - Dataset -
- GR, RI8, and RI24 image - - Dataset -
- Vdata - - Dataset -
- Vgroup - - Group -
- Annotation - - Attribute -
- Palette - - Dataset -
-
-
Options and Parameters: -
-
-h -
Displays a syntax summary. - The +-h +option causes a syntax summary similar to the following to be displayed: +
              h4toh5 inputfile.hdf outputfile.h5
+              h5toh4 inputfile.hdf                    
+Each object in the HDF4 file is converted to an equivalent HDF5 object, +according to the mapping described in Mapping +HDF4 Objects to HDF5 Objects. (If this mapping changes between +HDF5 Library releases, a more up-to-date version may be available at Mapping +HDF4 Objects to HDF5 Objects on the HDF FTP server.) +

In this inital version, h4toh5 converts the following HDF4 +objects: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HDF4 Object Resulting HDF5 Object 
SDS Dataset 
GR, RI8, and RI24 image Dataset 
Vdata Dataset 
Vgroup Group 
Annotation Attribute 
Palette Dataset 
+ +
+Options and Parameters:
+ +
+
+-h
+ +
+Displays a syntax summary.  -
h4file -
The HDF4 file to be converted. -
h5file -
The HDF5 file to be created. -
+ --> + +
+h4file
+ +
+The HDF4 file to be converted.
+ +
+h5file
+ +
+The HDF5 file to be created.
+
-
- - - - - + - -
-
- - - -
-Introduction to HDF5 
-HDF5 User Guide 
-Other HDF5 documents and links 
- -
-And in this document, the -HDF5 Reference Manual   -
-H5   -H5A   -H5D   -H5E   -H5F   -H5G   -H5I   -H5P   -
-H5R   -H5S   -H5T   -H5Z   -Tools   -Datatypes   -
-
+-->
And in this document, the HDF5 +Reference Manual +
H5  H5A +H5D  +H5E +H5F  H5G + +H5I  H5P +
H5R  H5S +H5T  +H5Z   Tools  Datatypes
+
- -
-HDF Help Desk - -
-Last modified: 15 December 2000 - -
-Describes HDF5 Release 1.4, February 2001 - +HDF Help Desk
+
Last modified: 15 December 2000 +
Describes HDF5 Release 1.4, February 2001 diff --git a/tools/h5dump.c b/tools/h5dump.c index a1e2fcadd7..c9d4b6bfa1 100644 --- a/tools/h5dump.c +++ b/tools/h5dump.c @@ -13,203 +13,410 @@ #include "H5private.h" #include "h5tools.h" -/* module-scoped global variables */ -static int display_oid; -static int display_data = 1; -static int d_status; -static int unamedtype; /* shared data type with no name */ -static int prefix_len = 1024; +static herr_t dump_all(hid_t group, const char *name, + void *op_data); +static int display_oid = 0; +static int display_data = 1; +static int d_status = 0; +static int unamedtype = 0; /* shared data type with no name */ -static table_t *group_table, *dset_table, *type_table; -static char *prefix; +static int prefix_len = 1024; +static table_t *group_table = NULL, *dset_table = NULL, *type_table = + NULL; +static char *prefix; static const dump_header *dump_header_format; -static h5dump_t dataformat = { - 0, /*raw*/ +/** + ** Added for XML ** + **/ - "", /*fmt_raw*/ - "%d", /*fmt_int*/ - "%u", /*fmt_uint*/ - "%d", /*fmt_schar*/ - "%u", /*fmt_uchar*/ - "%d", /*fmt_short*/ - "%u", /*fmt_ushort*/ - "%ld", /*fmt_long*/ - "%lu", /*fmt_ulong*/ - NULL, /*fmt_llong*/ - NULL, /*fmt_ullong*/ - "%g", /*fmt_double*/ - "%g", /*fmt_float*/ +/* global variables for XML option */ - 0, /*ascii*/ - 0, /*str_locale*/ - 0, /*str_repeat*/ +static int doxml = 0; +#define DEFAULT_DTD "http://hdf.ncsa.uiuc.edu/DTDs/HDF5-File.dtd" +static char *xml_dtd_uri = NULL; +/* fill_ref_path_table is called to inialize the object +reference paths. */ +hid_t thefile = -1; +static herr_t fill_ref_path_table(hid_t, const char *, + void UNUSED *); +struct ref_path_table_entry_t * ref_path_table_lookup(char *); +char * lookup_ref_path(hobj_ref_t *); +void check_compression(hid_t ); +/** end XML **/ +/* internal functions used by standard format */ - "[ ", /*arr_pre*/ - ", ", /*arr_sep*/ - " ]", /*arr_suf*/ - 1, /*arr_linebreak*/ - - "", /*cmpd_name*/ - ",\n", /*cmpd_sep*/ - "{\n", /*cmpd_pre*/ - "}", /*cmpd_suf*/ - "\n", /*cmpd_end*/ - - ",", /*vlen_sep*/ - "(", /*vlen_pre*/ - ")", /*vlen_suf*/ - "", /*vlen_end*/ - - "%s", /*elmt_fmt*/ - ",", /*elmt_suf1*/ - " ", /*elmt_suf2*/ - - "", /*idx_n_fmt*/ - "", /*idx_sep*/ - "", /*idx_fmt*/ - - 80, /*line_ncols*//*standard default columns*/ - 0, /*line_per_line*/ - "", /*line_pre*/ - "%s", /*line_1st*/ - "%s", /*line_cont*/ - "", /*line_suf*/ - "", /*line_sep*/ - 1, /*line_multi_new*/ - " ", /*line_indent*/ - - 1, /*skip_first*/ - - 1, /*obj_hidefileno*/ - " %lu:%lu",/*obj_format*/ - - 1, /*dset_hidefileno*/ - "DATASET %lu:%lu ",/*dset_format*/ - "%s", /*dset_blockformat_pre*/ - "%s", /*dset_ptformat_pre*/ - "%s", /*dset_ptformat*/ -}; - -static const dump_header standardformat = { - "standardformat", /*name*/ - "HDF5", /*fileebgin*/ - "", /*fileend*/ - BOOT_BLOCK, /*bootblockbegin*/ - "", /*bootblockend*/ - GROUPNAME, /*groupbegin*/ - "", /*groupend*/ - DATASET, /*datasetbegin*/ - "", /*datasetend*/ - ATTRIBUTE, /*attributebegin*/ - "", /*attributeend*/ - DATATYPE, /*datatypebegin*/ - "", /*datatypeend*/ - DATASPACE, /*dataspacebegin*/ - "", /*dataspaceend*/ - DATA, /*databegin*/ - "", /*dataend*/ - SOFTLINK, /*softlinkbegin*/ - "", /*softlinkend*/ - - "{", /*fileblockbegin*/ - "}", /*fileblockend*/ - "{", /*bootblockblockbegin*/ - "}", /*bootblockblockend*/ - "{", /*groupblockbegin*/ - "}", /*groupblockend*/ - "{", /*datasetblockbegin*/ - "}", /*datasetblockend*/ - "{", /*attributeblockbegin*/ - "}", /*attributeblockend*/ - "", /*datatypeblockbegin*/ - "", /*datatypeblockend*/ - "", /*dataspaceblockbegin*/ - "", /*dataspaceblockend*/ - "{", /*datablockbegin*/ - "}", /*datablockend*/ - "{", /*softlinkblockbegin*/ - "}", /*softlinkblockend*/ - "{", /*strblockbegin*/ - "}", /*strblockend*/ - "{", /*enumblockbegin*/ - "}", /*enumblockend*/ - "{", /*structblockbegin*/ - "}", /*structblockend*/ - "{", /*vlenblockbegin*/ - "}", /*vlenblockend*/ - - "", /*dataspacedescriptionbegin*/ - "", /*dataspacedescriptionend*/ - "(", /*dataspacedimbegin*/ - ")", /*dataspacedimend*/ -}; - -static const dump_header xmlformat = { - "xml", /*name*/ - "", /*filebegin*/ - "", /*fileend*/ - "", /*bootblockbegin*/ - "", /*bootblockend*/ - "", /*groupbegin*/ - "", /*groupend*/ - "", /*datasetbegin*/ - "", /*datasetend*/ - "", /*attributebegin*/ - "", /*attributeend*/ - "", /*datatypeend*/ - "", /*datatypeend*/ - "", /*dataspacebegin*/ - "", /*dataspaceend*/ - "", /*databegin*/ - "", /*dataend*/ - "", /*softlinkbegin*/ - "", /*softlinkend*/ - - "", /*fileblockbegin*/ - "", /*fileblockend*/ - "", /*bootblockblockbegin*/ - "", /*bootblockblockend*/ - "", /*groupblockbegin*/ - "", /*groupblockend*/ - "", /*datasetblockbegin*/ - "", /*datasetblockend*/ - "", /*attributeblockbegin*/ - "", /*attributeblockend*/ - "", /*datatypeblockbegin*/ - "", /*datatypeblockend*/ - "", /*dataspaceblockbegin*/ - "", /*dataspaceblockend*/ - "", /*datablockbegin*/ - "", /*datablockend*/ - "", /*softlinkblockbegin*/ - "", /*softlinkblockend*/ - "", /*strblockbegin*/ - "", /*strblockend*/ - "", /*enumblockbegin*/ - "", /*enumblockend*/ - "", /*structblockbegin*/ - "", /*structblockend*/ - "", /*vlenblockbegin*/ - "", /*vlenblockend*/ - - "", /*dataspacedescriptionbegin*/ - "", /*dataspacedescriptionend*/ - "(", /*dataspacedimbegin*/ - ")", /*dataspacedimend*/ -}; - -/* internal functions */ -static void dump_group(hid_t , const char* ); -static void dump_dataset(hid_t, const char*); -static void dump_data(hid_t, int); -static void dump_named_datatype(hid_t , const char *); -static void dump_oid(hid_t oid); -static void print_enum(hid_t type); +static void dump_oid(hid_t oid); +static void print_enum(hid_t type); /* external functions */ -extern int print_data(hid_t, hid_t, int); +extern void indentation(int); +extern int print_data(hid_t, hid_t, int); + +static h5dump_t dataformat = { + 0, /*raw */ + + "", /*fmt_raw */ + "%d", /*fmt_int */ + "%u", /*fmt_uint */ + "%d", /*fmt_schar */ + "%u", /*fmt_uchar */ + "%d", /*fmt_short */ + "%u", /*fmt_ushort */ + "%ld", /*fmt_long */ + "%lu", /*fmt_ulong */ + NULL, /*fmt_llong */ + NULL, /*fmt_ullong */ + "%g", /*fmt_double */ + "%g", /*fmt_float */ + + 0, /*ascii */ + 0, /*str_locale */ + 0, /*str_repeat */ + + "[ ", /*arr_pre */ + ", ", /*arr_sep */ + " ]", /*arr_suf */ + 1, /*arr_linebreak */ + + "", /*cmpd_name */ + ",\n", /*cmpd_sep */ + "{\n", /*cmpd_pre */ + "}", /*cmpd_suf */ + "\n", /*cmpd_end */ + + ",", /*vlen_sep */ + "(", /*vlen_pre */ + ")", /*vlen_suf */ + "", /*vlen_end */ + + "%s", /*elmt_fmt */ + ",", /*elmt_suf1 */ + " ", /*elmt_suf2 */ + + "", /*idx_n_fmt */ + "", /*idx_sep */ + "", /*idx_fmt */ + + 80, /*line_ncols *//*standard default columns */ + 0, /*line_per_line */ + "", /*line_pre */ + "%s", /*line_1st */ + "%s", /*line_cont */ + "", /*line_suf */ + "", /*line_sep */ + 1, /*line_multi_new */ + " ", /*line_indent */ + + 1, /*skip_first */ + + 1, /*obj_hidefileno */ + " %lu:%lu", /*obj_format */ + + 1, /*dset_hidefileno */ + "DATASET %lu:%lu ", /*dset_format */ + "%s", /*dset_blockformat_pre */ + "%s", /*dset_ptformat_pre */ + "%s", /*dset_ptformat */ +}; + +/** + ** Added for XML ** + **/ +/* + * Alternative formating for data dumped to XML + * In general, the numbers are the same, but separators + * except spaces are not used. + * + * Some of these are not used, as some kinds of data are + * dumped in completely new subroutines. + * + * Some of this formatting may yet need to change. + * + * This table only affects XML output. + */ +static h5dump_t xml_dataformat = { + 0, /*raw */ + + "", /*fmt_raw */ + "%d", /*fmt_int */ + "%u", /*fmt_uint */ + "%d", /*fmt_schar */ + "%u", /*fmt_uchar */ + "%d", /*fmt_short */ + "%u", /*fmt_ushort */ + "%ld", /*fmt_long */ + "%lu", /*fmt_ulong */ + NULL, /*fmt_llong */ + NULL, /*fmt_ullong */ + "%g", /*fmt_double */ + "%g", /*fmt_float */ + + 0, /*ascii */ + 0, /*str_locale */ + 0, /*str_repeat */ + + " ", /*arr_pre */ + " ", /*arr_sep */ + " ", /*arr_suf */ + 1, /*arr_linebreak */ + + "", /*cmpd_name */ + " ", /*cmpd_sep */ + "", /*cmpd_pre */ + "", /*cmpd_suf */ + "", /*cmpd_end */ + + " ", /*vlen_sep */ + " ", /*vlen_pre */ + " ", /*vlen_suf */ + "", /*vlen_end */ + + "%s", /*elmt_fmt */ + " ", /*elmt_suf1 */ + "", /*elmt_suf2 */ + + "", /*idx_n_fmt */ + "", /*idx_sep */ + "", /*idx_fmt */ + + 80, /*line_ncols *//*standard default columns */ + 0, /*line_per_line */ + "", /*line_pre */ + "%s", /*line_1st */ + "%s", /*line_cont */ + "", /*line_suf */ + "", /*line_sep */ + 1, /*line_multi_new */ + " ", /*line_indent */ + + 1, /*skip_first */ + + 1, /*obj_hidefileno */ + " %lu:%lu", /*obj_format */ + + 1, /*dset_hidefileno */ + "DATASET %lu:%lu ", /*dset_format */ + "%s", /*dset_blockformat_pre */ + "%s", /*dset_ptformat_pre */ + "%s", /*dset_ptformat */ +}; + +/** XML **/ + +static const dump_header standardformat = { + "standardformat", /*name */ + "HDF5", /*fileebgin */ + "", /*fileend */ + BOOT_BLOCK, /*bootblockbegin */ + "", /*bootblockend */ + GROUPNAME, /*groupbegin */ + "", /*groupend */ + DATASET, /*datasetbegin */ + "", /*datasetend */ + ATTRIBUTE, /*attributebegin */ + "", /*attributeend */ + DATATYPE, /*datatypebegin */ + "", /*datatypeend */ + DATASPACE, /*dataspacebegin */ + "", /*dataspaceend */ + DATA, /*databegin */ + "", /*dataend */ + SOFTLINK, /*softlinkbegin */ + "", /*softlinkend */ + + "{", /*fileblockbegin */ + "}", /*fileblockend */ + "{", /*bootblockblockbegin */ + "}", /*bootblockblockend */ + "{", /*groupblockbegin */ + "}", /*groupblockend */ + "{", /*datasetblockbegin */ + "}", /*datasetblockend */ + "{", /*attributeblockbegin */ + "}", /*attributeblockend */ + "", /*datatypeblockbegin */ + "", /*datatypeblockend */ + "", /*dataspaceblockbegin */ + "", /*dataspaceblockend */ + "{", /*datablockbegin */ + "}", /*datablockend */ + "{", /*softlinkblockbegin */ + "}", /*softlinkblockend */ + "{", /*strblockbegin */ + "}", /*strblockend */ + "{", /*enumblockbegin */ + "}", /*enumblockend */ + "{", /*structblockbegin */ + "}", /*structblockend */ + "{", /*vlenblockbegin */ + "}", /*vlenblockend */ + + "", /*dataspacedescriptionbegin */ + "", /*dataspacedescriptionend */ + "(", /*dataspacedimbegin */ + ")", /*dataspacedimend */ +}; + +/** + ** Added for XML ** + **/ +/* The 'header' formats for XML -- mostly null + * + * XML output has values embedded in the 'headers', so + * all the XML headers are done on a case by case basis. + */ +static const dump_header xmlformat = { + "xml", /*name */ + "", /*filebegin */ + "", /*fileend */ + "", /*bootblockbegin */ + "", /*bootblockend */ + "", /*groupbegin */ + "", /*groupend */ + "", /*datasetbegin */ + "", /*datasetend */ + "", /*attributebegin */ + "", /*attributeend */ + "", /*datatypeend */ + "", /*datatypeend */ + "", /*dataspacebegin */ + "", /*dataspaceend */ + "", /*databegin */ + "", /*dataend */ + "", /*softlinkbegin */ + "", /*softlinkend */ + + "", /*fileblockbegin */ + "", /*fileblockend */ + "", /*bootblockblockbegin */ + "", /*bootblockblockend */ + "", /*groupblockbegin */ + "", /*groupblockend */ + "", /*datasetblockbegin */ + "", /*datasetblockend */ + "", /*attributeblockbegin */ + "", /*attributeblockend */ + "", /*datatypeblockbegin */ + "", /*datatypeblockend */ + "", /*dataspaceblockbegin */ + "", /*dataspaceblockend */ + "", /*datablockbegin */ + "", /*datablockend */ + "", /*softlinkblockbegin */ + "", /*softlinkblockend */ + "", /*strblockbegin */ + "", /*strblockend */ + "", /*enumblockbegin */ + "", /*enumblockend */ + "", /*structblockbegin */ + "", /*structblockend */ + "", /*vlenblockbegin */ + "", /*vlenblockend */ + + "", /*dataspacedescriptionbegin */ + "", /*dataspacedescriptionend */ + "", /*dataspacedimbegin */ + "", /*dataspacedimend */ +}; + +/** XML **/ + +/** + ** Added for XML ** + **/ +/* internal functions used by XML option */ +static void xml_print_datatype(hid_t); +static void xml_print_enum(hid_t); +static int xml_print_refs(hid_t, int); +static int xml_print_strs(hid_t, int); +hobj_ref_t *ref_path_table_put(hid_t, char *); +char *xml_escape_the_string(char *, int); +char *xml_escape_the_name(char *); + +/** + ** Change for XML ** + ** + ** The 'dump_xxx' functions have two versions, standard and XML. + ** + ** They are called indirectly through the 'dump_function_table'. + ** e.g., dump_group(...) becomes dump_functions->dump_group(...); + ** + ** The standard functions are unchanged except for the way + ** they are called + **/ + +/* The dump functions of the dump_function_table */ + +/* standard format: no change */ +static void dump_group(hid_t, const char *); +static void dump_dataset(hid_t, const char *); +static void dump_data(hid_t, int); +static void dump_named_datatype(hid_t, const char *); +static void dump_dataspace(hid_t space); +static void dump_datatype(hid_t type); +static herr_t dump_attr(hid_t attr, const char *attr_name, + void UNUSED * op_data); + +/* XML format: same interface, alternaive output */ + +static void xml_dump_group(hid_t, const char *); +static void xml_dump_dataset(hid_t ds, const char *dsname); +static void xml_dump_data(hid_t, int); +static void xml_dump_named_datatype(hid_t, const char *); +static void xml_dump_dataspace(hid_t space); +static void xml_dump_datatype(hid_t type); +static herr_t xml_dump_attr(hid_t attr, const char *attr_name, + void UNUSED * op_data); + +/** + ** Added for XML ** + ** + ** This is the global dispatch table for the dump functions. + **/ +/* the table of dump functions */ +typedef struct +{ + void (*dump_group_function) (hid_t, const char *); + void (*dump_named_datatype_function) (hid_t, + const char *); + void (*dump_dataset_function) (hid_t, const char *); + void (*dump_dataspace_function) (hid_t); + void (*dump_datatype_function) (hid_t); + herr_t (*dump_attribute_function) (hid_t, const char *, + void *); + void (*dump_data_function) (hid_t, int); +} +dump_functions; + +/* Standard DDL output */ +static const dump_functions ddl_function_table = { + dump_group, + dump_named_datatype, + dump_dataset, + dump_dataspace, + dump_datatype, + dump_attr, + dump_data +}; + +/* XML output */ +static const dump_functions xml_function_table = { + xml_dump_group, + xml_dump_named_datatype, + xml_dump_dataset, + xml_dump_dataspace, + xml_dump_datatype, + xml_dump_attr, + xml_dump_data +}; + +/* The global table is set to either ddl_function_table or + xml_function_table in the initialization. + */ +static const dump_functions *dump_function_table; + /* a structure for handling the order command-line parameters come in */ struct handler_t { @@ -327,12 +534,14 @@ usage: %s [OPTIONS] file\n\ -o F, --output=F Output raw data into file F\n\ -t T, --datatype=T Print the specified named data type\n\ -w #, --width=# Set the number of columns of output\n\ -\n\ + -x, --xml Output XML\n\ + -D URI, --xml-dtd=URL Use the DTD at URI\n\ P - is the full path from the root group to the object.\n\ T - is the name of the data type.\n\ F - is a filename.\n\ # - is an integer greater than 1.\n\ -\n\ + URI - is a URI a URI reference (as defined in [IETF RFC 2396],\n\ + updated by [IETF RFC 2732])\n\ Example:\n\ \n\ Attribute foo of the group /bar_none in file quux.h5\n\ @@ -356,299 +565,300 @@ usage: %s [OPTIONS] file\n\ static void print_datatype(hid_t type) { - char *fname ; - hid_t nmembers, mtype, str_type; - int i, j, ndims, perm[H5DUMP_MAX_RANK]; - size_t size; - hsize_t dims[H5DUMP_MAX_RANK]; - H5T_str_t str_pad; - H5T_cset_t cset; - H5G_stat_t statbuf; - hid_t super; + char *fname; + hid_t nmembers, mtype, str_type; + int i, j, ndims, perm[H5DUMP_MAX_RANK]; + size_t size; + hsize_t dims[H5DUMP_MAX_RANK]; + H5T_str_t str_pad; + H5T_cset_t cset; + H5G_stat_t statbuf; + hid_t super; switch (H5Tget_class(type)) { - case H5T_INTEGER: - if (H5Tequal(type, H5T_STD_I8BE)) { - printf("H5T_STD_I8BE"); - } else if (H5Tequal(type, H5T_STD_I8LE)) { - printf("H5T_STD_I8LE"); - } else if (H5Tequal(type, H5T_STD_I16BE)) { - printf("H5T_STD_I16BE"); - } else if (H5Tequal(type, H5T_STD_I16LE)) { - printf("H5T_STD_I16LE"); - } else if (H5Tequal(type, H5T_STD_I32BE)) { - printf("H5T_STD_I32BE"); - } else if (H5Tequal(type, H5T_STD_I32LE)) { - printf("H5T_STD_I32LE"); - } else if (H5Tequal(type, H5T_STD_I64BE)) { - printf("H5T_STD_I64BE"); - } else if (H5Tequal(type, H5T_STD_I64LE)) { - printf("H5T_STD_I64LE"); - } else if (H5Tequal(type, H5T_STD_U8BE)) { - printf("H5T_STD_U8BE"); - } else if (H5Tequal(type, H5T_STD_U8LE)) { - printf("H5T_STD_U8LE"); - } else if (H5Tequal(type, H5T_STD_U16BE)) { - printf("H5T_STD_U16BE"); - } else if (H5Tequal(type, H5T_STD_U16LE)) { - printf("H5T_STD_U16LE"); - } else if (H5Tequal(type, H5T_STD_U32BE)) { - printf("H5T_STD_U32BE"); - } else if (H5Tequal(type, H5T_STD_U32LE)) { - printf("H5T_STD_U32LE"); - } else if (H5Tequal(type, H5T_STD_U64BE)) { - printf("H5T_STD_U64BE"); - } else if (H5Tequal(type, H5T_STD_U64LE)) { - printf("H5T_STD_U64LE"); - } else if (H5Tequal(type, H5T_NATIVE_SCHAR)) { - printf("H5T_NATIVE_SCHAR"); - } else if (H5Tequal(type, H5T_NATIVE_UCHAR)) { - printf("H5T_NATIVE_UCHAR"); - } else if (H5Tequal(type, H5T_NATIVE_SHORT)) { - printf("H5T_NATIVE_SHORT"); - } else if (H5Tequal(type, H5T_NATIVE_USHORT)) { - printf("H5T_NATIVE_USHORT"); - } else if (H5Tequal(type, H5T_NATIVE_INT)) { - printf("H5T_NATIVE_INT"); - } else if (H5Tequal(type, H5T_NATIVE_UINT)) { - printf("H5T_NATIVE_UINT"); - } else if (H5Tequal(type, H5T_NATIVE_LONG)) { - printf("H5T_NATIVE_LONG"); - } else if (H5Tequal(type, H5T_NATIVE_ULONG)) { - printf("H5T_NATIVE_ULONG"); - } else if (H5Tequal(type, H5T_NATIVE_LLONG)) { - printf("H5T_NATIVE_LLONG"); - } else if (H5Tequal(type, H5T_NATIVE_ULLONG)) { - printf("H5T_NATIVE_ULLONG"); - } else { - printf("undefined integer"); - d_status = 1; - } - break; + case H5T_INTEGER: + if (H5Tequal(type, H5T_STD_I8BE)) { + printf("H5T_STD_I8BE"); + } else if (H5Tequal(type, H5T_STD_I8LE)) { + printf("H5T_STD_I8LE"); + } else if (H5Tequal(type, H5T_STD_I16BE)) { + printf("H5T_STD_I16BE"); + } else if (H5Tequal(type, H5T_STD_I16LE)) { + printf("H5T_STD_I16LE"); + } else if (H5Tequal(type, H5T_STD_I32BE)) { + printf("H5T_STD_I32BE"); + } else if (H5Tequal(type, H5T_STD_I32LE)) { + printf("H5T_STD_I32LE"); + } else if (H5Tequal(type, H5T_STD_I64BE)) { + printf("H5T_STD_I64BE"); + } else if (H5Tequal(type, H5T_STD_I64LE)) { + printf("H5T_STD_I64LE"); + } else if (H5Tequal(type, H5T_STD_U8BE)) { + printf("H5T_STD_U8BE"); + } else if (H5Tequal(type, H5T_STD_U8LE)) { + printf("H5T_STD_U8LE"); + } else if (H5Tequal(type, H5T_STD_U16BE)) { + printf("H5T_STD_U16BE"); + } else if (H5Tequal(type, H5T_STD_U16LE)) { + printf("H5T_STD_U16LE"); + } else if (H5Tequal(type, H5T_STD_U32BE)) { + printf("H5T_STD_U32BE"); + } else if (H5Tequal(type, H5T_STD_U32LE)) { + printf("H5T_STD_U32LE"); + } else if (H5Tequal(type, H5T_STD_U64BE)) { + printf("H5T_STD_U64BE"); + } else if (H5Tequal(type, H5T_STD_U64LE)) { + printf("H5T_STD_U64LE"); + } else if (H5Tequal(type, H5T_NATIVE_SCHAR)) { + printf("H5T_NATIVE_SCHAR"); + } else if (H5Tequal(type, H5T_NATIVE_UCHAR)) { + printf("H5T_NATIVE_UCHAR"); + } else if (H5Tequal(type, H5T_NATIVE_SHORT)) { + printf("H5T_NATIVE_SHORT"); + } else if (H5Tequal(type, H5T_NATIVE_USHORT)) { + printf("H5T_NATIVE_USHORT"); + } else if (H5Tequal(type, H5T_NATIVE_INT)) { + printf("H5T_NATIVE_INT"); + } else if (H5Tequal(type, H5T_NATIVE_UINT)) { + printf("H5T_NATIVE_UINT"); + } else if (H5Tequal(type, H5T_NATIVE_LONG)) { + printf("H5T_NATIVE_LONG"); + } else if (H5Tequal(type, H5T_NATIVE_ULONG)) { + printf("H5T_NATIVE_ULONG"); + } else if (H5Tequal(type, H5T_NATIVE_LLONG)) { + printf("H5T_NATIVE_LLONG"); + } else if (H5Tequal(type, H5T_NATIVE_ULLONG)) { + printf("H5T_NATIVE_ULLONG"); + } else { + printf("undefined integer"); + d_status = 1; + } + break; - case H5T_FLOAT: - if (H5Tequal(type, H5T_IEEE_F32BE)) { - printf("H5T_IEEE_F32BE"); - } else if (H5Tequal(type, H5T_IEEE_F32LE)) { - printf("H5T_IEEE_F32LE"); - } else if (H5Tequal(type, H5T_IEEE_F64BE)) { - printf("H5T_IEEE_F64BE"); - } else if (H5Tequal(type, H5T_IEEE_F64LE)) { - printf("H5T_IEEE_F64LE"); - } else if (H5Tequal(type, H5T_NATIVE_FLOAT)) { - printf("H5T_NATIVE_FLOAT"); - } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) { - printf("H5T_NATIVE_DOUBLE"); - } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) { - printf("H5T_NATIVE_LDOUBLE"); - } else { - printf("undefined float"); - d_status = 1; - } - break; + case H5T_FLOAT: + if (H5Tequal(type, H5T_IEEE_F32BE)) { + printf("H5T_IEEE_F32BE"); + } else if (H5Tequal(type, H5T_IEEE_F32LE)) { + printf("H5T_IEEE_F32LE"); + } else if (H5Tequal(type, H5T_IEEE_F64BE)) { + printf("H5T_IEEE_F64BE"); + } else if (H5Tequal(type, H5T_IEEE_F64LE)) { + printf("H5T_IEEE_F64LE"); + } else if (H5Tequal(type, H5T_NATIVE_FLOAT)) { + printf("H5T_NATIVE_FLOAT"); + } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) { + printf("H5T_NATIVE_DOUBLE"); + } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) { + printf("H5T_NATIVE_LDOUBLE"); + } else { + printf("undefined float"); + d_status = 1; + } + break; - case H5T_TIME: - printf("H5T_TIME: not yet implemented"); - break; + case H5T_TIME: + printf("H5T_TIME: not yet implemented"); + break; - case H5T_STRING: - size = H5Tget_size(type); - str_pad = H5Tget_strpad(type); - cset = H5Tget_cset(type); + case H5T_STRING: + size = H5Tget_size(type); + str_pad = H5Tget_strpad(type); + cset = H5Tget_cset(type); - printf("H5T_STRING %s\n", dump_header_format->strblockbegin); - indent += COL; + printf("H5T_STRING %s\n", dump_header_format->strblockbegin); + indent += COL; - indentation(indent + COL); - printf("%s %d;\n", STRSIZE, (int)size); + indentation(indent + COL); + printf("%s %d;\n", STRSIZE, (int) size); - indentation(indent + COL); - printf("%s ", STRPAD); - if (str_pad == H5T_STR_NULLTERM ) - printf("H5T_STR_NULLTERM;\n"); - else if (str_pad == H5T_STR_NULLPAD ) - printf("H5T_STR_NULLPAD;\n"); - else if (str_pad == H5T_STR_SPACEPAD ) - printf("H5T_STR_SPACEPAD;\n"); - else - printf("H5T_STR_ERROR;\n"); + indentation(indent + COL); + printf("%s ", STRPAD); + if (str_pad == H5T_STR_NULLTERM) + printf("H5T_STR_NULLTERM;\n"); + else if (str_pad == H5T_STR_NULLPAD) + printf("H5T_STR_NULLPAD;\n"); + else if (str_pad == H5T_STR_SPACEPAD) + printf("H5T_STR_SPACEPAD;\n"); + else + printf("H5T_STR_ERROR;\n"); - indentation(indent + COL); - printf("%s ", CSET); - if (cset == H5T_CSET_ASCII) - printf("H5T_CSET_ASCII;\n"); - else - printf("unknown_cset;\n"); + indentation(indent + COL); + printf("%s ", CSET); - str_type = H5Tcopy(H5T_C_S1); - H5Tset_cset(str_type, cset); - H5Tset_size(str_type, size); - H5Tset_strpad(str_type, str_pad); + if (cset == H5T_CSET_ASCII) + printf("H5T_CSET_ASCII;\n"); + else + printf("unknown_cset;\n"); - indentation(indent + COL); - printf("%s ", CTYPE); + str_type = H5Tcopy(H5T_C_S1); + H5Tset_cset(str_type, cset); + H5Tset_size(str_type, size); + H5Tset_strpad(str_type, str_pad); - if (H5Tequal(type,str_type)) { - printf("H5T_C_S1;\n"); - H5Tclose(str_type); - } else { - H5Tclose(str_type); - str_type = H5Tcopy(H5T_FORTRAN_S1); - H5Tset_cset(str_type, cset ) ; - H5Tset_size(str_type, size); - H5Tset_strpad(str_type, str_pad ); + indentation(indent + COL); + printf("%s ", CTYPE); - if (H5Tequal(type,str_type)) { - printf( "H5T_FORTRAN_S1;\n"); - } else { - printf("unknown_one_character_type;\n "); - d_status = 1; - } + if (H5Tequal(type, str_type)) { + printf("H5T_C_S1;\n"); + H5Tclose(str_type); + } else { + H5Tclose(str_type); + str_type = H5Tcopy(H5T_FORTRAN_S1); + H5Tset_cset(str_type, cset); + H5Tset_size(str_type, size); + H5Tset_strpad(str_type, str_pad); - H5Tclose(str_type); - } + if (H5Tequal(type, str_type)) { + printf("H5T_FORTRAN_S1;\n"); + } else { + printf("unknown_one_character_type;\n "); + d_status = 1; + } - indent -= COL; - indentation(indent + COL); - printf("%s", dump_header_format->strblockend); - break; + H5Tclose(str_type); + } - case H5T_BITFIELD: - if (H5Tequal(type, H5T_STD_B8BE)) { - printf("H5T_STD_B8BE"); - } else if (H5Tequal(type, H5T_STD_B8LE)) { - printf("H5T_STD_B8LE"); - } else if (H5Tequal(type, H5T_STD_B16BE)) { - printf("H5T_STD_B16BE"); - } else if (H5Tequal(type, H5T_STD_B16LE)) { - printf("H5T_STD_B16LE"); - } else if (H5Tequal(type, H5T_STD_B32BE)) { - printf("H5T_STD_B32BE"); - } else if (H5Tequal(type, H5T_STD_B32LE)) { - printf("H5T_STD_B32LE"); - } else if (H5Tequal(type, H5T_STD_B64BE)) { - printf("H5T_STD_B64BE"); - } else if (H5Tequal(type, H5T_STD_B64LE)) { - printf("H5T_STD_B64LE"); - } else { - printf("undefined bitfield"); - d_status = 1; - } - break; + indent -= COL; + indentation(indent + COL); + printf("%s", dump_header_format->strblockend); + break; - case H5T_OPAQUE: - printf("\n"); - indentation(indent + COL); - printf("H5T_OPAQUE;\n"); - indentation(indent + COL); - printf("OPAQUE_TAG \"%s\";\n", H5Tget_tag(type)); - indentation(indent); - break; + case H5T_BITFIELD: + if (H5Tequal(type, H5T_STD_B8BE)) { + printf("H5T_STD_B8BE"); + } else if (H5Tequal(type, H5T_STD_B8LE)) { + printf("H5T_STD_B8LE"); + } else if (H5Tequal(type, H5T_STD_B16BE)) { + printf("H5T_STD_B16BE"); + } else if (H5Tequal(type, H5T_STD_B16LE)) { + printf("H5T_STD_B16LE"); + } else if (H5Tequal(type, H5T_STD_B32BE)) { + printf("H5T_STD_B32BE"); + } else if (H5Tequal(type, H5T_STD_B32LE)) { + printf("H5T_STD_B32LE"); + } else if (H5Tequal(type, H5T_STD_B64BE)) { + printf("H5T_STD_B64BE"); + } else if (H5Tequal(type, H5T_STD_B64LE)) { + printf("H5T_STD_B64LE"); + } else { + printf("undefined bitfield"); + d_status = 1; + } + break; - case H5T_COMPOUND: - if (H5Tcommitted(type) > 0) { - H5Gget_objinfo(type, ".", TRUE, &statbuf); - i = search_obj (type_table, statbuf.objno); + case H5T_OPAQUE: + printf("\n"); + indentation(indent + COL); + printf("H5T_OPAQUE;\n"); + indentation(indent + COL); + printf("OPAQUE_TAG \"%s\";\n", H5Tget_tag(type)); + indentation(indent); + break; - if (i >= 0) { - if (!type_table->objs[i].recorded) - printf("\"/#%lu:%lu\"\n", type_table->objs[i].objno[0], - type_table->objs[i].objno[1]); - else - printf("\"%s\"", type_table->objs[i].objname); - } else { - printf("h5dump error: unknown committed type.\n"); - d_status = 1; - } - } else { - nmembers = H5Tget_nmembers(type); - - printf("H5T_COMPOUND %s\n", dump_header_format->structblockbegin); - for (i = 0; i < nmembers; i++) { - fname = H5Tget_member_name(type, i); - mtype = H5Tget_member_type(type, i); + case H5T_COMPOUND: + if (H5Tcommitted(type) > 0) { + H5Gget_objinfo(type, ".", TRUE, &statbuf); + i = search_obj(type_table, statbuf.objno); - indentation (indent + COL); + if (i >= 0) { + if (!type_table->objs[i].recorded) + printf("\"/#%lu:%lu\"\n", type_table->objs[i].objno[0], + type_table->objs[i].objno[1]); + else + printf("\"%s\"", type_table->objs[i].objname); + } else { + printf("h5dump error: unknown committed type.\n"); + d_status = 1; + } + } else { + nmembers = H5Tget_nmembers(type); - if (H5Tget_class(mtype) == H5T_COMPOUND) { - indent += COL; - } + printf("H5T_COMPOUND %s\n", dump_header_format->structblockbegin); + for (i = 0; i < nmembers; i++) { + fname = H5Tget_member_name(type, i); + mtype = H5Tget_member_type(type, i); - print_datatype(mtype); + indentation(indent + COL); - if (H5Tget_class(mtype) == H5T_COMPOUND) { - indent -= COL; - } + if (H5Tget_class(mtype) == H5T_COMPOUND) { + indent += COL; + } - printf (" \"%s\";\n", fname); + print_datatype(mtype); - free(fname); - } - indentation(indent); - printf("%s", dump_header_format->structblockend); - } - break; + if (H5Tget_class(mtype) == H5T_COMPOUND) { + indent -= COL; + } - case H5T_REFERENCE: - printf("H5T_REFERENCE"); - break; + printf(" \"%s\";\n", fname); - case H5T_ENUM: - printf("H5T_ENUM %s\n",dump_header_format->enumblockbegin); - indent += COL; - indentation(indent + COL); - super = H5Tget_super(type); - print_datatype(super); - printf(";\n"); - print_enum(type); - indent -= COL; - indentation(indent + COL); - printf("%s", dump_header_format->enumblockend); - break; + free(fname); + } + indentation(indent); + printf("%s", dump_header_format->structblockend); + } + break; - case H5T_VLEN: - printf("H5T_VLEN %s ",dump_header_format->vlenblockbegin); + case H5T_REFERENCE: + printf("H5T_REFERENCE"); + break; - super = H5Tget_super(type); - print_datatype(super); - H5Tclose(super); + case H5T_ENUM: + printf("H5T_ENUM %s\n", dump_header_format->enumblockbegin); + indent += COL; + indentation(indent + COL); + super = H5Tget_super(type); + print_datatype(super); + printf(";\n"); + print_enum(type); + indent -= COL; + indentation(indent + COL); + printf("%s", dump_header_format->enumblockend); + break; - /* Print closing */ - printf("%s", dump_header_format->vlenblockend); - break; + case H5T_VLEN: + printf("H5T_VLEN %s ", dump_header_format->vlenblockbegin); - case H5T_ARRAY: - /* Get array base type */ - super = H5Tget_super(type); - - /* Print lead-in */ - printf("H5T_ARRAY { "); + super = H5Tget_super(type); + print_datatype(super); + H5Tclose(super); - /* Get array information */ - ndims = H5Tget_array_ndims(type); - H5Tget_array_dims(type, dims, perm); + /* Print closing */ + printf("%s", dump_header_format->vlenblockend); + break; - /* Print array dimensions */ - for (j = 0; j < ndims; j++) - printf("[%d]",(int)dims[j]); + case H5T_ARRAY: + /* Get array base type */ + super = H5Tget_super(type); - printf(" "); + /* Print lead-in */ + printf("H5T_ARRAY { "); - /* Print base type */ - print_datatype(super); + /* Get array information */ + ndims = H5Tget_array_ndims(type); + H5Tget_array_dims(type, dims, perm); - /* Close array base type */ - H5Tclose(super); + /* Print array dimensions */ + for (j = 0; j < ndims; j++) + printf("[%d]", (int) dims[j]); - /* Print closing */ - printf(" }"); + printf(" "); - break; + /* Print base type */ + print_datatype(super); - default: - printf("unknown data type"); - d_status = 1; - break; + /* Close array base type */ + H5Tclose(super); + + /* Print closing */ + printf(" }"); + + break; + + default: + printf("unknown data type"); + d_status = 1; + break; } } @@ -668,7 +878,7 @@ static void dump_bb(void) { printf("%s %s boot block not yet implemented %s\n", - BOOT_BLOCK, BEGIN, END); + BOOT_BLOCK, BEGIN, END); } /*------------------------------------------------------------------------- @@ -691,14 +901,14 @@ dump_datatype(hid_t type) indentation(indent); printf("%s %s ", dump_header_format->datatypebegin, - dump_header_format->datatypeblockbegin); + dump_header_format->datatypeblockbegin); print_datatype(type); - if (H5Tget_class(type) == H5T_COMPOUND || H5Tget_class(type) == H5T_STRING) - indentation(indent); + if (H5Tget_class(type) == H5T_COMPOUND + || H5Tget_class(type) == H5T_STRING) indentation(indent); printf(" %s %s\n", dump_header_format->datatypeblockend, - dump_header_format->datatypeend); + dump_header_format->datatypeend); indent -= COL; } @@ -719,53 +929,53 @@ dump_datatype(hid_t type) static void dump_dataspace(hid_t space) { - hsize_t size[H5DUMP_MAX_RANK]; - hsize_t maxsize[H5DUMP_MAX_RANK]; - int ndims = H5Sget_simple_extent_dims(space, size, maxsize); - int i; + hsize_t size[H5DUMP_MAX_RANK]; + hsize_t maxsize[H5DUMP_MAX_RANK]; + int ndims = + H5Sget_simple_extent_dims(space, size, maxsize); + int i; indentation(indent + COL); printf("%s ", dump_header_format->dataspacebegin); if (H5Sis_simple(space)) { - if (ndims == 0) { - /* scalar dataspace */ - HDfprintf(stdout, "%s %s ", - dump_header_format->dataspacedescriptionbegin, - SCALAR); + if (ndims == 0) { + /* scalar dataspace */ + HDfprintf(stdout, "%s %s ", + dump_header_format->dataspacedescriptionbegin, SCALAR); + } else { + /* simple dataspace */ + HDfprintf(stdout, "%s %s { %s %Hu", + dump_header_format->dataspacedescriptionbegin, SIMPLE, + dump_header_format->dataspacedimbegin, size[0]); + + for (i = 1; i < ndims; i++) + HDfprintf(stdout, ", %Hu", size[i]); + + printf(" %s / ", dump_header_format->dataspacedimend); + + if (maxsize[0] == H5S_UNLIMITED) + HDfprintf(stdout, "%s %s", + dump_header_format->dataspacedimbegin, + "H5S_UNLIMITED"); + else + HDfprintf(stdout, "%s %Hu", + dump_header_format->dataspacedimbegin, maxsize[0]); + + for (i = 1; i < ndims; i++) + if (maxsize[i] == H5S_UNLIMITED) + HDfprintf(stdout, ", %s", "H5S_UNLIMITED"); + else + HDfprintf(stdout, ", %Hu", maxsize[i]); + + printf(" %s }", dump_header_format->dataspacedimend); + } } else { - /* simple dataspace */ - HDfprintf(stdout, "%s %s { %s %Hu", - dump_header_format->dataspacedescriptionbegin, SIMPLE, - dump_header_format->dataspacedimbegin,size[0]); - - for (i = 1; i < ndims; i++) - HDfprintf(stdout, ", %Hu", size[i]); - - printf(" %s / ", dump_header_format->dataspacedimend); - - if (maxsize[0] == H5S_UNLIMITED) - HDfprintf(stdout, "%s %s", - dump_header_format->dataspacedimbegin, - "H5S_UNLIMITED"); - else - HDfprintf(stdout, "%s %Hu", - dump_header_format->dataspacedimbegin, maxsize[0]); - - for (i = 1; i < ndims; i++) - if (maxsize[i] == H5S_UNLIMITED) - HDfprintf(stdout, ", %s", "H5S_UNLIMITED"); - else - HDfprintf(stdout, ", %Hu", maxsize[i]); - - printf(" %s }", dump_header_format->dataspacedimend); - } - } else { - printf("%s not yet implemented %s\n", BEGIN, END); + printf("%s not yet implemented %s\n", BEGIN, END); } end_obj(dump_header_format->dataspaceend, - dump_header_format->dataspaceblockend); + dump_header_format->dataspaceblockend); } /*------------------------------------------------------------------------- @@ -783,44 +993,44 @@ dump_dataspace(hid_t space) * *-----------------------------------------------------------------------*/ static herr_t -dump_attr(hid_t attr, const char *attr_name, void UNUSED *op_data) +dump_attr(hid_t attr, const char *attr_name, void UNUSED * op_data) { - hid_t attr_id, type, space; - herr_t ret = SUCCEED; + hid_t attr_id, type, space; + herr_t ret = SUCCEED; indentation(indent); begin_obj(dump_header_format->attributebegin, attr_name, - dump_header_format->attributeblockbegin); + dump_header_format->attributeblockbegin); - if ((attr_id = H5Aopen_name (attr, attr_name)) >= 0) { - type = H5Aget_type(attr_id); - space = H5Aget_space(attr_id); - dump_datatype(type); - dump_dataspace(space); + if ((attr_id = H5Aopen_name(attr, attr_name)) >= 0) { + type = H5Aget_type(attr_id); + space = H5Aget_space(attr_id); + dump_datatype(type); + dump_dataspace(space); - if (display_oid) - dump_oid(attr_id); + if (display_oid) + dump_oid(attr_id); - if (display_data) - dump_data(attr_id, ATTRIBUTE_DATA); + if (display_data) + dump_data(attr_id, ATTRIBUTE_DATA); - H5Tclose(type); - H5Sclose(space); - H5Aclose (attr_id); - indentation (indent); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); + H5Tclose(type); + H5Sclose(space); + H5Aclose(attr_id); + indentation(indent); + end_obj(dump_header_format->attributeend, + dump_header_format->attributeblockend); } else { - indentation(indent + COL); - printf("h5dump error: unable to open attribute.\n"); - indentation(indent); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); - d_status = 1; - ret = FAIL; + indentation(indent + COL); + printf("h5dump error: unable to open attribute.\n"); + indentation(indent); + end_obj(dump_header_format->attributeend, + dump_header_format->attributeblockend); + d_status = 1; + ret = FAIL; } - return ret; + return ret; } /*------------------------------------------------------------------------- @@ -850,12 +1060,12 @@ dump_selected_attr(hid_t loc_id, const char *name) obj_name = malloc((size_t)j + 2); /* find the last / */ - while (name[j] != '/' && j >=0) - j--; + while (name[j] != '/' && j >= 0) + j--; /* object name */ if (j == -1) { - strcpy(obj_name, "/"); + strcpy(obj_name, "/"); } else { strncpy(obj_name, name, (size_t)j+1); obj_name[j+1] = '\0'; @@ -863,101 +1073,101 @@ dump_selected_attr(hid_t loc_id, const char *name) attr_name = name + j + 1; begin_obj(dump_header_format->attributebegin, name, - dump_header_format->attributeblockbegin); - H5Gget_objinfo(loc_id, obj_name, FALSE , &statbuf); + dump_header_format->attributeblockbegin); + H5Gget_objinfo(loc_id, obj_name, FALSE, &statbuf); switch (statbuf.type) { case H5G_GROUP: - if ((oid = H5Gopen(loc_id, obj_name)) < 0) { - indentation(COL); - fprintf(stdout, "h5dump error: unable to open %s\n", obj_name); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); - d_status = 1; - return FAIL; - } - break; + if ((oid = H5Gopen(loc_id, obj_name)) < 0) { + indentation(COL); + fprintf(stdout, "h5dump error: unable to open %s\n", obj_name); + end_obj(dump_header_format->attributeend, + dump_header_format->attributeblockend); + d_status = 1; + return FAIL; + } + break; case H5G_DATASET: - if ((oid = H5Dopen(loc_id, obj_name)) < 0) { - indentation(COL); - fprintf(stdout, "h5dump error: unable to open %s\n", obj_name); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); - d_status = 1; - return FAIL; - } - break; + if ((oid = H5Dopen(loc_id, obj_name)) < 0) { + indentation(COL); + fprintf(stdout, "h5dump error: unable to open %s\n", obj_name); + end_obj(dump_header_format->attributeend, + dump_header_format->attributeblockend); + d_status = 1; + return FAIL; + } + break; case H5G_TYPE: - if ((oid = H5Topen(loc_id, obj_name)) < 0 ) { - indentation(COL); - fprintf(stdout, "h5dump error: unable to open %s\n", obj_name); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); - d_status = 1; - return FAIL; - } - break; + if ((oid = H5Topen(loc_id, obj_name)) < 0) { + indentation(COL); + fprintf(stdout, "h5dump error: unable to open %s\n", obj_name); + end_obj(dump_header_format->attributeend, + dump_header_format->attributeblockend); + d_status = 1; + return FAIL; + } + break; default: - indentation(COL); - fprintf(stdout, "h5dump error: unable to open %s\n", obj_name); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); - d_status = 1; - return FAIL; + indentation(COL); + fprintf(stdout, "h5dump error: unable to open %s\n", obj_name); + end_obj(dump_header_format->attributeend, + dump_header_format->attributeblockend); + d_status = 1; + return FAIL; } - if ((attr_id = H5Aopen_name (oid, attr_name)) >= 0) { - type = H5Aget_type(attr_id); - space = H5Aget_space(attr_id); - dump_datatype(type); - dump_dataspace(space); + if ((attr_id = H5Aopen_name(oid, attr_name)) >= 0) { + type = H5Aget_type(attr_id); + space = H5Aget_space(attr_id); + dump_datatype(type); + dump_dataspace(space); - if (display_oid) - dump_oid(attr_id); + if (display_oid) + dump_oid(attr_id); - if (display_data) - dump_data(attr_id, ATTRIBUTE_DATA); + if (display_data) + dump_data(attr_id, ATTRIBUTE_DATA); - H5Tclose(type); - H5Sclose(space); - H5Aclose (attr_id); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); + H5Tclose(type); + H5Sclose(space); + H5Aclose(attr_id); + end_obj(dump_header_format->attributeend, + dump_header_format->attributeblockend); } else { - indentation(COL); - printf("h5dump error: unable to open attribute.\n"); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); - d_status = 1; + indentation(COL); + printf("h5dump error: unable to open attribute.\n"); + end_obj(dump_header_format->attributeend, + dump_header_format->attributeblockend); + d_status = 1; } switch (statbuf.type) { case H5G_GROUP: - if (H5Gclose (oid) < 0) { - d_status = 1; - return FAIL; - } - break; - + if (H5Gclose(oid) < 0) { + d_status = 1; + return FAIL; + } + break; + case H5G_DATASET: - if (H5Dclose (oid) < 0 ) { - d_status = 1; - return FAIL; - } - break; + if (H5Dclose(oid) < 0) { + d_status = 1; + return FAIL; + } + break; case H5G_TYPE: - if (H5Tclose(oid) < 0 ) { - d_status = 1; - return FAIL; - } - break; + if (H5Tclose(oid) < 0) { + d_status = 1; + return FAIL; + } + break; default: - d_status = 1; - return FAIL; + d_status = 1; + return FAIL; } free(obj_name); @@ -976,118 +1186,160 @@ dump_selected_attr(hid_t loc_id, const char *name) * Programmer: Ruey-Hsia Li * * Modifications: + * 11/00 Added XML support. Also, optionally checks the op_data + * argument. * *-----------------------------------------------------------------------*/ static herr_t -dump_all(hid_t group, const char *name, void UNUSED *op_data) +dump_all(hid_t group, const char *name, void * op_data) { - hid_t obj; - char *buf, *tmp; - H5G_stat_t statbuf; - int i; + hid_t obj; + char *buf, *tmp; + H5G_stat_t statbuf; + int i; H5Gget_objinfo(group, name, FALSE, &statbuf); - tmp = malloc(strlen(prefix) + strlen(name) + 2); + if ((*(int *)op_data != H5G_UNKNOWN) && + (statbuf.type != *(int *) op_data)) + return SUCCEED; + tmp = (char *) malloc(strlen(prefix) + strlen(name) + 2); strcpy(tmp, prefix); switch (statbuf.type) { case H5G_LINK: - indentation(indent); - buf = malloc(statbuf.linklen); - begin_obj(dump_header_format->softlinkbegin, name, - dump_header_format->softlinkblockbegin); - indentation(indent + COL); + indentation(indent); + buf = malloc(statbuf.linklen); - if (H5Gget_linkval(group, name, statbuf.linklen, buf) >= 0) { - printf("LINKTARGET \"%s\"\n", buf); - } else { - printf("h5dump error: unable to get link value.\n"); - d_status = 1; - } + if (!doxml) { + begin_obj(dump_header_format->softlinkbegin, name, + dump_header_format->softlinkblockbegin); + indentation(indent + COL); + } - indentation(indent); - end_obj(dump_header_format->softlinkend, - dump_header_format->softlinkblockend); - free(buf); - break; + if (H5Gget_linkval(group, name, statbuf.linklen, buf) >= 0) { + /* print the value of a soft link */ + if (!doxml) { + /* Standard DDL: no modification */ + printf("LINKTARGET \"%s\"\n", buf); + } else { + /* XML */ + printf + ("\n", + xml_escape_the_name((char *)name), xml_escape_the_name((char *)buf), + xml_escape_the_name((char *)buf), xml_escape_the_name((char *)name), + (strcmp(prefix, + "") ? xml_escape_the_name((char *)prefix) : "root")); + } + } else { + printf("h5dump error: unable to get link value.\n"); + d_status = 1; + } + + if (!doxml) { + indentation(indent); + end_obj(dump_header_format->softlinkend, + dump_header_format->softlinkblockend); + } + + free(buf); + break; case H5G_GROUP: - if ((obj = H5Gopen (group, name)) >= 0) { - strcat(strcat(prefix, "/"), name); - dump_group(obj, name); - strcpy(prefix, tmp); - H5Gclose (obj); - } else { - printf("h5dump error: unable to dump group %s\n", name); - d_status = 1; - } + if ((obj = H5Gopen(group, name)) >= 0) { + strcat(strcat(prefix, "/"), name); + dump_function_table->dump_group_function(obj, name); + strcpy(prefix, tmp); + H5Gclose(obj); + } else { + printf("h5dump error: unable to dump group %s\n", name); + d_status = 1; + } - break; + break; case H5G_DATASET: - if ((obj = H5Dopen(group, name)) >= 0) { - /* hard link */ - H5Gget_objinfo(obj, ".", TRUE, &statbuf); + if ((obj = H5Dopen(group, name)) >= 0) { + /* hard link */ + H5Gget_objinfo(obj, ".", TRUE, &statbuf); - if (statbuf.nlink > 1) { - i = search_obj(dset_table, statbuf.objno); + if (statbuf.nlink > 1) { + i = search_obj(dset_table, statbuf.objno); - if (i < 0) { - indentation(indent); - begin_obj(dump_header_format->datasetbegin, name, - dump_header_format->datasetblockbegin); - indentation(indent + COL); - printf("h5dump error: internal error\n"); - indentation(indent); - end_obj(dump_header_format->datasetend, - dump_header_format->datasetblockend); - d_status = 1; - goto done; - } else if (dset_table->objs[i].displayed) { - indentation(indent); - begin_obj(dump_header_format->datasetbegin, name, - dump_header_format->datasetblockbegin); - indentation(indent + COL); - printf("%s \"%s\"\n", HARDLINK, dset_table->objs[i].objname); - indentation(indent); - end_obj(dump_header_format->datasetend, - dump_header_format->datasetblockend); - goto done; - } else { - dset_table->objs[i].displayed = 1; - strcat(tmp, "/"); - strcat(tmp, name); - strcpy(dset_table->objs[i].objname, tmp); - } - } + if (i < 0) { + indentation(indent); + begin_obj(dump_header_format->datasetbegin, name, + dump_header_format->datasetblockbegin); + indentation(indent + COL); + printf("h5dump error: internal error\n"); + indentation(indent); + end_obj(dump_header_format->datasetend, + dump_header_format->datasetblockend); + d_status = 1; + H5Dclose(obj); + goto done; + } else if (dset_table->objs[i].displayed) { + indentation(indent); + if (!doxml) { + begin_obj(dump_header_format->datasetbegin, name, + dump_header_format->datasetblockbegin); + indentation(indent + COL); + printf("%s \"%s\"\n", HARDLINK, + dset_table->objs[i].objname); + indentation(indent); + end_obj(dump_header_format->datasetend, + dump_header_format->datasetblockend); + } else { + /* the XML version */ + printf + ("\n", + xml_escape_the_name((char *)name), + xml_escape_the_name((char *)tmp), + (strcmp(prefix, "") ? xml_escape_the_name((char *)prefix) + : "root")); - dump_dataset(obj, name); - H5Dclose(obj); - } else { - printf("h5dump error: unable to dump dataset %s\n", name); - d_status = 1; - } + indentation(indent + COL); + printf("\n", + xml_escape_the_name(dset_table-> + objs[i].objname)); + indentation(indent); + printf("%s\n", dump_header_format->datasetend); + } + H5Dclose(obj); + goto done; + } else { + dset_table->objs[i].displayed = 1; + strcat(tmp, "/"); + strcat(tmp, name); + strcpy(dset_table->objs[i].objname, tmp); + } + } - break; + dump_function_table->dump_dataset_function(obj, name); + H5Dclose(obj); + } else { + printf("h5dump error: unable to dump dataset %s\n", name); + d_status = 1; + } + break; case H5G_TYPE: - if ((obj = H5Topen(group, name)) >= 0) { - dump_named_datatype(obj, name); - H5Tclose(obj); - } else { - printf("h5dump error: unable to dump data type %s\n", name); - d_status = 1; - } + if ((obj = H5Topen(group, name)) >= 0) { + dump_function_table->dump_named_datatype_function(obj, name); + H5Tclose(obj); + } else { + printf("h5dump error: unable to dump data type %s\n", name); + d_status = 1; + } - break; + break; default: - printf ("h5dump error: unknown object %s\n", name); - d_status = 1; - return FAIL; + printf("h5dump error: unknown object %s\n", name); + d_status = 1; + return FAIL; } -done: + done: free(tmp); return SUCCEED; } @@ -1108,23 +1360,23 @@ static void dump_named_datatype(hid_t type, const char *name) { indentation(indent); - printf("%s \"%s\" %s",dump_header_format->datatypebegin, name, - dump_header_format->datatypeblockbegin); + printf("%s \"%s\" %s", dump_header_format->datatypebegin, name, + dump_header_format->datatypeblockbegin); if (H5Tget_class(type) == H5T_COMPOUND) { - hid_t temp_type=H5Tcopy(type); + hid_t temp_type = H5Tcopy(type); - print_datatype(temp_type); - H5Tclose(temp_type); + print_datatype(temp_type); + H5Tclose(temp_type); } else { - indentation(indent + COL); - print_datatype(type); - printf(";\n"); + indentation(indent + COL); + print_datatype(type); + printf(";\n"); } indentation(indent); end_obj(dump_header_format->datatypeend, - dump_header_format->datatypeblockend); + dump_header_format->datatypeblockend); } /*------------------------------------------------------------------------- @@ -1138,66 +1390,69 @@ dump_named_datatype(hid_t type, const char *name) * * Modifications: * + * Call to dump_all -- add parameter to select everything. + * + * *-----------------------------------------------------------------------*/ static void dump_group(hid_t gid, const char *name) { - H5G_stat_t statbuf; - hid_t dset, type; - char typename[1024], *tmp; - int i; + H5G_stat_t statbuf; + hid_t dset, type; + char typename[1024], *tmp; + int i; + int xtype = H5G_UNKNOWN; /* dump all */ tmp = malloc(strlen(prefix) + strlen(name) + 2); strcpy(tmp, prefix); indentation(indent); begin_obj(dump_header_format->groupbegin, name, - dump_header_format->groupblockbegin); + dump_header_format->groupblockbegin); indent += COL; if (display_oid) - dump_oid(gid); + dump_oid(gid); if (!strcmp(name, "/") && unamedtype) - /* dump unamed type in root group */ - for (i = 0; i < type_table->nobjs; i++) - if (!type_table->objs[i].recorded) { - dset = H5Dopen(gid, type_table->objs[i].objname); - type = H5Dget_type(dset); - sprintf(typename,"#%lu:%lu", - type_table->objs[i].objno[0], - type_table->objs[i].objno[1]); - dump_named_datatype(type, typename); - H5Tclose(type); - H5Dclose(dset); - } + /* dump unamed type in root group */ + for (i = 0; i < type_table->nobjs; i++) + if (!type_table->objs[i].recorded) { + dset = H5Dopen(gid, type_table->objs[i].objname); + type = H5Dget_type(dset); + sprintf(typename, "#%lu:%lu", + type_table->objs[i].objno[0], + type_table->objs[i].objno[1]); + dump_named_datatype(type, typename); + H5Tclose(type); + H5Dclose(dset); + } H5Gget_objinfo(gid, ".", TRUE, &statbuf); if (statbuf.nlink > 1) { i = search_obj(group_table, statbuf.objno); - if (i < 0) { - indentation(indent); - printf("h5dump error: internal error\n"); - d_status = 1; - } else if (group_table->objs[i].displayed) { - indentation(indent); - printf("%s \"%s\"\n", HARDLINK, group_table->objs[i].objname); - } else { - strcpy(group_table->objs[i].objname, prefix); - group_table->objs[i].displayed = 1; - H5Aiterate(gid, NULL, dump_attr, NULL); - H5Giterate(gid, ".", NULL, dump_all, NULL); - } + if (i < 0) { + indentation(indent); + printf("h5dump error: internal error\n"); + d_status = 1; + } else if (group_table->objs[i].displayed) { + indentation(indent); + printf("%s \"%s\"\n", HARDLINK, group_table->objs[i].objname); + } else { + strcpy(group_table->objs[i].objname, prefix); + group_table->objs[i].displayed = 1; + H5Aiterate(gid, NULL, dump_attr, NULL); + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + } } else { - H5Aiterate(gid, NULL, dump_attr, NULL); - H5Giterate(gid, ".", NULL, dump_all, NULL); + H5Aiterate(gid, NULL, dump_attr, NULL); + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); } indent -= COL; indentation(indent); - end_obj(dump_header_format->groupend, - dump_header_format->groupblockend); + end_obj(dump_header_format->groupend, dump_header_format->groupblockend); free(tmp); } @@ -1216,42 +1471,42 @@ dump_group(hid_t gid, const char *name) static void dump_dataset(hid_t did, const char *name) { - hid_t type, space; + hid_t type, space; - indentation (indent); + indentation(indent); begin_obj(dump_header_format->datasetbegin, name, - dump_header_format->datasetblockbegin); + dump_header_format->datasetblockbegin); type = H5Dget_type(did); space = H5Dget_space(did); dump_datatype(type); dump_dataspace(space); if (display_oid) - dump_oid(did); + dump_oid(did); if (display_data) - switch (H5Tget_class(type)) { - case H5T_TIME: - indentation(indent + COL); - printf("DATA{ not yet implemented.}\n"); - break; + switch (H5Tget_class(type)) { + case H5T_TIME: + indentation(indent + COL); + printf("DATA{ not yet implemented.}\n"); + break; - case H5T_INTEGER: - case H5T_FLOAT: - case H5T_STRING: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_COMPOUND: - case H5T_REFERENCE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_ARRAY: - dump_data(did,DATASET_DATA); - break; + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + dump_data(did, DATASET_DATA); + break; - default: - break; - } + default: + break; + } indent += COL; H5Aiterate(did, NULL, dump_attr, NULL); @@ -1260,7 +1515,7 @@ dump_dataset(hid_t did, const char *name) H5Sclose(space); indentation(indent); end_obj(dump_header_format->datasetend, - dump_header_format->datasetblockend); + dump_header_format->datasetblockend); } #if H5DUMP_DEBUG @@ -1276,39 +1531,36 @@ dump_dataset(hid_t did, const char *name) * Modifications: * *-----------------------------------------------------------------------*/ -static void +static void dump_tables(void) { - int i; + int i; printf("group_table: # of entries = %d\n", group_table->nobjs); - for ( i = 0; i < group_table->nobjs; i++) - printf("%ul %ul %s %d %d\n", group_table->objs[i].objno[0], - group_table->objs[i].objno[1], - group_table->objs[i].objname, - group_table->objs[i].displayed, - group_table->objs[i].recorded); + for (i = 0; i < group_table->nobjs; i++) + printf("%lu %lu %s %d %d\n", group_table->objs[i].objno[0], + group_table->objs[i].objno[1], + group_table->objs[i].objname, + group_table->objs[i].displayed, group_table->objs[i].recorded); printf("\ndset_table: # of entries = %d\n", dset_table->nobjs); - for ( i = 0; i < dset_table->nobjs; i++) - printf("%ul %ul %s %d %d\n", dset_table->objs[i].objno[0], - dset_table->objs[i].objno[1], - dset_table->objs[i].objname, - dset_table->objs[i].displayed, - dset_table->objs[i].recorded); - + for (i = 0; i < dset_table->nobjs; i++) + printf("%lu %lu %s %d %d\n", dset_table->objs[i].objno[0], + dset_table->objs[i].objno[1], + dset_table->objs[i].objname, + dset_table->objs[i].displayed, dset_table->objs[i].recorded); + printf("\ntype_table: # of entries = %d\n", type_table->nobjs); - for ( i = 0; i < type_table->nobjs; i++) - printf("%ul %ul %s %d %d\n", type_table->objs[i].objno[0], - type_table->objs[i].objno[1], - type_table->objs[i].objname, - type_table->objs[i].displayed, - type_table->objs[i].recorded); + for (i = 0; i < type_table->nobjs; i++) + printf("%lu %lu %s %d %d\n", type_table->objs[i].objno[0], + type_table->objs[i].objno[1], + type_table->objs[i].objname, + type_table->objs[i].displayed, type_table->objs[i].recorded); } -#endif /* H5DUMP_DEBUG */ +#endif /* H5DUMP_DEBUG */ /*------------------------------------------------------------------------- * Function: dump_data @@ -1326,14 +1578,14 @@ dump_tables(void) static void dump_data(hid_t obj_id, int obj_data) { - h5dump_t *outputformat = &dataformat; - int d_status = -1; - void *buf; - hid_t space, type, p_type; - int ndims, i; - hsize_t size[64], nelmts = 1, alloc_size; - int depth; - int stdindent = COL; /* should be 3*/ + h5dump_t *outputformat = &dataformat; + int d_status = -1; + void *buf; + hid_t space, type, p_type; + int ndims, i; + hsize_t size[64], nelmts = 1, alloc_size; + int depth; + int stdindent = COL; /* should be 3 */ outputformat->line_ncols = nCols; indent += COL; @@ -1346,12 +1598,12 @@ dump_data(hid_t obj_id, int obj_data) */ depth = indent / stdindent + 1; indentation(indent); - begin_obj(dump_header_format->databegin, (const char *)NULL, - dump_header_format->datablockbegin); + begin_obj(dump_header_format->databegin, (const char *) NULL, + dump_header_format->datablockbegin); /* Print all the values. */ if (obj_data == DATASET_DATA) { - d_status = h5dump_dset(stdout, outputformat, obj_id, -1,depth); + d_status = h5dump_dset(stdout, outputformat, obj_id, -1, depth); } else { /* need to call h5dump_mem for the attribute data */ type = H5Aget_type(obj_id); @@ -1375,16 +1627,14 @@ dump_data(hid_t obj_id, int obj_data) H5Sclose(space); H5Tclose(type); } - if (d_status < 0) { - indentation(indent+COL); - printf("Unable to print data.\n"); - d_status = 1; + indentation(indent + COL); + printf("Unable to print data.\n"); + d_status = 1; } indentation(indent); - end_obj(dump_header_format->dataend, - dump_header_format->datablockend); + end_obj(dump_header_format->dataend, dump_header_format->datablockend); indent -= COL; } @@ -1406,12 +1656,12 @@ dump_data(hid_t obj_id, int obj_data) static int set_output_file(const char *fname) { - FILE *f; /* temporary holding place for the stream pointer */ - /* so that rawdatastream is changed only when succeeded */ + FILE *f; /* temporary holding place for the stream pointer */ + /* so that rawdatastream is changed only when succeeded */ - if ((f = fopen(fname, "w"))!=NULL) { - rawdatastream = f; - return 0; + if ((f = fopen(fname, "w")) != NULL) { + rawdatastream = f; + return 0; } return -1; @@ -1671,6 +1921,7 @@ handle_datatypes(hid_t fid, const char *type) * Modifications: * Albert Cheng, 2000/09/30 * Add the -o option--output file for datasets raw data + * Changes to support XML Nov. 2000, REMcG * * Bill Wendling * Wednesday, 10. January 2001 @@ -1693,6 +1944,7 @@ main(int argc, const char *argv[]) find_objs_t info; int opt; struct handler_t *hand; + int usingdasho = 0;; if (argc < 2) { usage(progname); @@ -1700,6 +1952,7 @@ main(int argc, const char *argv[]) } dump_header_format = &standardformat; + dump_function_table = &ddl_function_table; /* Disable error reporting */ H5Eget_auto(&func, &edata); @@ -1791,8 +2044,8 @@ main(int argc, const char *argv[]) usage(progname); exit(EXIT_FAILURE); } + usingdasho = 1; break; -#if 0 case 'x': /* select XML output */ doxml = TRUE; @@ -1803,7 +2056,6 @@ main(int argc, const char *argv[]) /* specify alternative XML DTD */ xml_dtd_uri = strdup(opt_arg); break; -#endif /* for future XML stuff */ case 'h': usage(progname); exit(EXIT_SUCCESS); @@ -1814,10 +2066,40 @@ main(int argc, const char *argv[]) } } + /* check for conflicting options */ + if (doxml) { + if (!display_all) { + fprintf(stderr, "h5dump error: option %s not available for XML\n", + "to display selected objects"); + exit(1); + } else if (display_bb) { + fprintf(stderr, "h5dump error: option %s not available for XML\n", + "-bb"); + exit(1); + } else if (!display_data) { + fprintf(stderr, "h5dump error: option %s not available for XML\n", + "-header"); + exit(1); + } else if (display_oid == 1) { + fprintf(stderr, "h5dump error: option %s not available for XML\n", + "-v"); + exit(1); + } else if (usingdasho) { + fprintf(stderr, "h5dump error: option %s not available for XML\n", + "-o"); + exit(1); + } + } else { + if (xml_dtd_uri != NULL) { + fprintf(stderr, + "h5dump warning: option %s only applies with XML: %s\n", + "-dtd ", xml_dtd_uri); + } + } if (argv[argc - 1][0] == '\\') - fname = &argv[argc - 1][1]; + fname = &argv[argc - 1][1]; else - fname = argv[argc - 1]; + fname = argv[argc - 1]; fid = h5dump_fopen(fname, NULL, 0); @@ -1841,6 +2123,27 @@ main(int argc, const char *argv[]) info.dset_table = dset_table; info.status = d_status; + if (doxml) { + /* initialize XML */ + thefile = fid; + + /* find all objects that might be targets of a refernce */ + if ((gid = H5Gopen(fid, "/")) >= 0) { + ref_path_table_put(gid, (char *)"/"); + H5Giterate(fid, "/", NULL, fill_ref_path_table, NULL); + } + H5Gclose(gid); + /* reset prefix! */ +/* not needed yet + info.prefix = calloc((size_t)info.prefix_len, 1); +*/ + strcpy(prefix,""); + + /* make sure the URI is initialized to something */ + if (xml_dtd_uri == NULL) + xml_dtd_uri = strdup(DEFAULT_DTD); + } + /* find all shared objects */ H5Giterate(fid, "/", NULL, find_objs, (void *)&info); @@ -1859,21 +2162,28 @@ main(int argc, const char *argv[]) } /* start to dump */ - begin_obj(dump_header_format->filebegin, fname, - dump_header_format->fileblockbegin); - - if (display_bb) - dump_bb(); - + if (!doxml) { + begin_obj(dump_header_format->filebegin, fname, + dump_header_format->fileblockbegin); + } else { + printf("\n"); + printf("\n", + xml_dtd_uri); + printf("\n"); + } + + if (!doxml && display_bb) + dump_bb(); + if (newwidth) - sscanf(argv[newwidth + 1], "%d", &nCols); + sscanf(argv[newwidth + 1], "%d", &nCols); if (display_all) { if ((gid = H5Gopen (fid, "/")) < 0 ) { fprintf(stdout, "h5dump error: unable to open root group\n"); d_status = 1; } else { - dump_group(gid, "/"); + dump_function_table->dump_group_function(gid, "/"); } if (H5Gclose (gid) < 0) { @@ -1881,16 +2191,27 @@ main(int argc, const char *argv[]) d_status = 1; } } else { + if (doxml) { + /* Note: this option is not supported for XML */ + printf("internal error! \n"); + goto done; + } for (i = 0; i < argc; i++) if (hand[i].func) hand[i].func(fid, hand[i].obj); } - end_obj(dump_header_format->fileend, dump_header_format->fileblockend); + if (!doxml) { + end_obj(dump_header_format->fileend, + dump_header_format->fileblockend); + } else { + printf("%s\n", dump_header_format->fileend); + } -done: + done: if (H5Fclose(fid) < 0) - d_status = 1; + d_status = 1; + free(hand); @@ -1899,6 +2220,7 @@ done: free(type_table->objs); free(prefix); free(info.prefix); + /* To Do: clean up XML table */ h5tools_close(); H5Eset_auto(func, edata); @@ -1922,17 +2244,17 @@ done: static void print_enum(hid_t type) { - char **name = NULL; /*member names */ - unsigned char *value = NULL; /*value array */ - int nmembs; /*number of members */ - int nchars; /*number of output characters */ - hid_t super; /*enum base integer type */ - hid_t native = -1; /*native integer data type */ - size_t dst_size; /*destination value type size */ - int i; /*miscellaneous counters */ - size_t j; - - nmembs = H5Tget_nmembers(type); + char **name = NULL; /*member names */ + unsigned char *value = NULL; /*value array */ + int nmembs; /*number of members */ + int nchars; /*number of output characters */ + hid_t super; /*enum base integer type */ + hid_t native = -1; /*native integer data type */ + size_t dst_size; /*destination value type size */ + int i; /*miscellaneous counters */ + size_t j; + + nmembs = H5Tget_nmembers(type); super = H5Tget_super(type); /* @@ -1942,16 +2264,16 @@ print_enum(hid_t type) * 2. unsigned long_long -- the largest native unsigned integer * 3. raw format */ - if (H5Tget_size(type)<=sizeof(long_long)) { - dst_size = sizeof(long_long); + if (H5Tget_size(type) <= sizeof(long_long)) { + dst_size = sizeof(long_long); - if (H5T_SGN_NONE==H5Tget_sign(type)) { - native = H5T_NATIVE_ULLONG; - } else { - native = H5T_NATIVE_LLONG; - } + if (H5T_SGN_NONE == H5Tget_sign(type)) { + native = H5T_NATIVE_ULLONG; + } else { + native = H5T_NATIVE_LLONG; + } } else { - dst_size = H5Tget_size(type); + dst_size = H5Tget_size(type); } /* Get the names and raw values of all members */ @@ -1960,8 +2282,8 @@ print_enum(hid_t type) value = calloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size)); for (i = 0; i < nmembs; i++) { - name[i] = H5Tget_member_name(type, i); - H5Tget_member_value(type, i, value + i * H5Tget_size(type)); + name[i] = H5Tget_member_name(type, i); + H5Tget_member_value(type, i, value + i * H5Tget_size(type)); } /* Convert values to native data type */ @@ -1969,40 +2291,40 @@ print_enum(hid_t type) H5Tconvert(super, native, (hsize_t)nmembs, value, NULL, H5P_DEFAULT); /* Sort members by increasing value */ - /*not implemented yet*/ + /*not implemented yet */ /* Print members */ for (i = 0; i < nmembs; i++) { - indentation(indent + COL); - nchars = printf("\"%s\"", name[i]);/*display_string(stdout, name[i], TRUE);*/ - printf("%*s ", MAX(0, 16 - nchars), ""); + indentation(indent + COL); + nchars = printf("\"%s\"", name[i]); /*display_string(stdout, name[i], TRUE); */ + printf("%*s ", MAX(0, 16 - nchars), ""); - if (native < 0) { - printf("0x"); + if (native < 0) { + printf("0x"); - for (j = 0; j < dst_size; j++) - printf("%02x", value[i * dst_size + j]); - } else if (H5T_SGN_NONE == H5Tget_sign(native)) { - printf("%" PRINTF_LL_WIDTH "u", - *((unsigned long_long *)((void *)(value + i * dst_size)))); - } else { - printf("%" PRINTF_LL_WIDTH "d", - *((long_long *)((void *)(value + i * dst_size)))); - } + for (j = 0; j < dst_size; j++) + printf("%02x", value[i * dst_size + j]); + } else if (H5T_SGN_NONE == H5Tget_sign(native)) { + printf("%" PRINTF_LL_WIDTH "u", *((unsigned long_long *) + ((void *) (value + i * dst_size)))); + } else { + printf("%" PRINTF_LL_WIDTH "d", + *((long_long *) ((void *) (value + i * dst_size)))); + } - printf(";\n"); + printf(";\n"); } /* Release resources */ for (i = 0; i < nmembs; i++) - free(name[i]); + free(name[i]); free(name); free(value); H5Tclose(super); if (0 == nmembs) - printf("\n%*s ", indent+4, ""); + printf("\n%*s ", indent + 4, ""); } /*------------------------------------------------------------------------- @@ -2017,9 +2339,1890 @@ print_enum(hid_t type) * Modifications: * *-----------------------------------------------------------------------*/ -static void +static void dump_oid(hid_t oid) { indentation(indent + COL); - printf("%s %s %d %s\n", OBJID, BEGIN, oid, END); + printf("%s %s ", OBJID, BEGIN); + printf("%d", oid); + printf(" %s\n", END); +} + +/* + * XML support + */ + +/* + * XML needs a table to look up a path name for an object + * reference. + * + * This table stores mappings of reference -> path + * for all objects in the file that may be the target of + * an object reference. + * + * The 'path' is an absolute path by which the object + * can be accessed. When an object has > 1 such path, + * only one will be used in the table, with no particular + * method of selecting which one. + */ + +struct ref_path_table_entry_t +{ + hsize_t obj; + hobj_ref_t *obj_ref; + char *apath; + struct ref_path_table_entry_t *next; +}; + +struct ref_path_table_entry_t *ref_path_table = NULL; /* the table */ +int npte = 0; /* number of entries in the table */ + +/*------------------------------------------------------------------------- + * Function: ref_path_table_lookup + * + * Purpose: Looks up a table entry given a path name. + * Used during construction of the table. + * + * Return: The table entre (pte) or NULL if not in the + * table. + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +struct ref_path_table_entry_t * +ref_path_table_lookup(char *thepath) +{ + int i; + hobj_ref_t *ref; + herr_t status; + struct ref_path_table_entry_t *pte = ref_path_table; + if (ref_path_table == NULL) + return NULL; + ref = (hobj_ref_t *) malloc(sizeof(hobj_ref_t)); + if (ref == NULL) { + /* fatal error ? */ + return NULL; + } + status = H5Rcreate(ref, thefile, thepath, H5R_OBJECT, -1); + if (status < 0) { + /* fatal error ? */ + return NULL; + } + for (i = 0; i < npte; i++) { + if (memcmp(ref, pte->obj_ref, sizeof(hobj_ref_t)) == 0) { + return pte; + } + pte = pte->next; + } + return NULL; +} + +/*------------------------------------------------------------------------- + * Function: ref_path_table_put + * + * Purpose: Enter the 'obj' with 'path' in the table if + * not already there. + * Create an object reference, pte, and store them + * in the table. + * + * Return: The object reference for the object. + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ + +hobj_ref_t * +ref_path_table_put(hid_t obj, char *path) +{ + hobj_ref_t *ref; + herr_t status; + struct ref_path_table_entry_t *pte; + + /* look up 'obj'. If already in table, return */ + pte = ref_path_table_lookup(path); + if (pte != NULL) + return pte->obj_ref; + + /* if not found, then make new entry */ + + pte = (struct ref_path_table_entry_t *) + malloc(sizeof(struct ref_path_table_entry_t)); + if (pte == NULL) { + /* fatal error? */ + return NULL; + } + + pte->obj = obj; + ref = (hobj_ref_t *) malloc(sizeof(hobj_ref_t)); + if (ref == NULL) { + /* fatal error? */ + free(pte); + return NULL; + } + + status = H5Rcreate(ref, thefile, path, H5R_OBJECT, -1); + if (status < 0) { + /* fatal error? */ + free(ref); + free(pte); + return NULL; + } + + pte->obj_ref = ref; + + pte->apath = strdup(path); + + pte->next = ref_path_table; + ref_path_table = pte; + + npte++; + + return ref; +} + +/*------------------------------------------------------------------------- + * Function: lookup_ref_path + * + * Purpose: Lookup the path to the object with refernce 'ref'. + * + * Return: Return a path to the object, or NULL if not found. + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +char * +lookup_ref_path(hobj_ref_t * ref) +{ + int i; + struct ref_path_table_entry_t *pte = NULL; + + if (ref_path_table == NULL) + return NULL; + + pte = ref_path_table; + if (pte == NULL) { + /* fatal -- not initialized? */ + return NULL; + } + for (i = 0; i < npte; i++) { + if (memcmp(ref, pte->obj_ref, sizeof(hobj_ref_t)) == 0) { + return pte->apath; + } + pte = pte->next; + } + return NULL; +} + +/*------------------------------------------------------------------------- + * Function: fill_ref_path_table + * + * Purpose: Called by interator to create references for + * all objects and enter them in the table. + * + * Return: Error status. + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ + +static herr_t +fill_ref_path_table(hid_t group, const char *name, void UNUSED * op_data) +{ + hid_t obj; + char *tmp; + H5G_stat_t statbuf; + struct ref_path_table_entry_t *pte; + char *thepath; + + H5Gget_objinfo(group, name, FALSE, &statbuf); + tmp = (char *) malloc(strlen(prefix) + strlen(name) + 2); + if (tmp == NULL) + return FAIL; + thepath = (char *) malloc(strlen(prefix) + strlen(name) + 2); + if (thepath == NULL) { + free(tmp); + return FAIL; + } + strcpy(tmp, prefix); + + strcpy(thepath, prefix); + strcat(thepath, "/"); + strcat(thepath, name); + + switch (statbuf.type) { + case H5G_DATASET: + if ((obj = H5Dopen(group, name)) >= 0) { + pte = ref_path_table_lookup(thepath); + if (pte == NULL) { + ref_path_table_put(obj, thepath); + } + H5Dclose(obj); + } else { + fprintf(stderr, "h5dump error: unable to get dataset %s\n", name); + d_status = 1; + } + break; + case H5G_GROUP: + if ((obj = H5Gopen(group, name)) >= 0) { + strcat(strcat(prefix, "/"), name); + pte = ref_path_table_lookup(thepath); + if (pte == NULL) { + ref_path_table_put(obj, thepath); + H5Giterate(obj, ".", NULL, fill_ref_path_table, NULL); + strcpy(prefix, tmp); + } + H5Gclose(obj); + } else { + fprintf(stderr, "h5dump error: unable to dump group %s\n", name); + d_status = 1; + } + break; + case H5G_TYPE: + if ((obj = H5Topen(group, name)) >= 0) { + pte = ref_path_table_lookup(thepath); + if (pte == NULL) { + ref_path_table_put(obj, thepath); + } + H5Tclose(obj); + } else { + fprintf(stderr, "h5dump error: unable to get dataset %s\n", name); + d_status = 1; + } + break; + default:; + } + free(tmp); + free(thepath); + return 0; +} + +static const char *quote = """; +static const char *amp = "&"; +static const char *lt = "<"; +static const char *gt = ">"; +static const char *apos = "'"; + +/*------------------------------------------------------------------------- + * Function: xml_escape_the_name + * + * Purpose: Escape XML reserved chars in a name, so HDF5 strings + * and paths can be correctly read back in XML element. + * + * Return: The revised string. + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ + +char * +xml_escape_the_name(char *str) +{ + int extra; + int len; + int i; + char *cp; + char *ncp; + char *rcp; + + if (str == NULL) + return (char *) str; + cp = (char *) str; + len = strlen(str); + extra = 0; + for (i = 0; i < len; i++) { + if (*cp == '\"') { + extra += (strlen(quote) - 1); + } else if (*cp == '\'') { + extra += (strlen(apos) - 1); + } else if (*cp == '<') { + extra += (strlen(lt) - 1); + } else if (*cp == '>') { + extra += (strlen(gt) - 1); + } else if (*cp == '&') { + extra += (strlen(amp) - 1); + } + cp++; + } + + if (extra == 0) { + return (char *) str; + } else { + cp = (char *) str; + rcp = ncp = calloc((size_t)(len + extra + 1), sizeof(char)); + if (ncp == NULL) + return NULL; /* ?? */ + for (i = 0; i < len; i++) { + if (*cp == '\'') { + strncpy(ncp, apos, strlen(apos)); + ncp += strlen(apos); + cp++; + } else if (*cp == '<') { + strncpy(ncp, lt, strlen(lt)); + ncp += strlen(lt); + cp++; + } else if (*cp == '>') { + strncpy(ncp, gt, strlen(gt)); + ncp += strlen(gt); + cp++; + } else if (*cp == '\"') { + strncpy(ncp, quote, strlen(quote)); + ncp += strlen(quote); + cp++; + } else if (*cp == '&') { + strncpy(ncp, amp, strlen(amp)); + ncp += strlen(amp); + cp++; + } else { + *ncp++ = *cp++; + } + } + *ncp = '\0'; + return rcp; + } +} + +/*------------------------------------------------------------------------- + * Function: xml_escape_the_string + * + * Purpose: Escape XML reserved chars in a string, so HDF5 strings + * and paths can be correctly read back in XML CDATA. + * + * Return: The revised string. + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ + +char * +xml_escape_the_string(char *str, int slen) +{ + int extra; + int len; + int i; + char *cp; + char *ncp; + char *rcp; + + if (str == NULL) + return (char *) str; + cp = (char *) str; + if (slen < 0) { + len = strlen(str); + } else { + len = slen; + } + extra = 0; + for (i = 0; i < len; i++) { + if (*cp == '\\') { + extra++; + } else if (*cp == '\"') { + extra++; + } else if (*cp == '\'') { + extra += (strlen(apos) - 1); + } else if (*cp == '<') { + extra += (strlen(lt) - 1); + } else if (*cp == '>') { + extra += (strlen(gt) - 1); + } else if (*cp == '&') { + extra += (strlen(amp) - 1); + } + cp++; + } + + cp = (char *) str; + rcp = ncp = calloc((size_t)(len + extra + 1), sizeof(char)); + if (ncp == NULL) + return NULL; /* ?? */ + for (i = 0; i < len; i++) { + if (*cp == '\\') { + *ncp++ = '\\'; + *ncp++ = *cp++; + } else if (*cp == '\"') { + *ncp++ = '\\'; + *ncp++ = *cp++; + } else if (*cp == '\'') { + strncpy(ncp, apos, strlen(apos)); + ncp += strlen(apos); + cp++; + } else if (*cp == '<') { + strncpy(ncp, lt, strlen(lt)); + ncp += strlen(lt); + cp++; + } else if (*cp == '>') { + strncpy(ncp, gt, strlen(gt)); + ncp += strlen(gt); + cp++; + } else if (*cp == '&') { + strncpy(ncp, amp, strlen(amp)); + ncp += strlen(amp); + cp++; + } else { + *ncp++ = *cp++; + } + } + *ncp = '\0'; + return rcp; +} + +/** + ** XML print functions--these replace some functions in the + ** h5tools.c suite. + **/ + +/*------------------------------------------------------------------------- + * Function: xml_print_datatype + * + * Purpose: Print description of a datatype in XML. + * Note: this is called inside a element. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static void +xml_print_datatype(hid_t type) +{ + char *fname; + hid_t nmembers, mtype; + int i, j, ndims, perm[H5DUMP_MAX_RANK]; + size_t size; + hsize_t dims[H5DUMP_MAX_RANK]; + H5T_str_t str_pad; + H5T_cset_t cset; + H5G_stat_t statbuf; + hid_t super; + H5T_order_t ord; + H5T_sign_t sgn; + size_t sz; + size_t spos; + size_t epos; + size_t esize; + size_t mpos; + size_t msize; + int nmembs; + + switch (H5Tget_class(type)) { + case H5T_INTEGER: + indentation(indent); + printf("\n"); + indent += COL; + /* */ + ord = H5Tget_order(type); + sgn = H5Tget_sign(type); + indentation(indent); + printf("\n"); + indent -= COL; + indentation(indent); + printf("\n"); + break; + + case H5T_FLOAT: + /* */ + ord = H5Tget_order(type); + indentation(indent); + printf("\n"); + indent += COL; + indentation(indent); + printf("\n", + msize, mpos); + indent -= COL; + indentation(indent); + printf("\n"); + break; + + case H5T_TIME: + indentation(indent); + printf("\n"); + indent += COL; + indentation(indent); + printf("\n"); + printf(""); + indent -= COL; + indentation(indent); + printf("\n"); + break; + + case H5T_STRING: + /* */ + size = H5Tget_size(type); + str_pad = H5Tget_strpad(type); + cset = H5Tget_cset(type); + + indentation(indent); + printf("\n"); + indent += COL; + indentation(indent); + printf("\n"); + } else if (str_pad == H5T_STR_NULLPAD) { + printf("H5T_STR_NULLPAD\"/>\n"); + } else if (str_pad == H5T_STR_SPACEPAD) { + printf("H5T_STR_SPACEPAD\"/>\n"); + } else { + printf("H5T_STR_ERROR\"/>\n"); + } + indent -= COL; + indentation(indent); + printf("\n"); + break; + + case H5T_BITFIELD: + /* */ + ord = H5Tget_order(type); + indentation(indent); + printf("\n"); + indent += COL; + indentation(indent); + printf("\n", size); + indent -= COL; + indentation(indent); + printf("\n"); + break; + + case H5T_OPAQUE: + /* */ + + indentation(indent); + printf("\n"); + indent += COL; + indentation(indent); + printf("\n", size); + indent -= COL; + indentation(indent); + printf("\n"); + break; + + case H5T_COMPOUND: + /* recursively describe the components of a compound datatype */ + if (H5Tcommitted(type) > 0) { + /* detect a shared datatype, output only once */ + H5Gget_objinfo(type, ".", TRUE, &statbuf); + i = search_obj(type_table, statbuf.objno); + + if (i >= 0) { + /* This should be defined somewhere else */ + if (!type_table->objs[i].recorded) { + /* 'anonymous' NDT. Use it's object num. + as it's name. */ + printf("objs[i].objno[0], + type_table->objs[i].objno[1]); + printf("\"/>\n"); + } else { + /* point to the NDT by name */ + printf("objs[i].objname)); + printf("\"/>\n"); + } + } else { + printf("\n"); + d_status = 1; + } + + } else { + /* type of a dataset */ + nmembers = H5Tget_nmembers(type); + + indentation(indent); + printf("\n"); + + /* List each member Field of the type */ + /* */ + /* */ + indent += COL; + for (i = 0; i < nmembers; i++) { + fname = H5Tget_member_name(type, i); + mtype = H5Tget_member_type(type, i); + indentation(indent); + printf("\n", + xml_escape_the_name(fname)); + + free(fname); + indent += COL; + indentation(indent); + printf("\n"); + indent += COL; + xml_print_datatype(mtype); + indent -= COL; + indentation(indent); + printf("%s\n", dump_header_format->datatypeend); + indent -= COL; + + indentation(indent); + printf("\n"); + } + indent -= COL; + indentation(indent); + printf("\n"); + } + break; + + case H5T_REFERENCE: + indentation(indent); + printf("\n"); + indent += COL; + indentation(indent); + /* Only Object references supported at this time */ + printf("\n"); + indentation(indent + COL); + printf("\n"); + indentation(indent); + printf("\n"); + indent -= COL; + indentation(indent); + printf("\n"); + break; + + case H5T_ENUM: + /* + list Name, values of enum + */ + nmembs = H5Tget_nmembers(type); + indentation(indent); + printf("\n"); + indent += COL; + indentation(indent); + printf("\n", nmembs); + xml_print_enum(type); + indentation(indent); + printf("\n"); + indent -= COL; + indentation(indent); + printf("\n"); + break; + + case H5T_VLEN: + indentation(indent); + printf("\n"); + super = H5Tget_super(type); + indent += COL; + indentation(indent); + printf("\n"); + indent += COL; + xml_print_datatype(super); + indent -= COL; + indentation(indent); + printf("%s\n", dump_header_format->datatypeend); + indent -= COL; + indentation(indent); + printf("\n"); + H5Tclose(super); + + break; + + case H5T_ARRAY: + /* Get array base type */ + super = H5Tget_super(type); + + /* Print lead-in */ + indentation(indent); + printf("\n", ndims); + + /* Get array information */ + H5Tget_array_dims(type, dims, perm); + + /* list of dimensions */ + indent += COL; + if (perm != NULL) { + /* for each dimension, list */ + for (j = 0; j < ndims; j++) { + indentation(indent); + printf("\n", + (int) dims[j], (int) perm[j]); + } + } else { + for (j = 0; j < ndims; j++) { + indentation(indent); + printf("\n", + (int) dims[j]); + } + } + indent -= COL; + + indent += COL; + indentation(indent); + printf("\n"); + indent += COL; + xml_print_datatype(super); + indent -= COL; + indentation(indent); + printf("%s\n", dump_header_format->datatypeend); + indent -= COL; + indentation(indent); + printf("\n"); + /* Close array base type */ + H5Tclose(super); + break; + + default: + printf(""); + d_status = 1; + break; + } +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_datatype + * + * Purpose: Dump description of a datatype in XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static void +xml_dump_datatype(hid_t type) +{ + int i; + H5G_stat_t statbuf; + + indent += COL; + indentation(indent); + + if (H5Tcommitted(type) > 0) { + /* Data type is a shared or named data type */ + H5Gget_objinfo(type, ".", TRUE, &statbuf); + i = search_obj(type_table, statbuf.objno); + + if (i >= 0) { + /* Shared data type, must be entered as an object */ + if (!type_table->objs[i].recorded) { + /* anonymous stored data type: + following the dumper's current + practice: + use it's object ref as its name + */ + printf("objs[i].objno[0], + type_table->objs[i].objno[1]); + printf("\"/>\n"); + } else { + /* pointer to a named data type already in XML */ + printf("objs[i].objname)); + printf("\"/>\n"); + } + } else { + printf("\n"); + } + indent -= COL; + return; + } + printf("%s %s\n", dump_header_format->datatypebegin, + dump_header_format->datatypeblockbegin); + indent += COL; + xml_print_datatype(type); + indent -= COL; + indentation(indent); + printf("%s\n", dump_header_format->datatypeend); + indent -= COL; +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_dataspace + * + * Purpose: Dump description of a dataspace in XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static void +xml_dump_dataspace(hid_t space) +{ + hsize_t size[H5DUMP_MAX_RANK]; + hsize_t maxsize[H5DUMP_MAX_RANK]; + int ndims = + H5Sget_simple_extent_dims(space, size, maxsize); + int i; + + indentation(indent + COL); + printf("%s\n", dump_header_format->dataspacebegin); + if (H5Sis_simple(space)) { + indentation(indent + COL + COL); + + if (ndims == 0) { + /* scalar dataspace (just a tag, no XML attrs. defined */ + printf("\n"); + } else { + /* simple dataspace */ + /* */ + printf("\n", ndims); + + /* print the elements */ + for (i = 0; i < ndims; i++) { + indentation(indent + COL + COL + COL); + if (maxsize[i] == H5S_UNLIMITED) { + HDfprintf(stdout, + "\n", + size[i]); + } else if (maxsize[i] == (hsize_t) 0) { + HDfprintf(stdout, + "\n", + size[i], size[i]); + } else { + HDfprintf(stdout, + "\n", + size[i], maxsize[i]); + } + } + indentation(indent + COL + COL); + printf("\n"); + } + } else { + printf("\n"); + } + + indentation(indent + COL); + printf("%s\n", dump_header_format->dataspaceend); + +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_data + * + * Purpose: Dump description of data in XML. + * Note that this calls the h5dump_xxx calls in + * the h5tools library. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static void +xml_dump_data(hid_t obj_id, int obj_data) +{ + h5dump_t *outputformat = &xml_dataformat; + int status = -1; + void *buf; + hid_t space, type, p_type; + int ndims, i; + hsize_t size[64], nelmts = 1; + int depth; + int stdindent = COL; /* should be 3 */ + + outputformat->line_ncols = nCols; + + indent += COL; + + /* + * the depth will tell us how far we need to indent extra. we use to just + * use indent but with the merging of the tools lib we have to do + * something different for the lib funtions... the normal indentation is 6 + * so when we don't need any extra indentation, depth will be 0. + */ + depth = indent / stdindent + 1; + + /* Print all the values. */ + indentation(indent); + printf("%s\n", dump_header_format->databegin); + indentation(indent + COL); + printf("\n"); + if (obj_data == DATASET_DATA) { + type = H5Dget_type(obj_id); + if (H5Tget_class(type) == H5T_REFERENCE) { + status = xml_print_refs(obj_id, DATASET_DATA); + } else if (H5Tget_class(type) == H5T_STRING) { + status = xml_print_strs(obj_id, DATASET_DATA); + } else { + status = h5dump_dset(stdout, outputformat, obj_id, -1, depth); + } + } else { + /* Attribute data */ + type = H5Aget_type(obj_id); + + if (H5Tget_class(type) == H5T_REFERENCE) { + /* references are done differently than + the standard output: + XML dumps a path to the object + referenced. + */ + status = xml_print_refs(obj_id, ATTRIBUTE_DATA); + H5Tclose(type); + } else if (H5Tget_class(type) == H5T_STRING) { + status = xml_print_strs(obj_id, ATTRIBUTE_DATA); + } else { + /* all other data */ + p_type = h5dump_fixtype(type); + H5Tclose(type); + + space = H5Aget_space(obj_id); + + ndims = H5Sget_simple_extent_dims(space, size, NULL); + + for (i = 0; i < ndims; i++) + nelmts *= size[i]; + + buf = + malloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); + assert(buf); + + if (H5Aread(obj_id, p_type, buf) >= 0) { + status = + h5dump_mem(stdout, outputformat, obj_id, p_type, space, + buf, depth); + } + free(buf); + H5Tclose(p_type); + H5Sclose(space); + H5Tclose(type); + } + } + + if (status < 0) { + indentation(indent + COL); + printf("Unable to print data.\n"); + status = 1; + } + + indentation(indent + COL); + printf("\n"); + indentation(indent); + printf("%s\n", dump_header_format->dataend); + indent -= COL; +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_attr + * + * Purpose: Dump a description of an HDF5 attribute in XML. + * + * Return: herr_t + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static herr_t +xml_dump_attr(hid_t attr, const char *attr_name, void UNUSED * op_data) +{ + hid_t attr_id, type, space; + + indentation(indent); + printf("\n", xml_escape_the_name((char *)attr_name)); + + if ((attr_id = H5Aopen_name(attr, attr_name)) >= 0) { + type = H5Aget_type(attr_id); + space = H5Aget_space(attr_id); + + dump_function_table->dump_dataspace_function(space); + dump_function_table->dump_datatype_function(type); + + if (display_data) { + switch (H5Tget_class(type)) { + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_ENUM: + case H5T_ARRAY: + dump_function_table->dump_data_function(attr_id, + ATTRIBUTE_DATA); + break; + + case H5T_TIME: + indent += COL; + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + indent -= COL; + break; + + case H5T_COMPOUND: + indentation(indent); + printf + ("\n"); + dump_function_table->dump_data_function(attr_id, + ATTRIBUTE_DATA); + break; + + case H5T_REFERENCE: + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + xml_print_refs(attr_id, ATTRIBUTE_DATA); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + break; + + case H5T_VLEN: + printf("\n"); + dump_function_table->dump_data_function(attr_id, + ATTRIBUTE_DATA); + break; + default: + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n", H5Tget_class(type)); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + break; + } + } else { + /* The case of an attribute never yet written (??) */ + indentation(indent); + printf("\n"); + indentation(indent + COL); + printf("\n"); + indentation(indent); + printf("\n"); + } + + H5Tclose(type); + H5Sclose(space); + H5Aclose(attr_id); + indentation(indent); + printf("%s\n", dump_header_format->attributeend); + return SUCCEED; + + } else { + /* ?? failed */ + indentation(indent + COL); + printf("\n"); + indentation(indent); + printf("%s\n", dump_header_format->attributeend); + d_status = 1; + return FAIL; + } +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_named_datatype + * + * Purpose: Dump a description of an HDF5 NDT in XML. + * + * Return: herr_t + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static void +xml_dump_named_datatype(hid_t type, const char *name) +{ + int nmembers = 1, x; + hid_t mtype; + char *fname; + char *tmp; + + tmp = (char *) malloc(strlen(prefix) + strlen(name) + 2); + strcpy(tmp, prefix); + strcat(tmp, "/"); + strcat(tmp, name); + + indentation(indent); + if (strncmp(name, "#", 1) == 0) { + /* Special: this is an 'anonymous' NDT, deleted but + still in use. + We follow the dumper's undocumented practice, and + use its object id as its name. + Exactly the same as normal, but a separate case + in the event we want to do something else in + the future. + */ + printf("\n", + name, tmp, name); + } else { + printf("\n", + xml_escape_the_name((char *)name), + xml_escape_the_name((char *)tmp), + (strcmp(prefix, "") ? xml_escape_the_name((char *)name) : "root")); + } + + indent += COL; + if (H5Tget_class(type) == H5T_COMPOUND) { + /* Dump this here for sure. */ + nmembers = H5Tget_nmembers(type); + + indentation(indent); + printf("\n"); + + indent += COL; + for (x = 0; x < nmembers; x++) { + fname = H5Tget_member_name(type, x); + mtype = H5Tget_member_type(type, x); + indentation(indent); + printf("\n", xml_escape_the_name(fname)); + free(fname); + + if ((H5Tget_class(mtype) == H5T_COMPOUND) + || (H5Tget_class(mtype) == H5T_VLEN) + || (H5Tget_class(mtype) == H5T_ARRAY)) { + indent += COL; + + /* Nested compound type: recur */ + indentation(indent); + printf("%s %s\n", dump_header_format->datatypebegin, + dump_header_format->datatypeblockbegin); + indent += COL; + xml_print_datatype(mtype); + indent -= COL; + indentation(indent); + printf("%s\n", dump_header_format->datatypeend); + indent -= COL; + } else { + indent += COL; + indentation(indent); + printf("%s %s\n", dump_header_format->datatypebegin, + dump_header_format->datatypeblockbegin); + indent += COL; + xml_print_datatype(mtype); + indent -= COL; + indentation(indent); + printf("%s\n", dump_header_format->datatypeend); + indent -= COL; + } + + indentation(indent); + printf("\n"); + } + + indent -= COL; + indentation(indent); + printf("\n"); + } else { + /* Other data types: call print_datatype */ + indent += COL; + xml_print_datatype(type); + indent -= COL; + } + + indent -= COL; + indentation(indent); + printf("\n"); +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_group + * + * Purpose: Dump a description of an HDF5 Group (and its members) in XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static void +xml_dump_group(hid_t gid, const char *name) +{ + H5G_stat_t statbuf; + char *cp; + hid_t dset, type; + char typename[1024], *tmp; + char *par; + int i; + int isRoot = 0; + int xtype; + + if (strcmp(name, "/") == 0) { + isRoot = 1; + } else { + tmp = malloc(strlen(prefix) + strlen(name) + 2); + strcpy(tmp, prefix); + par = strdup(tmp); + cp = strrchr(par, '/'); + if (cp != NULL) { + if ((cp == par) && strlen(par) > 1) { + *(cp + 1) = '\0'; + } else { + *cp = '\0'; + } + } + } + indentation(indent); + if (isRoot) { + printf("\n"); + } else { + printf("\n", + xml_escape_the_name((char *)name), + xml_escape_the_name((char *)tmp), xml_escape_the_name((char *)par)); + } + indent += COL; + H5Gget_objinfo(gid, ".", TRUE, &statbuf); + + if (statbuf.nlink > 1) { + /* Group with more than one link to it... */ + i = search_obj(group_table, statbuf.objno); + + if (i < 0) { + indentation(indent); + printf("h5dump error: internal error\n"); + d_status = 1; + } else if (group_table->objs[i].displayed) { + /* already seen: enter a groupptr */ + indentation(indent + COL); + printf("\n", + xml_escape_the_name(group_table->objs[i].objname)); + } else { + /* first time this group has been seen -- describe it */ + strcpy(group_table->objs[i].objname, prefix); + group_table->objs[i].displayed = 1; + + /* 1. do all the attributes of the group */ + H5Aiterate(gid, NULL, + dump_function_table->dump_attribute_function, NULL); + + if (!strcmp(name, "/") && unamedtype) { + /* Very special case: dump unamed type in root group */ + for (i = 0; i < type_table->nobjs; i++) { + if (!type_table->objs[i].recorded) { + dset = H5Dopen(gid, type_table->objs[i].objname); + type = H5Dget_type(dset); + sprintf(typename, "#%lu:%lu", + type_table->objs[i].objno[0], + type_table->objs[i].objno[1]); + dump_function_table->dump_named_datatype_function + (type, typename); + H5Tclose(type); + H5Dclose(dset); + } + } + } + + /* iterate through all the members */ + xtype = H5G_TYPE; + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + xtype = H5G_DATASET; + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + xtype = H5G_LINK; + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + xtype = H5G_GROUP; + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + } + } else { + /* 1. do all the attributes of the group */ + H5Aiterate(gid, NULL, dump_function_table->dump_attribute_function, + NULL); + + if (!strcmp(name, "/") && unamedtype) { + /* Very special case: dump unamed type in root group */ + for (i = 0; i < type_table->nobjs; i++) { + if (!type_table->objs[i].recorded) { + dset = H5Dopen(gid, type_table->objs[i].objname); + type = H5Dget_type(dset); + sprintf(typename, "#%lu:%lu", + type_table->objs[i].objno[0], + type_table->objs[i].objno[1]); + dump_function_table->dump_named_datatype_function(type, + typename); + H5Tclose(type); + H5Dclose(dset); + } + } + } + + /* iterate through all the members */ + xtype = H5G_TYPE; + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + xtype = H5G_DATASET; + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + xtype = H5G_LINK; + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + xtype = H5G_GROUP; + H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + } + + indent -= COL; + indentation(indent); + if (isRoot) { + printf("\n"); + } else { + printf("%s\n", dump_header_format->groupend); + } +/* don't free this!!! + free(tmp); +*/ +} + +/*------------------------------------------------------------------------- + * Function: xml_print_refs + * + * Purpose: Print a path to the objects referenced by HDF5 Referneces. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static int +xml_print_refs(hid_t did, int source) +{ + herr_t e; + hid_t type, space; + char *buf; + hobj_ref_t *refbuf; + char *path; + hsize_t ssiz; + hsize_t i; + if (source == DATASET_DATA) { + type = H5Dget_type(did); + } else if (source == ATTRIBUTE_DATA) { + type = H5Aget_type(did); + } else { + /* return an error */ + return FAIL; + } + if (H5Tget_class(type) != H5T_REFERENCE) { + /* return an error */ + return FAIL; + } + if (!H5Tequal(type, H5T_STD_REF_OBJ)) { + /* region ref not supported yet... */ + /* return an error */ + return FAIL; + } + if (source == DATASET_DATA) { + space = H5Dget_space(did); + ssiz = H5Sget_simple_extent_npoints(space); + ssiz *= H5Tget_size(type); + + buf = calloc((size_t)ssiz, sizeof(char)); + if (buf == NULL) { + return FAIL; + } + e = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + /* need to check result here */ + if (e < 0) { + free(buf); + return FAIL; + } + + } else if (source == ATTRIBUTE_DATA) { + space = H5Aget_space(did); + ssiz = H5Sget_simple_extent_npoints(space); + ssiz *= H5Tget_size(type); + + buf = calloc((size_t)ssiz, sizeof(char)); + if (buf == NULL) { + free(buf); + return FAIL; + } + e = H5Aread(did, H5T_STD_REF_OBJ, buf); + /* need to check the result here */ + } else { + /* error */ + return FAIL; + } + + refbuf = (hobj_ref_t *) buf; + ssiz = H5Sget_simple_extent_npoints(space); + + for (i = 0; i < ssiz; i++) { + path = lookup_ref_path(refbuf); + indentation(indent + COL); + if (path == NULL) { + printf("\"%s\"\n", "NULL"); + } else { + printf("\"%s\"\n", xml_escape_the_string(path, -1)); + } + refbuf++; + } + return SUCCEED; +} + +/*------------------------------------------------------------------------- + * Function: xml_print_strs + * + * Purpose: Print strings. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static int +xml_print_strs(hid_t did, int source) +{ + herr_t e; + hid_t type, space; + char *buf; + char *bp; + char *onestring; + hsize_t ssiz; + size_t tsiz; + size_t i; + if (source == DATASET_DATA) { + type = H5Dget_type(did); + } else if (source == ATTRIBUTE_DATA) { + type = H5Aget_type(did); + } else { + /* return an error */ + return FAIL; + } + if (H5Tget_class(type) != H5T_STRING) { + /* return an error */ + return FAIL; + } + if (source == DATASET_DATA) { + space = H5Dget_space(did); + ssiz = H5Sget_simple_extent_npoints(space); + ssiz *= H5Tget_size(type); + + buf = calloc((size_t)ssiz, sizeof(char)); + if (buf == NULL) { + return FAIL; + } + e = H5Dread(did, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (e < 0) { + free(buf); + return FAIL; + } + + } else if (source == ATTRIBUTE_DATA) { + space = H5Aget_space(did); + ssiz = H5Sget_simple_extent_npoints(space); + ssiz *= H5Tget_size(type); + + buf = calloc((size_t)ssiz, sizeof(char)); + if (buf == NULL) { + return FAIL; + } + e = H5Aread(did, type, buf); + if (e < 0) { + free(buf); + return FAIL; + } + } else { + /* error */ + return FAIL; + } + +/* pull out each string... */ + ssiz = H5Sget_simple_extent_npoints(space); + + tsiz = H5Tget_size(type); + onestring = (char *) calloc((size_t)tsiz, sizeof(char)); + bp = buf; + + for (i = 0; i < ssiz; i++) { + strncpy(onestring, bp, tsiz); + indentation(indent + COL); + if (onestring == NULL) { + printf("\"%s\"\n", "NULL"); + } else { + printf("\"%s\"\n", xml_escape_the_string(onestring, (int)tsiz)); + } + bp += tsiz; + } + return SUCCEED; +} + +/*------------------------------------------------------------------------- + * Function: check_compression + * + * Purpose: private function to check for compression and + * put a comment in the XML. (Not fully implemented.) + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +void +check_compression(hid_t dcpl) +{ + int nfilt; + int i; + H5Z_filter_t filter; + char namebuf[20]; + size_t cd_nelmts = 1; + unsigned int cd_values; + unsigned int flags; +/* not used yet: will need to do somehting more elaborate to handle future + * compression methods. + char *t1 = "H5Z_FILTER_DEFLATE"; +*/ + + nfilt = H5Pget_nfilters(dcpl); + if (nfilt <= 0) + return; + for (i = 0; i < nfilt; i++) { + filter = H5Pget_filter(dcpl, i, &flags, + (size_t *) &cd_nelmts, + &cd_values, 20, namebuf); + if (filter == H5Z_FILTER_DEFLATE) { + indentation(indent + COL); + printf("\n"); + indentation(indent + COL); + printf("\n", cd_values); + } + } +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_group + * + * Purpose: Dump a description of an HDF5 Group (and its members) in XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static void +xml_dump_dataset(hid_t did, const char *name) +{ + hid_t type, space; + hid_t dcpl; + int maxdims; + hsize_t *chsize; + int ndims; + int i; + char *tmp; + + tmp = (char *) malloc(strlen(prefix) + strlen(name) + 2); + strcpy(tmp, prefix); + strcat(tmp, "/"); + strcat(tmp, name); + indentation(indent); + printf("\n", + xml_escape_the_name((char *)name), + xml_escape_the_name((char *)tmp), + (strcmp(prefix, "") ? xml_escape_the_name((char *)prefix) : "root")); + + dcpl = H5Dget_create_plist(did); + type = H5Dget_type(did); + space = H5Dget_space(did); + + /* Print information about chunked storage */ + if (H5D_CHUNKED == H5Pget_layout(dcpl)) { + maxdims = H5Sget_simple_extent_ndims(space); + chsize = (hsize_t *) malloc(maxdims * sizeof(hsize_t)); + indent += COL; + indentation(indent); + printf("\n"); + indent += COL; + indentation(indent); + printf("\n", ndims); + /* check for compression and tell about it... */ + + check_compression(dcpl); + + indent += COL; + for (i = 0; i < ndims; i++) { + indentation(indent); + HDfprintf(stdout,"\n", chsize[i]); + } + indent -= COL; + + indentation(indent); + printf("\n"); + indent -= COL; + indentation(indent); + printf("\n"); + indent -= COL; + free(chsize); + } + /* and check for external.... */ + + dump_function_table->dump_dataspace_function(space); + dump_function_table->dump_datatype_function(type); + + indent += COL; + H5Aiterate(did, NULL, dump_function_table->dump_attribute_function, NULL); + indent -= COL; + i = H5Dget_storage_size(did); + if (display_data && (i > 0)) { + switch (H5Tget_class(type)) { + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_ENUM: + case H5T_ARRAY: + dump_function_table->dump_data_function(did, DATASET_DATA); + break; + + case H5T_TIME: + indent += COL; + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + indent -= COL; + break; + + case H5T_COMPOUND: + indentation(indent); + printf("\n"); + dump_function_table->dump_data_function(did, DATASET_DATA); + break; + + case H5T_REFERENCE: + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + xml_print_refs(did, DATASET_DATA); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + break; + + case H5T_VLEN: + printf("\n"); + dump_function_table->dump_data_function(did, DATASET_DATA); + break; + default: + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n", H5Tget_class(type)); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + break; + } + } else { + /* no data written */ + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + } + +/* + free(tmp); +*/ + H5Tclose(type); + H5Sclose(space); + indentation(indent); + printf("%s\n", dump_header_format->datasetend); +} + +/*------------------------------------------------------------------------- + * Function: xml_print_enum + * + * Purpose: Print the values of an HDF5 ENUM in XML. + * Very similar to regular DDL output. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *-----------------------------------------------------------------------*/ +static void +xml_print_enum(hid_t type) +{ + char **name = NULL; /*member names */ + unsigned char *value = NULL; /*value array */ + int nmembs; /*number of members */ + hid_t super; /*enum base integer type */ + hid_t native = -1; /*native integer data type */ + size_t dst_size; /*destination value type size */ + int i; /*miscellaneous counters */ + size_t j; + + nmembs = H5Tget_nmembers(type); + super = H5Tget_super(type); + + /* + * Determine what data type to use for the native values. To simplify + * things we entertain three possibilities: + * 1. long_long -- the largest native signed integer + * 2. unsigned long_long -- the largest native unsigned integer + * 3. raw format + */ + if (H5Tget_size(type) <= sizeof(long_long)) { + dst_size = sizeof(long_long); + + if (H5T_SGN_NONE == H5Tget_sign(type)) { + native = H5T_NATIVE_ULLONG; + } else { + native = H5T_NATIVE_LLONG; + } + } else { + dst_size = H5Tget_size(type); + } + + /* Get the names and raw values of all members */ + name = calloc((size_t)nmembs, sizeof(char *)); + value = calloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size)); + + for (i = 0; i < nmembs; i++) { + name[i] = H5Tget_member_name(type, i); + H5Tget_member_value(type, i, value + i * H5Tget_size(type)); + } + + /* Convert values to native data type */ + if (native > 0) + H5Tconvert(super, native, (hsize_t)nmembs, value, NULL, H5P_DEFAULT); + + /* Sort members by increasing value */ + /*not implemented yet */ + + /* Print members */ + indent += COL; + for (i = 0; i < nmembs; i++) { + indentation(indent); + printf("\n"); + indentation(indent + COL); + printf("%s\n", xml_escape_the_name(name[i])); + indentation(indent); + printf("\n"); + indentation(indent); + printf("\n"); + indentation(indent + COL); + if (native < 0) { + printf("0x"); + + for (j = 0; j < dst_size; j++) + printf("%02x", value[i * dst_size + j]); + } else if (H5T_SGN_NONE == H5Tget_sign(native)) { + printf("%" PRINTF_LL_WIDTH "u", *((unsigned long_long *) + ((void *) (value + i * dst_size)))); + } else { + printf("%" PRINTF_LL_WIDTH "d", + *((long_long *) ((void *) (value + i * dst_size)))); + } + printf("\n"); + indentation(indent); + printf("\n"); + + } + indent -= COL; + + /* Release resources */ + for (i = 0; i < nmembs; i++) + free(name[i]); + + free(name); + free(value); + H5Tclose(super); } diff --git a/tools/testfiles/tall.h5.xml b/tools/testfiles/tall.h5.xml new file mode 100644 index 0000000000..6886916314 --- /dev/null +++ b/tools/testfiles/tall.h5.xml @@ -0,0 +1,173 @@ +############################# +Expected output for 'h5dump --xml tall.h5' +############################# + + + + + + + + + + + + + + + + + + 97 98 99 100 101 102 103 104 105 0 + + + + + + + + + + + + + + + + + + 0 1 + 2 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 49 115 116 32 97 116 116 114 105 98 117 116 101 32 111 102 32 + 100 115 101 116 49 46 49 46 49 0 + + + + + + + + + + + + + + + + + 50 110 100 32 97 116 116 114 105 98 117 116 101 32 111 102 32 + 100 115 101 116 49 46 49 46 49 0 + + + + + + 0 0 0 0 0 0 0 0 0 0 + 0 1 2 3 4 5 6 7 8 9 + 0 2 4 6 8 10 12 14 16 18 + 0 3 6 9 12 15 18 21 24 27 + 0 4 8 12 16 20 24 28 32 36 + 0 5 10 15 20 25 30 35 40 45 + 0 6 12 18 24 30 36 42 48 54 + 0 7 14 21 28 35 42 49 56 63 + 0 8 16 24 32 40 48 56 64 72 + 0 9 18 27 36 45 54 63 72 81 + + + + + + + + + + + + + + + + + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + + + + + + + + + + + + + + + + + + + + + + + + + 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 + + + + + + + + + + + + + + + + + + 0 0.1 0.2 0.3 0.4 + 0 0.2 0.4 0.6 0.8 + 0 0.3 0.6 0.9 1.2 + + + + + + diff --git a/tools/testfiles/tarray1.h5.xml b/tools/testfiles/tarray1.h5.xml new file mode 100644 index 0000000000..ea654cda46 --- /dev/null +++ b/tools/testfiles/tarray1.h5.xml @@ -0,0 +1,31 @@ +############################# +Expected output for 'h5dump --xml tarray1.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 3 10 11 12 13 20 21 22 23 30 31 32 33 + + + + + diff --git a/tools/testfiles/tarray2.h5.xml b/tools/testfiles/tarray2.h5.xml new file mode 100644 index 0000000000..5772b9892c --- /dev/null +++ b/tools/testfiles/tarray2.h5.xml @@ -0,0 +1,80 @@ +############################# +Expected output for 'h5dump --xml tarray2.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 3 4 + 10 11 12 13 14 + 20 21 22 23 24 + 30 31 32 33 34 + 100 101 102 103 104 + 110 111 112 113 114 + 120 121 122 123 124 + 130 131 132 133 134 + 200 201 202 203 204 + 210 211 212 213 214 + 220 221 222 223 224 + 230 231 232 233 234 + 1000 1001 1002 1003 1004 + 1010 1011 1012 1013 1014 + 1020 1021 1022 1023 1024 + 1030 1031 1032 1033 1034 + 1100 1101 1102 1103 1104 + 1110 1111 1112 1113 1114 + 1120 1121 1122 1123 1124 + 1130 1131 1132 1133 1134 + 1200 1201 1202 1203 1204 + 1210 1211 1212 1213 1214 + 1220 1221 1222 1223 1224 + 1230 1231 1232 1233 1234 + 2000 2001 2002 2003 2004 + 2010 2011 2012 2013 2014 + 2020 2021 2022 2023 2024 + 2030 2031 2032 2033 2034 + 2100 2101 2102 2103 2104 + 2110 2111 2112 2113 2114 + 2120 2121 2122 2123 2124 + 2130 2131 2132 2133 2134 + 2200 2201 2202 2203 2204 + 2210 2211 2212 2213 2214 + 2220 2221 2222 2223 2224 + 2230 2231 2232 2233 2234 + 3000 3001 3002 3003 3004 + 3010 3011 3012 3013 3014 + 3020 3021 3022 3023 3024 + 3030 3031 3032 3033 3034 + 3100 3101 3102 3103 3104 + 3110 3111 3112 3113 3114 + 3120 3121 3122 3123 3124 + 3130 3131 3132 3133 3134 + 3200 3201 3202 3203 3204 + 3210 3211 3212 3213 3214 + 3220 3221 3222 3223 3224 + 3230 3231 3232 3233 3234 + + + + + diff --git a/tools/testfiles/tarray3.h5.xml b/tools/testfiles/tarray3.h5.xml new file mode 100644 index 0000000000..5af5d85595 --- /dev/null +++ b/tools/testfiles/tarray3.h5.xml @@ -0,0 +1,120 @@ +############################# +Expected output for 'h5dump --xml tarray3.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 + 10 11 12 + 20 21 22 + 30 31 32 + 40 41 42 + 50 51 52 100 101 102 + 110 111 112 + 120 121 122 + 130 131 132 + 140 141 142 + 150 151 152 200 201 202 + 210 211 212 + 220 221 222 + 230 231 232 + 240 241 242 + 250 251 252 300 301 302 + 310 311 312 + 320 321 322 + 330 331 332 + 340 341 342 + 350 351 352 + 1000 1001 1002 + 1010 1011 1012 + 1020 1021 1022 + 1030 1031 1032 + 1040 1041 1042 + 1050 1051 1052 1100 1101 1102 + 1110 1111 1112 + 1120 1121 1122 + 1130 1131 1132 + 1140 1141 1142 + 1150 1151 1152 1200 1201 1202 + 1210 1211 1212 + 1220 1221 1222 + 1230 1231 1232 + 1240 1241 1242 + 1250 1251 1252 1300 1301 1302 + 1310 1311 1312 + 1320 1321 1322 + 1330 1331 1332 + 1340 1341 1342 + 1350 1351 1352 + 2000 2001 2002 + 2010 2011 2012 + 2020 2021 2022 + 2030 2031 2032 + 2040 2041 2042 + 2050 2051 2052 2100 2101 2102 + 2110 2111 2112 + 2120 2121 2122 + 2130 2131 2132 + 2140 2141 2142 + 2150 2151 2152 2200 2201 2202 + 2210 2211 2212 + 2220 2221 2222 + 2230 2231 2232 + 2240 2241 2242 + 2250 2251 2252 2300 2301 2302 + 2310 2311 2312 + 2320 2321 2322 + 2330 2331 2332 + 2340 2341 2342 + 2350 2351 2352 + 3000 3001 3002 + 3010 3011 3012 + 3020 3021 3022 + 3030 3031 3032 + 3040 3041 3042 + 3050 3051 3052 3100 3101 3102 + 3110 3111 3112 + 3120 3121 3122 + 3130 3131 3132 + 3140 3141 3142 + 3150 3151 3152 3200 3201 3202 + 3210 3211 3212 + 3220 3221 3222 + 3230 3231 3232 + 3240 3241 3242 + 3250 3251 3252 3300 3301 3302 + 3310 3311 3312 + 3320 3321 3322 + 3330 3331 3332 + 3340 3341 3342 + 3350 3351 3352 + + + + + diff --git a/tools/testfiles/tarray6.h5.xml b/tools/testfiles/tarray6.h5.xml new file mode 100644 index 0000000000..35e50caf12 --- /dev/null +++ b/tools/testfiles/tarray6.h5.xml @@ -0,0 +1,38 @@ +############################# +Expected output for 'h5dump --xml tarray6.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 10 11 20 21 22 30 31 32 33 + 100 101 110 111 112 120 121 122 123 130 131 132 133 134 + 200 201 202 210 211 212 213 220 221 222 223 224 230 231 232 233 234 235 + 300 301 302 303 310 311 312 313 314 320 321 322 323 324 325 330 331 332 333 334 335 336 + + + + + diff --git a/tools/testfiles/tarray7.h5.xml b/tools/testfiles/tarray7.h5.xml new file mode 100644 index 0000000000..a9fd541362 --- /dev/null +++ b/tools/testfiles/tarray7.h5.xml @@ -0,0 +1,43 @@ +############################# +Expected output for 'h5dump --xml tarray7.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 3 100 101 102 103 110 111 112 113 200 201 202 203 210 211 212 213 220 221 222 223 300 301 302 303 310 311 312 313 320 321 322 323 330 331 332 333 + 1000 1001 1002 1003 1010 1011 1012 1013 1100 1101 1102 1103 1110 1111 1112 1113 1120 1121 1122 1123 1200 1201 1202 1203 1210 1211 1212 1213 1220 1221 1222 1223 1230 1231 1232 1233 1300 1301 1302 1303 1310 1311 1312 1313 1320 1321 1322 1323 1330 1331 1332 1333 1340 1341 1342 1343 + 2000 2001 2002 2003 2010 2011 2012 2013 2020 2021 2022 2023 2100 2101 2102 2103 2110 2111 2112 2113 2120 2121 2122 2123 2130 2131 2132 2133 2200 2201 2202 2203 2210 2211 2212 2213 2220 2221 2222 2223 2230 2231 2232 2233 2240 2241 2242 2243 2300 2301 2302 2303 2310 2311 2312 2313 2320 2321 2322 2323 2330 2331 2332 2333 2340 2341 2342 2343 2350 2351 2352 2353 + 3000 3001 3002 3003 3010 3011 3012 3013 3020 3021 3022 3023 3030 3031 3032 3033 3100 3101 3102 3103 3110 3111 3112 3113 3120 3121 3122 3123 3130 3131 3132 3133 3140 3141 3142 3143 3200 3201 3202 3203 3210 3211 3212 3213 3220 3221 3222 3223 3230 3231 3232 3233 3240 3241 3242 3243 3250 3251 3252 3253 3300 3301 3302 3303 3310 3311 3312 3313 3320 3321 3322 3323 3330 3331 3332 3333 3340 3341 3342 3343 3350 3351 3352 3353 3360 3361 3362 3363 + + + + + diff --git a/tools/testfiles/tattr.h5.xml b/tools/testfiles/tattr.h5.xml new file mode 100644 index 0000000000..757b2977ee --- /dev/null +++ b/tools/testfiles/tattr.h5.xml @@ -0,0 +1,91 @@ +############################# +Expected output for 'h5dump --xml tattr.h5' +############################# + + + + + + + + + + + + + + + + + + 97 116 116 114 105 98 117 116 101 32 111 102 32 114 111 111 116 32 103 + 114 111 117 112 0 + + + + + + + + + + + + + + + + + 1 2 3 4 5 6 7 8 9 10 + + + + + + + + + + + + + + + + + 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 + + + + + + + + + + + + + + + 100 + + + + + + + + + + + + + + + "string attribute" + + + + + diff --git a/tools/testfiles/tbitfields.h5.xml b/tools/testfiles/tbitfields.h5.xml new file mode 100644 index 0000000000..f249fa7983 --- /dev/null +++ b/tools/testfiles/tbitfields.h5.xml @@ -0,0 +1,48 @@ +############################# +Expected output for 'h5dump --xml tbitfields.h5' +############################# + + + + + + + + + + + + + + + + + + + 0xff 0xfe 0xfd 0xfc 0xfb 0xfa 0xf9 0xf8 0xf7 0xf6 0xf5 0xf4 0xf3 + 0xf2 0xf1 0xf0 0xef 0xee 0xed 0xec 0xeb 0xea 0xe9 0xe8 0xe7 0xe6 + 0xe5 0xe4 0xe3 0xe2 0xe1 0xe0 + + + + + + + + + + + + + + + + + 0xfffe 0xfdfc 0xfbfa 0xf9f8 0xf7f6 0xf5f4 0xf3f2 0xf1f0 0xefee + 0xedec 0xebea 0xe9e8 0xe7e6 0xe5e4 0xe3e2 0xe1e0 + + + + + + diff --git a/tools/testfiles/tcompound.h5.xml b/tools/testfiles/tcompound.h5.xml new file mode 100644 index 0000000000..cc2db90a45 --- /dev/null +++ b/tools/testfiles/tcompound.h5.xml @@ -0,0 +1,280 @@ +############################# +Expected output for 'h5dump --xml tcompound.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 1 1 1 0.5 2 4 0.333333 3 9 0.25 4 16 0.2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 1 1.1 2 2.2 3 3.3 4 4.4 + + + + + + + + + + + + + + + 0 1 2 3 1 2 3 4 5 6 + 2 3 4 5 6 7 + 3 4 5 6 7 8 + 4 5 6 7 8 9 + 5 6 7 8 9 10 + 1 2 3 4 2 3 4 5 6 7 + 3 4 5 6 7 8 + 4 5 6 7 8 9 + 5 6 7 8 9 10 + 6 7 8 9 10 11 + 2 3 4 5 3 4 5 6 7 8 + 4 5 6 7 8 9 + 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 3 4 5 6 4 5 6 7 8 9 + 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 4 5 6 7 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 9 10 11 12 13 14 + 5 6 7 8 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 9 10 11 12 13 14 + 10 11 12 13 14 15 + 1 2 3 4 2 3 4 5 6 7 + 3 4 5 6 7 8 + 4 5 6 7 8 9 + 5 6 7 8 9 10 + 6 7 8 9 10 11 + 2 3 4 5 3 4 5 6 7 8 + 4 5 6 7 8 9 + 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 3 4 5 6 4 5 6 7 8 9 + 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 4 5 6 7 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 9 10 11 12 13 14 + 5 6 7 8 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 9 10 11 12 13 14 + 10 11 12 13 14 15 + 6 7 8 9 7 8 9 10 11 12 + 8 9 10 11 12 13 + 9 10 11 12 13 14 + 10 11 12 13 14 15 + 11 12 13 14 15 16 + 2 3 4 5 3 4 5 6 7 8 + 4 5 6 7 8 9 + 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 3 4 5 6 4 5 6 7 8 9 + 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 4 5 6 7 5 6 7 8 9 10 + 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 9 10 11 12 13 14 + 5 6 7 8 6 7 8 9 10 11 + 7 8 9 10 11 12 + 8 9 10 11 12 13 + 9 10 11 12 13 14 + 10 11 12 13 14 15 + 6 7 8 9 7 8 9 10 11 12 + 8 9 10 11 12 13 + 9 10 11 12 13 14 + 10 11 12 13 14 15 + 11 12 13 14 15 16 + 7 8 9 10 8 9 10 11 12 13 + 9 10 11 12 13 14 + 10 11 12 13 14 15 + 11 12 13 14 15 16 + 12 13 14 15 16 17 + + + + + + + + + + + + + + 0 3 1 4 2 5 3 6 4 7 + + + + + + + + + + + + + + + + 0 0 1 0.1 2 0.2 3 0.3 4 0.4 + + + + + + diff --git a/tools/testfiles/tcompound2.h5.xml b/tools/testfiles/tcompound2.h5.xml new file mode 100644 index 0000000000..95fe67a76f --- /dev/null +++ b/tools/testfiles/tcompound2.h5.xml @@ -0,0 +1,196 @@ +############################# +Expected output for 'h5dump --xml tcompound2.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 1 1 1 0.5 2 4 0.333333 3 9 0.25 4 16 0.2 5 25 0.166667 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 1 1.1 2 2.2 3 3.3 4 4.4 5 5.5 + + + + + + + + + + + + + + + + + + + 0 0 1 1 2 2 3 3 4 4 5 5 + + + + + + + + + + + + + + + + + + + + + 0 0 1 1 2 2 3 3 4 4 5 5 + + + + + + diff --git a/tools/testfiles/tdatareg.h5.xml b/tools/testfiles/tdatareg.h5.xml new file mode 100644 index 0000000000..ac6a6911e8 --- /dev/null +++ b/tools/testfiles/tdatareg.h5.xml @@ -0,0 +1,54 @@ +############################# +Expected output for 'h5dump --xml tdatareg.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 3 6 9 12 15 18 21 24 27 + 30 33 36 39 42 45 48 51 54 57 + 60 63 66 69 72 75 78 81 84 87 + 90 93 96 99 102 105 108 111 114 117 + 120 123 126 129 132 135 138 141 144 147 + 150 153 156 159 162 165 168 171 174 177 + 180 183 186 189 192 195 198 201 204 207 + 210 213 216 219 222 225 228 231 234 237 + 240 243 246 249 252 255 2 5 8 11 + 14 17 20 23 26 29 32 35 38 41 + + + + + diff --git a/tools/testfiles/tdset.h5.xml b/tools/testfiles/tdset.h5.xml new file mode 100644 index 0000000000..ea7bdb8dcb --- /dev/null +++ b/tools/testfiles/tdset.h5.xml @@ -0,0 +1,133 @@ +############################# +Expected output for 'h5dump --xml tdset.h5' +############################# + + + + + + + + + + + + + + + + + + + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 + 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 + 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 + 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 + 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 + 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 + 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 + 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + + + + + + + + + + + + + + + + + + 0 0.0001 0.0002 0.0003 0.0004 0.0005 0.0006 0.0007 0.0008 0.0009 0.001 + 0.0011 0.0012 0.0013 0.0014 0.0015 0.0016 0.0017 0.0018 0.0019 + 1 1.0001 1.0002 1.0003 1.0004 1.0005 1.0006 1.0007 1.0008 1.0009 1.001 + 1.0011 1.0012 1.0013 1.0014 1.0015 1.0016 1.0017 1.0018 1.0019 + 2 2.0001 2.0002 2.0003 2.0004 2.0005 2.0006 2.0007 2.0008 2.0009 2.001 + 2.0011 2.0012 2.0013 2.0014 2.0015 2.0016 2.0017 2.0018 2.0019 + 3 3.0001 3.0002 3.0003 3.0004 3.0005 3.0006 3.0007 3.0008 3.0009 3.001 + 3.0011 3.0012 3.0013 3.0014 3.0015 3.0016 3.0017 3.0018 3.0019 + 4 4.0001 4.0002 4.0003 4.0004 4.0005 4.0006 4.0007 4.0008 4.0009 4.001 + 4.0011 4.0012 4.0013 4.0014 4.0015 4.0016 4.0017 4.0018 4.0019 + 5 5.0001 5.0002 5.0003 5.0004 5.0005 5.0006 5.0007 5.0008 5.0009 5.001 + 5.0011 5.0012 5.0013 5.0014 5.0015 5.0016 5.0017 5.0018 5.0019 + 6 6.0001 6.0002 6.0003 6.0004 6.0005 6.0006 6.0007 6.0008 6.0009 6.001 + 6.0011 6.0012 6.0013 6.0014 6.0015 6.0016 6.0017 6.0018 6.0019 + 7 7.0001 7.0002 7.0003 7.0004 7.0005 7.0006 7.0007 7.0008 7.0009 7.001 + 7.0011 7.0012 7.0013 7.0014 7.0015 7.0016 7.0017 7.0018 7.0019 + 8 8.0001 8.0002 8.0003 8.0004 8.0005 8.0006 8.0007 8.0008 8.0009 8.001 + 8.0011 8.0012 8.0013 8.0014 8.0015 8.0016 8.0017 8.0018 8.0019 + 9 9.0001 9.0002 9.0003 9.0004 9.0005 9.0006 9.0007 9.0008 9.0009 9.001 + 9.0011 9.0012 9.0013 9.0014 9.0015 9.0016 9.0017 9.0018 9.0019 + 10 10.0001 10.0002 10.0003 10.0004 10.0005 10.0006 10.0007 10.0008 + 10.0009 10.001 10.0011 10.0012 10.0013 10.0014 10.0015 10.0016 10.0017 + 10.0018 10.0019 + 11 11.0001 11.0002 11.0003 11.0004 11.0005 11.0006 11.0007 11.0008 + 11.0009 11.001 11.0011 11.0012 11.0013 11.0014 11.0015 11.0016 11.0017 + 11.0018 11.0019 + 12 12.0001 12.0002 12.0003 12.0004 12.0005 12.0006 12.0007 12.0008 + 12.0009 12.001 12.0011 12.0012 12.0013 12.0014 12.0015 12.0016 12.0017 + 12.0018 12.0019 + 13 13.0001 13.0002 13.0003 13.0004 13.0005 13.0006 13.0007 13.0008 + 13.0009 13.001 13.0011 13.0012 13.0013 13.0014 13.0015 13.0016 13.0017 + 13.0018 13.0019 + 14 14.0001 14.0002 14.0003 14.0004 14.0005 14.0006 14.0007 14.0008 + 14.0009 14.001 14.0011 14.0012 14.0013 14.0014 14.0015 14.0016 14.0017 + 14.0018 14.0019 + 15 15.0001 15.0002 15.0003 15.0004 15.0005 15.0006 15.0007 15.0008 + 15.0009 15.001 15.0011 15.0012 15.0013 15.0014 15.0015 15.0016 15.0017 + 15.0018 15.0019 + 16 16.0001 16.0002 16.0003 16.0004 16.0005 16.0006 16.0007 16.0008 + 16.0009 16.001 16.0011 16.0012 16.0013 16.0014 16.0015 16.0016 16.0017 + 16.0018 16.0019 + 17 17.0001 17.0002 17.0003 17.0004 17.0005 17.0006 17.0007 17.0008 + 17.0009 17.001 17.0011 17.0012 17.0013 17.0014 17.0015 17.0016 17.0017 + 17.0018 17.0019 + 18 18.0001 18.0002 18.0003 18.0004 18.0005 18.0006 18.0007 18.0008 + 18.0009 18.001 18.0011 18.0012 18.0013 18.0014 18.0015 18.0016 18.0017 + 18.0018 18.0019 + 19 19.0001 19.0002 19.0003 19.0004 19.0005 19.0006 19.0007 19.0008 + 19.0009 19.001 19.0011 19.0012 19.0013 19.0014 19.0015 19.0016 19.0017 + 19.0018 19.0019 + 20 20.0001 20.0002 20.0003 20.0004 20.0005 20.0006 20.0007 20.0008 + 20.0009 20.001 20.0011 20.0012 20.0013 20.0014 20.0015 20.0016 20.0017 + 20.0018 20.0019 + 21 21.0001 21.0002 21.0003 21.0004 21.0005 21.0006 21.0007 21.0008 + 21.0009 21.001 21.0011 21.0012 21.0013 21.0014 21.0015 21.0016 21.0017 + 21.0018 21.0019 + 22 22.0001 22.0002 22.0003 22.0004 22.0005 22.0006 22.0007 22.0008 + 22.0009 22.001 22.0011 22.0012 22.0013 22.0014 22.0015 22.0016 22.0017 + 22.0018 22.0019 + 23 23.0001 23.0002 23.0003 23.0004 23.0005 23.0006 23.0007 23.0008 + 23.0009 23.001 23.0011 23.0012 23.0013 23.0014 23.0015 23.0016 23.0017 + 23.0018 23.0019 + 24 24.0001 24.0002 24.0003 24.0004 24.0005 24.0006 24.0007 24.0008 + 24.0009 24.001 24.0011 24.0012 24.0013 24.0014 24.0015 24.0016 24.0017 + 24.0018 24.0019 + 25 25.0001 25.0002 25.0003 25.0004 25.0005 25.0006 25.0007 25.0008 + 25.0009 25.001 25.0011 25.0012 25.0013 25.0014 25.0015 25.0016 25.0017 + 25.0018 25.0019 + 26 26.0001 26.0002 26.0003 26.0004 26.0005 26.0006 26.0007 26.0008 + 26.0009 26.001 26.0011 26.0012 26.0013 26.0014 26.0015 26.0016 26.0017 + 26.0018 26.0019 + 27 27.0001 27.0002 27.0003 27.0004 27.0005 27.0006 27.0007 27.0008 + 27.0009 27.001 27.0011 27.0012 27.0013 27.0014 27.0015 27.0016 27.0017 + 27.0018 27.0019 + 28 28.0001 28.0002 28.0003 28.0004 28.0005 28.0006 28.0007 28.0008 + 28.0009 28.001 28.0011 28.0012 28.0013 28.0014 28.0015 28.0016 28.0017 + 28.0018 28.0019 + 29 29.0001 29.0002 29.0003 29.0004 29.0005 29.0006 29.0007 29.0008 + 29.0009 29.001 29.0011 29.0012 29.0013 29.0014 29.0015 29.0016 29.0017 + 29.0018 29.0019 + + + + + diff --git a/tools/testfiles/tdset2.h5.xml b/tools/testfiles/tdset2.h5.xml new file mode 100644 index 0000000000..fa7ebd3357 --- /dev/null +++ b/tools/testfiles/tdset2.h5.xml @@ -0,0 +1,95 @@ +############################# +Expected output for 'h5dump --xml tdset2.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + + + + + diff --git a/tools/testfiles/tempty.h5.xml b/tools/testfiles/tempty.h5.xml new file mode 100644 index 0000000000..43f4d6baca --- /dev/null +++ b/tools/testfiles/tempty.h5.xml @@ -0,0 +1,125 @@ +############################# +Expected output for 'h5dump --xml tempty.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 0 0 + + + + + diff --git a/tools/testfiles/tenum.h5.xml b/tools/testfiles/tenum.h5.xml new file mode 100644 index 0000000000..8fc64a2a41 --- /dev/null +++ b/tools/testfiles/tenum.h5.xml @@ -0,0 +1,59 @@ +############################# +Expected output for 'h5dump --xml tenum.h5' +############################# + + + + + + + + + RED + + + 0 + + + GREEN + + + 1 + + + BLUE + + + 2 + + + WHITE + + + 3 + + + BLACK + + + 4 + + + + + + + + + + + + + + RED GREEN BLUE GREEN WHITE WHITE BLACK GREEN BLUE RED RED BLUE GREEN + BLACK WHITE RED WHITE GREEN GREEN BLUE + + + + + diff --git a/tools/testfiles/tgroup.h5.xml b/tools/testfiles/tgroup.h5.xml new file mode 100644 index 0000000000..c8e936af65 --- /dev/null +++ b/tools/testfiles/tgroup.h5.xml @@ -0,0 +1,35 @@ +############################# +Expected output for 'h5dump --xml tgroup.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/testfiles/thlink.h5.xml b/tools/testfiles/thlink.h5.xml new file mode 100644 index 0000000000..306f4eb7b8 --- /dev/null +++ b/tools/testfiles/thlink.h5.xml @@ -0,0 +1,39 @@ +############################# +Expected output for 'h5dump --xml thlink.h5' +############################# + + + + + + + + + + + + + + + + + + 0 1 2 3 4 + + + + + + + + + + + + + + + + + + diff --git a/tools/testfiles/tloop.h5.xml b/tools/testfiles/tloop.h5.xml new file mode 100644 index 0000000000..2e36c89e2b --- /dev/null +++ b/tools/testfiles/tloop.h5.xml @@ -0,0 +1,19 @@ +############################# +Expected output for 'h5dump --xml tloop.h5' +############################# + + + + + + + + + + + + + + + + diff --git a/tools/testfiles/tloop2.h5.xml b/tools/testfiles/tloop2.h5.xml new file mode 100644 index 0000000000..2af291a20b --- /dev/null +++ b/tools/testfiles/tloop2.h5.xml @@ -0,0 +1,17 @@ +############################# +Expected output for 'h5dump --xml tloop2.h5' +############################# + + + + + + + + + + + + + + diff --git a/tools/testfiles/tmany.h5.xml b/tools/testfiles/tmany.h5.xml new file mode 100644 index 0000000000..ab1b81a701 --- /dev/null +++ b/tools/testfiles/tmany.h5.xml @@ -0,0 +1,338 @@ +############################# +Expected output for 'h5dump --xml tmany.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 97 98 99 100 101 102 103 104 105 0 + + + + + + + + + + + + + + + + + + 0 1 + 2 3 + + + + + + + + + + + + + + + + + 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 + + + + + + + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 + 0 1 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 1 2 + 1 2 + 1 2 + 1 2 + 1 2 + 1 2 + 1 2 + 1 2 1 2 + 1 2 + 1 2 + 1 2 + 1 2 + 1 2 + 1 2 + 1 2 7 8 + 7 8 + 7 8 + 7 8 + 7 8 + 7 8 + 7 8 + 7 8 + 2 3 + 2 3 + 2 3 + 2 3 + 2 3 + 2 3 + 2 3 + 2 3 2 3 + 2 3 + 2 3 + 2 3 + 2 3 + 2 3 + 2 3 + 2 3 8 9 + 8 9 + 8 9 + 8 9 + 8 9 + 8 9 + 8 9 + 8 9 + 3 4 + 3 4 + 3 4 + 3 4 + 3 4 + 3 4 + 3 4 + 3 4 3 4 + 3 4 + 3 4 + 3 4 + 3 4 + 3 4 + 3 4 + 3 4 9 10 + 9 10 + 9 10 + 9 10 + 9 10 + 9 10 + 9 10 + 9 10 + 4 5 + 4 5 + 4 5 + 4 5 + 4 5 + 4 5 + 4 5 + 4 5 4 5 + 4 5 + 4 5 + 4 5 + 4 5 + 4 5 + 4 5 + 4 5 10 11 + 10 11 + 10 11 + 10 11 + 10 11 + 10 11 + 10 11 + 10 11 + 5 6 + 5 6 + 5 6 + 5 6 + 5 6 + 5 6 + 5 6 + 5 6 5 6 + 5 6 + 5 6 + 5 6 + 5 6 + 5 6 + 5 6 + 5 6 11 12 + 11 12 + 11 12 + 11 12 + 11 12 + 11 12 + 11 12 + 11 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + 0 1 2 3 4 5 6 7 8 9 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 + 1 1 1 1 1 1 1 1 1 1 + 2 2 2 2 2 2 2 2 2 2 + 3 3 3 3 3 3 3 3 3 3 + 4 4 4 4 4 4 4 4 4 4 + 5 5 5 5 5 5 5 5 5 5 + 6 6 6 6 6 6 6 6 6 6 + 7 7 7 7 7 7 7 7 7 7 + 8 8 8 8 8 8 8 8 8 8 + 9 9 9 9 9 9 9 9 9 9 + + + + + + diff --git a/tools/testfiles/tname-amp.h5 b/tools/testfiles/tname-amp.h5 new file mode 100644 index 0000000000..eeaeb67101 Binary files /dev/null and b/tools/testfiles/tname-amp.h5 differ diff --git a/tools/testfiles/tname-amp.h5.xml b/tools/testfiles/tname-amp.h5.xml new file mode 100644 index 0000000000..e7e882b584 --- /dev/null +++ b/tools/testfiles/tname-amp.h5.xml @@ -0,0 +1,55 @@ +############################# +Expected output for 'h5dump --xml tname-amp.h5' +############################# + + + + + + + + + + + + + + + + + + 97 98 99 100 101 102 103 104 105 0 + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 + 0 1 2 3 4 5 6 7 8 9 + 0 2 4 6 8 10 12 14 16 18 + 0 3 6 9 12 15 18 21 24 27 + 0 4 8 12 16 20 24 28 32 36 + 0 5 10 15 20 25 30 35 40 45 + 0 6 12 18 24 30 36 42 48 54 + 0 7 14 21 28 35 42 49 56 63 + 0 8 16 24 32 40 48 56 64 72 + 0 9 18 27 36 45 54 63 72 81 + + + + + + diff --git a/tools/testfiles/tname-apos.h5 b/tools/testfiles/tname-apos.h5 new file mode 100644 index 0000000000..c86d2dd25c Binary files /dev/null and b/tools/testfiles/tname-apos.h5 differ diff --git a/tools/testfiles/tname-apos.h5.xml b/tools/testfiles/tname-apos.h5.xml new file mode 100644 index 0000000000..5133ad7954 --- /dev/null +++ b/tools/testfiles/tname-apos.h5.xml @@ -0,0 +1,55 @@ +############################# +Expected output for 'h5dump --xml tname-apos.h5' +############################# + + + + + + + + + + + + + + + + + + 97 98 99 100 101 102 103 104 105 0 + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 + 0 1 2 3 4 5 6 7 8 9 + 0 2 4 6 8 10 12 14 16 18 + 0 3 6 9 12 15 18 21 24 27 + 0 4 8 12 16 20 24 28 32 36 + 0 5 10 15 20 25 30 35 40 45 + 0 6 12 18 24 30 36 42 48 54 + 0 7 14 21 28 35 42 49 56 63 + 0 8 16 24 32 40 48 56 64 72 + 0 9 18 27 36 45 54 63 72 81 + + + + + + diff --git a/tools/testfiles/tname-gt.h5 b/tools/testfiles/tname-gt.h5 new file mode 100644 index 0000000000..b852be8e10 Binary files /dev/null and b/tools/testfiles/tname-gt.h5 differ diff --git a/tools/testfiles/tname-gt.h5.xml b/tools/testfiles/tname-gt.h5.xml new file mode 100644 index 0000000000..383e31f8b1 --- /dev/null +++ b/tools/testfiles/tname-gt.h5.xml @@ -0,0 +1,55 @@ +############################# +Expected output for 'h5dump --xml tname-gt.h5' +############################# + + + + + + + + + + + + + + + + + + 97 98 99 100 101 102 103 104 105 0 + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 + 0 1 2 3 4 5 6 7 8 9 + 0 2 4 6 8 10 12 14 16 18 + 0 3 6 9 12 15 18 21 24 27 + 0 4 8 12 16 20 24 28 32 36 + 0 5 10 15 20 25 30 35 40 45 + 0 6 12 18 24 30 36 42 48 54 + 0 7 14 21 28 35 42 49 56 63 + 0 8 16 24 32 40 48 56 64 72 + 0 9 18 27 36 45 54 63 72 81 + + + + + + diff --git a/tools/testfiles/tname-lt.h5 b/tools/testfiles/tname-lt.h5 new file mode 100644 index 0000000000..698cf82994 Binary files /dev/null and b/tools/testfiles/tname-lt.h5 differ diff --git a/tools/testfiles/tname-lt.h5.xml b/tools/testfiles/tname-lt.h5.xml new file mode 100644 index 0000000000..abbe46bcee --- /dev/null +++ b/tools/testfiles/tname-lt.h5.xml @@ -0,0 +1,55 @@ +############################# +Expected output for 'h5dump --xml tname-lt.h5' +############################# + + + + + + + + + + + + + + + + + + 97 98 99 100 101 102 103 104 105 0 + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 + 0 1 2 3 4 5 6 7 8 9 + 0 2 4 6 8 10 12 14 16 18 + 0 3 6 9 12 15 18 21 24 27 + 0 4 8 12 16 20 24 28 32 36 + 0 5 10 15 20 25 30 35 40 45 + 0 6 12 18 24 30 36 42 48 54 + 0 7 14 21 28 35 42 49 56 63 + 0 8 16 24 32 40 48 56 64 72 + 0 9 18 27 36 45 54 63 72 81 + + + + + + diff --git a/tools/testfiles/tname-quot.h5 b/tools/testfiles/tname-quot.h5 new file mode 100644 index 0000000000..be7f44840b Binary files /dev/null and b/tools/testfiles/tname-quot.h5 differ diff --git a/tools/testfiles/tname-quot.h5.xml b/tools/testfiles/tname-quot.h5.xml new file mode 100644 index 0000000000..d1b2949885 --- /dev/null +++ b/tools/testfiles/tname-quot.h5.xml @@ -0,0 +1,55 @@ +############################# +Expected output for 'h5dump --xml tname-quot.h5' +############################# + + + + + + + + + + + + + + + + + + 97 98 99 100 101 102 103 104 105 0 + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 + 0 1 2 3 4 5 6 7 8 9 + 0 2 4 6 8 10 12 14 16 18 + 0 3 6 9 12 15 18 21 24 27 + 0 4 8 12 16 20 24 28 32 36 + 0 5 10 15 20 25 30 35 40 45 + 0 6 12 18 24 30 36 42 48 54 + 0 7 14 21 28 35 42 49 56 63 + 0 8 16 24 32 40 48 56 64 72 + 0 9 18 27 36 45 54 63 72 81 + + + + + + diff --git a/tools/testfiles/tname-sp.h5 b/tools/testfiles/tname-sp.h5 new file mode 100644 index 0000000000..f21d79fd51 Binary files /dev/null and b/tools/testfiles/tname-sp.h5 differ diff --git a/tools/testfiles/tname-sp.h5.xml b/tools/testfiles/tname-sp.h5.xml new file mode 100644 index 0000000000..8eb4ae9971 --- /dev/null +++ b/tools/testfiles/tname-sp.h5.xml @@ -0,0 +1,55 @@ +############################# +Expected output for 'h5dump --xml tname-sp.h5' +############################# + + + + + + + + + + + + + + + + + + 97 98 99 100 101 102 103 104 105 0 + + + + + + + + + + + + + + + + + + + 0 0 0 0 0 0 0 0 0 0 + 0 1 2 3 4 5 6 7 8 9 + 0 2 4 6 8 10 12 14 16 18 + 0 3 6 9 12 15 18 21 24 27 + 0 4 8 12 16 20 24 28 32 36 + 0 5 10 15 20 25 30 35 40 45 + 0 6 12 18 24 30 36 42 48 54 + 0 7 14 21 28 35 42 49 56 63 + 0 8 16 24 32 40 48 56 64 72 + 0 9 18 27 36 45 54 63 72 81 + + + + + + diff --git a/tools/testfiles/tnestedcomp.h5.xml b/tools/testfiles/tnestedcomp.h5.xml new file mode 100644 index 0000000000..b6c92d44a7 --- /dev/null +++ b/tools/testfiles/tnestedcomp.h5.xml @@ -0,0 +1,76 @@ +############################# +Expected output for 'h5dump --xml tnestedcomp.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 1 "A" -100 100 1 1 0.5 "B" -100 100 + 2 4 0.333333 "C" -100 100 3 9 0.25 "D" -100 100 + 4 16 0.2 "E" -100 100 5 25 0.166667 "F" -100 100 + 6 36 0.142857 "G" -100 100 7 49 0.125 "H" -100 100 + 8 64 0.111111 "I" -100 100 9 81 0.1 "J" -100 100 + + + + + diff --git a/tools/testfiles/tnodata.h5 b/tools/testfiles/tnodata.h5 new file mode 100644 index 0000000000..baaa3fb077 Binary files /dev/null and b/tools/testfiles/tnodata.h5 differ diff --git a/tools/testfiles/tnodata.h5.xml b/tools/testfiles/tnodata.h5.xml new file mode 100644 index 0000000000..5e8321a232 --- /dev/null +++ b/tools/testfiles/tnodata.h5.xml @@ -0,0 +1,26 @@ +############################# +Expected output for 'h5dump --xml tnodata.h5' +############################# + + + + + + + + + + + + + + + + + + 0 0 0 0 0 + + + + + diff --git a/tools/testfiles/tobjref.h5.xml b/tools/testfiles/tobjref.h5.xml new file mode 100644 index 0000000000..f0b856ef01 --- /dev/null +++ b/tools/testfiles/tobjref.h5.xml @@ -0,0 +1,92 @@ +############################# +Expected output for 'h5dump --xml tobjref.h5' +############################# + + + + + + + + + + + + + + + + + + + + "/Group1/Dataset1" + "/Group1/Dataset2" + "/Group1" + "/Group1/Datatype1" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 3 6 9 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + diff --git a/tools/testfiles/topaque.h5.xml b/tools/testfiles/topaque.h5.xml new file mode 100644 index 0000000000..688f2b87b1 --- /dev/null +++ b/tools/testfiles/topaque.h5.xml @@ -0,0 +1,27 @@ +############################# +Expected output for 'h5dump --xml topaque.h5' +############################# + + + + + + + + + + + + + + + + + + 0x0063016202610360045f055e065d075c085b095a0a590b580c570d560e550f541053115212511350144f154e164d174c184b194a1a491b481c471d461e451f442043214222412340243f253e263d273c283b293a2a392b382c372d362e352f343033313232313330342f352e362d372c382b392a3a293b283c273d263e253f244023412242214320441f451e461d471c481b491a4a194b184c174d164e154f145013511252115310540f550e560d570c580b590a5a095b085c075d065e055f046003610262016300 + 0x3800002c3c000027340001ea04000012000000000008a4640000000000000000000000000000000000000000ef7ec9c000000001effffa84effffa8c0003fc000000000000000000effffa2000012e84effffa2000012e5800000003effffa8400000004effffa8c00000005effffaf0000000000000000000000001effffa84effffa8c0003fc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + + + + + diff --git a/tools/testfiles/tref-escapes-at.h5 b/tools/testfiles/tref-escapes-at.h5 new file mode 100644 index 0000000000..c03c20182c Binary files /dev/null and b/tools/testfiles/tref-escapes-at.h5 differ diff --git a/tools/testfiles/tref-escapes-at.h5.xml b/tools/testfiles/tref-escapes-at.h5.xml new file mode 100644 index 0000000000..03184f3ea9 --- /dev/null +++ b/tools/testfiles/tref-escapes-at.h5.xml @@ -0,0 +1,282 @@ +############################# +Expected output for 'h5dump --xml tref-escapes-at.h5' +############################# + + + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 3 6 9 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "/Group1/Dataset\"quote" + + + + + + + + + + + + + + + + + + + "/Group1/Dataset\\slash" + + + + + + + + + + + + + + + + + + + "/Group1/Dataset&amp" + + + + + + + + + + + + + + + + + + + "/Group1/Dataset<lt" + + + + + + + + + + + + + + + + + + + "/Group1/Dataset>gt" + + + + + + + + + + + + + + + + + + + "/Group1/Dataset'apos" + + + + + + + + + + + + + + + + + + + "/Group1/Dataset space" + + + + + + 0 + + + + + + + diff --git a/tools/testfiles/tref-escapes.h5 b/tools/testfiles/tref-escapes.h5 new file mode 100644 index 0000000000..b9bff90eb2 Binary files /dev/null and b/tools/testfiles/tref-escapes.h5 differ diff --git a/tools/testfiles/tref-escapes.h5.xml b/tools/testfiles/tref-escapes.h5.xml new file mode 100644 index 0000000000..4f471444c8 --- /dev/null +++ b/tools/testfiles/tref-escapes.h5.xml @@ -0,0 +1,157 @@ +############################# +Expected output for 'h5dump --xml tref-escapes.h5' +############################# + + + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 3 6 9 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + + + + + + + + + + + + + + + "/Group1/Dataset\"quote" + "/Group1/Dataset\\slash" + "/Group1/Dataset&amp" + "/Group1/Dataset<lt" + "/Group1/Dataset space" + "/Group1/Dataset'apos" + "/Group1/Dataset>gt" + + + + + + + diff --git a/tools/testfiles/tref.h5 b/tools/testfiles/tref.h5 new file mode 100644 index 0000000000..12453be298 Binary files /dev/null and b/tools/testfiles/tref.h5 differ diff --git a/tools/testfiles/tref.h5.xml b/tools/testfiles/tref.h5.xml new file mode 100644 index 0000000000..26373475ed --- /dev/null +++ b/tools/testfiles/tref.h5.xml @@ -0,0 +1,66 @@ +############################# +Expected output for 'h5dump --xml tref.h5' +############################# + + + + + + + + + + + + + + + + + + + + "/Group1/Dataset1" + "/Group1/Dataset2" + "/Group1" + + + + + + + + + + + + + + + + + + 0 3 6 9 + + + + + + + + + + + + + + + + + 0 0 0 0 + + + + + + diff --git a/tools/testfiles/tsaf.h5.xml b/tools/testfiles/tsaf.h5.xml new file mode 100644 index 0000000000..9b3feef224 --- /dev/null +++ b/tools/testfiles/tsaf.h5.xml @@ -0,0 +1,2602 @@ +############################# +Expected output for 'h5dump --xml tsaf.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + 47 32 67 79 78 84 65 73 78 69 82 10 47 46 97 116 116 114 105 98 117 + 116 101 115 32 67 79 78 84 65 73 78 69 82 10 47 46 97 116 116 114 105 + 98 117 116 101 115 47 100 97 116 97 98 97 115 101 32 67 79 78 84 65 73 + 78 69 82 10 47 46 97 116 116 114 105 98 117 116 101 115 47 100 97 116 + 97 98 97 115 101 47 46 83 65 70 95 68 98 80 114 111 112 115 32 68 65 + 84 65 83 69 84 32 115 116 114 117 99 116 32 83 65 70 95 68 98 80 114 + 111 112 115 123 105 110 116 32 109 97 103 105 99 59 99 104 97 114 32 + 83 70 105 108 101 68 105 114 91 49 48 50 52 93 59 99 104 97 114 32 73 + 109 112 111 114 116 70 105 108 101 91 49 48 50 52 93 59 105 110 116 32 + 112 97 114 97 108 108 101 108 59 115 116 114 117 99 116 32 83 65 70 95 + 86 101 114 115 105 111 110 73 110 102 111 123 105 110 116 32 118 109 + 97 106 111 114 59 105 110 116 32 118 109 105 110 111 114 59 105 110 + 116 32 114 101 108 59 99 104 97 114 32 97 110 110 111 116 91 49 48 93 + 59 125 115 97 102 97 112 105 59 115 116 114 117 99 116 32 83 65 70 95 + 86 101 114 115 105 111 110 73 110 102 111 123 105 110 116 32 118 109 + 97 106 111 114 59 105 110 116 32 118 109 105 110 111 114 59 105 110 + 116 32 114 101 108 59 99 104 97 114 32 97 110 110 111 116 91 49 48 93 + 59 125 115 97 102 108 105 98 59 115 116 114 117 99 116 32 83 65 70 95 + 86 101 114 115 105 111 110 73 110 102 111 123 105 110 116 32 118 109 + 97 106 111 114 59 105 110 116 32 118 109 105 110 111 114 59 105 110 + 116 32 114 101 108 59 99 104 97 114 32 97 110 110 111 116 91 49 48 93 + 59 125 118 98 116 59 115 116 114 117 99 116 32 83 65 70 95 86 101 114 + 115 105 111 110 73 110 102 111 123 105 110 116 32 118 109 97 106 111 + 114 59 105 110 116 32 118 109 105 110 111 114 59 105 110 116 32 114 + 101 108 59 99 104 97 114 32 97 110 110 111 116 91 49 48 93 59 125 100 + 115 108 59 115 116 114 117 99 116 32 83 65 70 95 86 101 114 115 105 + 111 110 73 110 102 111 123 105 110 116 32 118 109 97 106 111 114 59 + 105 110 116 32 118 109 105 110 111 114 59 105 110 116 32 114 101 108 + 59 99 104 97 114 32 97 110 110 111 116 91 49 48 93 59 125 104 100 102 + 53 59 115 116 114 117 99 116 32 83 65 70 95 86 101 114 115 105 111 110 + 73 110 102 111 123 105 110 116 32 118 109 97 106 111 114 59 105 110 + 116 32 118 109 105 110 111 114 59 105 110 116 32 114 101 108 59 99 104 + 97 114 32 97 110 110 111 116 91 49 48 93 59 125 109 112 105 59 105 110 + 116 32 68 111 84 111 99 59 105 110 116 32 82 101 97 100 79 110 108 121 + 59 105 110 116 32 67 108 111 98 98 101 114 59 105 110 116 32 79 83 77 + 111 100 101 115 59 125 59 10 47 115 115 114 101 108 45 95 48 48 48 48 + 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 114 101 108 45 + 95 48 48 48 49 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 + 114 101 108 45 95 48 48 48 50 32 68 65 84 65 83 69 84 32 105 110 116 + 59 10 47 115 115 114 101 108 45 95 48 48 48 51 32 68 65 84 65 83 69 84 + 32 105 110 116 59 10 47 115 115 114 101 108 45 95 48 48 48 52 32 68 65 + 84 65 83 69 84 32 105 110 116 59 10 47 115 115 114 101 108 45 95 48 48 + 48 53 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 114 101 + 108 45 95 48 48 48 54 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 + 115 115 114 101 108 45 95 48 48 48 55 32 68 65 84 65 83 69 84 32 105 + 110 116 59 10 47 115 115 114 101 108 45 95 48 48 48 56 32 68 65 84 65 + 83 69 84 32 105 110 116 59 10 47 115 115 114 101 108 45 95 48 48 48 57 + 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 114 101 108 45 + 95 48 48 49 48 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 + 114 101 108 45 95 48 48 49 49 32 68 65 84 65 83 69 84 32 105 110 116 + 59 10 47 115 115 114 101 108 45 95 48 48 49 50 32 68 65 84 65 83 69 84 + 32 105 110 116 59 10 47 116 111 112 111 114 101 108 45 95 48 48 49 55 + 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 116 111 112 111 114 + 101 108 45 95 48 48 49 56 32 68 65 84 65 83 69 84 32 105 110 116 59 10 + 47 116 111 112 111 114 101 108 45 95 48 48 49 57 32 68 65 84 65 83 69 + 84 32 105 110 116 59 10 47 116 111 112 111 114 101 108 45 95 48 48 50 + 48 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 102 105 101 108 100 + 45 99 111 111 114 100 115 95 48 48 48 50 32 68 65 84 65 83 69 84 32 + 102 108 111 97 116 59 10 47 102 105 101 108 100 45 100 105 115 116 114 + 105 98 117 116 105 111 110 95 102 97 99 116 111 114 115 95 48 48 48 51 + 32 68 65 84 65 83 69 84 32 102 108 111 97 116 59 10 47 102 105 101 108 + 100 45 116 101 109 112 101 114 97 116 117 114 101 95 48 48 48 52 32 68 + 65 84 65 83 69 84 32 102 108 111 97 116 59 10 47 102 105 101 108 100 + 45 100 105 115 112 108 97 99 101 109 101 110 116 115 95 48 48 48 55 32 + 68 65 84 65 83 69 84 32 102 108 111 97 116 59 10 47 102 105 101 108 + 100 45 115 116 114 101 115 115 95 48 48 49 49 32 68 65 84 65 83 69 84 + 32 102 108 111 97 116 59 10 47 102 105 101 108 100 45 116 101 109 112 + 101 114 97 116 117 114 101 95 48 48 49 50 32 68 65 84 65 83 69 84 32 + 102 108 111 97 116 59 10 47 102 105 101 108 100 45 112 114 101 115 115 + 117 114 101 95 48 48 49 51 32 68 65 84 65 83 69 84 32 102 108 111 97 + 116 59 10 47 66 108 111 98 32 68 65 84 65 83 69 84 32 115 116 114 117 + 99 116 32 66 108 111 98 123 68 83 76 95 79 102 102 115 101 116 32 102 + 105 108 101 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 100 97 + 116 97 115 101 116 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 + 111 102 102 115 101 116 59 68 83 76 95 79 102 102 115 101 116 32 115 + 116 114 105 100 101 59 68 83 76 95 79 102 102 115 101 116 32 99 111 + 117 110 116 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 101 95 + 105 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 114 + 101 99 115 59 125 59 10 47 73 110 100 101 120 83 112 101 99 32 68 65 + 84 65 83 69 84 32 115 116 114 117 99 116 32 73 110 100 101 120 83 112 + 101 99 123 105 110 116 32 110 100 105 109 115 59 105 110 116 32 111 + 114 105 103 105 110 115 91 56 93 59 105 110 116 32 115 105 122 101 115 + 91 56 93 59 105 110 116 32 111 114 100 101 114 91 56 93 59 101 110 117 + 109 32 73 110 100 101 120 84 121 112 101 123 86 66 84 95 73 78 68 69 + 88 95 84 89 80 69 95 67 95 79 82 68 69 82 61 48 44 86 66 84 95 73 78 + 68 69 88 95 84 89 80 69 95 70 95 79 82 68 69 82 61 49 44 86 66 84 95 + 73 78 68 69 88 95 84 89 80 69 95 65 78 89 61 45 49 44 86 66 84 95 73 + 78 68 69 88 95 84 89 80 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 + 84 95 73 78 68 69 88 95 84 89 80 69 95 78 65 61 45 51 44 86 66 84 95 + 73 78 68 69 88 95 84 89 80 69 95 85 78 75 78 79 87 78 61 45 52 125 105 + 110 100 101 120 95 116 121 112 101 59 68 83 76 95 79 102 102 115 101 + 116 32 98 97 115 101 95 105 100 59 68 83 76 95 79 102 102 115 101 116 + 32 110 117 109 95 114 101 99 115 59 125 59 10 47 67 97 116 32 68 65 84 + 65 83 69 84 32 115 116 114 117 99 116 32 67 97 116 123 99 104 97 114 + 32 110 97 109 101 91 54 52 93 59 101 110 117 109 32 82 111 108 101 123 + 86 66 84 95 82 79 76 69 95 84 79 80 79 61 48 44 86 66 84 95 82 79 76 + 69 95 66 78 68 61 49 44 86 66 84 95 82 79 76 69 95 80 82 79 67 61 50 + 44 86 66 84 95 82 79 76 69 95 68 79 77 78 61 51 44 86 66 84 95 82 79 + 76 69 95 66 76 79 67 75 61 52 44 86 66 84 95 82 79 76 69 95 65 83 83 + 89 61 53 44 86 66 84 95 82 79 76 69 95 77 65 84 61 54 44 86 66 84 95 + 82 79 76 69 95 88 80 82 79 68 61 55 44 86 66 84 95 82 79 76 69 95 85 + 83 69 82 68 61 56 44 86 66 84 95 82 79 76 69 95 65 78 89 61 45 49 44 + 86 66 84 95 82 79 76 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 + 95 82 79 76 69 95 78 65 61 45 51 44 86 66 84 95 82 79 76 69 95 85 78 + 75 78 79 87 78 61 45 52 125 114 111 108 101 59 105 110 116 32 116 100 + 105 109 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 101 95 105 + 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 114 101 99 + 115 59 125 59 10 47 83 101 116 32 68 65 84 65 83 69 84 32 115 116 114 + 117 99 116 32 83 101 116 123 105 110 116 32 117 115 101 114 95 105 100 + 59 99 104 97 114 32 110 97 109 101 91 54 52 93 59 105 110 116 32 116 + 100 105 109 59 101 110 117 109 32 83 105 108 82 111 108 101 123 86 66 + 84 95 83 82 79 76 69 95 84 73 77 69 61 48 44 86 66 84 95 83 82 79 76 + 69 95 83 80 65 67 69 61 49 44 86 66 84 95 83 82 79 76 69 95 83 84 65 + 84 69 61 50 44 86 66 84 95 83 82 79 76 69 95 80 65 82 65 77 61 51 44 + 86 66 84 95 83 82 79 76 69 95 67 84 89 80 69 61 52 44 86 66 84 95 83 + 82 79 76 69 95 65 84 89 80 69 61 53 44 86 66 84 95 83 82 79 76 69 95 + 85 83 69 82 68 61 54 44 86 66 84 95 83 82 79 76 69 95 65 78 89 61 45 + 49 44 86 66 84 95 83 82 79 76 69 95 73 78 86 65 76 73 68 61 45 50 44 + 86 66 84 95 83 82 79 76 69 95 78 65 61 45 51 44 86 66 84 95 83 82 79 + 76 69 95 85 78 75 78 79 87 78 61 45 52 125 115 114 111 108 101 59 68 + 83 76 95 79 102 102 115 101 116 32 99 111 108 108 95 105 100 115 91 49 + 54 93 59 105 110 116 32 105 115 95 116 111 112 59 105 110 116 32 105 + 115 95 101 120 116 101 110 100 105 98 108 101 59 68 83 76 95 79 102 + 102 115 101 116 32 100 102 108 116 95 99 111 111 114 100 102 108 100 + 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 98 110 100 95 115 + 101 116 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 + 101 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 + 114 101 99 115 59 125 59 10 47 67 111 108 108 101 99 116 105 111 110 + 32 68 65 84 65 83 69 84 32 115 116 114 117 99 116 32 67 111 108 108 + 101 99 116 105 111 110 123 68 83 76 95 79 102 102 115 101 116 32 99 + 111 110 116 97 105 110 105 110 103 95 115 101 116 95 105 100 59 68 83 + 76 95 79 102 102 115 101 116 32 99 97 116 95 105 100 59 101 110 117 + 109 32 67 101 108 108 84 121 112 101 123 86 66 84 95 67 69 76 76 95 84 + 89 80 69 95 78 79 78 69 61 48 44 86 66 84 95 67 69 76 76 95 84 89 80 + 69 95 80 79 73 78 84 61 49 44 86 66 84 95 67 69 76 76 95 84 89 80 69 + 95 76 73 78 69 61 50 44 86 66 84 95 67 69 76 76 95 84 89 80 69 95 84 + 82 73 61 51 44 86 66 84 95 67 69 76 76 95 84 89 80 69 95 81 85 65 68 + 61 52 44 86 66 84 95 67 69 76 76 95 84 89 80 69 95 84 69 84 61 53 44 + 86 66 84 95 67 69 76 76 95 84 89 80 69 95 80 89 82 65 77 73 68 61 54 + 44 86 66 84 95 67 69 76 76 95 84 89 80 69 95 80 82 73 83 77 61 55 44 + 86 66 84 95 67 69 76 76 95 84 89 80 69 95 72 69 88 61 56 44 86 66 84 + 95 67 69 76 76 95 84 89 80 69 95 77 73 88 69 68 61 57 44 86 66 84 95 + 67 69 76 76 95 84 89 80 69 95 65 82 66 61 49 48 44 86 66 84 95 67 69 + 76 76 95 84 89 80 69 95 49 66 65 76 76 61 49 49 44 86 66 84 95 67 69 + 76 76 95 84 89 80 69 95 50 66 65 76 76 61 49 50 44 86 66 84 95 67 69 + 76 76 95 84 89 80 69 95 51 66 65 76 76 61 49 51 44 86 66 84 95 67 69 + 76 76 95 84 89 80 69 95 49 83 72 69 76 76 61 49 52 44 86 66 84 95 67 + 69 76 76 95 84 89 80 69 95 50 83 72 69 76 76 61 49 53 44 86 66 84 95 + 67 69 76 76 95 84 89 80 69 95 65 78 89 61 45 49 44 86 66 84 95 67 69 + 76 76 95 84 89 80 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 + 67 69 76 76 95 84 89 80 69 95 78 65 61 45 51 44 86 66 84 95 67 69 76 + 76 95 84 89 80 69 95 85 78 75 78 79 87 78 61 45 52 125 99 101 108 108 + 95 116 121 112 101 59 105 110 116 32 99 111 117 110 116 59 68 83 76 95 + 79 102 102 115 101 116 32 105 110 100 101 120 105 110 103 95 105 100 + 59 105 110 116 32 105 115 95 100 101 99 111 109 112 59 68 83 76 95 79 + 102 102 115 101 116 32 109 101 109 98 101 114 115 95 98 108 111 98 95 + 105 100 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 101 95 105 + 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 114 101 99 + 115 59 125 59 10 47 82 101 108 97 116 105 111 110 32 68 65 84 65 83 69 + 84 32 115 116 114 117 99 116 32 82 101 108 97 116 105 111 110 123 68 + 83 76 95 79 102 102 115 101 116 32 115 117 98 95 105 100 59 68 83 76 + 95 79 102 102 115 101 116 32 115 117 98 95 99 97 116 95 105 100 59 68 + 83 76 95 79 102 102 115 101 116 32 115 117 98 95 100 101 99 111 109 + 112 95 99 97 116 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 + 115 117 112 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 115 + 117 112 95 99 97 116 95 105 100 59 68 83 76 95 79 102 102 115 101 116 + 32 115 117 112 95 100 101 99 111 109 112 95 99 97 116 95 105 100 59 + 101 110 117 109 32 82 101 108 75 105 110 100 123 86 66 84 95 82 69 76 + 75 73 78 68 95 83 85 66 83 69 84 61 48 44 86 66 84 95 82 69 76 75 73 + 78 68 95 83 85 80 83 69 84 61 49 44 86 66 84 95 82 69 76 75 73 78 68 + 95 66 79 85 78 68 61 50 44 86 66 84 95 82 69 76 75 73 78 68 95 80 69 + 82 77 85 84 69 61 51 44 86 66 84 95 82 69 76 75 73 78 68 95 78 69 73 + 71 72 66 79 82 61 52 44 86 66 84 95 82 69 76 75 73 78 68 95 67 79 80 + 89 61 53 44 86 66 84 95 82 69 76 75 73 78 68 95 69 81 85 65 76 61 54 + 44 86 66 84 95 82 69 76 75 73 78 68 95 65 78 89 61 45 49 44 86 66 84 + 95 82 69 76 75 73 78 68 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 + 95 82 69 76 75 73 78 68 95 78 65 61 45 51 44 86 66 84 95 82 69 76 75 + 73 78 68 95 85 78 75 78 79 87 78 61 45 52 125 107 105 110 100 59 101 + 110 117 109 32 82 101 108 82 101 112 123 86 66 84 95 82 69 76 82 69 80 + 95 73 68 69 78 84 73 84 89 61 48 44 86 66 84 95 82 69 76 82 69 80 95 + 72 76 73 83 84 61 49 44 86 66 84 95 82 69 76 82 69 80 95 84 76 73 83 + 84 61 50 44 86 66 84 95 82 69 76 82 69 80 95 84 76 73 83 84 95 49 61 + 51 44 86 66 84 95 82 69 76 82 69 80 95 69 76 73 83 84 61 52 44 86 66 + 84 95 82 69 76 82 69 80 95 83 84 82 85 67 84 85 82 69 68 61 53 44 86 + 66 84 95 82 69 76 82 69 80 95 85 78 83 84 82 85 67 84 85 82 69 68 61 + 54 44 86 66 84 95 82 69 76 82 69 80 95 65 82 66 73 84 82 65 82 89 95 + 82 61 55 44 86 66 84 95 82 69 76 82 69 80 95 65 82 66 73 84 82 65 82 + 89 95 68 82 61 56 44 86 66 84 95 82 69 76 82 69 80 95 65 78 89 61 45 + 49 44 86 66 84 95 82 69 76 82 69 80 95 73 78 86 65 76 73 68 61 45 50 + 44 86 66 84 95 82 69 76 82 69 80 95 78 65 61 45 51 44 86 66 84 95 82 + 69 76 82 69 80 95 85 78 75 78 79 87 78 61 45 52 125 114 101 112 95 116 + 121 112 101 59 68 83 76 95 79 102 102 115 101 116 32 100 95 98 108 111 + 98 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 114 95 98 108 + 111 98 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 + 101 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 + 114 101 99 115 59 125 59 10 47 70 105 101 108 100 84 109 112 108 32 68 + 65 84 65 83 69 84 32 115 116 114 117 99 116 32 70 105 101 108 100 84 + 109 112 108 123 99 104 97 114 32 110 97 109 101 91 54 52 93 59 68 83 + 76 95 79 102 102 115 101 116 32 98 97 115 101 95 115 112 97 99 101 95 + 105 100 59 101 110 117 109 32 65 108 103 101 98 114 97 105 99 84 121 + 112 101 123 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 + 67 79 78 83 84 65 78 84 61 48 44 86 66 84 95 65 76 71 69 66 82 65 73 + 67 95 84 89 80 69 95 67 79 77 80 79 78 69 78 84 61 49 44 86 66 84 95 + 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 83 67 65 76 65 82 61 50 + 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 86 69 67 + 84 79 82 61 51 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 + 69 95 84 69 78 83 79 82 61 52 44 86 66 84 95 65 76 71 69 66 82 65 73 + 67 95 84 89 80 69 95 83 89 77 95 84 69 78 83 79 82 61 53 44 86 66 84 + 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 70 73 69 76 68 61 54 + 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 83 84 65 + 84 69 61 55 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 + 95 84 85 80 76 69 61 56 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 + 84 89 80 69 95 65 78 89 61 45 49 44 86 66 84 95 65 76 71 69 66 82 65 + 73 67 95 84 89 80 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 + 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 78 65 61 45 51 44 86 66 + 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 85 78 75 78 79 87 + 78 61 45 52 125 97 108 103 95 116 121 112 101 59 101 110 117 109 32 66 + 97 115 105 115 84 121 112 101 123 86 66 84 95 66 65 83 73 83 95 84 89 + 80 69 95 85 78 73 84 89 61 48 44 86 66 84 95 66 65 83 73 83 95 84 89 + 80 69 95 67 65 82 84 69 83 73 65 78 61 49 44 86 66 84 95 66 65 83 73 + 83 95 84 89 80 69 95 83 80 72 69 82 73 67 65 76 61 50 44 86 66 84 95 + 66 65 83 73 83 95 84 89 80 69 95 67 89 76 73 78 68 82 73 67 65 76 61 + 51 44 86 66 84 95 66 65 83 73 83 95 84 89 80 69 95 85 80 80 69 82 95 + 84 82 73 61 52 44 86 66 84 95 66 65 83 73 83 95 84 89 80 69 95 70 79 + 85 82 73 69 82 61 53 44 86 66 84 95 66 65 83 73 83 95 84 89 80 69 95 + 86 65 82 73 65 66 76 69 61 54 44 86 66 84 95 66 65 83 73 83 95 84 89 + 80 69 95 65 78 89 61 45 49 44 86 66 84 95 66 65 83 73 83 95 84 89 80 + 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 66 65 83 73 83 95 + 84 89 80 69 95 78 65 61 45 51 44 86 66 84 95 66 65 83 73 83 95 84 89 + 80 69 95 85 78 75 78 79 87 78 61 45 52 125 98 97 115 105 115 59 68 83 + 76 95 79 102 102 115 101 116 32 113 117 97 110 116 105 116 121 95 105 + 100 59 105 110 116 32 110 117 109 95 99 111 109 112 115 59 68 83 76 95 + 79 102 102 115 101 116 32 102 116 109 112 108 95 105 100 115 95 98 108 + 111 98 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 + 101 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 + 114 101 99 115 59 125 59 10 47 70 105 101 108 100 32 68 65 84 65 83 69 + 84 32 115 116 114 117 99 116 32 70 105 101 108 100 123 68 83 76 95 79 + 102 102 115 101 116 32 102 116 109 112 108 95 105 100 59 99 104 97 114 + 32 110 97 109 101 91 54 52 93 59 68 83 76 95 79 102 102 115 101 116 32 + 117 110 105 116 115 95 105 100 59 68 83 76 95 79 102 102 115 101 116 + 32 115 116 111 114 97 103 101 95 100 101 99 111 109 112 95 99 97 116 + 95 105 100 59 101 110 117 109 32 73 110 116 101 114 108 101 97 118 101 + 123 86 66 84 95 73 78 84 69 82 76 69 65 86 69 95 67 79 77 80 79 78 69 + 78 84 61 48 44 86 66 84 95 73 78 84 69 82 76 69 65 86 69 95 86 69 67 + 84 79 82 61 49 44 86 66 84 95 73 78 84 69 82 76 69 65 86 69 95 73 78 + 68 69 80 69 78 68 69 78 84 61 50 44 86 66 84 95 73 78 84 69 82 76 69 + 65 86 69 95 78 79 78 69 61 51 44 86 66 84 95 73 78 84 69 82 76 69 65 + 86 69 95 65 78 89 61 45 49 44 86 66 84 95 73 78 84 69 82 76 69 65 86 + 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 73 78 84 69 82 76 + 69 65 86 69 95 78 65 61 45 51 44 86 66 84 95 73 78 84 69 82 76 69 65 + 86 69 95 85 78 75 78 79 87 78 61 45 52 125 99 111 109 112 95 105 110 + 116 108 118 59 68 83 76 95 79 102 102 115 101 116 32 105 110 100 101 + 120 105 110 103 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 + 100 111 102 95 97 115 115 111 99 95 99 97 116 95 105 100 59 105 110 + 116 32 97 115 115 111 99 95 114 97 116 105 111 59 68 83 76 95 79 102 + 102 115 101 116 32 101 118 97 108 95 100 101 99 111 109 112 95 99 97 + 116 95 105 100 59 101 110 117 109 32 69 118 97 108 70 117 110 99 123 + 86 66 84 95 69 86 65 76 95 70 85 78 67 95 67 79 78 83 84 65 78 84 61 + 48 44 86 66 84 95 69 86 65 76 95 70 85 78 67 95 85 78 73 70 79 82 77 + 61 49 44 86 66 84 95 69 86 65 76 95 70 85 78 67 95 80 87 67 79 78 83 + 84 61 50 44 86 66 84 95 69 86 65 76 95 70 85 78 67 95 80 87 76 73 78 + 69 65 82 61 51 44 86 66 84 95 69 86 65 76 95 70 85 78 67 95 65 78 89 + 61 45 49 44 86 66 84 95 69 86 65 76 95 70 85 78 67 95 73 78 86 65 76 + 73 68 61 45 50 44 86 66 84 95 69 86 65 76 95 70 85 78 67 95 78 65 61 + 45 51 44 86 66 84 95 69 86 65 76 95 70 85 78 67 95 85 78 75 78 79 87 + 78 61 45 52 125 101 118 97 108 95 102 117 110 99 59 105 110 116 32 105 + 115 95 104 111 109 111 103 101 110 101 111 117 115 59 105 110 116 32 + 105 115 95 99 111 111 114 100 95 102 105 101 108 100 59 68 83 76 95 79 + 102 102 115 101 116 32 99 111 109 112 95 105 100 115 95 98 108 111 98 + 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 99 111 109 112 95 + 111 114 100 101 114 95 98 108 111 98 95 105 100 59 68 83 76 95 79 102 + 102 115 101 116 32 118 98 97 115 105 115 95 98 108 111 98 95 105 100 + 59 68 83 76 95 79 102 102 115 101 116 32 100 111 102 95 98 108 111 98 + 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 101 95 + 105 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 114 + 101 99 115 59 125 59 10 47 109 101 116 97 98 108 111 98 48 48 48 48 48 + 46 105 110 100 101 120 32 68 65 84 65 83 69 84 32 115 116 114 117 99 + 116 32 73 110 100 101 120 80 97 105 114 123 68 83 76 95 79 102 102 115 + 101 116 32 105 110 100 101 120 59 105 110 116 32 108 101 110 103 116 + 104 59 125 59 10 47 109 101 116 97 98 108 111 98 48 48 48 48 48 46 98 + 108 111 98 32 68 65 84 65 83 69 84 32 68 83 76 95 79 102 102 115 101 + 116 59 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1 1 0 1 9 0 1 -1 2 0 1 4 1 1 -1 3 0 1 7 2 1 -1 4 0 1 4 3 1 + -1 5 0 1 5 4 1 -1 6 0 1 3 5 1 -1 7 0 1 4 6 1 -1 8 0 1 1 7 1 + -1 9 0 1 10 8 1 -1 10 0 1 4 9 1 -1 11 0 1 3 10 1 -1 12 0 1 5 11 1 + -1 13 0 1 5 12 1 -1 14 0 1 16 13 1 -1 15 0 1 9 14 1 -1 16 0 1 4 15 1 + -1 17 0 1 16 16 1 -1 18 0 1 36 17 1 -1 19 0 1 5 18 1 -1 20 0 1 5 19 1 + -1 21 0 1 36 20 1 -1 22 0 1 12 21 1 -1 23 0 1 7 22 1 -1 24 0 1 2 23 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TOPO + + + 0 + + + BND + + + 1 + + + PROC + + + 2 + + + DOMN + + + 3 + + + BLOCK + + + 4 + + + ASSY + + + 5 + + + MAT + + + 6 + + + XPROD + + + 7 + + + USERD + + + 8 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "nodes" TOPO 0 0 1 "elems" TOPO 2 1 1 "edges" USERD 1 2 1 + "blocks" BLOCK 2 3 1 "side_sets" USERD 1 4 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NONE + + + 0 + + + POINT + + + 1 + + + LINE + + + 2 + + + TRI + + + 3 + + + QUAD + + + 4 + + + TET + + + 5 + + + PYRAMID + + + 6 + + + PRISM + + + 7 + + + HEX + + + 8 + + + MIXED + + + 9 + + + ARB + + + 10 + + + 1BALL + + + 11 + + + 2BALL + + + 12 + + + 3BALL + + + 13 + + + 1SHELL + + + 14 + + + 2SHELL + + + 15 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 POINT 18 0 0 -2 0 1 0 1 MIXED 12 1 1 -2 1 1 0 3 NONE 4 2 1 0 2 1 + 0 4 NONE 2 3 0 1 3 1 1 0 POINT 9 4 0 -2 4 1 1 1 QUAD 4 5 1 -2 5 1 + 1 3 NONE 1 6 1 2 6 1 2 0 POINT 7 7 0 -2 7 1 2 1 MIXED 4 8 1 -2 8 1 + 2 3 NONE 2 9 1 3 9 1 3 0 POINT 10 10 0 -2 10 1 3 1 QUAD 4 11 1 -2 11 1 + 3 3 NONE 1 12 1 4 12 1 4 0 POINT 3 13 0 -2 13 1 + 4 2 LINE 2 14 1 -2 14 1 5 0 POINT 5 15 0 -2 15 1 + 5 2 LINE 4 16 1 -2 16 1 6 0 POINT 5 17 1 -2 17 1 + 7 0 POINT 5 18 0 -2 18 1 7 1 TRI 3 19 1 -2 19 1 7 3 NONE 1 20 1 5 20 1 + 8 0 POINT 4 21 0 -2 21 1 8 1 QUAD 1 22 1 -2 22 1 8 3 NONE 1 23 1 6 23 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + COMPONENT + + + 0 + + + VECTOR + + + 1 + + + INDEPENDENT + + + 2 + + + NONE + + + 3 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CONSTANT + + + 0 + + + UNIFORM + + + 1 + + + PWCONST + + + 2 + + + PWLINEAR + + + 3 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 "X" -7 -2 NONE -2 0 1 0 PWLINEAR 1 0 -2 -2 -2 -2 0 1 + 1 "Y" -7 -2 NONE -2 0 1 0 PWLINEAR 1 0 -2 -2 -2 -2 1 1 + 0 "coords" -7 -2 VECTOR -2 0 1 0 PWLINEAR 1 1 7 -2 -2 17 2 1 + 2 "distribution factors" -5 -2 NONE -2 0 1 0 PWLINEAR 1 0 -2 -2 -2 18 3 1 + 3 "temperature" -7 -2 NONE -2 0 1 0 PWLINEAR 1 0 -2 -2 -2 19 4 1 + 1 "dX" -7 -2 NONE -2 0 1 0 PWLINEAR 1 0 -2 -2 -2 -2 5 1 + 1 "dY" -7 -2 NONE -2 0 1 0 PWLINEAR 1 0 -2 -2 -2 -2 6 1 + 0 "displacements" -7 -2 VECTOR -2 0 1 0 PWLINEAR 1 0 8 -2 -2 20 7 1 + 5 "Sx" -7 -2 NONE -2 1 1 1 PWCONST 1 0 -2 -2 -2 -2 8 1 + 5 "Sy" -7 -2 NONE -2 1 1 1 PWCONST 1 0 -2 -2 -2 -2 9 1 + 5 "Sxy" -7 -2 NONE -2 1 1 1 PWCONST 1 0 -2 -2 -2 -2 10 1 + 4 "stress" -7 -2 VECTOR -2 1 1 1 PWCONST 1 0 9 -2 -2 21 11 1 + 6 "temperature" -7 -2 NONE -2 0 1 0 PWLINEAR 1 0 -2 -2 -2 22 12 1 + 7 "pressure" -7 -2 NONE -2 2 1 2 PWCONST 1 0 -2 -2 -2 23 13 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CONSTANT + + + 0 + + + COMPONENT + + + 1 + + + SCALAR + + + 2 + + + VECTOR + + + 3 + + + TENSOR + + + 4 + + + SYM_TENSOR + + + 5 + + + FIELD + + + 6 + + + STATE + + + 7 + + + TUPLE + + + 8 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + UNITY + + + 0 + + + CARTESIAN + + + 1 + + + SPHERICAL + + + 2 + + + CYLINDRICAL + + + 3 + + + UPPER_TRI + + + 4 + + + FOURIER + + + 5 + + + VARIABLE + + + 6 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "coordinate_tmpl" 0 VECTOR CARTESIAN 2 2 0 0 1 + "coordinate_tmpl_component" 0 SCALAR CARTESIAN 2 1 0 1 1 + "distrib_factors_tmpl" 5 SCALAR UNITY -5 1 0 2 1 + "temp_on_ns1_tmpl" 6 SCALAR UNITY 0 1 0 3 1 + "stress_on_cell_1_tmpl" 1 SYM_TENSOR UPPER_TRI 0 3 0 4 1 + "stress_on_cell_1_tmpl_component" 1 SCALAR UPPER_TRI 0 1 0 5 1 + "temp_on_cell_2_tmpl" 2 SCALAR UNITY 1 1 0 6 1 + "pressure_on_ss1" 4 SCALAR UNITY 0 1 0 7 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C_ORDER + + + 0 + + + F_ORDER + + + 1 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + + + + + + + + + + + + + + + 1 0 0 0 0 0 0 0 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 0 1 + 1 0 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 1 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 2 1 + 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 3 1 + 1 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 4 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 5 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 6 1 + 1 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 7 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 8 1 + 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 9 1 + 1 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 10 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 11 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 12 1 + 1 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 13 1 + 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 14 1 + 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 15 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 16 1 + 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 17 1 + 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 18 1 + 1 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 19 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 20 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 21 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 22 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 23 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SUBSET + + + 0 + + + SUPSET + + + 1 + + + BOUND + + + 2 + + + PERMUTE + + + 3 + + + NEIGHBOR + + + 4 + + + COPY + + + 5 + + + EQUAL + + + 6 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + IDENTITY + + + 0 + + + HLIST + + + 1 + + + TLIST + + + 2 + + + TLIST_1 + + + 3 + + + ELIST + + + 4 + + + STRUCTURED + + + 5 + + + UNSTRUCTURED + + + 6 + + + ARBITRARY_R + + + 7 + + + ARBITRARY_DR + + + 8 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 0 -2 0 0 -2 EQUAL TLIST -2 0 0 1 1 1 -2 0 1 -2 EQUAL TLIST -2 1 1 1 + 2 0 -2 0 0 -2 EQUAL TLIST -2 2 2 1 2 1 -2 0 1 -2 EQUAL TLIST -2 3 3 1 + 7 0 -2 0 0 -2 EQUAL TLIST -2 4 4 1 7 1 -2 0 1 -2 EQUAL TLIST -2 5 5 1 + 8 0 -2 0 0 -2 EQUAL TLIST -2 6 6 1 8 1 -2 0 1 -2 EQUAL TLIST -2 7 7 1 + 3 0 -2 0 0 -2 EQUAL TLIST -2 8 8 1 3 1 -2 0 1 -2 EQUAL TLIST -2 9 9 1 + 4 0 -2 0 0 -2 EQUAL TLIST -2 10 10 1 + 5 0 -2 0 0 -2 EQUAL TLIST -2 11 11 1 + 6 0 -2 0 0 -2 EQUAL TLIST -2 12 12 1 + 1 3 -2 0 3 -2 EQUAL TLIST -2 -2 13 1 + 7 3 -2 0 3 -2 EQUAL TLIST -2 -2 14 1 + 8 3 -2 0 3 -2 EQUAL TLIST -2 -2 15 1 + 3 3 -2 0 3 -2 EQUAL TLIST -2 -2 16 1 + 1 1 -2 0 0 -2 SUBSET UNSTRUCTURED -2 13 17 1 + 7 1 -2 0 0 -2 SUBSET UNSTRUCTURED -2 14 18 1 + 8 1 -2 0 0 -2 SUBSET UNSTRUCTURED -2 15 19 1 + 3 1 -2 0 0 -2 SUBSET UNSTRUCTURED -2 16 20 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TIME + + + 0 + + + SPACE + + + 1 + + + STATE + + + 2 + + + PARAM + + + 3 + + + CTYPE + + + 4 + + + ATYPE + + + 5 + + + USERD + + + 6 + + + ANY + + + -1 + + + INVALID + + + -2 + + + NA + + + -3 + + + UNKNOWN + + + -4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 "TOP_CELL" 2 SPACE 0 1 -2 2 3 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 1 0 -2 -2 0 1 + 0 "CELL_1" 2 SPACE 4 5 -2 6 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 1 1 + 0 "CELL_2" 2 SPACE 7 8 -2 9 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 2 1 + 0 "CELL_3" 2 SPACE 10 11 -2 12 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 3 1 + 0 "SIDE_SET_1" 1 SPACE 13 -2 14 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 4 1 + 0 "SIDE_SET_2" 1 SPACE 15 -2 16 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 5 1 + 0 "NODE_SET_1" 0 SPACE 17 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 6 1 + 0 "CELL_2_TRIS" 2 SPACE 18 19 -2 20 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 7 1 + 0 "CELL_2_QUADS" 2 SPACE 21 22 -2 23 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 8 1 + + + + + + + + + + + + + + + + + 0 4 1 4 2 4 2.5 4 0 3 1 3 2 3 2.5 3 0 2 1 2 2 2 2.5 2 0 1 2 1 2.5 1 0 + 0 2 0 2.5 0 + + + + + + + + + + + + + + + + + 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 + 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 + 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 + + + + + + + + + + + + + + + + + 4 3 2 1 0 + + + + + + + + + + + + + + + + + 45 55 + + + + + + + + + + + + + + + + + 0.5 0.25 0.5 0.5 0.25 0.5 0.5 0.25 0.5 0.5 0.25 0.5 + + + + + + + + + + + + + + + + + 100 150 150 100 75 + + + + + + + + + + + + + + + + + 75 95 120 80 115 85 110 + + + + + + + + + + + + + + + + + + + + + + 1 7 8 3 -2 -2 -2 -2 -2 -2 -2 -2 0 1 5 6 8 9 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 4 4 2 6 1 7 2 9 1 10 1 11 1 12 2 14 2 16 3 + + + + + + + + + + + + + + + + + 1 2 3 5 6 7 9 10 11 + + + + + + + + + + + + + + + + + 1 2 4 5 + + + + + + + + + + + + + + + + + 9 10 11 13 14 16 17 + + + + + + + + + + + + + + + + + 7 8 9 11 + + + + + + + + + + + + + + + + + 9 10 11 13 14 + + + + + + + + + + + + + + + + + 7 8 9 + + + + + + + + + + + + + + + + + 13 14 16 17 + + + + + + + + + + + + + + + + + 11 + + + + + + + + + + + + + + + + + 3 4 7 8 11 12 14 15 17 18 + + + + + + + + + + + + + + + + + 3 6 10 12 + + + + + + + + + + + + + + + + + 9 10 11 + + + + + + + + + + + + + + + + + 1 5 9 13 16 + + + + + + + + + + + + + + + + + 4 8 12 15 18 + + + + + + + + + + + + + + + + + 1 2 6 5 2 3 7 6 5 6 10 9 6 7 11 10 + + + + + + + + + + + + + + + + + 9 10 13 10 14 13 10 11 14 + + + + + + + + + + + + + + + + + 13 14 17 16 + + + + + + + + + + + + + + + + + 3 4 8 7 7 8 12 11 11 12 15 14 14 15 18 17 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -604320037 "." "don't import" 1 0 0 0 "none" 0 1 0 "devel" 1 3 0 "" 0 0 0 "none" 1 2 1 "" 1 2 0 "" 1 0 1 0 + + + + + + + diff --git a/tools/testfiles/tslink.h5.xml b/tools/testfiles/tslink.h5.xml new file mode 100644 index 0000000000..5b2d4a58b4 --- /dev/null +++ b/tools/testfiles/tslink.h5.xml @@ -0,0 +1,11 @@ +############################# +Expected output for 'h5dump --xml tslink.h5' +############################# + + + + + + + + diff --git a/tools/testfiles/tstr.h5.xml b/tools/testfiles/tstr.h5.xml new file mode 100644 index 0000000000..b31aacc267 --- /dev/null +++ b/tools/testfiles/tstr.h5.xml @@ -0,0 +1,359 @@ +############################# +Expected output for 'h5dump --xml tstr.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 1 4 9 16 25 36 49 64 81 + 1 4 9 16 25 36 49 64 81 100 + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 1 4 9 16 25 36 49 64 81 100 + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 + 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 + 121 144 169 196 225 256 289 324 361 400 + 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 0 1 4 9 16 25 36 49 64 81 + 1 4 9 16 25 36 49 64 81 100 + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 1 4 9 16 25 36 49 64 81 100 + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 + 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 + 121 144 169 196 225 256 289 324 361 400 + 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 0 1 4 9 16 25 36 49 64 81 + 1 4 9 16 25 36 49 64 81 100 + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 1 4 9 16 25 36 49 64 81 100 + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 4 9 16 25 36 49 64 81 100 121 + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 9 16 25 36 49 64 81 100 121 144 + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 16 25 36 49 64 81 100 121 144 169 + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 + 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 25 36 49 64 81 100 121 144 169 196 + 36 49 64 81 100 121 144 169 196 225 + 49 64 81 100 121 144 169 196 225 256 + 64 81 100 121 144 169 196 225 256 289 + 81 100 121 144 169 196 225 256 289 324 + 100 121 144 169 196 225 256 289 324 361 + 121 144 169 196 225 256 289 324 361 400 + 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + + + + + + + + + + + + + + + + + + "s1" + "s2" + "s3" + "s4" + "s5" + "s6" + "s7" + "s8" + "s9" + "s0" + "s1" + "s2" + + + + + + + + + + + + + + + + + "ab cd ef1 " + "ab cd ef2 " + "ab cd ef3 " + "ab cd ef4 " + "ab cd ef5 " + "ab cd ef6 " + "ab cd ef7 " + "ab cd ef8 " + "ab cd ef9 " + "ab cd ef0 " + "ab cd ef1 " + "ab cd ef2 " + "ab cd ef3 " + "ab cd ef4 " + "ab cd ef5 " + "ab cd ef6 " + "ab cd ef7 " + "ab cd ef8 " + "ab cd ef9 " + "ab cd ef0 " + + + + + + + + + + + + + + + + + "abcd0" + "abcd1" + "abcd2" + "abcd3" + "abcd4" + "abcd5" + "abcd6" + "abcd7" + "abcd8" + "abcd9" + "abcd0" + "abcd1" + "abcd2" + "abcd3" + "abcd4" + "abcd5" + "abcd6" + "abcd7" + "abcd8" + "abcd9" + "abcd0" + "abcd1" + "abcd2" + "abcd3" + "abcd4" + "abcd5" + "abcd6" + + + + + + + + + + + + + + + + + "s1234567890123456789 " + "s1234567890123456789 " + "s1234567890123456789 " + + + + + diff --git a/tools/testfiles/tstr2.h5.xml b/tools/testfiles/tstr2.h5.xml new file mode 100644 index 0000000000..046cfbab62 --- /dev/null +++ b/tools/testfiles/tstr2.h5.xml @@ -0,0 +1,196 @@ +############################# +Expected output for 'h5dump --xml tstr2.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "0123456789" + "abcdefghij" + "ABCDEFGHIJ" + + + + + + "This is row 0 of type H5T_STR_NULLTERM of" + "This is row 1 of type H5T_STR_NULLTERM of" + "This is row 2 of type H5T_STR_NULLTERM of" + "This is row 3 of type H5T_STR_NULLTERM of" + "This is row 4 of type H5T_STR_NULLTERM of" + "This is row 5 of type H5T_STR_NULLTERM of" + "This is row 6 of type H5T_STR_NULLTERM of" + "This is row 7 of type H5T_STR_NULLTERM of" + "This is row 8 of type H5T_STR_NULLTERM of" + "This is row 9 of type H5T_STR_NULLTERM of" + + + + + + + + + + + + + + + + + + + "This is row 0 of type H5T_STR_NULLTERM of string " + "This is row 1 of type H5T_STR_NULLTERM of string " + "This is row 2 of type H5T_STR_NULLTERM of string " + "This is row 3 of type H5T_STR_NULLTERM of string " + "This is row 4 of type H5T_STR_NULLTERM of string " + "This is row 5 of type H5T_STR_NULLTERM of string " + "This is row 6 of type H5T_STR_NULLTERM of string " + "This is row 7 of type H5T_STR_NULLTERM of string " + "This is row 8 of type H5T_STR_NULLTERM of string " + "This is row 9 of type H5T_STR_NULLTERM of string " + + + + + + + + + + + + + + + + + + + "This is row 0 of type H5T_STR_NULLPAD of" + "This is row 1 of type H5T_STR_NULLPAD of" + "This is row 2 of type H5T_STR_NULLPAD of" + "This is row 3 of type H5T_STR_NULLPAD of" + "This is row 4 of type H5T_STR_NULLPAD of" + "This is row 5 of type H5T_STR_NULLPAD of" + "This is row 6 of type H5T_STR_NULLPAD of" + "This is row 7 of type H5T_STR_NULLPAD of" + "This is row 8 of type H5T_STR_NULLPAD of" + "This is row 9 of type H5T_STR_NULLPAD of" + + + + + + + + + + + + + + + + + + + "This is row 0 of type H5T_STR_NULLPAD of string ar" + "This is row 1 of type H5T_STR_NULLPAD of string ar" + "This is row 2 of type H5T_STR_NULLPAD of string ar" + "This is row 3 of type H5T_STR_NULLPAD of string ar" + "This is row 4 of type H5T_STR_NULLPAD of string ar" + "This is row 5 of type H5T_STR_NULLPAD of string ar" + "This is row 6 of type H5T_STR_NULLPAD of string ar" + "This is row 7 of type H5T_STR_NULLPAD of string ar" + "This is row 8 of type H5T_STR_NULLPAD of string ar" + "This is row 9 of type H5T_STR_NULLPAD of string ar" + + + + + + + + + + + + + + + + + + + "This is row 0 of type H5T_STR_SPACEPAD of " + "This is row 1 of type H5T_STR_SPACEPAD of " + "This is row 2 of type H5T_STR_SPACEPAD of " + "This is row 3 of type H5T_STR_SPACEPAD of " + "This is row 4 of type H5T_STR_SPACEPAD of " + "This is row 5 of type H5T_STR_SPACEPAD of " + "This is row 6 of type H5T_STR_SPACEPAD of " + "This is row 7 of type H5T_STR_SPACEPAD of " + "This is row 8 of type H5T_STR_SPACEPAD of " + "This is row 9 of type H5T_STR_SPACEPAD of " + + + + + + + + + + + + + + + + + + + "This is row 0 of type H5T_STR_SPACEPAD of string a" + "This is row 1 of type H5T_STR_SPACEPAD of string a" + "This is row 2 of type H5T_STR_SPACEPAD of string a" + "This is row 3 of type H5T_STR_SPACEPAD of string a" + "This is row 4 of type H5T_STR_SPACEPAD of string a" + "This is row 5 of type H5T_STR_SPACEPAD of string a" + "This is row 6 of type H5T_STR_SPACEPAD of string a" + "This is row 7 of type H5T_STR_SPACEPAD of string a" + "This is row 8 of type H5T_STR_SPACEPAD of string a" + "This is row 9 of type H5T_STR_SPACEPAD of string a" + + + + + + diff --git a/tools/testfiles/tstring-at.h5 b/tools/testfiles/tstring-at.h5 new file mode 100644 index 0000000000..c166dea58d Binary files /dev/null and b/tools/testfiles/tstring-at.h5 differ diff --git a/tools/testfiles/tstring-at.h5.xml b/tools/testfiles/tstring-at.h5.xml new file mode 100644 index 0000000000..18e4809c1e --- /dev/null +++ b/tools/testfiles/tstring-at.h5.xml @@ -0,0 +1,55 @@ +############################# +Expected output for 'h5dump --xml tstring-at.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "String withsp " + "String\\withsl " + "String&withamp " + "String<withlt " + "String>withgt " + "String'withapos " + "String\"withquot " + + + + + + "" + "" + "" + "" + "" + "" + "" + + + + + diff --git a/tools/testfiles/tstring.h5 b/tools/testfiles/tstring.h5 new file mode 100644 index 0000000000..41fb96d802 Binary files /dev/null and b/tools/testfiles/tstring.h5 differ diff --git a/tools/testfiles/tstring.h5.xml b/tools/testfiles/tstring.h5.xml new file mode 100644 index 0000000000..3617aaf183 --- /dev/null +++ b/tools/testfiles/tstring.h5.xml @@ -0,0 +1,55 @@ +############################# +Expected output for 'h5dump --xml tstring.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + " " + " " + " " + " " + " " + " " + " " + + + + + + "String withsp " + "String\\withsl " + "String&withamp " + "String<withlt " + "String>withgt " + "String'withapos " + "String\"withquot " + + + + + diff --git a/tools/testfiles/tvldtypes.h5.xml b/tools/testfiles/tvldtypes.h5.xml new file mode 100644 index 0000000000..132e7b1c59 --- /dev/null +++ b/tools/testfiles/tvldtypes.h5.xml @@ -0,0 +1,3 @@ +############################# +Expected output for 'h5dump -xml tvldtypes.h5' +############################# diff --git a/tools/testfiles/tvldtypes1.h5.xml b/tools/testfiles/tvldtypes1.h5.xml new file mode 100644 index 0000000000..303e25d2a3 --- /dev/null +++ b/tools/testfiles/tvldtypes1.h5.xml @@ -0,0 +1,73 @@ +############################# +Expected output for 'h5dump --xml tvldtypes1.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + 0 10 11 20 21 22 30 31 32 33 + + + + + + + + + + + + + + + + + + + + + + 0 10 10.1 20 20.1 20.2 30 30.1 30.2 30.3 + + + + + + + + + + + + + + + + + + + + 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 + + + + + diff --git a/tools/testfiles/tvldtypes2.h5.xml b/tools/testfiles/tvldtypes2.h5.xml new file mode 100644 index 0000000000..a8802ecac9 --- /dev/null +++ b/tools/testfiles/tvldtypes2.h5.xml @@ -0,0 +1,36 @@ +############################# +Expected output for 'h5dump --xml tvldtypes2.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 100 110 111 200 210 211 220 221 222 + 300 310 311 320 321 322 330 331 332 333 + + + + + diff --git a/tools/testfiles/tvldtypes3.h5.xml b/tools/testfiles/tvldtypes3.h5.xml new file mode 100644 index 0000000000..dc6f71708c --- /dev/null +++ b/tools/testfiles/tvldtypes3.h5.xml @@ -0,0 +1,51 @@ +############################# +Expected output for 'h5dump --xml tvldtypes3.h5' +############################# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 0 0 10 6.66667 10 11 20 13.3333 20 21 22 30 20 30 31 32 33 + + + + + diff --git a/tools/testh5dump.sh b/tools/testh5dump.sh index 03acf2a3ae..ae6e479b6f 100755 --- a/tools/testh5dump.sh +++ b/tools/testh5dump.sh @@ -13,7 +13,7 @@ verbose=yes if test "X$srcdir" = X; then srcdir=. fi -test -d testfiles || mkdir testfiles +mkdir testfiles >/dev/null 2>&1 # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". @@ -38,16 +38,14 @@ TOOLTEST() full=`pwd`/$h5tool # Run test. - # Stderr is included in stdout so that the diff can detect - # any unexpected output from that stream too. TESTING $h5tool $@ ( echo "#############################" echo "Expected output for '$h5tool $@'" echo "#############################" cd $srcdir/testfiles - $RUNSERIAL $h5tool_bin "$@" - ) >$actual 2>& 1 + $RUNSERIAL $h5tool_bin "$@" 2>/dev/null + ) >$actual if $CMP $expect $actual; then echo " PASSED" @@ -144,6 +142,50 @@ TOOLTEST tarray7.ddl tarray7.h5 # test for files with empty data TOOLTEST tempty.ddl tempty.h5 +# test XML +TOOLTEST tall.h5.xml --xml tall.h5 +TOOLTEST tattr.h5.xml --xml tattr.h5 +TOOLTEST tbitfields.h5.xml --xml tbitfields.h5 +TOOLTEST tcompound.h5.xml --xml tcompound.h5 +TOOLTEST tcompound2.h5.xml --xml tcompound2.h5 +TOOLTEST tdatareg.h5.xml --xml tdatareg.h5 +TOOLTEST tdset.h5.xml --xml tdset.h5 +TOOLTEST tdset2.h5.xml --xml tdset2.h5 +TOOLTEST tenum.h5.xml --xml tenum.h5 +TOOLTEST tgroup.h5.xml --xml tgroup.h5 +TOOLTEST thlink.h5.xml --xml thlink.h5 +TOOLTEST tloop.h5.xml --xml tloop.h5 +TOOLTEST tloop2.h5.xml --xml tloop2.h5 +TOOLTEST tmany.h5.xml --xml tmany.h5 +TOOLTEST tnestedcomp.h5.xml --xml tnestedcomp.h5 +TOOLTEST tobjref.h5.xml --xml tobjref.h5 +TOOLTEST topaque.h5.xml --xml topaque.h5 +TOOLTEST tslink.h5.xml --xml tslink.h5 +TOOLTEST tstr.h5.xml --xml tstr.h5 +TOOLTEST tstr2.h5.xml --xml tstr2.h5 +TOOLTEST tref.h5.xml --xml tref.h5 +TOOLTEST tname-amp.h5.xml --xml tname-amp.h5 +TOOLTEST tname-apos.h5.xml --xml tname-apos.h5 +TOOLTEST tname-gt.h5.xml --xml tname-gt.h5 +TOOLTEST tname-lt.h5.xml --xml tname-lt.h5 +TOOLTEST tname-quot.h5.xml --xml tname-quot.h5 +TOOLTEST tname-sp.h5.xml --xml tname-sp.h5 +TOOLTEST tstring.h5.xml --xml tstring.h5 +TOOLTEST tstring-at.h5.xml --xml tstring-at.h5 +TOOLTEST tref-escapes.h5.xml --xml tref-escapes.h5 +TOOLTEST tref-escapes-at.h5.xml --xml tref-escapes-at.h5 +TOOLTEST tnodata.h5.xml --xml tnodata.h5 +TOOLTEST tarray1.h5.xml --xml tarray1.h5 +TOOLTEST tarray2.h5.xml --xml tarray2.h5 +TOOLTEST tarray3.h5.xml --xml tarray3.h5 +TOOLTEST tarray6.h5.xml --xml tarray6.h5 +TOOLTEST tarray7.h5.xml --xml tarray7.h5 +TOOLTEST tvldtypes1.h5.xml --xml tvldtypes1.h5 +TOOLTEST tvldtypes2.h5.xml --xml tvldtypes2.h5 +TOOLTEST tvldtypes3.h5.xml --xml tvldtypes3.h5 +TOOLTEST tsaf.h5.xml --xml tsaf.h5 +TOOLTEST tempty.h5.xml --xml tempty.h5 + if test $nerrors -eq 0 ; then echo "All $h5tool tests passed." fi