diff options
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 58 |
1 files changed, 25 insertions, 33 deletions
@@ -21,20 +21,13 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Aprivate.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ #include "H5FLprivate.h" /* Free lists */ -#include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -#include "H5Tprivate.h" /* Datatypes */ #include "H5VLprivate.h" /* Virtual Object Layer */ #include "H5VLnative_private.h" /* Native VOL connector */ @@ -479,7 +472,7 @@ done: hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { - H5F_t * new_file = NULL; /* File struct for new file */ + void * new_file = NULL; /* File struct for new file */ H5P_genplist_t * plist; /* Property list pointer */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ H5VL_object_t * vol_obj = NULL; /* VOL object for file */ @@ -534,8 +527,8 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; /* Create a new file or truncate an existing file through the VOL */ - if (NULL == (new_file = (H5F_t *)H5VL_file_create(&connector_prop, filename, flags, fcpl_id, fapl_id, - H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) + if (NULL == (new_file = H5VL_file_create(&connector_prop, filename, flags, fcpl_id, fapl_id, + H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to create file") /* Get an atom for the file */ @@ -579,7 +572,7 @@ done: hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { - H5F_t * new_file = NULL; /* File struct for new file */ + void * new_file = NULL; /* File struct for new file */ H5P_genplist_t * plist; /* Property list pointer */ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ H5VL_object_t * vol_obj = NULL; /* VOL object for file */ @@ -622,8 +615,8 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set VOL connector info in API context") /* Open the file through the VOL layer */ - if (NULL == (new_file = (H5F_t *)H5VL_file_open(&connector_prop, filename, flags, fapl_id, - H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) + if (NULL == (new_file = H5VL_file_open(&connector_prop, filename, flags, fapl_id, + H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file") /* Get an ID for the file */ @@ -674,7 +667,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) H5I_DATASET != obj_type && H5I_ATTR != obj_type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - /* get the file object */ + /* Get the file object */ if (NULL == (vol_obj = H5VL_vol_object(object_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") @@ -704,7 +697,7 @@ done: herr_t H5Fclose(hid_t file_id) { - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -715,7 +708,7 @@ H5Fclose(hid_t file_id) /* Close the file */ if (H5I_dec_app_ref(file_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed") + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") done: FUNC_LEAVE_API(ret_value) @@ -833,7 +826,6 @@ H5Freopen(hid_t file_id) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to make file 'post open' callback") done: - /* XXX (VOL MERGE): If registration fails, file will not be closed */ FUNC_LEAVE_API(ret_value) } /* end H5Freopen() */ @@ -1013,13 +1005,13 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) +H5Fget_file_image(hid_t file_id, void *buf, size_t buf_len) { H5VL_object_t *vol_obj; /* File object for file ID */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "i*xz", file_id, buf_ptr, buf_len); + H5TRACE3("Zs", "i*xz", file_id, buf, buf_len); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1027,7 +1019,7 @@ H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) /* Get the file image */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_FILE_IMAGE, H5P_DATASET_XFER_DEFAULT, - H5_REQUEST_NULL, buf_ptr, &ret_value, buf_len) < 0) + H5_REQUEST_NULL, buf, &ret_value, buf_len) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "unable to get file image") done: @@ -1049,17 +1041,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) +H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config) { H5VL_object_t *vol_obj = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*x", file_id, config_ptr); + H5TRACE2("e", "i*x", file_id, config); /* Check args */ - if ((NULL == config_ptr) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") + if ((NULL == config) || (config->version != H5AC__CURR_CACHE_CONFIG_VERSION)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad configptr") /* Get the file object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id))) @@ -1067,7 +1059,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) /* Get the metadata cache configuration */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_CONF, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - config_ptr) < 0) + config) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache configuration") done: @@ -1120,23 +1112,23 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr) +H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate) { H5VL_object_t *vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*d", file_id, hit_rate_ptr); + H5TRACE2("e", "i*d", file_id, hit_rate); /* Check args */ - if (NULL == hit_rate_ptr) + if (NULL == hit_rate) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL hit rate pointer") if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Get the current hit rate */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_HR, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - hit_rate_ptr) < 0) + hit_rate) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC hit rate") done: @@ -1157,14 +1149,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, - int *cur_num_entries_ptr) +H5Fget_mdc_size(hid_t file_id, size_t *max_size, size_t *min_clean_size, size_t *cur_size, + int *cur_num_entries) { H5VL_object_t *vol_obj; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*z*z*z*Is", file_id, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr); + H5TRACE5("e", "i*z*z*z*Is", file_id, max_size, min_clean_size, cur_size, cur_num_entries); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1172,7 +1164,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, /* Get the size data */ if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_GET_MDC_SIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, - max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr) < 0) + max_size, min_clean_size, cur_size, cur_num_entries) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get MDC size") done: |