summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-08-21 19:45:36 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-08-21 19:45:36 (GMT)
commit18d574106c5eaeb7addd6fa6b28d5197cedce992 (patch)
tree71b66031947de38674867f1826f60a8c872eb1d8 /src/H5Pfapl.c
parent60d3b3091764c2ec9bede45aeacb6b2da1fa22d8 (diff)
parente53af0ed745a7bec1795681c473ba54025814fd5 (diff)
downloadhdf5-18d574106c5eaeb7addd6fa6b28d5197cedce992.zip
hdf5-18d574106c5eaeb7addd6fa6b28d5197cedce992.tar.gz
hdf5-18d574106c5eaeb7addd6fa6b28d5197cedce992.tar.bz2
[svn-r22704] merge from trunk up to 22703.
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c355
1 files changed, 130 insertions, 225 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 1479cd5..26b6862 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -178,6 +178,7 @@ static herr_t H5P_file_image_info_close(const char *name, size_t size, void *val
/* File access property list class library initialization object */
const H5P_libclass_t H5P_CLS_FACC[1] = {{
"file access", /* Class name for debugging */
+ H5P_TYPE_FILE_ACCESS, /* Class type */
&H5P_CLS_ROOT_g, /* Parent class ID */
&H5P_CLS_FILE_ACCESS_g, /* Pointer to class ID */
&H5P_LST_FILE_ACCESS_g, /* Pointer to default property list ID */
@@ -609,47 +610,40 @@ done:
* Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/,
- hsize_t *alignment/*out*/)
+ hsize_t *alignment/*out*/)
{
- H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "ixx", fapl_id, threshold, alignment);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Get values */
- if (threshold)
+ if(threshold)
if(H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, threshold) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get threshold");
- if (alignment)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get threshold")
+ if(alignment)
if(H5P_get(plist, H5F_ACS_ALIGN_NAME, alignment) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_alignment() */
/*-------------------------------------------------------------------------
* Function: H5P_set_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access or data
- * transfer property list (PLIST_ID) and supply an optional
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
* struct containing the driver-specific properites
* (DRIVER_INFO). The driver properties will be copied into the
* property list and the reference count on the driver will be
@@ -657,19 +651,11 @@ done:
* still use the property list.
*
* Return: Success: Non-negative
- *
* Failure: Negative
*
* Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -677,7 +663,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive
{
hid_t driver_id; /* VFL driver ID */
void *driver_info; /* VFL driver info */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -692,29 +678,15 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL,"can't get driver info")
/* Close the driver for the property list */
- if(H5FD_fapl_close(driver_id, driver_info)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't reset driver")
-
- /* Set the driver for the property list */
- if(H5FD_fapl_open(plist, new_driver_id, new_driver_info)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } else if(TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER)) {
- /* Get the current driver information */
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID")
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &driver_info) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver info")
-
- /* Close the driver for the property list */
- if(H5FD_dxpl_close(driver_id, driver_info) < 0)
+ if(H5FD_fapl_close(driver_id, driver_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't reset driver")
/* Set the driver for the property list */
- if(H5FD_dxpl_open(plist, new_driver_id, new_driver_info) < 0)
+ if(H5FD_fapl_open(plist, new_driver_id, new_driver_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set driver")
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list")
- }
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -724,8 +696,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Pset_driver
*
- * Purpose: Set the file driver (DRIVER_ID) for a file access or data
- * transfer property list (PLIST_ID) and supply an optional
+ * Purpose: Set the file driver (DRIVER_ID) for a file access
+ * property list (PLIST_ID) and supply an optional
* struct containing the driver-specific properites
* (DRIVER_INFO). The driver properties will be copied into the
* property list and the reference count on the driver will be
@@ -733,19 +705,11 @@ done:
* still use the property list.
*
* Return: Success: Non-negative
- *
* Failure: Negative
*
* Programmer: Robb Matzke
* Tuesday, August 3, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -776,7 +740,7 @@ done:
* Function: H5P_get_driver
*
* Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list or data transfer propert list.
+ * be a file access property list.
*
* Return: Success: A low-level driver ID which is the same ID
* used when the driver was set for the property
@@ -788,54 +752,36 @@ done:
* Programmer: Robb Matzke
* Thursday, February 26, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-03
- * Rewritten to use the virtual file layer.
- *
- * Robb Matzke, 1999-08-05
- * If the driver ID is H5FD_VFD_DEFAULT then substitute the
- * current value of H5FD_SEC2.
- *
- * Quincey Koziol 2000-11-28
- * Added internal function..
- *
- * Raymond Lu, 2001-10-23
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
hid_t
H5P_get_driver(H5P_genplist_t *plist)
{
- hid_t ret_value=FAIL; /* Return value */
+ hid_t ret_value = FAIL; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Get the current driver ID */
- if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &ret_value) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID");
- } else if( TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER) ) {
- if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &ret_value)<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
- if (H5FD_VFD_DEFAULT==ret_value)
+ if(H5FD_VFD_DEFAULT == ret_value)
ret_value = H5_DEFAULT_VFD;
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_driver() */
/*-------------------------------------------------------------------------
* Function: H5Pget_driver
*
* Purpose: Return the ID of the low-level file driver. PLIST_ID should
- * be a file access property list or data transfer propert list.
+ * be a file access property list.
*
* Return: Success: A low-level driver ID which is the same ID
* used when the driver was set for the property
@@ -847,16 +793,6 @@ done:
* Programmer: Robb Matzke
* Thursday, February 26, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-03
- * Rewritten to use the virtual file layer.
- *
- * Robb Matzke, 1999-08-05
- * If the driver ID is H5FD_VFD_DEFAULT then substitute the current value of
- * H5FD_SEC2.
- *
- * Quincey Koziol 2000-11-28
- * Added internal function..
*-------------------------------------------------------------------------
*/
hid_t
@@ -871,7 +807,9 @@ H5Pget_driver(hid_t plist_id)
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
- ret_value = H5P_get_driver(plist);
+ /* Get the driver */
+ if((ret_value = H5P_get_driver(plist)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver")
done:
FUNC_LEAVE_API(ret_value)
@@ -882,7 +820,7 @@ done:
* Function: H5P_get_driver_info
*
* Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access or data transfer property list.
+ * information of a file access.
*
* Return: Success: Ptr to *uncopied* driver specific data
* structure if any.
@@ -895,32 +833,22 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
void *
H5P_get_driver_info(H5P_genplist_t *plist)
{
- void *ret_value=NULL;
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
/* Get the current driver info */
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FILE_DRV_INFO_NAME, &ret_value) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,NULL,"can't get driver info");
- } else if( TRUE == H5P_isa_class(plist->plist_id, H5P_DATASET_XFER) ) {
- if(H5P_get(plist, H5D_XFER_VFL_INFO_NAME, &ret_value)<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, NULL, "Can't retrieve VFL driver ID");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver info")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -931,7 +859,7 @@ done:
* Function: H5Pget_driver_info
*
* Purpose: Returns a pointer directly to the file driver-specific
- * information of a file access or data transfer property list.
+ * information of a file access.
*
* Return: Success: Ptr to *uncopied* driver specific data
* structure if any.
@@ -944,26 +872,20 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list design to the new generic
- * property list.
- *
*-------------------------------------------------------------------------
*/
void *
H5Pget_driver_info(hid_t plist_id)
{
H5P_genplist_t *plist; /* Property list pointer */
- void *ret_value; /* Return value */
+ void *ret_value; /* Return value */
FUNC_ENTER_API(NULL)
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list")
+ /* Get the driver info */
if(NULL == (ret_value = H5P_get_driver_info(plist)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver info")
@@ -980,37 +902,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pset_family_offset(hid_t fapl_id, hsize_t offset)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ih", fapl_id, offset);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_set_family_offset(plist, offset)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set value */
+ if((ret_value = H5P_set_family_offset(plist, offset)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_family_offset() */
/*-------------------------------------------------------------------------
@@ -1020,33 +940,30 @@ done:
* H5Pset_family_offset
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_set_family_offset(H5P_genplist_t *plist, hsize_t offset)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_set(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set offset for family file")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_set_family_offset() */
/*-------------------------------------------------------------------------
@@ -1057,37 +974,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_family_offset(hid_t fapl_id, hsize_t *offset)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*h", fapl_id, offset);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_get_family_offset(plist, offset)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get value */
+ if((ret_value = H5P_get_family_offset(plist, offset)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_family_offset() */
/*-------------------------------------------------------------------------
@@ -1097,33 +1012,30 @@ done:
* H5Pget_family_offset
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_get_family_offset(H5P_genplist_t *plist, hsize_t *offset)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, offset) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set offset for family file")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_family_offset() */
/*-------------------------------------------------------------------------
@@ -1134,14 +1046,11 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1155,16 +1064,17 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type)
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_set_multi_type(plist, type)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set value */
+ if((ret_value = H5P_set_multi_type(plist, type)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pset_multi_type() */
/*-------------------------------------------------------------------------
@@ -1174,33 +1084,30 @@ done:
* H5Pset_multi_type.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_set_multi_type(H5P_genplist_t *plist, H5FD_mem_t type)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_set(plist, H5F_ACS_MULTI_TYPE_NAME, &type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set type for multi driver");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set type for multi driver")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_set_multi_type() */
/*-------------------------------------------------------------------------
@@ -1211,37 +1118,35 @@ done:
* to retrieve VFD file handle.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type)
{
H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value = SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*Mt", fapl_id, type);
/* Get the plist structure */
if(H5P_DEFAULT == fapl_id)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list");
- if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Set values */
- if((ret_value=H5P_get_multi_type(plist, type)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list")
+ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get value */
+ if((ret_value = H5P_get_multi_type(plist, type)) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_multi_type() */
/*-------------------------------------------------------------------------
@@ -1251,33 +1156,30 @@ done:
* H5Pget_multi_type.
*
* Return: Success: Non-negative value.
- *
* Failure: Negative value.
*
* Programmer: Raymond Lu
* Sep 17, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type)
{
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) {
+ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver");
- } else {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
- }
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get type for multi driver")
+ } /* end if */
+ else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5P_get_multi_type() */
/*-------------------------------------------------------------------------
@@ -2724,12 +2626,13 @@ done:
herr_t
H5P_file_image_info_copy(const char UNUSED *name, size_t UNUSED size, void *value)
{
- H5FD_file_image_info_t *info; /* Image info struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
if(value) {
+ H5FD_file_image_info_t *info; /* Image info struct */
+
info = (H5FD_file_image_info_t *)value;
/* verify file image field consistancy */
@@ -2763,16 +2666,17 @@ H5P_file_image_info_copy(const char UNUSED *name, size_t UNUSED size, void *valu
else
HDmemcpy(info->buffer, old_buffer, info->size);
} /* end if */
- } /* end if */
- /* Copy udata if it exists */
- if(info->callbacks.udata) {
- void *old_udata = info->callbacks.udata;
+ /* Copy udata if it exists */
+ if(info->callbacks.udata) {
+ void *old_udata = info->callbacks.udata;
- if(NULL == info->callbacks.udata_copy)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "udata_copy not defined")
+ if(NULL == info->callbacks.udata_copy)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "udata_copy not defined")
+
+ info->callbacks.udata = info->callbacks.udata_copy(old_udata);
+ } /* end if */
- info->callbacks.udata = info->callbacks.udata_copy(old_udata);
} /* end if */
done:
@@ -2797,32 +2701,33 @@ done:
herr_t
H5P_file_image_info_close(const char UNUSED *name, size_t UNUSED size, void *value)
{
- H5FD_file_image_info_t info; /* Image info struct */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
if(value) {
- info = *(H5FD_file_image_info_t *)value;
+ H5FD_file_image_info_t *info; /* Image info struct */
+
+ info = (H5FD_file_image_info_t *)value;
- if(info.buffer != NULL && info.size > 0) {
+ if(info->buffer != NULL && info->size > 0) {
/* Free buffer */
- if(info.callbacks.image_free) {
- if(info.callbacks.image_free(info.buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE,
- info.callbacks.udata) < 0)
+ if(info->callbacks.image_free) {
+ if(info->callbacks.image_free(info->buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE,
+ info->callbacks.udata) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "image_free callback failed")
} /* end if */
else
- H5MM_xfree(info.buffer);
+ H5MM_xfree(info->buffer);
} /* end if */
- } /* end if */
- /* Free udata if it exists */
- if(info.callbacks.udata) {
- if(NULL == info.callbacks.udata_free)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "udata_free not defined")
- if(info.callbacks.udata_free(info.callbacks.udata) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed")
+ /* Free udata if it exists */
+ if(info->callbacks.udata) {
+ if(NULL == info->callbacks.udata_free)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "udata_free not defined")
+ if(info->callbacks.udata_free(info->callbacks.udata) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed")
+ } /* end if */
} /* end if */
done: