diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5EA.c | 9 | ||||
-rw-r--r-- | src/H5EAcache.c | 4 | ||||
-rw-r--r-- | src/H5EAhdr.c | 9 | ||||
-rw-r--r-- | src/H5EApkg.h | 6 | ||||
-rw-r--r-- | src/H5EAprivate.h | 7 | ||||
-rw-r--r-- | src/H5EAtest.c | 5 |
6 files changed, 22 insertions, 18 deletions
@@ -110,7 +110,7 @@ H5FL_DEFINE_STATIC(H5EA_t); */ BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL, -H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam)) +H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5EA_t *ea = NULL; /* Pointer to new extensible array */ @@ -128,7 +128,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(cparam); /* Create extensible array header */ - if(HADDR_UNDEF == (ea_addr = H5EA__hdr_create(f, dxpl_id, cparam))) + if(HADDR_UNDEF == (ea_addr = H5EA__hdr_create(f, dxpl_id, cparam, ctx_udata))) H5E_THROW(H5E_CANTINIT, "can't create extensible array header") /* Allocate extensible array wrapper */ @@ -181,7 +181,8 @@ END_FUNC(PRIV) /* end H5EA_create() */ */ BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL, -H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, const H5EA_class_t *cls)) +H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, const H5EA_class_t *cls, + void *ctx_udata)) /* Local variables */ H5EA_t *ea = NULL; /* Pointer to new extensible array wrapper */ @@ -198,7 +199,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, const H5EA_class_t *cls)) #ifdef QAK HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr); #endif /* QAK */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, cls, NULL, H5AC_READ))) + if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, cls, ctx_udata, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for pending array deletion */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 8947960..00d3089 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -199,7 +199,7 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{ BEGIN_FUNC(STATIC, ERR, H5EA_hdr_t *, NULL, NULL, H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls, - void UNUSED *udata2)) + void *ctx_udata)) /* Local variables */ const H5EA_class_t *cls = (const H5EA_class_t *)_cls; /* Extensible array class */ @@ -217,7 +217,7 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls, HDassert(H5F_addr_defined(addr)); /* Allocate space for the extensible array data structure */ - if(NULL == (hdr = H5EA__hdr_alloc(f, cls))) + if(NULL == (hdr = H5EA__hdr_alloc(f, cls, ctx_udata))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header") /* Set the extensible array header's address */ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 0a7ddef..1e01601 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -116,7 +116,7 @@ H5FL_SEQ_DEFINE_STATIC(H5EA_sblk_info_t); */ BEGIN_FUNC(PKG, ERR, H5EA_hdr_t *, NULL, NULL, -H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls)) +H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls, void *udata)) /* Local variables */ H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */ @@ -141,7 +141,7 @@ H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls)) hdr->cparam.cls = cls; /* Create the callback context */ - if(NULL == (hdr->cb_ctx = (*cls->crt_context)(f))) + if(NULL == (hdr->cb_ctx = (*cls->crt_context)(udata))) H5E_THROW(H5E_CANTCREATE, "unable to create extensible array client callback context") /* Set the return value */ @@ -368,7 +368,8 @@ END_FUNC(PKG) /* end H5EA__hdr_free_elmts() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam)) +H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, + void *ctx_udata)) /* Local variables */ H5EA_hdr_t *hdr = NULL; /* Extensible array header */ @@ -416,7 +417,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); #endif /* NDEBUG */ /* Allocate space for the shared information */ - if(NULL == (hdr = H5EA__hdr_alloc(f, cparam->cls))) + if(NULL == (hdr = H5EA__hdr_alloc(f, cparam->cls, ctx_udata))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header") /* Set the internal parameters for the array */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 3f32b19..b2f837a 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -652,9 +652,11 @@ H5_DLL herr_t H5EA__destroy_flush_depend(H5EA_hdr_t *hdr, H5AC_info_t *parent_en H5AC_info_t *child_entry); /* Header routines */ -H5_DLL H5EA_hdr_t *H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls); +H5_DLL H5EA_hdr_t *H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls, + void *ctx_udata); H5_DLL herr_t H5EA__hdr_init(H5EA_hdr_t *hdr); -H5_DLL haddr_t H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam); +H5_DLL haddr_t H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, + void *ctx_udata); H5_DLL void *H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts); H5_DLL herr_t H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts); H5_DLL herr_t H5EA__hdr_incr(H5EA_hdr_t *hdr); diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h index 9b36ad2..674e626 100644 --- a/src/H5EAprivate.h +++ b/src/H5EAprivate.h @@ -65,7 +65,7 @@ typedef struct H5EA_class_t { size_t nat_elmt_size; /* Size of native (memory) element */ /* Extensible array client callback methods */ - void *(*crt_context)(const H5F_t *f); /* Create context for other callbacks */ + void *(*crt_context)(void *udata); /* Create context for other callbacks */ herr_t (*dst_context)(void *ctx); /* Destroy context */ herr_t (*fill)(void *nat_blk, size_t nelmts); /* Fill array of elements with encoded form of "missing element" value */ herr_t (*encode)(void *raw, const void *elmt, size_t nelmts, void *ctx); /* Encode elements from native form to disk storage form */ @@ -121,9 +121,10 @@ typedef struct H5EA_t H5EA_t; /***************************************/ /* General routines */ -H5_DLL H5EA_t *H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam); +H5_DLL H5EA_t *H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, + void *ctx_udata); H5_DLL H5EA_t *H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, - const H5EA_class_t *cls); + const H5EA_class_t *cls, void *ctx_udata); H5_DLL herr_t H5EA_get_nelmts(const H5EA_t *ea, hsize_t *nelmts); H5_DLL herr_t H5EA_get_addr(const H5EA_t *ea, haddr_t *addr); H5_DLL herr_t H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt); diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 5337aea..fa0a62f 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -71,7 +71,7 @@ typedef struct H5EA__test_ctx_t { /********************/ /* Extensible array class callbacks */ -static void *H5EA__test_crt_context(const H5F_t *f); +static void *H5EA__test_crt_context(void *udata); static herr_t H5EA__test_dst_context(void *ctx); static herr_t H5EA__test_fill(void *nat_blk, size_t nelmts); static herr_t H5EA__test_encode(void *raw, const void *elmt, size_t nelmts, @@ -128,13 +128,12 @@ H5FL_DEFINE_STATIC(H5EA__test_ctx_t); */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5EA__test_crt_context(const H5F_t UNUSED *f)) +H5EA__test_crt_context(void UNUSED *udata)) /* Local variables */ H5EA__test_ctx_t *ctx; /* Context for callbacks */ /* Sanity checks */ - HDassert(f); /* Allocate new context structure */ if(NULL == (ctx = H5FL_MALLOC(H5EA__test_ctx_t))) |