From 668df7889cdb78ddf5c05ba6846794991d1ed826 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 29 Mar 2012 15:06:05 -0500 Subject: [svn-r22194] - fix bug in set_vol_fapl to fix case when a vol is set explicitly by the user - remove the num_args parameter from the VOL GET callbacks --- src/H5D.c | 14 +++++++------- src/H5F.c | 24 ++++++++++++------------ src/H5G.c | 14 +++++++------- src/H5O.c | 23 ++++++++++++----------- src/H5Pfapl.c | 2 +- src/H5VL.c | 40 +++++++++++++++++++++------------------- src/H5VLdummy.c | 6 ++---- src/H5VLnative.c | 51 +++++++++++++++++---------------------------------- src/H5VLprivate.h | 10 +++++----- src/H5VLpublic.h | 10 +++++----- 10 files changed, 89 insertions(+), 105 deletions(-) diff --git a/src/H5D.c b/src/H5D.c index 6263804..99a2b19 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -333,7 +333,7 @@ H5Dget_space(hid_t dset_id) H5TRACE1("i", "i", dset_id); /* get the dataspace through the VOL */ - if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_SPACE, 1, &ret_value) < 0) + if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_SPACE, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get data space") done: FUNC_LEAVE_API(ret_value) @@ -363,7 +363,7 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) H5TRACE2("e", "i*Ds", dset_id, allocation); /* Read data space address through the VOL and return */ - if((ret_value=H5VL_dataset_get(dset_id, H5VL_DATASET_GET_SPACE_STATUS, 1, allocation)) < 0) + if((ret_value=H5VL_dataset_get(dset_id, H5VL_DATASET_GET_SPACE_STATUS, allocation)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get space status") done: @@ -396,7 +396,7 @@ H5Dget_type(hid_t dset_id) H5TRACE1("i", "i", dset_id); /* get the datatype through the VOL */ - if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_TYPE, 1, &ret_value) < 0) + if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_TYPE, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get datatype") done: @@ -428,7 +428,7 @@ H5Dget_create_plist(hid_t dset_id) FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); - if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_DCPL, 1, &ret_value) < 0) + if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_DCPL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataset creation properties") done: @@ -477,7 +477,7 @@ H5Dget_access_plist(hid_t dset_id) FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); - if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_DAPL, 1, &ret_value) < 0) + if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_DAPL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataset access properties") done: @@ -512,7 +512,7 @@ H5Dget_storage_size(hid_t dset_id) H5TRACE1("h", "i", dset_id); /* get storage size through the VOL */ - if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_STORAGE_SIZE, 1, &ret_value) < 0) + if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_STORAGE_SIZE, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get storage size") done: @@ -543,7 +543,7 @@ H5Dget_offset(hid_t dset_id) H5TRACE1("a", "i", dset_id); /* get offset through the VOL */ - if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_OFFSET, 1, &ret_value) < 0) + if(H5VL_dataset_get(dset_id, H5VL_DATASET_GET_OFFSET, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get offset") done: diff --git a/src/H5F.c b/src/H5F.c index b32c07d..bf8b89a 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -193,7 +193,7 @@ H5Fget_create_plist(hid_t uid) FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", uid); - if(H5VL_file_get(uid, H5VL_FILE_GET_FCPL, 1, &ret_value) < 0) + if(H5VL_file_get(uid, H5VL_FILE_GET_FCPL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file creation properties") done: @@ -230,7 +230,7 @@ H5Fget_access_plist(hid_t uid) FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", uid); - if(H5VL_file_get(uid, H5VL_FILE_GET_FAPL, 1, &ret_value) < 0) + if(H5VL_file_get(uid, H5VL_FILE_GET_FAPL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file creation properties") done: @@ -750,7 +750,7 @@ H5Fget_vfd_handle(hid_t uid, hid_t fapl, void **file_handle) if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file handle pointer") - if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_VFD_HANDLE, 2, file_handle, fapl)) < 0) + if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_VFD_HANDLE, file_handle, fapl)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file handle") done: @@ -1967,7 +1967,7 @@ H5Fget_intent(hid_t uid, unsigned *intent_flags) /* If no intent flags were passed in, exit quietly */ if(intent_flags) { - if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_INTENT, 1, intent_flags)) < 0) + if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_INTENT, intent_flags)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file intent") } @@ -2387,7 +2387,7 @@ H5Fget_freespace(hid_t uid) FUNC_ENTER_API(FAIL) H5TRACE1("Hs", "i", uid); - if(H5VL_file_get(uid, H5VL_FILE_GET_FREE_SPACE, 1, &ret_value) < 0) + if(H5VL_file_get(uid, H5VL_FILE_GET_FREE_SPACE, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file free space") done: @@ -2421,7 +2421,7 @@ H5Fget_filesize(hid_t uid, hsize_t *size) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", uid, size); - if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_SIZE, 1, size)) < 0) + if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_SIZE, size)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file size") done: @@ -2459,7 +2459,7 @@ H5Fget_mdc_config(hid_t uid, H5AC_cache_config_t *config_ptr) if((NULL == config_ptr) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") - if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_MDC_CONF, 1, config_ptr)) < 0) + if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_MDC_CONF, config_ptr)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get mdc config") done: @@ -2537,7 +2537,7 @@ H5Fget_mdc_hit_rate(hid_t uid, double *hit_rate_ptr) if(NULL == hit_rate_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL hit rate pointer") - if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_MDC_HR, 1, hit_rate_ptr)) < 0) + if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_MDC_HR, hit_rate_ptr)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get MDC hit rate") done: @@ -2572,7 +2572,7 @@ H5Fget_mdc_size(hid_t uid, size_t *max_size_ptr, size_t *min_clean_size_ptr, H5TRACE5("e", "i*z*z*z*Is", uid, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr); - if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_MDC_SIZE, 4, max_size_ptr, + if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_MDC_SIZE, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get MDC hit rate") @@ -2663,7 +2663,7 @@ H5Fget_name(hid_t uid, char *name/*out*/, size_t size) if (H5I_FILE_PUBLIC == H5I_get_type(uid) || H5I_GROUP_PUBLIC == H5I_get_type(uid) || H5I_DATATYPE_PUBLIC == H5I_get_type(uid) || H5I_DATASET_PUBLIC == H5I_get_type(uid) || H5I_ATTR_PUBLIC == H5I_get_type(uid)) { - if(H5VL_file_get(uid, H5VL_FILE_GET_NAME, 3, name, &ret_value, size) < 0) + if(H5VL_file_get(uid, H5VL_FILE_GET_NAME, name, &ret_value, size) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file name") } else { @@ -2731,7 +2731,7 @@ H5Fget_info2(hid_t uid, H5F_info2_t *finfo) if(!finfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_INFO, 1, finfo)) < 0) + if((ret_value = H5VL_file_get(uid, H5VL_FILE_GET_INFO, finfo)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file info") done: FUNC_LEAVE_API(ret_value) @@ -2766,7 +2766,7 @@ H5Fget_free_sections(hid_t uid, H5F_mem_t type, size_t nsects, if(sect_info && nsects == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "nsects must be > 0") - if(H5VL_file_get(uid, H5VL_FILE_GET_FREE_SECTIONS, 4, sect_info, &ret_value, + if(H5VL_file_get(uid, H5VL_FILE_GET_FREE_SECTIONS, sect_info, &ret_value, type, nsects) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get file info") done: diff --git a/src/H5G.c b/src/H5G.c index f1a689e..ffa39f4 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -437,7 +437,7 @@ H5Gget_create_plist(hid_t uid) FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", uid); - if(H5VL_group_get(uid, H5VL_GROUP_GET_GCPL, 1, &ret_value) < 0) + if(H5VL_group_get(uid, H5VL_GROUP_GET_GCPL, &ret_value) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group creation properties") done: @@ -477,11 +477,11 @@ H5Gget_info(hid_t loc_id, H5G_info_t *grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP, 1, &location) < 0) + if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP, &location) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, 2, grp_info, location)) < 0) + if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, grp_info, location)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: @@ -529,11 +529,11 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, 3, &location, name, lapl_id) < 0) + if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, &location, name, lapl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, 2, grp_info, location)) < 0) + if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, grp_info, location)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: @@ -587,12 +587,12 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_IDX, 6, &location, group_name, + if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_IDX, &location, group_name, idx_type, order, n, lapl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, 2, grp_info, location)) < 0) + if((ret_value = H5VL_group_get(loc_id, H5VL_GROUP_GET_INFO, grp_info, location)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: diff --git a/src/H5O.c b/src/H5O.c index 51ed59f..ae03519 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -241,7 +241,7 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, 3, &location, name, lapl_id) < 0) + if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, &location, name, lapl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") /* Open the object through the VOL */ @@ -304,7 +304,7 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_IDX, 6, &location, group_name, + if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_IDX, &location, group_name, idx_type, order, n, lapl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") @@ -367,7 +367,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr) H5TRACE2("i", "ia", loc_id, addr); /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_ADDR, 2, &location, addr) < 0) + if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_ADDR, &location, addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") /* Open the object through the VOL */ @@ -607,10 +607,10 @@ H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) else { /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP, 1, &location) < 0) + if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP, &location) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_object_get(loc_id, H5VL_OBJECT_GET_INFO, 2, oinfo, location)) < 0) + if((ret_value = H5VL_object_get(loc_id, H5VL_OBJECT_GET_INFO, oinfo, location)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") } @@ -658,11 +658,11 @@ H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lap HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, 3, &location, name, lapl_id) < 0) + if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, &location, name, lapl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_object_get(loc_id, H5VL_OBJECT_GET_INFO, 2, oinfo, location)) < 0) + if((ret_value = H5VL_object_get(loc_id, H5VL_OBJECT_GET_INFO, oinfo, location)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: @@ -716,12 +716,12 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_IDX, 6, &location, group_name, + if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_IDX, &location, group_name, idx_type, order, n, lapl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") /* Get the group info through the VOL using the location token */ - if((ret_value = H5VL_object_get(loc_id, H5VL_OBJECT_GET_INFO, 2, oinfo, location)) < 0) + if((ret_value = H5VL_object_get(loc_id, H5VL_OBJECT_GET_INFO, oinfo, location)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") done: @@ -843,7 +843,8 @@ H5Oget_comment(hid_t loc_id, char *comment, size_t bufsize) FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "i*sz", loc_id, comment, bufsize); - if(H5VL_object_get(loc_id, H5VL_OBJECT_GET_COMMENT, 3, &ret_value, comment, bufsize) < 0) + if(H5VL_object_get(loc_id, H5VL_OBJECT_GET_COMMENT, &ret_value, comment, bufsize, + ".", H5P_LINK_ACCESS_DEFAULT) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get object info") done: @@ -885,7 +886,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - if(H5VL_object_get(loc_id, H5VL_OBJECT_GET_COMMENT, 5, &ret_value, comment, bufsize, + if(H5VL_object_get(loc_id, H5VL_OBJECT_GET_COMMENT, &ret_value, comment, bufsize, name, lapl_id) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get object info") diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 13effa6..c75cf61 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2170,7 +2170,7 @@ H5P_set_vol(H5P_genplist_t *plist, H5VL_class_t *vol_cls) FUNC_ENTER_NOAPI(FAIL) /* Get the current vol information */ - if(H5P_get(plist, H5F_ACS_VOL_NAME, old_vol_cls) < 0) + if(H5P_get(plist, H5F_ACS_VOL_NAME, &old_vol_cls) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get vol ID") /* Close the vol for the property list */ diff --git a/src/H5VL.c b/src/H5VL.c index 83546de..dd624c8 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -705,18 +705,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_file_get(hid_t uid, H5VL_file_get_t get_type, int num_args, ...) +H5VL_file_get(hid_t uid, H5VL_file_get_t get_type, ...) { H5VL_id_wrapper_t *uid_info; /* user id structure */ va_list arguments; /* argument list passed from the API call */ + H5I_type_t id_type; /* Type of ID */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) + id_type = H5I_get_type(uid); /* Check/fix arguments. */ - if (H5I_FILE_PUBLIC != H5I_get_type(uid) && H5I_GROUP_PUBLIC != H5I_get_type(uid) && - H5I_DATATYPE_PUBLIC != H5I_get_type(uid) && H5I_DATASET_PUBLIC != H5I_get_type(uid) && - H5I_ATTR_PUBLIC != H5I_get_type(uid)) + if (H5I_FILE_PUBLIC != id_type && H5I_GROUP_PUBLIC != id_type && + H5I_DATATYPE_PUBLIC != id_type && H5I_DATASET_PUBLIC != id_type && + H5I_ATTR_PUBLIC != id_type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a user ID") /* get the ID struct */ @@ -726,8 +728,8 @@ H5VL_file_get(hid_t uid, H5VL_file_get_t get_type, int num_args, ...) if(NULL == uid_info->vol_plugin->file_cls.get) HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `file get' method") - va_start(arguments, num_args); - if((ret_value = (uid_info->vol_plugin->file_cls.get)(uid_info->obj_id, get_type, num_args, arguments)) < 0) + va_start(arguments, get_type); + if((ret_value = (uid_info->vol_plugin->file_cls.get)(uid_info->obj_id, get_type, arguments)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "get failed") va_end(arguments); @@ -899,7 +901,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_group_get(hid_t uid, H5VL_group_get_t get_type, int num_args, ...) +H5VL_group_get(hid_t uid, H5VL_group_get_t get_type, ...) { H5VL_id_wrapper_t *uid_info; /* user id structure */ va_list arguments; /* argument list passed from the API call */ @@ -920,9 +922,9 @@ H5VL_group_get(hid_t uid, H5VL_group_get_t get_type, int num_args, ...) if(NULL == uid_info->vol_plugin->group_cls.get) HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `group get' method") - va_start (arguments, num_args); + va_start (arguments, get_type); if((ret_value = (uid_info->vol_plugin->group_cls.get)(uid_info->obj_id, get_type, - num_args, arguments)) < 0) + arguments)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "get failed") va_end (arguments); @@ -1078,9 +1080,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_object_lookup(hid_t uid, H5VL_object_lookup_t lookup_type, int num_args, ...) +H5VL_object_lookup(hid_t uid, H5VL_object_lookup_t lookup_type, ...) { - H5VL_id_wrapper_t *uid_info; /* user id structure */ + H5VL_id_wrapper_t *uid_info; /* user id structure */ va_list arguments; /* argument list passed from the API call */ H5I_type_t id_type; herr_t ret_value = SUCCEED; @@ -1101,9 +1103,9 @@ H5VL_object_lookup(hid_t uid, H5VL_object_lookup_t lookup_type, int num_args, .. if(NULL == uid_info->vol_plugin->object_cls.lookup) HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `object lookup' method") - va_start (arguments, num_args); + va_start (arguments, lookup_type); if((ret_value = (uid_info->vol_plugin->object_cls.lookup)(uid_info->obj_id, lookup_type, - num_args, arguments)) < 0) + arguments)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "lookup of object location failed") va_end (arguments); done: @@ -1126,7 +1128,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_object_get(hid_t uid, H5VL_object_get_t get_type, int num_args, ...) +H5VL_object_get(hid_t uid, H5VL_object_get_t get_type, ...) { H5VL_id_wrapper_t *uid_info; /* user id structure */ va_list arguments; /* argument list passed from the API call */ @@ -1149,9 +1151,9 @@ H5VL_object_get(hid_t uid, H5VL_object_get_t get_type, int num_args, ...) if(NULL == uid_info->vol_plugin->object_cls.get) HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `object get' method") - va_start (arguments, num_args); + va_start (arguments, get_type); if((ret_value = (uid_info->vol_plugin->object_cls.get)(uid_info->obj_id, get_type, - num_args, arguments)) < 0) + arguments)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "get failed") va_end (arguments); done: @@ -1550,7 +1552,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL_dataset_get(hid_t uid, H5VL_dataset_get_t get_type, int num_args, ...) +H5VL_dataset_get(hid_t uid, H5VL_dataset_get_t get_type, ...) { H5VL_id_wrapper_t *uid_info; /* user id structure */ va_list arguments; /* argument list passed from the API call */ @@ -1569,9 +1571,9 @@ H5VL_dataset_get(hid_t uid, H5VL_dataset_get_t get_type, int num_args, ...) if(NULL == uid_info->vol_plugin->dataset_cls.get) HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "vol plugin has no `dataset get' method") - va_start (arguments, num_args); + va_start (arguments, get_type); if((ret_value = (uid_info->vol_plugin->dataset_cls.get)(uid_info->obj_id, get_type, - num_args, arguments)) < 0) + arguments)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "get failed") va_end (arguments); done: diff --git a/src/H5VLdummy.c b/src/H5VLdummy.c index c015dfe..334345a 100644 --- a/src/H5VLdummy.c +++ b/src/H5VLdummy.c @@ -55,8 +55,7 @@ static hid_t H5VL_DUMMY_g = 0; /* Prototypes */ static herr_t H5VL_dummy_term(void); -static hid_t H5VL_dummy_file_open(const char *name, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t dxpl_id); +static hid_t H5VL_dummy_file_open(const char *name, unsigned flags, hid_t fapl_id); static herr_t H5VL_dummy_file_close(hid_t fid); static hid_t H5VL_dummy_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); @@ -237,8 +236,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5VL_dummy_file_open(const char *name, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t dxpl_id) +H5VL_dummy_file_open(const char *name, unsigned flags, hid_t fapl_id) { FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5VLnative.c b/src/H5VLnative.c index e833a65..91f1efa 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -60,8 +60,7 @@ static herr_t H5VL_native_term(void); static hid_t H5VL_native_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); static hid_t H5VL_native_file_open(const char *name, unsigned flags, hid_t fapl_id); static herr_t H5VL_native_file_flush(hid_t fid, H5F_scope_t scope); -static herr_t H5VL_native_file_get(hid_t file_id, H5VL_file_get_t get_type, - int num_args, va_list arguments); +static herr_t H5VL_native_file_get(hid_t file_id, H5VL_file_get_t get_type, va_list arguments); static herr_t H5VL_native_file_close(hid_t fid); static hid_t H5VL_native_dataset_create(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, @@ -72,8 +71,7 @@ static herr_t H5VL_native_dataset_read(hid_t dset_id, hid_t mem_type_id, hid_t m static herr_t H5VL_native_dataset_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf); static herr_t H5VL_native_dataset_set_extent(hid_t dset_id, const hsize_t size[]); -static herr_t H5VL_native_dataset_get(hid_t id, H5VL_dataset_get_t get_type, - int num_args, va_list arguments); +static herr_t H5VL_native_dataset_get(hid_t id, H5VL_dataset_get_t get_type, va_list arguments); static herr_t H5VL_native_dataset_close(hid_t dataset_id); static herr_t H5VL_native_datatype_commit(hid_t loc_id, const char *name, hid_t type_id, @@ -83,15 +81,12 @@ static hid_t H5VL_native_datatype_open(hid_t loc_id, const char *name, hid_t tap static hid_t H5VL_native_group_create(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id); static hid_t H5VL_native_group_open(hid_t loc_id, const char *name, hid_t gapl_id); -static herr_t H5VL_native_group_get(hid_t obj_id, H5VL_group_get_t get_type, - int num_args, va_list arguments); +static herr_t H5VL_native_group_get(hid_t obj_id, H5VL_group_get_t get_type, va_list arguments); static herr_t H5VL_native_group_close(hid_t group_id); static hid_t H5VL_native_object_open(hid_t loc_id, void *location, hid_t lapl_id); -static herr_t H5VL_native_object_get(hid_t id, H5VL_object_get_t get_type, - int num_args, va_list arguments); -static herr_t H5VL_native_object_lookup(hid_t loc_id, H5VL_object_lookup_t lookup_type, - int num_args, va_list arguments); +static herr_t H5VL_native_object_get(hid_t id, H5VL_object_get_t get_type, va_list arguments); +static herr_t H5VL_native_object_lookup(hid_t loc_id, H5VL_object_lookup_t lookup_type, va_list arguments); static herr_t H5VL_native_object_close(hid_t object_id); H5VL_class_t H5VL_native_g = { @@ -529,7 +524,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_file_get(hid_t obj_id, H5VL_file_get_t get_type, int num_args, va_list arguments) +H5VL_native_file_get(hid_t obj_id, H5VL_file_get_t get_type, va_list arguments) { H5F_t *f = NULL; /* File struct */ herr_t ret_value = SUCCEED; /* Return value */ @@ -902,7 +897,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_group_get(hid_t obj_id, H5VL_group_get_t get_type, int num_args, va_list arguments) +H5VL_native_group_get(hid_t obj_id, H5VL_group_get_t get_type, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1073,7 +1068,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_object_get(hid_t id, H5VL_object_get_t get_type, int num_args, va_list arguments) +H5VL_native_object_get(hid_t id, H5VL_object_get_t get_type, va_list arguments) { herr_t ret_value = SUCCEED; /* Return value */ H5G_loc_t loc; /* Location of group */ @@ -1108,31 +1103,20 @@ H5VL_native_object_get(hid_t id, H5VL_object_get_t get_type, int num_args, va_li ssize_t *ret = va_arg (arguments, ssize_t *); char *comment = va_arg (arguments, char *); size_t bufsize = va_arg (arguments, size_t); + char *name = va_arg (arguments, char *); + hid_t lapl_id = va_arg (arguments, hid_t); + + /* Retrieve the object's comment */ + if((*ret = H5G_loc_get_comment(&loc, name, comment/*out*/, bufsize, + lapl_id, H5AC_ind_dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") - if(3 == num_args) { - /* Retrieve the object's comment */ - if((*ret = H5G_loc_get_comment(&loc, ".", comment/*out*/, bufsize, - H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") - } - else if(5 == num_args) { - char *name = va_arg (arguments, char *); - hid_t lapl_id = va_arg (arguments, hid_t); - - /* Retrieve the object's comment */ - if((*ret = H5G_loc_get_comment(&loc, name, comment/*out*/, bufsize, lapl_id, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") - } break; } default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from object") } done: - /* Release the object location - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_native_object_get() */ @@ -1150,8 +1134,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_object_lookup(hid_t loc_id, H5VL_object_lookup_t lookup_type, - int num_args, va_list arguments) +H5VL_native_object_lookup(hid_t loc_id, H5VL_object_lookup_t lookup_type, va_list arguments) { H5G_loc_t loc; H5G_loc_t obj_loc; @@ -1704,7 +1687,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5VL_native_dataset_get(hid_t id, H5VL_dataset_get_t get_type, int num_args, va_list arguments) +H5VL_native_dataset_get(hid_t id, H5VL_dataset_get_t get_type, va_list arguments) { H5D_t *dset = NULL; herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h index 6e86b7c..f3bce81 100644 --- a/src/H5VLprivate.h +++ b/src/H5VLprivate.h @@ -59,7 +59,7 @@ H5_DLL hid_t H5VL_file_open(const char *name, unsigned flags, hid_t fapl_id); H5_DLL hid_t H5VL_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); H5_DLL herr_t H5VL_file_close(hid_t file_id); H5_DLL herr_t H5VL_file_flush(hid_t file_id, H5F_scope_t scope); -H5_DLL herr_t H5VL_file_get(hid_t uid, H5VL_file_get_t get_type, int num_args, ...); +H5_DLL herr_t H5VL_file_get(hid_t uid, H5VL_file_get_t get_type, ...); H5_DLL hid_t H5VL_dataset_create(hid_t uid, const char *name, hid_t dtype_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id); H5_DLL hid_t H5VL_dataset_open(hid_t uid, const char *name, hid_t dapl_id); @@ -67,7 +67,7 @@ H5_DLL herr_t H5VL_dataset_close(hid_t uid); H5_DLL herr_t H5VL_dataset_read(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, void *buf); H5_DLL herr_t H5VL_dataset_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t plist_id, const void *buf); H5_DLL herr_t H5VL_dataset_set_extent(hid_t uid, const hsize_t size[]); -H5_DLL herr_t H5VL_dataset_get(hid_t uid, H5VL_dataset_get_t get_type, int num_args, ...); +H5_DLL herr_t H5VL_dataset_get(hid_t uid, H5VL_dataset_get_t get_type, ...); H5_DLL herr_t H5VL_datatype_commit(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id); H5_DLL hid_t H5VL_datatype_open(hid_t loc_id, const char *name, hid_t tapl_id); @@ -75,12 +75,12 @@ H5_DLL hid_t H5VL_datatype_open(hid_t loc_id, const char *name, hid_t tapl_id); H5_DLL hid_t H5VL_group_create(hid_t uid, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id); H5_DLL hid_t H5VL_group_open(hid_t uid, const char *name, hid_t gapl_id); H5_DLL herr_t H5VL_group_close(hid_t uid); -H5_DLL herr_t H5VL_group_get(hid_t uid, H5VL_group_get_t get_type, int num_args, ...); +H5_DLL herr_t H5VL_group_get(hid_t uid, H5VL_group_get_t get_type, ...); H5_DLL hid_t H5VL_object_open(hid_t uid, void *obj_loc, hid_t lapl_id); H5_DLL herr_t H5VL_object_close(hid_t uid); -H5_DLL herr_t H5VL_object_get(hid_t uid, H5VL_object_get_t get_type, int num_args, ...); -H5_DLL herr_t H5VL_object_lookup(hid_t uid, H5VL_object_lookup_t lookup_type, int num_args, ...); +H5_DLL herr_t H5VL_object_get(hid_t uid, H5VL_object_get_t get_type, ...); +H5_DLL herr_t H5VL_object_lookup(hid_t uid, H5VL_object_lookup_t lookup_type, ...); H5_DLL herr_t H5VL_fapl_open(struct H5P_genplist_t *plist, H5VL_class_t *vol_cls); H5_DLL herr_t H5VL_fapl_close(H5VL_class_t *vol_cls); diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index cb23f62..80ed8bc 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -80,7 +80,7 @@ typedef struct H5VL_file_class_t { hid_t (*create)(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); hid_t (*open) (const char *name, unsigned flags, hid_t fapl_id); herr_t (*flush) (hid_t file_id, H5F_scope_t scope); - herr_t (*get) (hid_t file_id, H5VL_file_get_t get_type, int num_args, va_list arguments); + herr_t (*get) (hid_t file_id, H5VL_file_get_t get_type, va_list arguments); herr_t (*close) (hid_t file_id); } H5VL_file_class_t; @@ -94,7 +94,7 @@ typedef struct H5VL_dataset_class_t { herr_t (*write) (hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t xfer_plist_id, const void * buf ); herr_t (*set_extent) (hid_t uid, const hsize_t size[]); - herr_t (*get) (hid_t file_id, H5VL_dataset_get_t get_type, int num_args, va_list arguments); + herr_t (*get) (hid_t file_id, H5VL_dataset_get_t get_type, va_list arguments); herr_t (*close) (hid_t dataset_id); } H5VL_dataset_class_t; @@ -131,7 +131,7 @@ typedef struct H5VL_link_class_t { typedef struct H5VL_group_class_t { hid_t (*create)(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id); hid_t (*open) (hid_t loc_id, const char *name, hid_t gapl_id); - herr_t (*get) (hid_t file_id, H5VL_group_get_t get_type, int num_args, va_list arguments); + herr_t (*get) (hid_t file_id, H5VL_group_get_t get_type, va_list arguments); herr_t (*close) (hid_t group_id); } H5VL_group_class_t; @@ -142,8 +142,8 @@ typedef struct H5VL_object_class_t { const char *dest_name, hid_t lcpl, hid_t lapl); herr_t (*copy) (hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id ); - herr_t (*lookup)(hid_t loc_id, H5VL_object_lookup_t lookup_type, int num_args, va_list arguments); - herr_t (*get) (hid_t loc_id, H5VL_object_get_t get_type, int num_args, va_list arguments); + herr_t (*lookup)(hid_t loc_id, H5VL_object_lookup_t lookup_type, va_list arguments); + herr_t (*get) (hid_t loc_id, H5VL_object_get_t get_type, va_list arguments); herr_t (*close) (hid_t obj_id); } H5VL_object_class_t; -- cgit v0.12