summaryrefslogtreecommitdiffstats
path: root/tools/misc/h5debug.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-02-03 19:59:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-02-03 19:59:05 (GMT)
commit0b332ace5e6a94c1238b99268675a9ba840215c0 (patch)
tree373c7c8d4533ea7273d4bfd9c4bf72a559399b5a /tools/misc/h5debug.c
parent3bf1bfa4ec9988e038944b59fcaa8acc2d79f734 (diff)
downloadhdf5-0b332ace5e6a94c1238b99268675a9ba840215c0.zip
hdf5-0b332ace5e6a94c1238b99268675a9ba840215c0.tar.gz
hdf5-0b332ace5e6a94c1238b99268675a9ba840215c0.tar.bz2
[svn-r9928] Purpose:
New feature Description: Add basic code for new B-tree implementation. They don't do much yet, aren't hooked up to anything yet and the format may change, but I'd like to start getting them into the daily tests. Platforms tested: FreeBSD 4.11 (sleipnir) w/parallel Too minor to require h5committest
Diffstat (limited to 'tools/misc/h5debug.c')
-rw-r--r--tools/misc/h5debug.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index 466279c..88dc861 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -26,9 +26,11 @@
*/
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
#define H5O_PACKAGE /*suppress error about including H5Opkg */
+#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
-#include "H5private.h"
+#include "H5private.h" /* Generic Functions */
#include "H5Bprivate.h"
+#include "H5B2pkg.h" /* B-trees */
#include "H5Dprivate.h"
#include "H5Fpkg.h"
#include "H5Gprivate.h"
@@ -75,7 +77,7 @@ main(int argc, char *argv[])
if (argc == 1) {
fprintf(stderr,
- "Usage: %s filename [signature addr [extra]]\n", argv[0]);
+ "Usage: %s filename [signature-addr [extra]]\n", argv[0]);
HDexit(1);
}
@@ -173,6 +175,36 @@ main(int argc, char *argv[])
HDexit(4);
}
+ } else if (!HDmemcmp(sig, H5B2_HDR_MAGIC, H5B2_SIZEOF_MAGIC)) {
+ /*
+ * Debug a v2 B-tree. B-trees are debugged through the B-tree
+ * subclass. The subclass identifier is two bytes after the
+ * B-tree signature.
+ */
+ H5B2_subid_t subtype = (H5B_subid_t)sig[H5B2_SIZEOF_MAGIC+1];
+
+#ifdef NOT_YET
+ switch (subtype) {
+ case H5B_SNODE_ID:
+ status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
+ break;
+
+ case H5B_ISTORE_ID:
+ ndims = (unsigned)extra;
+ status = H5D_istore_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims);
+ break;
+
+ default:
+ fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
+ HDexit(4);
+ }
+#else /* NOT_YET */
+H5B2_class_t type={0,sizeof(hsize_t),NULL,NULL,NULL}; /* B-tree class information */
+
+fprintf(stderr,"B-tree subtype=%u\n",(unsigned)subtype);
+ status = H5B2_hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, &type);
+#endif /* NOT_YET */
+
} else if (sig[0] == H5O_VERSION) {
/*
* This could be an object header. Since they don't have a signature