diff options
Diffstat (limited to 'src/H5VLnative.c')
-rw-r--r-- | src/H5VLnative.c | 1121 |
1 files changed, 616 insertions, 505 deletions
diff --git a/src/H5VLnative.c b/src/H5VLnative.c index acfceed..d071b3a 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -11,7 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Purpose: The native VOL driver where access is to a single HDF5 file + * Purpose: The native VOL plugin where access is to a single HDF5 file * using HDF5 VFDs. */ @@ -40,151 +40,157 @@ #include "H5Rpkg.h" /* References */ #include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5Tpkg.h" /* Datatypes */ -#include "H5VLprivate.h" /* VOL drivers */ -#include "H5VLnative.h" /* Native VOL driver */ +#include "H5VLprivate.h" /* VOL plugins */ +#include "H5VLnative.h" /* Native VOL plugin */ /* - * The VOL driver identification number. + * The VOL plugin identification number. */ static hid_t H5VL_NATIVE_ID_g = H5I_INVALID_HID; /* Prototypes */ -static H5F_t *H5VL_native_get_file(void *obj, H5I_type_t type); +static H5F_t *H5VL__native_get_file(void *obj, H5I_type_t type); static herr_t H5VL__native_term(void); /* Atrribute callbacks */ -static void *H5VL_native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req); -static void *H5VL_native_attr_open(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t aapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t dxpl_id, void **req); -static herr_t H5VL_native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t dxpl_id, void **req); -static herr_t H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_attr_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_attr_close(void *attr, hid_t dxpl_id, void **req); +static void *H5VL__native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req); +static void *H5VL__native_attr_open(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t aapl_id, hid_t dxpl_id, void **req); +static herr_t H5VL__native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t dxpl_id, void **req); +static herr_t H5VL__native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t dxpl_id, void **req); +static herr_t H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_attr_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_attr_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_attr_close(void *attr, hid_t dxpl_id, void **req); /* Dataset callbacks */ -static void *H5VL_native_dataset_create(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id, void **req); -static void *H5VL_native_dataset_open(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t dapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_dataset_read(void *dset, hid_t mem_type_id, hid_t mem_space_id, +static void *H5VL__native_dataset_create(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id, void **req); +static void *H5VL__native_dataset_open(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t dapl_id, hid_t dxpl_id, void **req); +static herr_t H5VL__native_dataset_read(void *dset, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf, void **req); -static herr_t H5VL_native_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_space_id, +static herr_t H5VL__native_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf, void **req); -static herr_t H5VL_native_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_dataset_specific(void *dset, H5VL_dataset_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_dataset_optional(void *dset, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_dataset_close(void *dset, hid_t dxpl_id, void **req); +static herr_t H5VL__native_dataset_get(void *dset, H5VL_dataset_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_dataset_specific(void *dset, H5VL_dataset_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_dataset_optional(void *dset, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_dataset_close(void *dset, hid_t dxpl_id, void **req); /* File callbacks */ -static void *H5VL_native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, void **req); -static void *H5VL_native_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_file_specific(void *file, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_file_optional(void *file, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_file_close(void *file, hid_t dxpl_id, void **req); +static void *H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id, void **req); +static void *H5VL__native_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_id, void **req); +static herr_t H5VL__native_file_get(void *file, H5VL_file_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_file_specific(void *file, H5VL_file_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_file_optional(void *file, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_file_close(void *file, hid_t dxpl_id, void **req); /* Group callbacks */ -static void *H5VL_native_group_create(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req); -static void *H5VL_native_group_open(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t gapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_group_specific(void *dset, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_group_close(void *grp, hid_t dxpl_id, void **req); +static void *H5VL__native_group_create(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id, void **req); +static void *H5VL__native_group_open(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t gapl_id, hid_t dxpl_id, void **req); +static herr_t H5VL__native_group_get(void *obj, H5VL_group_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_group_specific(void *dset, H5VL_group_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_group_close(void *grp, hid_t dxpl_id, void **req); /* Link callbacks */ -static herr_t H5VL_native_link_create(H5VL_link_create_type_t create_type, void *obj, +static herr_t H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, H5VL_loc_params_t loc_params, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_link_copy(void *src_obj, H5VL_loc_params_t loc_params1, +static herr_t H5VL__native_link_copy(void *src_obj, H5VL_loc_params_t loc_params1, void *dst_obj, H5VL_loc_params_t loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_link_move(void *src_obj, H5VL_loc_params_t loc_params1, +static herr_t H5VL__native_link_move(void *src_obj, H5VL_loc_params_t loc_params1, void *dst_obj, H5VL_loc_params_t loc_params2, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_link_get(void *obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_link_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_link_get(void *obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_link_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_link_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); /* Object callbacks */ -static void *H5VL_native_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *opened_type, hid_t dxpl_id, void **req); -static herr_t H5VL_native_object_copy(void *src_obj, H5VL_loc_params_t loc_params1, const char *src_name, +static void *H5VL__native_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *opened_type, hid_t dxpl_id, void **req); +static herr_t H5VL__native_object_copy(void *src_obj, H5VL_loc_params_t loc_params1, const char *src_name, void *dst_obj, H5VL_loc_params_t loc_params2, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_object_get(void *obj, H5VL_loc_params_t loc_params, H5VL_object_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_object_optional(void *obj, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_object_get(void *obj, H5VL_loc_params_t loc_params, H5VL_object_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_object_optional(void *obj, hid_t dxpl_id, void **req, va_list arguments); /* Datatype callbacks */ -static void *H5VL_native_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req); -static void *H5VL_native_datatype_open(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_native_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_datatype_specific(void *dt, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); -static herr_t H5VL_native_datatype_close(void *dt, hid_t dxpl_id, void **req); +static void *H5VL__native_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id, void **req); +static void *H5VL__native_datatype_open(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t tapl_id, hid_t dxpl_id, void **req); +static herr_t H5VL__native_datatype_get(void *dt, H5VL_datatype_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_datatype_specific(void *dt, H5VL_datatype_specific_t specific_type, hid_t dxpl_id, void **req, va_list arguments); +static herr_t H5VL__native_datatype_close(void *dt, hid_t dxpl_id, void **req); -/* Native VOL driver class struct */ +/* Native VOL plugin class struct */ static H5VL_class_t H5VL_native_cls_g = { H5VL_NATIVE_VERSION, /* version */ H5VL_NATIVE_VALUE, /* value */ H5VL_NATIVE_NAME, /* name */ + 0, /* capability flags */ NULL, /* initialize */ - NULL, /* terminate */ - (size_t)0, /* fapl size */ - NULL, /* fapl copy */ - NULL, /* fapl free */ + H5VL__native_term, /* terminate */ + (size_t)0, /* info size */ + NULL, /* info copy */ + NULL, /* info compare */ + NULL, /* info free */ + NULL, /* get_object */ + NULL, /* get_wrap_ctx */ + NULL, /* free_wrap_ctx */ + NULL, /* wrap_object */ { /* attribute_cls */ - H5VL_native_attr_create, /* create */ - H5VL_native_attr_open, /* open */ - H5VL_native_attr_read, /* read */ - H5VL_native_attr_write, /* write */ - H5VL_native_attr_get, /* get */ - H5VL_native_attr_specific, /* specific */ + H5VL__native_attr_create, /* create */ + H5VL__native_attr_open, /* open */ + H5VL__native_attr_read, /* read */ + H5VL__native_attr_write, /* write */ + H5VL__native_attr_get, /* get */ + H5VL__native_attr_specific, /* specific */ NULL, /* optional */ - H5VL_native_attr_close /* close */ + H5VL__native_attr_close /* close */ }, { /* dataset_cls */ - H5VL_native_dataset_create, /* create */ - H5VL_native_dataset_open, /* open */ - H5VL_native_dataset_read, /* read */ - H5VL_native_dataset_write, /* write */ - H5VL_native_dataset_get, /* get */ - H5VL_native_dataset_specific, /* specific */ - H5VL_native_dataset_optional, /* optional */ - H5VL_native_dataset_close /* close */ + H5VL__native_dataset_create, /* create */ + H5VL__native_dataset_open, /* open */ + H5VL__native_dataset_read, /* read */ + H5VL__native_dataset_write, /* write */ + H5VL__native_dataset_get, /* get */ + H5VL__native_dataset_specific, /* specific */ + H5VL__native_dataset_optional, /* optional */ + H5VL__native_dataset_close /* close */ }, { /* datatype_cls */ - H5VL_native_datatype_commit, /* commit */ - H5VL_native_datatype_open, /* open */ - H5VL_native_datatype_get, /* get */ - H5VL_native_datatype_specific, /* specific */ + H5VL__native_datatype_commit, /* commit */ + H5VL__native_datatype_open, /* open */ + H5VL__native_datatype_get, /* get */ + H5VL__native_datatype_specific, /* specific */ NULL, /* optional */ - H5VL_native_datatype_close /* close */ + H5VL__native_datatype_close /* close */ }, { /* file_cls */ - H5VL_native_file_create, /* create */ - H5VL_native_file_open, /* open */ - H5VL_native_file_get, /* get */ - H5VL_native_file_specific, /* specific */ - H5VL_native_file_optional, /* optional */ - H5VL_native_file_close /* close */ + H5VL__native_file_create, /* create */ + H5VL__native_file_open, /* open */ + H5VL__native_file_get, /* get */ + H5VL__native_file_specific, /* specific */ + H5VL__native_file_optional, /* optional */ + H5VL__native_file_close /* close */ }, { /* group_cls */ - H5VL_native_group_create, /* create */ - H5VL_native_group_open, /* open */ - H5VL_native_group_get, /* get */ - H5VL_native_group_specific, /* specific */ + H5VL__native_group_create, /* create */ + H5VL__native_group_open, /* open */ + H5VL__native_group_get, /* get */ + H5VL__native_group_specific, /* specific */ NULL, /* optional */ - H5VL_native_group_close /* close */ + H5VL__native_group_close /* close */ }, { /* link_cls */ - H5VL_native_link_create, /* create */ - H5VL_native_link_copy, /* copy */ - H5VL_native_link_move, /* move */ - H5VL_native_link_get, /* get */ - H5VL_native_link_specific, /* specific */ + H5VL__native_link_create, /* create */ + H5VL__native_link_copy, /* copy */ + H5VL__native_link_move, /* move */ + H5VL__native_link_get, /* get */ + H5VL__native_link_specific, /* specific */ NULL /* optional */ }, { /* object_cls */ - H5VL_native_object_open, /* open */ - H5VL_native_object_copy, /* copy */ - H5VL_native_object_get, /* get */ - H5VL_native_object_specific, /* specific */ - H5VL_native_object_optional /* optional */ + H5VL__native_object_open, /* open */ + H5VL__native_object_copy, /* copy */ + H5VL__native_object_get, /* get */ + H5VL__native_object_specific, /* specific */ + H5VL__native_object_optional /* optional */ }, { /* async_cls */ NULL, /* cancel */ @@ -198,27 +204,25 @@ static H5VL_class_t H5VL_native_cls_g = { /*------------------------------------------------------------------------- * Function: H5VL_native_init * - * Purpose: Initialize this VOL driver by registering it with the + * Purpose: Initialize this VOL plugin by registering it with the * library. * - * Return: Success: The ID for the native driver + * Return: Success: The ID for the native plugin * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ hid_t -H5VL_native_init(void) +H5VL_native_init(hid_t vipl_id) { hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI(H5I_INVALID_HID) - /* Register the native VOL driver, if it isn't already */ - if(NULL == H5I_object_verify(H5VL_NATIVE_ID_g, H5I_VOL)) { - if((H5VL_NATIVE_ID_g = H5VL_register((const H5VL_class_t *)&H5VL_native_cls_g, - sizeof(H5VL_class_t), TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, H5I_INVALID_HID, "can't create ID for native VOL driver") - } + /* Register the native VOL plugin, if it isn't already */ + if(NULL == H5I_object_verify(H5VL_NATIVE_ID_g, H5I_VOL)) + if((H5VL_NATIVE_ID_g = H5VL_register((const H5VL_class_t *)&H5VL_native_cls_g, TRUE, vipl_id)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, H5I_INVALID_HID, "can't create ID for native VOL plugin") /* Set return value */ ret_value = H5VL_NATIVE_ID_g; @@ -231,6 +235,7 @@ done: hid_t H5VL_native_get_driver_id(void) { +HDassert(0 && "H5VL_native_get_driver_id"); return H5VL_NATIVE_ID_g; } @@ -260,7 +265,7 @@ H5VL__native_term(void) * Function: H5Pset_fapl_native * * Purpose: Modify the file access property list to use the H5VL_NATIVE - * driver defined in this source file. + * plugin defined in this source file. * * Return: SUCCEED/FAIL * @@ -286,10 +291,10 @@ done: /*--------------------------------------------------------------------------- - * Function: H5VL_native_get_file + * Function: H5VL__native_get_file * * Purpose: Utility routine to get file struct for an object via the - * native VOL driver. + * native VOL plugin. * * Returns: SUCCESS: A pointer to the H5F_t struct for the file * associated with the object. @@ -298,17 +303,18 @@ done: *--------------------------------------------------------------------------- */ static H5F_t * -H5VL_native_get_file(void *obj, H5I_type_t type) +H5VL__native_get_file(void *obj, H5I_type_t type) { H5F_t *ret_value = NULL; /* File pointer */ H5O_loc_t *oloc = NULL; /* Object location for ID */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(type) { case H5I_FILE: ret_value = (H5F_t *)obj; break; + case H5I_GROUP: { H5G_t *grp; @@ -316,6 +322,7 @@ H5VL_native_get_file(void *obj, H5I_type_t type) oloc = H5G_oloc(grp); break; } + case H5I_DATATYPE: { H5T_t *dt; @@ -323,6 +330,7 @@ H5VL_native_get_file(void *obj, H5I_type_t type) oloc = H5T_oloc(dt); break; } + case H5I_DATASET: { H5D_t *dset; @@ -338,6 +346,7 @@ H5VL_native_get_file(void *obj, H5I_type_t type) oloc = H5A_oloc(attr); break; } + case H5I_UNINIT: case H5I_BADID: case H5I_DATASPACE: @@ -364,13 +373,13 @@ H5VL_native_get_file(void *obj, H5I_type_t type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5VL_native_get_file */ +} /* H5VL__native_get_file */ /*--------------------------------------------------------------------------- * Function: H5VL_native_register * - * Purpose: Utility routine to register an ID with the native VOL driver + * Purpose: Utility routine to register an ID with the native VOL plugin * as an auxilary object. * * Returns: Success: An ID for the object @@ -383,7 +392,7 @@ H5VL_native_register(H5I_type_t type, void *obj, hbool_t app_ref) { hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(H5I_INVALID_HID) HDassert(obj); @@ -394,6 +403,7 @@ H5VL_native_register(H5I_type_t type, void *obj, hbool_t app_ref) if(((H5T_t *)obj)->vol_obj != NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can only get an ID for an uncommitted datatype") +HDassert(0 && "H5VL_native_register"); /* Get an ID for the object */ if((ret_value = H5VL_object_register(obj, type, H5VL_NATIVE_ID_g, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object") @@ -403,39 +413,8 @@ done: } /* end H5VL_native_register() */ -/*--------------------------------------------------------------------------- - * Function: H5VL_native_unregister - * - * Purpose: Utility routine to decrement ref count on Native VOL driver - * objects. - * - * Returns: SUCCEED/FAIL - * - *--------------------------------------------------------------------------- - */ -herr_t -H5VL_native_unregister(hid_t obj_id) -{ - H5VL_object_t *vol_obj = NULL; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - /* get the driver pointer */ - if(NULL == (vol_obj = (H5VL_object_t *)H5VL_get_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid ID") - - /* free object */ - if(H5VL_free_object(vol_obj) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to free VOL object") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_unregister() */ - - /*------------------------------------------------------------------------- - * Function: H5VL_native_attr_create + * Function: H5VL__native_attr_create * * Purpose: Creates an attribute on an object. * @@ -445,8 +424,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, hid_t acpl_id, - hid_t H5_ATTR_UNUSED aapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, + hid_t acpl_id, hid_t H5_ATTR_UNUSED aapl_id, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req) { H5G_loc_t loc; /* Object location */ H5G_loc_t obj_loc; /* Location used to open group */ @@ -458,7 +438,7 @@ H5VL_native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *att H5A_t *attr = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(acpl_id))) @@ -477,7 +457,7 @@ H5VL_native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *att if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype") - /* If this is a named datatype, get the driver pointer to the datatype */ + /* If this is a named datatype, get the plugin's pointer to the datatype */ type = H5T_get_actual_type(dt); if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -488,27 +468,28 @@ H5VL_native_attr_create(void *obj, H5VL_loc_params_t loc_params, const char *att /* Go do the real work for attaching the attribute to the dataset */ if(NULL == (attr = H5A__create(&loc, attr_name, type, space, acpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to create attribute") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Acreate_by_name */ if(NULL == (attr = H5A__create_by_name(&loc, loc_params.loc_data.loc_by_name.name, attr_name, type, space, acpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to create attribute") - } - else { + } /* end else-if */ + else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, NULL, "unknown attribute create parameters") - } + ret_value = (void *)attr; done: /* Release resources */ if(loc_found && H5G_loc_free(&obj_loc) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't free location") + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_attr_create() */ +} /* end H5VL__native_attr_create() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_attr_open + * Function: H5VL__native_attr_open * * Purpose: Opens a attr inside a native h5 file. * @@ -521,14 +502,14 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_attr_open(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, - hid_t H5_ATTR_UNUSED aapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_attr_open(void *obj, H5VL_loc_params_t loc_params, const char *attr_name, + hid_t H5_ATTR_UNUSED aapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ void *ret_value; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) @@ -539,13 +520,13 @@ H5VL_native_attr_open(void *obj, H5VL_loc_params_t loc_params, const char *attr_ /* Open the attribute */ if(NULL == (attr = H5A__open(&loc, attr_name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open attribute: '%s'", attr_name) - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Aopen_by_name */ /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_name(&loc, loc_params.loc_data.loc_by_name.name, attr_name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "can't open attribute") - } + } /* end else-if */ else if(loc_params.type == H5VL_OBJECT_BY_IDX) { /* H5Aopen_by_idx */ /* Open the attribute in the object header */ @@ -554,20 +535,19 @@ H5VL_native_attr_open(void *obj, H5VL_loc_params_t loc_params, const char *attr_ loc_params.loc_data.loc_by_idx.order, loc_params.loc_data.loc_by_idx.n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open attribute") - } - else { + } /* end else-if */ + else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, NULL, "unknown attribute open parameters") - } ret_value = (void *)attr; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_attr_open() */ +} /* end H5VL__native_attr_open() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_attr_read + * Function: H5VL__native_attr_read * * Purpose: Reads in data from attribute. * @@ -579,26 +559,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_attr_read(void *attr, hid_t dtype_id, void *buf, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5T_t *mem_type; /* Memory datatype */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (mem_type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + /* Go write the actual data to the attribute */ if((ret_value = H5A__read((H5A_t*)attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_attr_read() */ +} /* end H5VL__native_attr_read() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_attr_write + * Function: H5VL__native_attr_write * * Purpose: Writes out data to attribute. * @@ -610,26 +592,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_attr_write(void *attr, hid_t dtype_id, const void *buf, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5T_t *mem_type; /* Memory datatype */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL == (mem_type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + /* Go write the actual data to the attribute */ if((ret_value = H5A__write((H5A_t*)attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_attr_write() */ +} /* end H5VL__native_attr_write() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_attr_get + * Function: H5VL__native_attr_get * * Purpose: Gets certain information about an attribute * @@ -642,11 +626,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_attr_get(void *obj, H5VL_attr_get_t get_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(get_type) { /* H5Aget_space */ @@ -659,6 +644,7 @@ H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED d HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute") break; } + /* H5Aget_type */ case H5VL_ATTR_GET_TYPE: { @@ -669,6 +655,7 @@ H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED d HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute") break; } + /* H5Aget_create_plist */ case H5VL_ATTR_GET_ACPL: { @@ -680,6 +667,7 @@ H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED d break; } + /* H5Aget_name */ case H5VL_ATTR_GET_NAME: { @@ -721,13 +709,14 @@ H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED d /* Release resources */ if(attr && H5A__close(attr) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") } else HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get name of attr") break; } + /* H5Aget_info */ case H5VL_ATTR_GET_INFO: { @@ -759,7 +748,7 @@ H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED d /* Release resources */ if(attr && H5A__close(attr) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") } else if(H5VL_OBJECT_BY_IDX == loc_params.type) { H5G_loc_t loc; @@ -781,13 +770,14 @@ H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED d /* Release resources */ if(attr && H5A__close(attr) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") } else HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get name of attr") break; } + case H5VL_ATTR_GET_STORAGE_SIZE: { hsize_t *ret = va_arg(arguments, hsize_t *); @@ -797,17 +787,18 @@ H5VL_native_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t H5_ATTR_UNUSED d *ret = attr->shared->data_size; break; } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from attr") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_attr_get() */ +} /* end H5VL__native_attr_get() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_attr_specific + * Function: H5VL__native_attr_specific * * Purpose: Specific operations for attributes * @@ -820,18 +811,17 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_attr_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_attr_specific_t specific_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_attr_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_attr_specific_t specific_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get location for passed-in object */ if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - /* XXX: Do I need to clean this up? */ switch(specific_type) { case H5VL_ATTR_DELETE: @@ -843,24 +833,25 @@ H5VL_native_attr_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_attr_spe /* Delete the attribute from the location */ if(H5O__attr_remove(loc.oloc, attr_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") - } + } /* end if */ else if(H5VL_OBJECT_BY_NAME == loc_params.type) { /* H5Adelete_by_name */ /* Delete the attribute */ if(H5A__delete_by_name(&loc, loc_params.loc_data.loc_by_name.name, attr_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") - } + } /* end else-if */ else if(H5VL_OBJECT_BY_IDX == loc_params.type) { /* H5Adelete_by_idx */ /* Delete the attribute from the location */ if(H5A__delete_by_idx(&loc, loc_params.loc_data.loc_by_idx.name, loc_params.loc_data.loc_by_idx.idx_type, loc_params.loc_data.loc_by_idx.order, loc_params.loc_data.loc_by_idx.n) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") - } + } /* end else-if */ else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute remove parameters") break; } + case H5VL_ATTR_EXISTS: { const char *attr_name = va_arg(arguments, const char *); @@ -870,16 +861,17 @@ H5VL_native_attr_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_attr_spe /* Check if the attribute exists */ if((*ret = H5O__attr_exists(loc.oloc, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Aexists_by_name */ /* Check if the attribute exists */ if((*ret = H5A__exists_by_name(loc, loc_params.loc_data.loc_by_name.name, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") - } + } /* end else-if */ else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown parameters") break; } + case H5VL_ATTR_ITER: { H5_index_t idx_type = va_arg(arguments, H5_index_t); @@ -889,21 +881,20 @@ H5VL_native_attr_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_attr_spe void *op_data = va_arg(arguments, void *); if(loc_params.type == H5VL_OBJECT_BY_SELF) { /* H5Aiterate2 */ - /* Iterate over attributes */ if((ret_value = H5A__iterate(&loc, ".", idx_type, order, idx, op, op_data)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Aiterate_by_name */ - /* Iterate over attributes by name */ if((ret_value = H5A__iterate(&loc, loc_params.loc_data.loc_by_name.name, idx_type, order, idx, op, op_data)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "attribute iteration failed"); - } + } /* end else-if */ else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown parameters") break; } + /* H5Arename/rename_by_name */ case H5VL_ATTR_RENAME: { @@ -914,26 +905,28 @@ H5VL_native_attr_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_attr_spe /* Call attribute rename routine */ if(H5O__attr_rename(loc.oloc, old_name, new_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Arename_by_name */ /* Call attribute rename routine */ if(H5A__rename_by_name(loc, loc_params.loc_data.loc_by_name.name, old_name, new_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") - } + } /* end else-if */ else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown attribute rename parameters") break; } + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") - } + } /* end switch */ + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_attr_specific() */ +} /* end H5VL__native_attr_specific() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_attr_close + * Function: H5VL__native_attr_close * * Purpose: Closes an attribute. * @@ -946,22 +939,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_attr_close(void *attr, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_attr_close(void *attr, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5A__close((H5A_t*)attr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't close attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_attr_close() */ +} /* end H5VL__native_attr_close() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_dataset_create + * Function: H5VL__native_dataset_create * * Purpose: Creates a dataset in a native HDF5 file * @@ -971,8 +964,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_dataset_create(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t dcpl_id, - hid_t dapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_dataset_create(void *obj, H5VL_loc_params_t loc_params, + const char *name, hid_t dcpl_id, hid_t dapl_id, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req) { H5P_genplist_t *plist; /* Property list pointer */ H5G_loc_t loc; /* Object location to insert dataset into */ @@ -983,7 +977,7 @@ H5VL_native_dataset_create(void *obj, H5VL_loc_params_t loc_params, const char * const H5S_t *space; /* Dataspace for dataset */ void *ret_value; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) @@ -1010,14 +1004,14 @@ H5VL_native_dataset_create(void *obj, H5VL_loc_params_t loc_params, const char * /* build and open the new dataset */ if(NULL == (dset = H5D__create(loc.oloc->file, type_id, space, dcpl_id, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset") - } + } /* end if */ /* H5Dcreate2 */ else { /* Create the new dataset & get its ID */ - if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, - dcpl_id, dapl_id))) + if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset") - } + } /* end else */ + ret_value = (void *)dset; done: @@ -1033,14 +1027,15 @@ done: /* Decrement refcount on dataset's object header in memory */ if(H5O_dec_rc_by_loc(oloc) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") - } - } + } /* end if */ + } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_dataset_create() */ +} /* end H5VL__native_dataset_create() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_dataset_open + * Function: H5VL__native_dataset_open * * Purpose: Opens a dataset in a native HDF5 file. * @@ -1050,14 +1045,14 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_dataset_open(void *obj, H5VL_loc_params_t loc_params, const char *name, - hid_t dapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_dataset_open(void *obj, H5VL_loc_params_t loc_params, const char *name, + hid_t dapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file or file object") @@ -1070,11 +1065,11 @@ H5VL_native_dataset_open(void *obj, H5VL_loc_params_t loc_params, const char *na done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_dataset_open() */ +} /* end H5VL__native_dataset_open() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_dataset_read + * Function: H5VL__native_dataset_read * * Purpose: Reads raw data from a dataset into a buffer. * @@ -1083,15 +1078,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t H5_ATTR_UNUSED dxpl_id, void *buf, void H5_ATTR_UNUSED **req) +H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t H5_ATTR_UNUSED dxpl_id, void *buf, + void H5_ATTR_UNUSED **req) { H5D_t *dset = (H5D_t *)obj; const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ if(NULL == dset->oloc.file) @@ -1109,11 +1105,11 @@ H5VL_native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_dataset_read() */ +} /* end H5VL__native_dataset_read() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_dataset_write + * Function: H5VL__native_dataset_write * * Purpose: Writes raw data from a buffer into a dataset. * @@ -1122,15 +1118,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t H5_ATTR_UNUSED dxpl_id, const void *buf, void H5_ATTR_UNUSED **req) +H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, + hid_t file_space_id, hid_t H5_ATTR_UNUSED dxpl_id, const void *buf, + void H5_ATTR_UNUSED **req) { H5D_t *dset = (H5D_t *)obj; const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ if(NULL == dset->oloc.file) @@ -1148,11 +1145,11 @@ H5VL_native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_dataset_write() */ +} /* end H5VL__native_dataset_write() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_dataset_get + * Function: H5VL__native_dataset_get * * Purpose: Gets certain information about a dataset * @@ -1161,13 +1158,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, - void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_dataset_get(void *obj, H5VL_dataset_get_t get_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5D_t *dset = (H5D_t *)obj; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(get_type) { /* H5Dget_space */ @@ -1180,7 +1177,8 @@ H5VL_native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UN break; } - /* H5Dget_space_statuc */ + + /* H5Dget_space_statuc */ case H5VL_DATASET_GET_SPACE_STATUS: { H5D_space_status_t *allocation = va_arg(arguments, H5D_space_status_t *); @@ -1191,7 +1189,8 @@ H5VL_native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UN break; } - /* H5Dget_type */ + + /* H5Dget_type */ case H5VL_DATASET_GET_TYPE: { hid_t *ret_id = va_arg(arguments, hid_t *); @@ -1201,7 +1200,8 @@ H5VL_native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UN break; } - /* H5Dget_create_plist */ + + /* H5Dget_create_plist */ case H5VL_DATASET_GET_DCPL: { hid_t *ret_id = va_arg(arguments, hid_t *); @@ -1211,7 +1211,8 @@ H5VL_native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UN break; } - /* H5Dget_access_plist */ + + /* H5Dget_access_plist */ case H5VL_DATASET_GET_DAPL: { hid_t *ret_id = va_arg(arguments, hid_t *); @@ -1221,7 +1222,8 @@ H5VL_native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UN break; } - /* H5Dget_storage_size */ + + /* H5Dget_storage_size */ case H5VL_DATASET_GET_STORAGE_SIZE: { hsize_t *ret = va_arg(arguments, hsize_t *); @@ -1231,7 +1233,8 @@ H5VL_native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UN HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of dataset's storage") break; } - /* H5Dget_offset */ + + /* H5Dget_offset */ case H5VL_DATASET_GET_OFFSET: { haddr_t *ret = va_arg(arguments, haddr_t *); @@ -1242,17 +1245,18 @@ H5VL_native_dataset_get(void *obj, H5VL_dataset_get_t get_type, hid_t H5_ATTR_UN *ret = HADDR_UNDEF; break; } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from dataset") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_dataset_get() */ +} /* end H5VL__native_dataset_get() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_dataset_specific + * Function: H5VL__native_dataset_specific * * Purpose: Specific operations for datasets * @@ -1261,13 +1265,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5D_t *dset = (H5D_t *)obj; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(specific_type) { /* H5Dspecific_space */ @@ -1279,6 +1283,7 @@ H5VL_native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extent of dataset") break; } + case H5VL_DATASET_FLUSH: { hid_t dset_id = va_arg(arguments, hid_t); @@ -1289,6 +1294,7 @@ H5VL_native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, break; } + case H5VL_DATASET_REFRESH: { hid_t dset_id = va_arg(arguments, hid_t); @@ -1299,32 +1305,34 @@ H5VL_native_dataset_specific(void *obj, H5VL_dataset_specific_t specific_type, break; } + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_dataset_specific() */ +} /* end H5VL__native_dataset_specific() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_dataset_optional + * Function: H5VL__native_dataset_optional * - * Purpose: Perform a driver specific operation on a native dataset + * Purpose: Perform a plugin-specific operation on a native dataset * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5VL_native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req, va_list arguments) { H5D_t *dset = NULL; /* Dataset */ H5VL_dataset_optional_t optional_type = va_arg(arguments, H5VL_dataset_optional_t); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(optional_type) { case H5VL_DATASET_FORMAT_CONVERT: @@ -1361,6 +1369,7 @@ H5VL_native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_AT break; } + case H5VL_DATASET_GET_CHUNK_INDEX_TYPE: { H5D_chunk_index_t *idx_type = va_arg(arguments, H5D_chunk_index_t *); @@ -1376,6 +1385,7 @@ H5VL_native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_AT break; } + case H5VL_DATASET_GET_CHUNK_STORAGE_SIZE: { hsize_t *offset = va_arg(arguments, hsize_t *); @@ -1393,6 +1403,7 @@ H5VL_native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_AT break; } + case H5VL_DATASET_CHUNK_READ: { const hsize_t *offset = va_arg(arguments, hsize_t *); @@ -1420,6 +1431,7 @@ H5VL_native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_AT break; } + case H5VL_DATASET_CHUNK_WRITE: { uint32_t filters = va_arg(arguments, uint32_t); @@ -1448,17 +1460,18 @@ H5VL_native_dataset_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_AT break; } + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_dataset_optional() */ +} /* end H5VL__native_dataset_optional() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_dataset_close + * Function: H5VL__native_dataset_close * * Purpose: Closes a dataset. * @@ -1468,22 +1481,23 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_dataset_close(void *dset, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_dataset_close(void *dset, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5D_close((H5D_t*)dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't close dataset") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_dataset_close() */ +} /* end H5VL__native_dataset_close() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_file_create + * Function: H5VL__native_file_create * * Purpose: Creates a file as a native HDF5 file. * @@ -1494,13 +1508,13 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5F_t *new_file = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Adjust bit flags by turning on the creation bit and making sure that * the EXCL or TRUNC bit is set. All newly-created files are opened for @@ -1521,12 +1535,13 @@ done: if(NULL == ret_value && new_file) if(H5F__close(new_file) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_file_create() */ +} /* end H5VL__native_file_create() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_file_open + * Function: H5VL__native_file_open * * Purpose: Opens a file as a native HDF5 file. * @@ -1537,12 +1552,13 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_file_open(const char *name, unsigned flags, hid_t fapl_id, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5F_t *new_file = NULL; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Open the file */ if(NULL == (new_file = H5F_open(name, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) @@ -1554,12 +1570,13 @@ H5VL_native_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t H5_ done: if(NULL == ret_value && new_file && H5F_try_close(new_file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_file_open() */ +} /* end H5VL__native_file_open() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_file_get + * Function: H5VL__native_file_get * * Purpose: Gets certain data about a file * @@ -1568,12 +1585,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_file_get(void *obj, H5VL_file_get_t get_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5F_t *f = NULL; /* File struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(get_type) { /* H5Fget_access_plist */ @@ -1592,6 +1610,7 @@ H5VL_native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED d HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") break; } + /* H5Fget_create_plist */ case H5VL_FILE_GET_FCPL: { @@ -1608,6 +1627,7 @@ H5VL_native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED d break; } + /* H5Fget_obj_count */ case H5VL_FILE_GET_OBJ_COUNT: { @@ -1624,6 +1644,7 @@ H5VL_native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED d *ret = (ssize_t)obj_count; break; } + /* H5Fget_obj_ids */ case H5VL_FILE_GET_OBJ_IDS: { @@ -1642,6 +1663,7 @@ H5VL_native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED d *ret = (ssize_t)obj_count; break; } + /* H5Fget_intent */ case H5VL_FILE_GET_INTENT: { @@ -1670,6 +1692,7 @@ H5VL_native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED d break; } + /* H5Fget_name */ case H5VL_FILE_GET_NAME: { @@ -1679,7 +1702,7 @@ H5VL_native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED d ssize_t *ret = va_arg(arguments, ssize_t *); size_t len; - if(NULL == (f = H5VL_native_get_file(obj, type))) + if(NULL == (f = H5VL__native_get_file(obj, type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") len = HDstrlen(H5F_OPEN_NAME(f)); @@ -1694,28 +1717,18 @@ H5VL_native_file_get(void *obj, H5VL_file_get_t get_type, hid_t H5_ATTR_UNUSED d *ret = (ssize_t)len; break; } - /* H5Iget_file_id */ - case H5VL_OBJECT_GET_FILE: - { - H5I_type_t type = va_arg(arguments, H5I_type_t); - void **ret = va_arg(arguments, void **); - if(NULL == (f = H5VL_native_get_file(obj, type))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - f->id_exists = TRUE; - *ret = (void*)f; - break; - } default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information") } /* end switch */ + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_file_get() */ +} /* end H5VL__native_file_get() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_file_specific + * Function: H5VL__native_file_specific * * Purpose: Perform an operation * @@ -1724,12 +1737,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, - void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_file_specific(void *obj, H5VL_file_specific_t specific_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(specific_type) { /* H5Fflush */ @@ -1740,7 +1753,7 @@ H5VL_native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t H H5F_t *f = NULL; /* File to flush */ /* Get the file for the object */ - if(NULL == (f = H5VL_native_get_file(obj, type))) + if(NULL == (f = H5VL__native_get_file(obj, type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* Nothing to do if the file is read only. This determination is @@ -1764,6 +1777,21 @@ H5VL_native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t H } break; } + + /* H5Freopen */ + case H5VL_FILE_REOPEN: + { + void **ret = va_arg(arguments, void **); + H5F_t *new_file = NULL; + + /* Reopen the file through the VOL plugin */ + if(NULL == (new_file = H5F__reopen((H5F_t *)obj))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") + new_file->id_exists = TRUE; + *ret = (void *)new_file; + break; + } + /* H5Fmount */ case H5VL_FILE_MOUNT: { @@ -1782,6 +1810,7 @@ H5VL_native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t H break; } + /* H5Funmount */ case H5VL_FILE_UNMOUNT: { @@ -1798,6 +1827,7 @@ H5VL_native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t H break; } + /* H5Fis_accessible */ case H5VL_FILE_IS_ACCESSIBLE: { @@ -1810,33 +1840,35 @@ H5VL_native_file_specific(void *obj, H5VL_file_specific_t specific_type, hid_t H HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "error in HDF5 file check") break; } + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_file_specific() */ +} /* end H5VL__native_file_specific() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_file_optional + * Function: H5VL__native_file_optional * - * Purpose: Perform a driver specific operation on a native file + * Purpose: Perform a plugin-specific operation on a native file * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5F_t *f = NULL; /* File */ H5VL_file_optional_t optional_type = va_arg(arguments, H5VL_file_optional_t); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC + f = (H5F_t *)obj; switch(optional_type) { /* H5Fget_filesize */ case H5VL_FILE_GET_SIZE: @@ -1845,8 +1877,6 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ haddr_t base_addr; /* Base address for the file */ hsize_t *size = va_arg(arguments, hsize_t *); - f = (H5F_t *)obj; - /* Go get the actual file size */ if(H5F__get_max_eof_eoa(f, &max_eof_eoa) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ") @@ -1858,6 +1888,7 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ break; } + /* H5Fget_file_image */ case H5VL_FILE_GET_FILE_IMAGE: { @@ -1865,25 +1896,25 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ ssize_t *ret = va_arg(arguments, ssize_t *); size_t buf_len = va_arg(arguments, size_t ); - f = (H5F_t *)obj; /* Do the actual work */ if((*ret = H5F__get_file_image(f, buf_ptr, buf_len)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "get file image failed") break; } + /* H5Fget_freespace */ case H5VL_FILE_GET_FREE_SPACE: { hsize_t tot_space; /* Amount of free space in the file */ hssize_t *ret = va_arg(arguments, hssize_t *); - f = (H5F_t *)obj; /* Go get the actual amount of free space in the file */ if(H5MF_get_freespace(f, &tot_space, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") *ret = (hssize_t)tot_space; break; } + case H5VL_FILE_GET_FREE_SECTIONS: { H5F_sect_info_t *sect_info = va_arg(arguments, H5F_sect_info_t *); @@ -1891,12 +1922,12 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ H5F_mem_t type = va_arg(arguments, H5F_mem_t); size_t nsects = va_arg(arguments, size_t); - f = (H5F_t *)obj; /* Go get the free-space section information in the file */ if((*ret = H5MF_get_free_sections(f, type, nsects, sect_info)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") break; } + /* H5Fget_info2 */ case H5VL_FILE_GET_INFO: { @@ -1906,7 +1937,7 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ /* Get the file struct. This call is careful to not return the file pointer * for the top file in a mount hierarchy. */ - if(NULL == (f = H5VL_native_get_file(obj, type))) + if(NULL == (f = H5VL__native_get_file(obj, type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get a file struct") /* Get the file info */ @@ -1915,28 +1946,29 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ break; } + /* H5Fget_mdc_config */ case H5VL_FILE_GET_MDC_CONF: { H5AC_cache_config_t *config_ptr = va_arg(arguments, H5AC_cache_config_t *); - f = (H5F_t *)obj; /* Go get the resize configuration */ if(H5AC_get_cache_auto_resize_config(f->shared->cache, config_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_auto_resize_config() failed.") break; } + /* H5Fget_mdc_hit_rate */ case H5VL_FILE_GET_MDC_HR: { double *hit_rate_ptr = va_arg(arguments, double *); - f = (H5F_t *)obj; /* Go get the current hit rate */ if(H5AC_get_cache_hit_rate(f->shared->cache, hit_rate_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_hit_rate() failed.") break; } + /* H5Fget_mdc_size */ case H5VL_FILE_GET_MDC_SIZE: { @@ -1946,7 +1978,6 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ int *cur_num_entries_ptr = va_arg(arguments, int *); uint32_t cur_num_entries; - f = (H5F_t *)obj; /* Go get the size data */ if(H5AC_get_cache_size(f->shared->cache, max_size_ptr, min_clean_size_ptr, cur_size_ptr, &cur_num_entries) < 0) @@ -1956,138 +1987,120 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ *cur_num_entries_ptr = (int)cur_num_entries; break; } + /* H5Fget_vfd_handle */ case H5VL_FILE_GET_VFD_HANDLE: { void **file_handle = va_arg(arguments, void **); hid_t fapl_id = va_arg(arguments, hid_t); - f = (H5F_t *)obj; - /* Retrieve the VFD handle for the file */ if(H5F_get_vfd_handle(f, fapl_id, file_handle) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve VFD handle") break; } + + /* H5Iget_file_id */ + case H5VL_FILE_GET_FILE: + { + H5I_type_t type = va_arg(arguments, H5I_type_t); + void **ret = va_arg(arguments, void **); + + if(NULL == (f = H5VL__native_get_file(obj, type))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + f->id_exists = TRUE; + *ret = (void*)f; + break; + } + /* H5Fclear_elink_file_cache */ case H5VL_FILE_CLEAR_ELINK_CACHE: { - f = (H5F_t *)obj; - /* Release the EFC */ if(f->shared->efc) if(H5F__efc_release(f->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") break; } - /* H5Freopen */ - case H5VL_FILE_REOPEN: - { - void **ret = va_arg(arguments, void **); - H5F_t *new_file = NULL; - f = (H5F_t *)obj; - - /* Reopen the file through the VOL driver */ - if(NULL == (new_file = H5F__reopen(f))) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") - - new_file->id_exists = TRUE; - - *ret = (void *)new_file; - break; - } /* H5Freset_mdc_hit_rate_stats */ case H5VL_FILE_RESET_MDC_HIT_RATE: { - f = (H5F_t *)obj; /* Reset the hit rate statistic */ if(H5AC_reset_cache_hit_rate_stats(f->shared->cache) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't reset cache hit rate") break; } + case H5VL_FILE_SET_MDC_CONFIG: { H5AC_cache_config_t *config_ptr = va_arg(arguments, H5AC_cache_config_t *); - f = (H5F_t *)obj; /* set the resize configuration */ if(H5AC_set_cache_auto_resize_config(f->shared->cache, config_ptr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "H5AC_set_cache_auto_resize_config() failed") break; } + case H5VL_FILE_GET_METADATA_READ_RETRY_INFO: { H5F_retry_info_t *info = va_arg(arguments, H5F_retry_info_t *); - f = (H5F_t *)obj; - if(H5F_get_metadata_read_retry_info(f, info) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't get metadata read retry info") break; } + case H5VL_FILE_START_SWMR_WRITE: { - f = (H5F_t *)obj; - if(H5F__start_swmr_write(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't start SWMR write") break; } + case H5VL_FILE_START_MDC_LOGGING: { - f = (H5F_t *)obj; - /* Call mdc logging function */ if(H5C_start_logging(f->shared->cache) < 0) HGOTO_ERROR(H5E_FILE, H5E_LOGFAIL, FAIL, "unable to start mdc logging") break; } + case H5VL_FILE_STOP_MDC_LOGGING: { - f = (H5F_t *)obj; - /* Call mdc logging function */ if(H5C_stop_logging(f->shared->cache) < 0) HGOTO_ERROR(H5E_FILE, H5E_LOGFAIL, FAIL, "unable to stop mdc logging") break; } + case H5VL_FILE_GET_MDC_LOGGING_STATUS: { hbool_t *is_enabled = va_arg(arguments, hbool_t *); hbool_t *is_currently_logging = va_arg(arguments, hbool_t *); - f = (H5F_t *)obj; - /* Call mdc logging function */ if(H5C_get_logging_status(f->shared->cache, is_enabled, is_currently_logging) < 0) HGOTO_ERROR(H5E_FILE, H5E_LOGFAIL, FAIL, "unable to get logging status") break; } - case H5VL_FILE_SET_LATEST_FORMAT: - { - HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation") - break; - } + case H5VL_FILE_FORMAT_CONVERT: { - f = (H5F_t *)obj; - /* Convert the format */ if(H5F__format_convert(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "can't convert file format") break; } + case H5VL_FILE_RESET_PAGE_BUFFERING_STATS: { - f = (H5F_t *)obj; - /* Sanity check */ if(NULL == f->shared->page_buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page buffering not enabled on file") @@ -2098,6 +2111,7 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ break; } + case H5VL_FILE_GET_PAGE_BUFFERING_STATS: { unsigned *accesses = va_arg(arguments, unsigned *); @@ -2106,8 +2120,6 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ unsigned *evictions = va_arg(arguments, unsigned *); unsigned *bypasses = va_arg(arguments, unsigned *); - f = (H5F_t *)obj; - /* Sanity check */ if(NULL == f->shared->page_buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page buffering not enabled on file") @@ -2118,23 +2130,81 @@ H5VL_native_file_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_ break; } + case H5VL_FILE_GET_MDC_IMAGE_INFO: { HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation") break; } + case H5VL_FILE_GET_EOA: + { + haddr_t *eoa = va_arg(arguments, haddr_t *); + haddr_t rel_eoa; /* Relative address of EOA */ + + /* Sanity check */ + HDassert(eoa); + + /* This routine will work only for drivers with this feature enabled.*/ + /* We might introduce a new feature flag in the future */ + if(!H5F_HAS_FEATURE(f, H5FD_FEAT_SUPPORTS_SWMR_IO)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "must use a SWMR-compatible VFD for this public routine") + + /* The real work */ + if(HADDR_UNDEF == (rel_eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "get_eoa request failed") + + /* Set return value */ + /* (Note compensating for base address subtraction in internal routine) */ + *eoa = rel_eoa + H5F_get_base_addr(f); + + break; + } + + case H5VL_FILE_INCR_FILESIZE: + { + hsize_t increment = va_arg(arguments, hsize_t); + haddr_t max_eof_eoa; /* Maximum of the relative EOA & EOF */ + + /* This public routine will work only for drivers with this feature enabled.*/ + /* We might introduce a new feature flag in the future */ + if(!H5F_HAS_FEATURE(f, H5FD_FEAT_SUPPORTS_SWMR_IO)) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "must use a SWMR-compatible VFD for this public routine") + + /* Get the maximum of EOA and EOF */ + if(H5F__get_max_eof_eoa(f, &max_eof_eoa) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file can't get max eof/eoa ") + + /* Set EOA to the maximum value + increment */ + if(H5F__set_eoa(f, H5FD_MEM_DEFAULT, max_eof_eoa + increment) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed") + + break; + } + + case H5VL_FILE_SET_LIBVER_BOUNDS: + { + H5F_libver_t low = va_arg(arguments, H5F_libver_t); + H5F_libver_t high = va_arg(arguments, H5F_libver_t); + + /* Call internal set_libver_bounds function */ + if(H5F__set_libver_bounds(f, low, high) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds") + + break; + } + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_file_optional() */ +} /* end H5VL__native_file_optional() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_file_close + * Function: H5VL__native_file_close * * Purpose: Closes a file. * @@ -2143,14 +2213,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req) { int nref; H5F_t *f = (H5F_t *)file; hid_t file_id = H5I_INVALID_HID; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* This routine should only be called when a file ID's ref count drops to zero */ HDassert(H5F_ID_EXISTS(f)); @@ -2164,13 +2235,14 @@ H5VL_native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UN /* Get the file ID corresponding to the H5F_t struct */ if(H5I_find_id(f, H5I_FILE, &file_id) < 0 || H5I_INVALID_HID == file_id) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "invalid atom") + /* Get the number of references outstanding for this file ID */ if((nref = H5I_get_ref(file_id, FALSE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") if(nref == 1) if(H5F__flush(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") - } + } /* end if */ /* Close the file */ if(H5F__close(f) < 0) @@ -2178,11 +2250,11 @@ H5VL_native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UN done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_file_close() */ +} /* end H5VL__native_file_close() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_group_create + * Function: H5VL__native_group_create * * Purpose: Creates a group inside a native h5 file. * @@ -2193,8 +2265,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_group_create(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t gcpl_id, - hid_t H5_ATTR_UNUSED gapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_group_create(void *obj, H5VL_loc_params_t loc_params, const char *name, + hid_t gcpl_id, hid_t H5_ATTR_UNUSED gapl_id, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req) { H5P_genplist_t *plist; /* Property list pointer */ H5G_loc_t loc; /* Location to create group */ @@ -2202,7 +2275,7 @@ H5VL_native_group_create(void *obj, H5VL_loc_params_t loc_params, const char *na hid_t lcpl_id; void *ret_value; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the property list structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(gcpl_id))) @@ -2228,13 +2301,14 @@ H5VL_native_group_create(void *obj, H5VL_loc_params_t loc_params, const char *na /* Create the new group & get its ID */ if(NULL == (grp = H5G__create(loc.oloc->file, &gcrt_info))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") - } + } /* end if */ /* otherwise it's from H5Gcreate */ else { /* Create the new group & get its ID */ if(NULL == (grp = H5G__create_named(&loc, name, lcpl_id, gcpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") - } + } /* end else */ + ret_value = (void *)grp; done: @@ -2250,14 +2324,15 @@ done: /* Decrement refcount on group's object header in memory */ if(H5O_dec_rc_by_loc(oloc) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") - } - } + } /* end if */ + } /* end if */ + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_group_create() */ +} /* end H5VL__native_group_create() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_group_open + * Function: H5VL__native_group_open * * Purpose: Opens a group inside a native h5 file. * @@ -2268,14 +2343,14 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_group_open(void *obj, H5VL_loc_params_t loc_params, const char *name, - hid_t H5_ATTR_UNUSED gapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_group_open(void *obj, H5VL_loc_params_t loc_params, const char *name, + hid_t H5_ATTR_UNUSED gapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; /* Location to open group */ H5G_t *grp = NULL; /* New group opend */ void *ret_value; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set up the location */ if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) @@ -2289,11 +2364,11 @@ H5VL_native_group_open(void *obj, H5VL_loc_params_t loc_params, const char *name done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_group_open() */ +} /* end H5VL__native_group_open() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_group_get + * Function: H5VL__native_group_get * * Purpose: Gets data about a group * @@ -2302,11 +2377,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_group_get(void *obj, H5VL_group_get_t get_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_group_get(void *obj, H5VL_group_get_t get_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(get_type) { /* H5Gget_create_plist */ @@ -2319,6 +2395,7 @@ H5VL_native_group_get(void *obj, H5VL_group_get_t get_type, hid_t H5_ATTR_UNUSED HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get creation property list for group") break; } + /* H5Gget_info */ case H5VL_GROUP_GET_INFO: { @@ -2335,14 +2412,14 @@ H5VL_native_group_get(void *obj, H5VL_group_get_t get_type, hid_t H5_ATTR_UNUSED /* Retrieve the group's information */ if(H5G__obj_info(loc.oloc, group_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") - } + } /* end if */ else if (loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Gget_info_by_name */ /* Retrieve the group's information */ if(H5G__get_info_by_name(&loc, loc_params.loc_data.loc_by_name.name, group_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") - } + } /* end else-if */ else if(loc_params.type == H5VL_OBJECT_BY_IDX) { /* H5Gget_info_by_idx */ @@ -2350,23 +2427,23 @@ H5VL_native_group_get(void *obj, H5VL_group_get_t get_type, hid_t H5_ATTR_UNUSED if(H5G__get_info_by_idx(&loc, loc_params.loc_data.loc_by_idx.name, loc_params.loc_data.loc_by_idx.idx_type, loc_params.loc_data.loc_by_idx.order, loc_params.loc_data.loc_by_idx.n, group_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") - } - else { + } /* end else-if */ + else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown get info parameters") - } break; } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from group") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_group_get() */ +} /* end H5VL__native_group_get() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_group_specific + * Function: H5VL__native_group_specific * * Purpose: Specific operations for groups * @@ -2375,13 +2452,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_group_specific(void *obj, H5VL_group_specific_t specific_type, +H5VL__native_group_specific(void *obj, H5VL_group_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_t *grp = (H5G_t *)obj; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(specific_type) { case H5VL_GROUP_FLUSH: @@ -2394,6 +2471,7 @@ H5VL_native_group_specific(void *obj, H5VL_group_specific_t specific_type, break; } + case H5VL_GROUP_REFRESH: { hid_t group_id = va_arg(arguments, hid_t); @@ -2404,17 +2482,18 @@ H5VL_native_group_specific(void *obj, H5VL_group_specific_t specific_type, break; } + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_group_specific() */ +} /* end H5VL__native_group_specific() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_group_close + * Function: H5VL__native_group_close * * Purpose: Closes a group. * @@ -2423,22 +2502,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_group_close(void *grp, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_group_close(void *grp, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5G_close((H5G_t *)grp) < 0) HGOTO_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close group") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_group_close() */ +} /* end H5VL__native_group_close() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_link_create + * Function: H5VL__native_link_create * * Purpose: Creates an hard/soft/UD/external links. * @@ -2450,13 +2529,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_link_create(H5VL_link_create_type_t create_type, void *obj, H5VL_loc_params_t loc_params, - hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, + H5VL_loc_params_t loc_params, hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the plist structure */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(lcpl_id))) @@ -2498,14 +2578,15 @@ H5VL_native_link_create(H5VL_link_create_type_t create_type, void *obj, H5VL_loc if((ret_value = H5L_create_hard(cur_loc_p, cur_params.loc_data.loc_by_name.name, link_loc_p, loc_params.loc_data.loc_by_name.name, lcpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") - } + } /* end if */ else { /* H5Olink */ /* Link to the object */ if(H5L_link(&link_loc, loc_params.loc_data.loc_by_name.name, &cur_loc, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create link") - } + } /* end else */ break; } + case H5VL_LINK_CREATE_SOFT: { char *target_name; @@ -2522,6 +2603,7 @@ H5VL_native_link_create(H5VL_link_create_type_t create_type, void *obj, H5VL_loc HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") break; } + case H5VL_LINK_CREATE_UD: { H5G_loc_t link_loc; /* Group location for new link */ @@ -2545,16 +2627,18 @@ H5VL_native_link_create(H5VL_link_create_type_t create_type, void *obj, H5VL_loc HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") break; } + default: HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "invalid link creation call") - } + } /* end switch */ + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_link_create() */ +} /* end H5VL__native_link_create() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_link_copy + * Function: H5VL__native_link_copy * * Purpose: Renames an object within an HDF5 file and copies it to a new * group. The original name SRC is unlinked from the group graph @@ -2571,15 +2655,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_link_copy(void *src_obj, H5VL_loc_params_t loc_params1, - void *dst_obj, H5VL_loc_params_t loc_params2, - hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_link_copy(void *src_obj, H5VL_loc_params_t loc_params1, + void *dst_obj, H5VL_loc_params_t loc_params2, hid_t lcpl_id, + hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req) { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL != src_obj && H5G_loc_real(src_obj, loc_params1.obj_type, &src_loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") @@ -2602,11 +2687,11 @@ H5VL_native_link_copy(void *src_obj, H5VL_loc_params_t loc_params1, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_link_copy() */ +} /* end H5VL__native_link_copy() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_link_move + * Function: H5VL__native_link_move * * Purpose: Renames an object within an HDF5 file and moves it to a new * group. The original name SRC is unlinked from the group graph @@ -2623,15 +2708,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_link_move(void *src_obj, H5VL_loc_params_t loc_params1, - void *dst_obj, H5VL_loc_params_t loc_params2, - hid_t lcpl_id, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_link_move(void *src_obj, H5VL_loc_params_t loc_params1, + void *dst_obj, H5VL_loc_params_t loc_params2, hid_t lcpl_id, + hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req) { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(NULL != src_obj && H5G_loc_real(src_obj, loc_params1.obj_type, &src_loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") @@ -2654,11 +2740,11 @@ H5VL_native_link_move(void *src_obj, H5VL_loc_params_t loc_params1, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_link_move() */ +} /* end H5VL__native_link_move() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_link_get + * Function: H5VL__native_link_get * * Purpose: Gets certain data about a link * @@ -2671,13 +2757,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_link_get(void *obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_link_get(void *obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") @@ -2703,6 +2789,7 @@ H5VL_native_link_get(void *obj, H5VL_loc_params_t loc_params, H5VL_link_get_t ge HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") break; } + /* H5Lget_name_by_idx */ case H5VL_LINK_GET_NAME: { @@ -2717,6 +2804,7 @@ H5VL_native_link_get(void *obj, H5VL_loc_params_t loc_params, H5VL_link_get_t ge break; } + /* H5Lget_val/H5Lget_val_by_idx */ case H5VL_LINK_GET_VAL: { @@ -2739,17 +2827,18 @@ H5VL_native_link_get(void *obj, H5VL_loc_params_t loc_params, H5VL_link_get_t ge break; } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from link") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_link_get() */ +} /* end H5VL__native_link_get() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_link_specific + * Function: H5VL__native_link_specific * * Purpose: Specific operations with links * @@ -2762,12 +2851,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_link_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_link_specific_t specific_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_link_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_link_specific_t specific_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(specific_type) { case H5VL_LINK_EXISTS: @@ -2783,6 +2872,7 @@ H5VL_native_link_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_link_spe HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to specific link info") break; } + case H5VL_LINK_ITER: { H5G_loc_t loc; @@ -2803,31 +2893,31 @@ H5VL_native_link_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_link_spe /* H5Lvisit */ if((ret_value = H5G_visit(&loc, ".", idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") - } + } /* end if */ else { /* H5Literate */ if((ret_value = H5L_iterate(&loc, ".", idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "error iterating over links") - } - } + } /* end else */ + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { if(recursive) { /* H5Lvisit_by_name */ if((ret_value = H5G_visit(&loc, loc_params.loc_data.loc_by_name.name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") - } + } /* end if */ else { /* H5Literate_by_name */ if((ret_value = H5L_iterate(&loc, loc_params.loc_data.loc_by_name.name, idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "error iterating over links") - } - } - else{ + } /* end else */ + } /* end else-if */ + else HGOTO_ERROR(H5E_LINK, H5E_UNSUPPORTED, FAIL, "unknown link iterate params") - } break; } + case H5VL_LINK_DELETE: { H5G_loc_t loc; @@ -2839,28 +2929,28 @@ H5VL_native_link_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_link_spe if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Ldelete */ if(H5L_delete(&loc, loc_params.loc_data.loc_by_name.name) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_IDX) { /* H5Ldelete_by_idx */ - if(H5L_delete_by_idx(&loc, loc_params.loc_data.loc_by_idx.name, loc_params.loc_data.loc_by_idx.idx_type, loc_params.loc_data.loc_by_idx.order, loc_params.loc_data.loc_by_idx.n) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") - } + } /* end else-if */ else HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") break; } + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_link_specific() */ +} /* end H5VL__native_link_specific() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_object_open + * Function: H5VL__native_object_open * * Purpose: Opens a object inside a native h5 file. * @@ -2873,13 +2963,13 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *opened_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *opened_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file or file object") @@ -2892,6 +2982,7 @@ H5VL_native_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *ope HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object by name") break; } + case H5VL_OBJECT_BY_IDX: { /* Open the object */ @@ -2900,6 +2991,7 @@ H5VL_native_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *ope HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object by index") break; } + case H5VL_OBJECT_BY_ADDR: { /* Open the object */ @@ -2907,6 +2999,7 @@ H5VL_native_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *ope HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object by address") break; } + case H5VL_OBJECT_BY_REF: { hid_t temp_id = H5I_INVALID_HID; @@ -2923,21 +3016,22 @@ H5VL_native_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *ope *opened_type = H5I_get_type(temp_id); if(NULL == (ret_value = H5I_remove(temp_id))) - HDONE_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open object") + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open object") break; } + case H5VL_OBJECT_BY_SELF: default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, NULL, "unknown open parameters") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_object_open() */ +} /* end H5VL__native_object_open() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_object_copy + * Function: H5VL__native_object_copy * * Purpose: Copys a object inside a native h5 file. * @@ -2950,15 +3044,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_object_copy(void *src_obj, H5VL_loc_params_t loc_params1, const char *src_name, - void *dst_obj, H5VL_loc_params_t loc_params2, const char *dst_name, - hid_t ocpypl_id, hid_t lcpl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_object_copy(void *src_obj, H5VL_loc_params_t loc_params1, const char *src_name, + void *dst_obj, H5VL_loc_params_t loc_params2, const char *dst_name, + hid_t ocpypl_id, hid_t lcpl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t src_loc; /* Source object group location */ H5G_loc_t dst_loc; /* Destination group location */ herr_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* get location for objects */ if(H5G_loc_real(src_obj, loc_params1.obj_type, &src_loc) < 0) @@ -2966,16 +3060,17 @@ H5VL_native_object_copy(void *src_obj, H5VL_loc_params_t loc_params1, const char if(H5G_loc_real(dst_obj, loc_params2.obj_type, &dst_loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - /* Open the object */ + /* Copy the object */ if((ret_value = H5O_copy(&src_loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object") + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_object_copy() */ +} /* end H5VL__native_object_copy() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_object_get + * Function: H5VL__native_object_get * * Purpose: Gets certain data about an object * @@ -2987,13 +3082,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_object_get(void *obj, H5VL_loc_params_t loc_params, H5VL_object_get_t get_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_object_get(void *obj, H5VL_loc_params_t loc_params, H5VL_object_get_t get_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ H5G_loc_t loc; /* Location of group */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") @@ -3017,6 +3112,7 @@ H5VL_native_object_get(void *obj, H5VL_loc_params_t loc_params, H5VL_object_get_ break; } + /* H5Rget_obj_type2 */ case H5VL_REF_GET_TYPE: { @@ -3029,6 +3125,7 @@ H5VL_native_object_get(void *obj, H5VL_loc_params_t loc_params, H5VL_object_get_ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object type") break; } + /* H5Rget_name */ case H5VL_REF_GET_NAME: { @@ -3043,31 +3140,33 @@ H5VL_native_object_get(void *obj, H5VL_loc_params_t loc_params, H5VL_object_get_ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object path") break; } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from object") - } + } /* end switch */ + done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_object_get() */ +} /* end H5VL__native_object_get() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_object_specific + * Function: H5VL__native_object_specific * - * Purpose: Perform a driver specific operation for an objectibute + * Purpose: Perform a plugin-specific operation for an objectibute * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t -H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object_specific_t specific_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object_specific_t specific_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5G_loc_t loc; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") @@ -3084,6 +3183,7 @@ H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object break; } + /* H5Oexists_by_name */ case H5VL_OBJECT_EXISTS: { @@ -3092,14 +3192,13 @@ H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* Check if the object exists */ if((*ret = H5G_loc_exists(&loc, loc_params.loc_data.loc_by_name.name)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", - loc_params.loc_data.loc_by_name.name) - } - else { + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", loc_params.loc_data.loc_by_name.name) + } /* end if */ + else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown object exists parameters") - } break; } + case H5VL_OBJECT_VISIT: { H5_index_t idx_type = va_arg(arguments, H5_index_t); @@ -3113,16 +3212,17 @@ H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object /* H5Ovisit */ if((ret_value = H5O__visit(&loc, ".", idx_type, order, op, op_data, fields)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Ovisit_by_name */ if((ret_value = H5O__visit(&loc, loc_params.loc_data.loc_by_name.name, idx_type, order, op, op_data, fields)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") - } + } /* end else-if */ else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown object visit params"); break; } + case H5VL_OBJECT_FLUSH: { hid_t oid = va_arg(arguments, hid_t); @@ -3133,6 +3233,7 @@ H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object break; } + case H5VL_OBJECT_REFRESH: { hid_t oid = va_arg(arguments, hid_t); @@ -3144,6 +3245,7 @@ H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object break; } + case H5VL_REF_CREATE: { void *ref = va_arg(arguments, void *); @@ -3161,19 +3263,20 @@ H5VL_native_object_specific(void *obj, H5VL_loc_params_t loc_params, H5VL_object break; } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't recognize this operation type") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_object_specific() */ +} /* end H5VL__native_object_specific() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_object_optional + * Function: H5VL__native_object_optional * - * Purpose: Perform a driver specific operation for an objectibute + * Purpose: Perform a plugin-specific operation for an objectibute * * Return: Success: 0 * Failure: -1 @@ -3184,14 +3287,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_object_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_object_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, + void H5_ATTR_UNUSED **req, va_list arguments) { H5VL_object_optional_t optional_type = va_arg(arguments, H5VL_object_optional_t); H5VL_loc_params_t loc_params = va_arg(arguments, H5VL_loc_params_t); H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") @@ -3207,12 +3311,12 @@ H5VL_native_object_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATT /* Retrieve the object's information */ if(H5G_loc_info(&loc, ".", obj_info, fields) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Oget_info_by_name */ /* Retrieve the object's information */ if(H5G_loc_info(&loc, loc_params.loc_data.loc_by_name.name, obj_info, fields) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") - } + } /* end else-if */ else if(loc_params.type == H5VL_OBJECT_BY_IDX) { /* H5Oget_info_by_idx */ H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -3234,17 +3338,17 @@ H5VL_native_object_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATT if(H5O_get_info(obj_loc.oloc, obj_info, fields) < 0) { H5G_loc_free(&obj_loc); HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") - } + } /* end if */ /* Release the object location */ if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - } - else { + HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + } /* end else-if */ + else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown get info parameters") - } break; } + /* H5Oget_comment / H5Oget_comment_by_name */ case H5VL_OBJECT_GET_COMMENT: { @@ -3256,16 +3360,16 @@ H5VL_native_object_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATT if(loc_params.type == H5VL_OBJECT_BY_SELF) { /* H5Oget_comment */ if((*ret = H5G_loc_get_comment(&loc, ".", comment/*out*/, bufsize)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Oget_comment_by_name */ if((*ret = H5G_loc_get_comment(&loc, loc_params.loc_data.loc_by_name.name, comment/*out*/, bufsize)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") - } - else { + } /* end else-if */ + else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown set_coment parameters") - } break; } + /* H5Oset_comment */ case H5VL_OBJECT_SET_COMMENT: { @@ -3275,28 +3379,28 @@ H5VL_native_object_optional(void *obj, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATT /* (Re)set the object's comment */ if(H5G_loc_set_comment(&loc, ".", comment) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") - } + } /* end if */ else if(loc_params.type == H5VL_OBJECT_BY_NAME) { /* H5Oset_comment_by_name */ /* (Re)set the object's comment */ if(H5G_loc_set_comment(&loc, loc_params.loc_data.loc_by_name.name, comment) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") - } - else { + } /* end else-if */ + else HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "unknown set_coment parameters") - } break; } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't perform this operation on object"); - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_object_optional() */ +} /* end H5VL__native_object_optional() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_datatype_commit + * Function: H5VL__native_datatype_commit * * Purpose: Commits a datatype inside a native h5 file. * @@ -3309,15 +3413,16 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char *name, hid_t type_id, - hid_t lcpl_id, hid_t tcpl_id, hid_t H5_ATTR_UNUSED tapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char *name, + hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t H5_ATTR_UNUSED tapl_id, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5G_loc_t loc; /* Location to commit datatype */ H5T_t *dt; /* Datatype for ID */ H5T_t *type = NULL; /* copy of the original type which will be committed */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) @@ -3351,23 +3456,25 @@ H5VL_native_datatype_commit(void *obj, H5VL_loc_params_t loc_params, const char /* H5Tcommit */ if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to commit datatype") - } + } /* end if */ else { /* H5Tcommit_anon */ if(H5T__commit_anon(loc.oloc->file, type, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to commit datatype") - } + } /* end else */ + ret_value = (void *)type; done: if(NULL == ret_value && type) H5T_close(type); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_datatype_commit() */ +} /* end H5VL__native_datatype_commit() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_datatype_open + * Function: H5VL__native_datatype_open * * Purpose: Opens a named datatype inside a native h5 file. * @@ -3377,14 +3484,14 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL_native_datatype_open(void *obj, H5VL_loc_params_t loc_params, const char *name, - hid_t H5_ATTR_UNUSED tapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_datatype_open(void *obj, H5VL_loc_params_t loc_params, const char *name, + hid_t H5_ATTR_UNUSED tapl_id, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { H5T_t *type = NULL; /* Datatype opened in file */ H5G_loc_t loc; /* Group location of object to open */ void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5G_loc_real(obj, loc_params.obj_type, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file or file object") @@ -3399,11 +3506,11 @@ H5VL_native_datatype_open(void *obj, H5VL_loc_params_t loc_params, const char *n done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_datatype_open() */ +} /* end H5VL__native_datatype_open() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_datatype_get + * Function: H5VL__native_datatype_get * * Purpose: Gets certain information about a datatype * @@ -3416,13 +3523,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_datatype_get(void *obj, H5VL_datatype_get_t get_type, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) +H5VL__native_datatype_get(void *obj, H5VL_datatype_get_t get_type, + hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5T_t *dt = (H5T_t *)obj; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch (get_type) { case H5VL_DATATYPE_GET_BINARY: @@ -3437,6 +3544,7 @@ H5VL_native_datatype_get(void *obj, H5VL_datatype_get_t get_type, *nalloc = (ssize_t) size; break; } + /* H5Tget_create_plist */ case H5VL_DATATYPE_GET_TCPL: { @@ -3447,17 +3555,18 @@ H5VL_native_datatype_get(void *obj, H5VL_datatype_get_t get_type, break; } + default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from datatype") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_datatype_get() */ +} /* end H5VL__native_datatype_get() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_datatype_specific + * Function: H5VL__native_datatype_specific * * Purpose: Specific operations for datatype * @@ -3466,13 +3575,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, +H5VL__native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments) { H5T_t *dt = (H5T_t *)obj; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC switch(specific_type) { case H5VL_DATATYPE_FLUSH: @@ -3485,6 +3594,7 @@ H5VL_native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, break; } + case H5VL_DATATYPE_REFRESH: { hid_t type_id = va_arg(arguments, hid_t); @@ -3495,17 +3605,18 @@ H5VL_native_datatype_specific(void *obj, H5VL_datatype_specific_t specific_type, break; } + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid specific operation") - } + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_datatype_specific() */ +} /* end H5VL__native_datatype_specific() */ /*------------------------------------------------------------------------- - * Function: H5VL_native_datatype_close + * Function: H5VL__native_datatype_close * * Purpose: Closes an datatype. * @@ -3518,16 +3629,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_datatype_close(void *dt, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) +H5VL__native_datatype_close(void *dt, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(H5T_close((H5T_t*)dt) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't close datatype") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_native_datatype_close() */ +} /* end H5VL__native_datatype_close() */ |