summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2016-05-13 18:29:36 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2016-11-29 23:42:33 (GMT)
commita48da0df72c9144c2efb219488cf0abee1282dda (patch)
tree44ed22588fbb8d7074a67c1e222731d05db9a624
parent4a2ec004427a3214ace86cba444dba395427a605 (diff)
downloadhdf5-a48da0df72c9144c2efb219488cf0abee1282dda.zip
hdf5-a48da0df72c9144c2efb219488cf0abee1282dda.tar.gz
hdf5-a48da0df72c9144c2efb219488cf0abee1282dda.tar.bz2
Rework H5X_class_t to make idx_class separate and fix initialization
Cleanup
-rw-r--r--src/H5Dint.c16
-rw-r--r--src/H5Dio.c12
-rw-r--r--src/H5Fint.c16
-rw-r--r--src/H5Oidxinfo.c36
-rw-r--r--src/H5Pxapl.c2
-rw-r--r--src/H5Pxxpl.c2
-rw-r--r--src/H5X.c8
-rw-r--r--src/H5Xdummy.c16
-rw-r--r--src/H5Xfastbit.c16
-rw-r--r--src/H5Xmeta_dummy.c16
-rw-r--r--src/H5Xpublic.h12
11 files changed, 85 insertions, 67 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 7981ceb..6596360 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -3248,9 +3248,9 @@ H5D_open_index(H5D_t *dset, hid_t xapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset");
if (NULL == metadata)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "no index metadata was found");
- if (NULL == idx_class->idx_class.data_class.open)
+ if (NULL == idx_class->idx_class->data_class.open)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin open callback not defined");
- if (NULL == (idx_handle = idx_class->idx_class.data_class.open(dset_id, xapl_id, metadata_size, metadata)))
+ if (NULL == (idx_handle = idx_class->idx_class->data_class.open(dset_id, xapl_id, metadata_size, metadata)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "cannot open index");
dset->shared->idx_handle = idx_handle;
@@ -3280,9 +3280,9 @@ H5D_close_index(H5D_t *dset)
HDassert(dset);
idx_class = dset->shared->idx_class;
- if (NULL == (idx_class->idx_class.data_class.close))
+ if (NULL == (idx_class->idx_class->data_class.close))
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin close callback not defined");
- if (FAIL == idx_class->idx_class.data_class.close(dset->shared->idx_handle))
+ if (FAIL == idx_class->idx_class->data_class.close(dset->shared->idx_handle))
HGOTO_ERROR(H5E_INDEX, H5E_CANTCLOSEOBJ, FAIL, "cannot close index");
dset->shared->idx_handle = NULL;
@@ -3352,11 +3352,11 @@ herr_t H5D_get_index_size(H5D_t *dset, hsize_t *idx_size)
idx_class = dset->shared->idx_class;
if (!idx_class)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "index class not defined");
- if (NULL == (idx_class->idx_class.data_class.get_size))
+ if (NULL == (idx_class->idx_class->data_class.get_size))
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin get size callback not defined");
if (!dset->shared->idx_handle && (FAIL == H5D_open_index(dset, xapl_id)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "cannot open index");
- if (FAIL == idx_class->idx_class.data_class.get_size(dset->shared->idx_handle, &actual_size))
+ if (FAIL == idx_class->idx_class->data_class.get_size(dset->shared->idx_handle, &actual_size))
HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "cannot get index size");
*idx_size = actual_size;
@@ -3464,7 +3464,7 @@ H5D__query_singleton(H5D_t *dset, const H5S_t *file_space, const H5Q_t *query,
if (idx_class) {
/* Index associated to dataset so use it */
- if (NULL == idx_class->idx_class.data_class.query)
+ if (NULL == idx_class->idx_class->data_class.query)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, NULL, "plugin query callback not defined");
/* Open index if not opened yet */
@@ -3476,7 +3476,7 @@ H5D__query_singleton(H5D_t *dset, const H5S_t *file_space, const H5Q_t *query,
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, NULL, "unable to register dataspace");
/* Call plugin query */
- if (FAIL == (space_id = idx_class->idx_class.data_class.query(dset->shared->idx_handle, file_space_id, query->query_id, xxpl_id)))
+ if (FAIL == (space_id = idx_class->idx_class->data_class.query(dset->shared->idx_handle, file_space_id, query->query_id, xxpl_id)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTSELECT, NULL, "cannot query index");
if (NULL == (ret_value = (H5S_t *) H5I_object_verify(space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a dataspace");
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 4c6e413..b7818b1 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -239,8 +239,8 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
void *idx_handle = dset->shared->idx_handle;
hid_t xxpl_id = H5P_INDEX_XFER_DEFAULT;
- if (idx_class->idx_class.data_class.pre_update &&
- (FAIL == idx_class->idx_class.data_class.pre_update(idx_handle, file_space_id, xxpl_id)))
+ if (idx_class->idx_class->data_class.pre_update &&
+ (FAIL == idx_class->idx_class->data_class.pre_update(idx_handle, file_space_id, xxpl_id)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "cannot do an index pre-update");
}
@@ -284,19 +284,19 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
void *idx_handle = dset->shared->idx_handle;
hid_t xxpl_id = H5P_INDEX_XFER_DEFAULT;
- if (idx_class->idx_class.data_class.post_update &&
- (FAIL == idx_class->idx_class.data_class.post_update(idx_handle, buf, file_space_id, xxpl_id)))
+ if (idx_class->idx_class->data_class.post_update &&
+ (FAIL == idx_class->idx_class->data_class.post_update(idx_handle, buf, file_space_id, xxpl_id)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "cannot do an index post-update");
/* Calling post_update rebuilds the index and index metadata may need
* to be refreshed.
*/
- if (idx_class->idx_class.data_class.refresh) {
+ if (idx_class->idx_class->data_class.refresh) {
H5O_idxinfo_t idx_info;
void *metadata;
size_t metadata_size;
- if (FAIL == idx_class->idx_class.data_class.refresh(idx_handle, &metadata_size, &metadata))
+ if (FAIL == idx_class->idx_class->data_class.refresh(idx_handle, &metadata_size, &metadata))
HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "cannot do an index refresh");
/* Write the index header message */
diff --git a/src/H5Fint.c b/src/H5Fint.c
index d07c26e..be26663 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -2199,9 +2199,9 @@ H5F_open_index(H5F_t *file, hid_t xapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file");
if (NULL == metadata)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "no index metadata was found");
- if (NULL == idx_class->idx_class.metadata_class.open)
+ if (NULL == idx_class->idx_class->metadata_class.open)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin open callback not defined");
- if (NULL == (idx_handle = idx_class->idx_class.metadata_class.open(file_id, xapl_id, metadata_size, metadata)))
+ if (NULL == (idx_handle = idx_class->idx_class->metadata_class.open(file_id, xapl_id, metadata_size, metadata)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "cannot open index");
file->shared->idx_handle = idx_handle;
@@ -2231,9 +2231,9 @@ H5F_close_index(H5F_t *file)
HDassert(file);
idx_class = file->shared->idx_class;
- if (NULL == (idx_class->idx_class.metadata_class.close))
+ if (NULL == (idx_class->idx_class->metadata_class.close))
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin close callback not defined");
- if (FAIL == idx_class->idx_class.metadata_class.close(file->shared->idx_handle))
+ if (FAIL == idx_class->idx_class->metadata_class.close(file->shared->idx_handle))
HGOTO_ERROR(H5E_INDEX, H5E_CANTCLOSEOBJ, FAIL, "cannot close index");
file->shared->idx_handle = NULL;
@@ -2304,11 +2304,11 @@ H5F_get_index_size(H5F_t *file, hsize_t *idx_size)
idx_class = file->shared->idx_class;
if (!idx_class)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "index class not defined");
- if (NULL == (idx_class->idx_class.metadata_class.get_size))
+ if (NULL == (idx_class->idx_class->metadata_class.get_size))
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin get size callback not defined");
if (!file->shared->idx_handle && (FAIL == H5F_open_index(file, xapl_id)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "cannot open index");
- if (FAIL == idx_class->idx_class.metadata_class.get_size(file->shared->idx_handle, &actual_size))
+ if (FAIL == idx_class->idx_class->metadata_class.get_size(file->shared->idx_handle, &actual_size))
HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "cannot get index size");
*idx_size = actual_size;
@@ -2347,7 +2347,7 @@ H5F_query(H5F_t *file, const struct H5Q_t *query,
HGOTO_DONE(SUCCEED);
/* Index associated to file so use it */
- if (NULL == idx_class->idx_class.metadata_class.query)
+ if (NULL == idx_class->idx_class->metadata_class.query)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin query callback not defined");
/* Open index if not opened yet */
@@ -2355,7 +2355,7 @@ H5F_query(H5F_t *file, const struct H5Q_t *query,
HGOTO_ERROR(H5E_INDEX, H5E_CANTOPENOBJ, FAIL, "cannot open index");
/* Call query of index plugin */
- if (FAIL == idx_class->idx_class.metadata_class.query(
+ if (FAIL == idx_class->idx_class->metadata_class.query(
file->shared->idx_handle, query->query_id, xxpl_id, ref_count, refs))
HGOTO_ERROR(H5E_INDEX, H5E_CANTCOMPARE, FAIL, "cannot query index");
diff --git a/src/H5Oidxinfo.c b/src/H5Oidxinfo.c
index fafb31a..9f9387b 100644
--- a/src/H5Oidxinfo.c
+++ b/src/H5Oidxinfo.c
@@ -86,8 +86,9 @@ const H5O_msg_class_t H5O_MSG_IDXINFO[1] = {{
*-------------------------------------------------------------------------
*/
static void *
-H5O_idxinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+H5O_idxinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
+ H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
+ unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
{
H5O_idxinfo_t *mesg;
void *ret_value = NULL; /* Return value */
@@ -134,8 +135,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_idxinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
- const void *_mesg)
+H5O_idxinfo_encode(H5F_t H5_ATTR_UNUSED *f,
+ hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
const H5O_idxinfo_t *mesg = (const H5O_idxinfo_t *) _mesg;
@@ -213,7 +214,8 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_idxinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
+H5O_idxinfo_size(const H5F_t H5_ATTR_UNUSED *f,
+ hbool_t H5_ATTR_UNUSED disable_shared, const void *_mesg)
{
const H5O_idxinfo_t *mesg = (const H5O_idxinfo_t *) _mesg;
size_t ret_value = 0;
@@ -243,7 +245,7 @@ H5O_idxinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s
static herr_t
H5O_idxinfo_reset(void *_mesg)
{
- H5O_idxinfo_t *mesg = (H5O_idxinfo_t *) _mesg;
+ H5O_idxinfo_t *mesg = (H5O_idxinfo_t *) _mesg;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -298,7 +300,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_idxinfo_delete(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t *open_oh, void *_mesg)
+H5O_idxinfo_delete(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id,
+ H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg)
{
hid_t file_id;
H5O_idxinfo_t *mesg = (H5O_idxinfo_t *) _mesg;
@@ -317,10 +320,17 @@ H5O_idxinfo_delete(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t *open_oh, void
/* call plugin index remove callback */
if (NULL == (idx_class = H5X_registered(mesg->plugin_id)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTGET, FAIL, "can't get index plugin class");
- if (NULL == idx_class->idx_class.data_class.remove)
- HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin remove callback is not defined");
- if (FAIL == idx_class->idx_class.data_class.remove(file_id, mesg->metadata_size, mesg->metadata))
- HGOTO_ERROR(H5E_INDEX, H5E_CANTCREATE, FAIL, "cannot remove index");
+ if (idx_class->type == H5X_TYPE_DATA) {
+ if (NULL == idx_class->idx_class->data_class.remove)
+ HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin remove callback is not defined");
+ if (FAIL == idx_class->idx_class->data_class.remove(file_id, mesg->metadata_size, mesg->metadata))
+ HGOTO_ERROR(H5E_INDEX, H5E_CANTCREATE, FAIL, "cannot remove index");
+ } else {
+ if (NULL == idx_class->idx_class->metadata_class.remove)
+ HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin remove callback is not defined");
+ if (FAIL == idx_class->idx_class->metadata_class.remove(file_id, mesg->metadata_size, mesg->metadata))
+ HGOTO_ERROR(H5E_INDEX, H5E_CANTCREATE, FAIL, "cannot remove index");
+ }
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -336,8 +346,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_idxinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream,
- int indent, int fwidth)
+H5O_idxinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
+ const void *_mesg, FILE *stream, int indent, int fwidth)
{
const H5O_idxinfo_t *mesg = (const H5O_idxinfo_t *)_mesg;
diff --git a/src/H5Pxapl.c b/src/H5Pxapl.c
index c85ec7a..8480009 100644
--- a/src/H5Pxapl.c
+++ b/src/H5Pxapl.c
@@ -105,7 +105,7 @@ const H5P_libclass_t H5P_CLS_XACC[1] = {{
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__xacc_reg_prop(H5P_genclass_t *pclass)
+H5P__xacc_reg_prop(H5P_genclass_t H5_ATTR_UNUSED *pclass)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Pxxpl.c b/src/H5Pxxpl.c
index 81f2a15..5dc5988 100644
--- a/src/H5Pxxpl.c
+++ b/src/H5Pxxpl.c
@@ -104,7 +104,7 @@ const H5P_libclass_t H5P_CLS_XXFR[1] = {{
*-------------------------------------------------------------------------
*/
static herr_t
-H5P__xxfr_reg_prop(H5P_genclass_t *pclass)
+H5P__xxfr_reg_prop(H5P_genclass_t H5_ATTR_UNUSED *pclass)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5X.c b/src/H5X.c
index 18ec4cf..696c72c 100644
--- a/src/H5X.c
+++ b/src/H5X.c
@@ -543,9 +543,9 @@ H5X_create_data(hid_t loc_id, H5X_class_t *idx_class, hid_t xcpl_id,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset");
/* Call create of the plugin */
- if (NULL == idx_class->idx_class.data_class.create)
+ if (NULL == idx_class->idx_class->data_class.create)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin create callback is not defined");
- if (NULL == (idx_handle = idx_class->idx_class.data_class.create(loc_id, xcpl_id, xapl_id,
+ if (NULL == (idx_handle = idx_class->idx_class->data_class.create(loc_id, xcpl_id, xapl_id,
&metadata_size, &metadata)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTCREATE, FAIL, "cannot create new plugin index");
@@ -590,9 +590,9 @@ H5X_create_metadata(hid_t loc_id, H5X_class_t *idx_class, hid_t xcpl_id,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file");
/* Call create of the plugin */
- if (NULL == idx_class->idx_class.metadata_class.create)
+ if (NULL == idx_class->idx_class->metadata_class.create)
HGOTO_ERROR(H5E_INDEX, H5E_BADVALUE, FAIL, "plugin create callback is not defined");
- if (NULL == (idx_handle = idx_class->idx_class.metadata_class.create(loc_id, xcpl_id, xapl_id,
+ if (NULL == (idx_handle = idx_class->idx_class->metadata_class.create(loc_id, xcpl_id, xapl_id,
&metadata_size, &metadata)))
HGOTO_ERROR(H5E_INDEX, H5E_CANTCREATE, FAIL, "cannot create new plugin index");
diff --git a/src/H5Xdummy.c b/src/H5Xdummy.c
index 4b22c74..cd902e0 100644
--- a/src/H5Xdummy.c
+++ b/src/H5Xdummy.c
@@ -115,12 +115,7 @@ H5X_dummy_get_size(void *idx_handle, hsize_t *idx_size);
/*******************/
/* Dummy index class */
-const H5X_class_t H5X_DUMMY[1] = {{
- H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */
- H5X_PLUGIN_DUMMY, /* (Or whatever number is assigned) */
- "dummy index plugin", /* Whatever name desired */
- H5X_TYPE_DATA, /* This plugin operates on dataset elements */
- {
+static H5X_idx_class_t idx_class = {.data_class = {
H5X_dummy_create, /* create */
H5X_dummy_remove, /* remove */
H5X_dummy_open, /* open */
@@ -131,7 +126,14 @@ const H5X_class_t H5X_DUMMY[1] = {{
NULL, /* refresh */
NULL, /* copy */
H5X_dummy_get_size /* get_size */
- }
+}};
+
+const H5X_class_t H5X_DUMMY[1] = {{
+ H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */
+ H5X_PLUGIN_DUMMY, /* (Or whatever number is assigned) */
+ "dummy index plugin", /* Whatever name desired */
+ H5X_TYPE_DATA, /* This plugin operates on dataset elements */
+ &idx_class /* Index class */
}};
/*-------------------------------------------------------------------------
diff --git a/src/H5Xfastbit.c b/src/H5Xfastbit.c
index 79eb765..0d37b06 100644
--- a/src/H5Xfastbit.c
+++ b/src/H5Xfastbit.c
@@ -188,12 +188,7 @@ H5X_fastbit_get_size(void *idx_handle, hsize_t *idx_size);
/*******************/
/* FastBit index class */
-const H5X_class_t H5X_FASTBIT[1] = {{
- H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */
- H5X_PLUGIN_FASTBIT, /* (Or whatever number is assigned) */
- "FASTBIT index plugin", /* Whatever name desired */
- H5X_TYPE_DATA, /* This plugin operates on dataset elements */
- {{
+static H5X_idx_class_t idx_class = {.data_class = {
H5X_fastbit_create, /* create */
H5X_fastbit_remove, /* remove */
H5X_fastbit_open, /* open */
@@ -204,7 +199,14 @@ const H5X_class_t H5X_FASTBIT[1] = {{
H5X_fastbit_refresh, /* refresh */
NULL, /* copy */
H5X_fastbit_get_size /* get_size */
- }}
+}};
+
+const H5X_class_t H5X_FASTBIT[1] = {{
+ H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */
+ H5X_PLUGIN_FASTBIT, /* (Or whatever number is assigned) */
+ "FASTBIT index plugin", /* Whatever name desired */
+ H5X_TYPE_DATA, /* This plugin operates on dataset elements */
+ &idx_class /* Index class */
}};
/*-------------------------------------------------------------------------
diff --git a/src/H5Xmeta_dummy.c b/src/H5Xmeta_dummy.c
index 5235522..9c6aafb 100644
--- a/src/H5Xmeta_dummy.c
+++ b/src/H5Xmeta_dummy.c
@@ -259,12 +259,7 @@ static herr_t H5X__dummy_query(void *idx_handle, hid_t query_id, hid_t xxpl_id,
/*******************/
/* Dummy index class */
-const H5X_class_t H5X_META_DUMMY[1] = {{
- H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */
- H5X_PLUGIN_META_DUMMY, /* (Or whatever number is assigned) */
- "dummy index plugin", /* Whatever name desired */
- H5X_TYPE_METADATA, /* This plugin operates on metadata */
- {{
+static H5X_idx_class_t idx_class = {.metadata_class = {
H5X__dummy_create, /* create */
H5X__dummy_remove, /* remove */
H5X__dummy_open, /* open */
@@ -273,7 +268,14 @@ const H5X_class_t H5X_META_DUMMY[1] = {{
H5X__dummy_remove_entry, /* remove_entry */
H5X__dummy_query, /* query */
NULL /* get_size */
- }}
+}};
+
+const H5X_class_t H5X_META_DUMMY[1] = {{
+ H5X_CLASS_T_VERS, /* (From the H5Xpublic.h header file) */
+ H5X_PLUGIN_META_DUMMY, /* (Or whatever number is assigned) */
+ "dummy index plugin", /* Whatever name desired */
+ H5X_TYPE_METADATA, /* This plugin operates on metadata */
+ &idx_class /* Index class */
}};
static void
diff --git a/src/H5Xpublic.h b/src/H5Xpublic.h
index 0636b05..e6a560c 100644
--- a/src/H5Xpublic.h
+++ b/src/H5Xpublic.h
@@ -97,6 +97,12 @@ typedef struct {
herr_t (*get_size)(void *idx_handle, hsize_t *idx_size);
} H5X_metadata_class_t;
+typedef union {
+ /* Union of callback index structures */
+ H5X_data_class_t data_class;
+ H5X_metadata_class_t metadata_class;
+} H5X_idx_class_t;
+
typedef struct {
unsigned version; /* Version number of the index plugin class struct */
/* (Should always be set to H5X_CLASS_VERSION, which
@@ -106,11 +112,7 @@ typedef struct {
H5X_type_t type; /* Type of data indexed by this plugin */
/* Callbacks */
- union {
- /* Union of callback index structures */
- H5X_data_class_t data_class;
- H5X_metadata_class_t metadata_class;
- } idx_class;
+ H5X_idx_class_t *idx_class; /* Callback index class */
} H5X_class_t;
/********************/