diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-12-01 17:33:08 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-12-01 17:33:08 (GMT) |
commit | 6029983f3ee972b3aedf043fe98ae9bb40c85ea1 (patch) | |
tree | 839be3c973d18f229b68e5b0bbd376193c88578d /src | |
parent | 71a9d507255366be01c25e458ac4c953d4481f45 (diff) | |
download | hdf5-6029983f3ee972b3aedf043fe98ae9bb40c85ea1.zip hdf5-6029983f3ee972b3aedf043fe98ae9bb40c85ea1.tar.gz hdf5-6029983f3ee972b3aedf043fe98ae9bb40c85ea1.tar.bz2 |
[svn-r17945] Description:
Add missing debugging context create/destroy callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FAtest.c | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/src/H5FAtest.c b/src/H5FAtest.c index 70e21dc..187b5be 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -80,6 +80,8 @@ static herr_t H5FA__test_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5FA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); +static void *H5FA__test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, + haddr_t obj_addr); /*********************/ @@ -96,7 +98,9 @@ const H5FA_class_t H5FA_CLS_TEST[1]={{ H5FA__test_fill, /* Fill block of missing elements callback */ H5FA__test_encode, /* Element encoding callback */ H5FA__test_decode, /* Element decoding callback */ - H5FA__test_debug /* Element debugging callback */ + H5FA__test_debug, /* Element debugging callback */ + H5FA__test_crt_dbg_context, /* Create debugging context */ + H5FA__test_dst_context /* Destroy debugging context */ }}; @@ -222,10 +226,12 @@ END_FUNC(STATIC) /* end H5FA__test_fill() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx)) +H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void UNUSED *_ctx)) /* Local variables */ +#ifndef NDEBUG H5FA__test_ctx_t *ctx = (H5FA__test_ctx_t *)_ctx; /* Callback context to destroy */ +#endif /* NDEBUG */ const uint64_t *elmt = (const uint64_t *)_elmt; /* Convenience pointer to native elements */ /* Sanity checks */ @@ -265,10 +271,12 @@ END_FUNC(STATIC) /* end H5FA__test_encode() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx)) +H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void UNUSED *_ctx)) /* Local variables */ +#ifndef NDEBUG H5FA__test_ctx_t *ctx = (H5FA__test_ctx_t *)_ctx; /* Callback context to destroy */ +#endif /* NDEBUG */ uint64_t *elmt = (uint64_t *)_elmt; /* Convenience pointer to native elements */ const uint8_t *raw = (const uint8_t *)_raw; /* Convenience pointer to raw elements */ @@ -328,6 +336,41 @@ END_FUNC(STATIC) /* end H5FA__test_debug() */ /*------------------------------------------------------------------------- + * Function: H5FA__test_crt_dbg_context + * + * Purpose: Create context for debugging callback + * + * Return: Success: non-NULL + * Failure: NULL + * + * Programmer: Quincey Koziol + * Tuesday, December 1, 2009 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(STATIC, ERR, +void *, NULL, NULL, +H5FA__test_crt_dbg_context(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED obj_addr)) + + /* Local variables */ + H5FA__test_ctx_t *ctx; /* Context for callbacks */ + + /* Allocate new context structure */ + if(NULL == (ctx = H5FL_MALLOC(H5FA__test_ctx_t))) + H5E_THROW(H5E_CANTALLOC, "can't allocate fixed array client callback context") + + /* Initialize the context */ + ctx->bogus = H5FA__TEST_BOGUS_VAL; + + /* Set return value */ + ret_value = ctx; + +CATCH + +END_FUNC(STATIC) /* end H5FA__test_crt_dbg_context() */ + + +/*------------------------------------------------------------------------- * Function: H5FA_get_cparam_test * * Purpose: Retrieve the parameters used to create the fixed array |