summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c83
1 files changed, 39 insertions, 44 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index f9a730d..09ff894 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -493,7 +493,7 @@ static const hbool_t H5F_def_coll_md_write_flag_g =
H5F_ACS_COLL_MD_WRITE_FLAG_DEF; /* Default setting for the collective metedata write flag */
static const MPI_Comm H5F_def_mpi_params_comm_g = H5F_ACS_MPI_PARAMS_COMM_DEF; /* Default MPI communicator */
static const MPI_Info H5F_def_mpi_params_info_g = H5F_ACS_MPI_PARAMS_INFO_DEF; /* Default MPI info struct */
-#endif /* H5_HAVE_PARALLEL */
+#endif /* H5_HAVE_PARALLEL */
static const H5AC_cache_image_config_t H5F_def_mdc_initCacheImageCfg_g =
H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_DEF; /* Default metadata cache image settings */
static const size_t H5F_def_page_buf_size_g = H5F_ACS_PAGE_BUFFER_SIZE_DEF; /* Default page buffer size */
@@ -1816,23 +1816,22 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr)
+H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*x", plist_id, config_ptr);
+ H5TRACE2("e", "i*x", plist_id, config);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- /* validate the config_ptr */
- if (config_ptr == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.")
-
- if (config_ptr->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION)
+ /* validate the config ptr */
+ if (config == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config ptr on entry.")
+ if (config->version != H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown image config version.")
/* If we ever support multiple versions of H5AC_cache_config_t, we
@@ -1841,7 +1840,7 @@ H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr)
*/
/* Get the current initial metadata cache resize configuration */
- if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config_ptr) < 0)
+ if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_IMAGE_CONFIG_NAME, config) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get metadata cache initial image config")
done:
@@ -1897,7 +1896,7 @@ done:
* Purpose: Retrieve the metadata cache initial resize configuration
* from the target FAPL.
*
- * Observe that the function will fail if config_ptr is
+ * Observe that the function will fail if config is
* NULL, or if config_ptr->version specifies an unknown
* version of H5AC_cache_config_t.
*
@@ -1909,23 +1908,22 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr)
+H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*x", plist_id, config_ptr);
+ H5TRACE2("e", "i*x", plist_id, config);
/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- /* validate the config_ptr */
- if (config_ptr == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.")
-
- if (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)
+ /* validate the config ptr */
+ if (config == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config ptr on entry.")
+ if (config->version != H5AC__CURR_CACHE_CONFIG_VERSION)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.")
/* If we ever support multiple versions of H5AC_cache_config_t, we
@@ -1934,7 +1932,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr)
*/
/* Get the current initial metadata cache resize configuration */
- if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, config_ptr) < 0)
+ if (H5P_get(plist, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, config) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get metadata cache initial resize config")
done:
@@ -2438,7 +2436,6 @@ H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, H5F_libver_t high)
/* Check args */
if (low < 0 || low > H5F_LIBVER_LATEST)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "low bound is not valid")
-
if (high < 0 || high > H5F_LIBVER_LATEST)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "high bound is not valid")
@@ -2490,15 +2487,13 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low /*out*/, H5F_libver_t *hi
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
- if (low) {
+ if (low)
if (H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, low) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get low bound for library format versions")
- }
- if (high) {
+ if (high)
if (H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get high bound for library format versions")
- }
done:
FUNC_LEAVE_API(ret_value)
@@ -2663,22 +2658,22 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pget_file_image
*
- * Purpose: If the file image exists and buf_ptr_ptr is not NULL,
+ * Purpose: If the file image exists and buf is not NULL,
* allocate a buffer of the correct size, copy the image into
* the new buffer, and return the buffer to the caller in
- * *buf_ptr_ptr. Do this using the file image callbacks
+ * *buf. Do this using the file image callbacks
* if defined.
*
* NB: It is the responsibility of the caller to free the
- * buffer whose address is returned in *buf_ptr_ptr. Do
+ * buffer whose address is returned in *buf. Do
* this using free if the file image callbacks are not
* defined, or with whatever method is appropriate if
* the callbacks are defined.
*
- * If buf_ptr_ptr is not NULL, and no image exists, set
- * *buf_ptr_ptr to NULL.
+ * If buf is not NULL, and no image exists, set
+ * *buf to NULL.
*
- * If buf_len_ptr is not NULL, set *buf_len_ptr equal
+ * If buf_len is not NULL, set *buf_len equal
* to the length of the file image if it exists, and
* to 0 if it does not.
*
@@ -2690,14 +2685,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr)
+H5Pget_file_image(hid_t fapl_id, void **buf, size_t *buf_len)
{
H5P_genplist_t * fapl; /* Property list pointer */
H5FD_file_image_info_t image_info; /* File image info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE3("e", "i**x*z", fapl_id, buf_ptr_ptr, buf_len_ptr);
+ H5TRACE3("e", "i**x*z", fapl_id, buf, buf_len);
/* Get the plist structure */
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
@@ -2712,11 +2707,11 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr)
((image_info.buffer == NULL) && (image_info.size == 0)));
/* Set output size */
- if (buf_len_ptr != NULL)
- *buf_len_ptr = image_info.size;
+ if (buf_len != NULL)
+ *buf_len = image_info.size;
/* Duplicate the image if desired, using callbacks if available */
- if (buf_ptr_ptr != NULL) {
+ if (buf != NULL) {
void *copy_ptr = NULL; /* Copy of memory image */
if (image_info.buffer != NULL) {
@@ -2741,7 +2736,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr)
H5MM_memcpy(copy_ptr, image_info.buffer, image_info.size);
} /* end if */
- *buf_ptr_ptr = copy_ptr;
+ *buf = copy_ptr;
} /* end if */
done:
@@ -2826,7 +2821,7 @@ done:
} /* end H5Pset_file_image_callbacks() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_file_image_callbacks
+ * Function: H5Pget_file_image_callbacks
*
* Purpose: Sets the callbacks for file images. Some file drivers allow
* the use of user-defined callbacks for allocating, freeing and
@@ -2841,14 +2836,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr)
+H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks)
{
H5P_genplist_t * fapl; /* Property list pointer */
H5FD_file_image_info_t info; /* File image info */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*x", fapl_id, callbacks_ptr);
+ H5TRACE2("e", "i*x", fapl_id, callbacks);
/* Get the plist structure */
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
@@ -2861,17 +2856,17 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback
/* verify file image field consistency */
HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0)));
- /* verify that callbacks_ptr is not NULL */
- if (NULL == callbacks_ptr)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr")
+ /* verify that callbacks is not NULL */
+ if (NULL == callbacks)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks ptr")
/* Transfer values to parameters */
- *callbacks_ptr = info.callbacks;
+ *callbacks = info.callbacks;
/* Copy udata if it exists */
if (info.callbacks.udata != NULL) {
HDassert(info.callbacks.udata_copy);
- if ((callbacks_ptr->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0)
+ if ((callbacks->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy udata")
} /* end if */
@@ -4309,7 +4304,7 @@ H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled, char *location, size
*location_size = HDstrlen(location_ptr) + 1;
else
*location_size = 0;
- }
+ } /* end if */
done:
FUNC_LEAVE_API(ret_value)