summaryrefslogtreecommitdiffstats
path: root/src/H5B2test.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-11-20 20:24:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-11-20 20:24:23 (GMT)
commit8830acb2cbc9384978c22a3e01f4dd15276290e5 (patch)
tree3ff95fe7a8885ade286b1caeb350e57ef25b63e2 /src/H5B2test.c
parent5c6f1819d5033b2443a165b12b81b0343bec6456 (diff)
downloadhdf5-8830acb2cbc9384978c22a3e01f4dd15276290e5.zip
hdf5-8830acb2cbc9384978c22a3e01f4dd15276290e5.tar.gz
hdf5-8830acb2cbc9384978c22a3e01f4dd15276290e5.tar.bz2
[svn-r28422] Description:
Revert most of r27549, since revise_chunks code requires debugging contexts for v2 B-trees. Also, misc. warning cleanups and alignments w/changes on revise_chunks branch. Tested on: MacOSX/64 10.11.1 (amazon) w/serial & parallel (h5committest forthcoming)
Diffstat (limited to 'src/H5B2test.c')
-rw-r--r--src/H5B2test.c50
1 files changed, 47 insertions, 3 deletions
diff --git a/src/H5B2test.c b/src/H5B2test.c
index 8ed364e..87fddf7 100644
--- a/src/H5B2test.c
+++ b/src/H5B2test.c
@@ -67,7 +67,9 @@ static herr_t H5B2__test_store(void *nrecord, const void *udata);
static herr_t H5B2__test_compare(const void *rec1, const void *rec2);
static herr_t H5B2__test_encode(uint8_t *raw, const void *nrecord, void *ctx);
static herr_t H5B2__test_decode(const uint8_t *raw, void *nrecord, void *ctx);
-static herr_t H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record);
+static herr_t H5B2__test_debug(FILE *stream, int indent, int fwidth,
+ const void *record, const void *_udata);
+static void *H5B2__test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr);
/*********************/
@@ -84,7 +86,9 @@ const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */
H5B2__test_compare, /* Record comparison callback */
H5B2__test_encode, /* Record encoding callback */
H5B2__test_decode, /* Record decoding callback */
- H5B2__test_debug /* Record debugging callback */
+ H5B2__test_debug, /* Record debugging callback */
+ H5B2__test_crt_dbg_context, /* Create debugging context */
+ H5B2__test_dst_context /* Destroy debugging context */
}};
@@ -291,7 +295,8 @@ H5B2__test_decode(const uint8_t *raw, void *nrecord, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
-H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record)
+H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record,
+ const void H5_ATTR_UNUSED *_udata)
{
FUNC_ENTER_STATIC_NOERR
@@ -305,6 +310,45 @@ H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record)
/*-------------------------------------------------------------------------
+ * Function: H5B2__test_crt_dbg_context
+ *
+ * Purpose: Create context for debugging callback
+ *
+ * Return: Success: non-NULL
+ * Failure: NULL
+ *
+ * Programmer: Quincey Koziol
+ * Tuesday, December 1, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5B2__test_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr)
+{
+ H5B2_test_ctx_t *ctx; /* Callback context structure */
+ void *ret_value = NULL; /* Return value */
+
+ FUNC_ENTER_STATIC
+
+ /* Sanity check */
+ HDassert(f);
+
+ /* Allocate callback context */
+ if(NULL == (ctx = H5FL_MALLOC(H5B2_test_ctx_t)))
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate callback context")
+
+ /* Determine the size of addresses & lengths in the file */
+ ctx->sizeof_size = H5F_SIZEOF_SIZE(f);
+
+ /* Set return value */
+ ret_value = ctx;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5B2__test_crt_dbg_context() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5B2_get_root_addr_test
*
* Purpose: Retrieve the root node's address