From 2f6965f07124e003b02b172c5d428d7863797d18 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 8 Sep 2014 14:07:33 -0500 Subject: [svn-r25579] Add version number for VOL plugins in VOL Plugin structure. --- examples/h5_vol_external_log_native.c | 1 + src/H5VLnative.c | 5 +++-- src/H5VLnative.h | 1 + src/H5VLpublic.h | 33 +++++++++++++++++---------------- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/examples/h5_vol_external_log_native.c b/examples/h5_vol_external_log_native.c index 5cc2593..74c05da 100644 --- a/examples/h5_vol_external_log_native.c +++ b/examples/h5_vol_external_log_native.c @@ -43,6 +43,7 @@ static herr_t H5VL_log_object_specific(void *obj, H5VL_loc_params_t loc_params, hid_t native_plugin_id = -1; static const H5VL_class_t H5VL_log_g = { + 0, LOG, "log", /* name */ H5VL_log_init, /* initialize */ diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 18bd09e..b528121 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -123,8 +123,9 @@ static herr_t H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_param static herr_t H5VL_native_object_optional(void *obj, hid_t dxpl_id, void **req, va_list arguments); static H5VL_class_t H5VL_native_g = { - NATIVE, - "native", /* name */ + HDF5_VOL_NATIVE_VERSION_1, /* Version number */ + NATIVE, /* Plugin value */ + "native", /* Plugin name */ NULL, /* initialize */ NULL, /* terminate */ 0, /* fapl_size */ diff --git a/src/H5VLnative.h b/src/H5VLnative.h index 36177ed..ae0e601 100644 --- a/src/H5VLnative.h +++ b/src/H5VLnative.h @@ -23,6 +23,7 @@ #define H5VLnative_H #define H5VL_NATIVE (H5VL_native_init()) +#define HDF5_VOL_NATIVE_VERSION_1 1 /* Version number of Native VOL plugin */ #ifdef __cplusplus extern "C" { diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index c3face6..35c4c46 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -325,26 +325,27 @@ typedef enum H5VL_class_value_t { /* Class information for each VOL driver */ typedef struct H5VL_class_t { - H5VL_class_value_t value; - const char *name; - herr_t (*initialize)(hid_t vipl_id); - herr_t (*terminate)(hid_t vtpl_id); - size_t fapl_size; - void * (*fapl_copy)(const void *info); - herr_t (*fapl_free)(void *info); + unsigned version; /* Class version # */ + H5VL_class_value_t value; /* value to identify plugin */ + const char *name; /* Plugin name */ + herr_t (*initialize)(hid_t vipl_id); /* Plugin initialization callback */ + herr_t (*terminate)(hid_t vtpl_id); /* Plugin termination callback */ + size_t fapl_size; /* size of the vol info in the fapl property */ + void * (*fapl_copy)(const void *info); /* callback to create a copy of the vol info */ + herr_t (*fapl_free)(void *info); /* callback to release the vol info copy */ /* Data Model */ - H5VL_attr_class_t attr_cls; - H5VL_dataset_class_t dataset_cls; - H5VL_datatype_class_t datatype_cls; - H5VL_file_class_t file_cls; - H5VL_group_class_t group_cls; - H5VL_link_class_t link_cls; - H5VL_object_class_t object_cls; + H5VL_attr_class_t attr_cls; /* attribute class callbacks */ + H5VL_dataset_class_t dataset_cls; /* dataset class callbacks */ + H5VL_datatype_class_t datatype_cls; /* datatype class callbacks */ + H5VL_file_class_t file_cls; /* file class callbacks */ + H5VL_group_class_t group_cls; /* group class callbacks */ + H5VL_link_class_t link_cls; /* link class callbacks */ + H5VL_object_class_t object_cls; /* object class callbacks */ /* Services */ - H5VL_async_class_t async_cls; - herr_t (*optional)(void *obj, hid_t dxpl_id, void **req, va_list arguments); + H5VL_async_class_t async_cls; /* asynchronous class callbacks */ + herr_t (*optional)(void *obj, hid_t dxpl_id, void **req, va_list arguments); /* Optional callback */ } H5VL_class_t; #ifdef __cplusplus -- cgit v0.12