summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-06-07 20:20:32 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-06-07 20:20:32 (GMT)
commit58eb9c4aa043151cf9ec77b46afb162988cc1d42 (patch)
tree19282b5d416b04a480bbcec3fd28555c7e794e01 /tools
parent8532eb342ec94f6f7c92c73108c37228c91ee31c (diff)
downloadhdf5-58eb9c4aa043151cf9ec77b46afb162988cc1d42.zip
hdf5-58eb9c4aa043151cf9ec77b46afb162988cc1d42.tar.gz
hdf5-58eb9c4aa043151cf9ec77b46afb162988cc1d42.tar.bz2
[svn-r1311] Changes since 19990607
---------------------- ./tools/h5ls.c ./tools/h5tools.c Added support for printing bitfields and opaque data. ./test/dsets.c Added bitfield and opaque datasets to the output file so h5ls has something interesting to print. ./test/trefer.c Resync'd ./src/H5Tconv.c Fixed bitfield conversion which resulted in possible garbage in high-order bits of destination when the destination type is larger than the source type. Thanks for spotting it, Quincey.
Diffstat (limited to 'tools')
-rw-r--r--tools/h5ls.c39
-rw-r--r--tools/h5tools.c15
2 files changed, 51 insertions, 3 deletions
diff --git a/tools/h5ls.c b/tools/h5ls.c
index acd8c9e..ae14077 100644
--- a/tools/h5ls.c
+++ b/tools/h5ls.c
@@ -923,6 +923,42 @@ display_reference_type(hid_t type, int UNUSED indent)
/*-------------------------------------------------------------------------
+ * Function: display_opaque_type
+ *
+ * Purpose: Prints information about an opaque data type.
+ *
+ * Return: Success: TRUE
+ *
+ * Failure: FALSE, nothing printed
+ *
+ * Programmer: Robb Matzke
+ * Monday, June 7, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static hbool_t
+display_opaque_type(hid_t type, int indent)
+{
+ char *tag;
+ size_t size;
+
+ if (H5T_OPAQUE!=H5Tget_class(type)) return FALSE;
+
+ size = H5Tget_size(type);
+ printf("%lu-byte opaque type", (unsigned long)size);
+ if ((tag=H5Tget_tag(type))) {
+ printf("\n%*s(tag = \"", indent, "");
+ display_string(stdout, tag, FALSE);
+ printf("\")");
+ free(tag);
+ }
+ return TRUE;
+}
+
+
+/*-------------------------------------------------------------------------
* Function: display_type
*
* Purpose: Prints a data type definition. The definition is printed
@@ -962,7 +998,8 @@ display_type(hid_t type, int indent)
display_cmpd_type(type, indent) ||
display_enum_type(type, indent) ||
display_string_type(type, indent) ||
- display_reference_type(type, indent)) {
+ display_reference_type(type, indent) ||
+ display_opaque_type(type, indent)) {
return;
}
diff --git a/tools/h5tools.c b/tools/h5tools.c
index fdc544d..d42472f 100644
--- a/tools/h5tools.c
+++ b/tools/h5tools.c
@@ -910,6 +910,7 @@ h5dump_sprint(h5dump_str_t *str/*in,out*/, const h5dump_t *info,
}
} else {
+ /* All other types get printed as hexadecimal */
h5dump_str_append(str, "0x");
n = H5Tget_size(type);
for (i=0; i<n; i++) {
@@ -1555,12 +1556,22 @@ h5dump_fixtype(hid_t f_type)
case H5T_ENUM:
case H5T_REFERENCE:
+ case H5T_OPAQUE:
+ /* Same as file type */
m_type = H5Tcopy(f_type);
break;
- case H5T_TIME:
case H5T_BITFIELD:
- case H5T_OPAQUE:
+ /*
+ * Same as the file except the offset is set to zero and the byte
+ * order is set to little endian.
+ */
+ m_type = H5Tcopy(f_type);
+ H5Tset_offset(m_type, 0);
+ H5Tset_order(m_type, H5T_ORDER_LE);
+ break;
+
+ case H5T_TIME:
/*
* These type classes are not implemented yet.
*/