summaryrefslogtreecommitdiffstats
path: root/src/H5Ddeprec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Ddeprec.c')
-rw-r--r--src/H5Ddeprec.c71
1 files changed, 60 insertions, 11 deletions
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c
index 6380bee..f4f4223 100644
--- a/src/H5Ddeprec.c
+++ b/src/H5Ddeprec.c
@@ -113,11 +113,9 @@ hid_t
H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t dcpl_id)
{
- void *dset = NULL; /* dset token from VOL connector */
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ void *dset = NULL; /* dset object from VOL connector */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
- hid_t lcpl_id = H5P_LINK_CREATE_DEFAULT;
- hid_t dapl_id = H5P_DEFAULT; /* DAPL used by library */
hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(H5I_INVALID_HID)
@@ -129,6 +127,10 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
if(!*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string")
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read")
+
if(H5P_DEFAULT == dcpl_id)
dcpl_id = H5P_DATASET_CREATE_DEFAULT;
else
@@ -138,10 +140,6 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
/* Set the DCPL for the API context */
H5CX_set_dcpl(dcpl_id);
- /* Verify access property list and set up collective metadata if appropriate */
- if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
-
/* Set location parameters */
loc_params.type = H5VL_OBJECT_BY_SELF;
loc_params.obj_type = H5I_get_type(loc_id);
@@ -151,7 +149,8 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
/* Create the dataset through the VOL */
- if(NULL == (dset = H5VL_dataset_create(vol_obj, &loc_params, name, lcpl_id, type_id, space_id, dcpl_id, H5P_DATASET_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
+ if(NULL == (dset = H5VL_dataset_create(vol_obj, &loc_params, name, H5P_LINK_CREATE_DEFAULT, type_id, space_id, dcpl_id,
+ H5P_DATASET_ACCESS_DEFAULT, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to create dataset")
/* Get an atom for the dataset */
@@ -187,8 +186,8 @@ done:
hid_t
H5Dopen1(hid_t loc_id, const char *name)
{
- void *dset = NULL; /* dset token from VOL connector */
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ void *dset = NULL; /* dset object from VOL connector */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
hid_t ret_value = H5I_INVALID_HID; /* Return value */
@@ -303,5 +302,55 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Dextend() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Dvlen_reclaim
+ *
+ * Purpose: Frees the buffers allocated for storing variable-length data
+ * in memory. Only frees the VL data in the selection defined in the
+ * dataspace. The dataset transfer property list is required to find the
+ * correct allocation/free methods for the VL data in the buffer.
+ *
+ * Return: Non-negative on success, negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, June 10, 1999
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf)
+{
+ H5S_t *space; /* Dataspace for iteration */
+ herr_t ret_value; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE4("e", "iii*x", type_id, space_id, dxpl_id, buf);
+
+ /* Check args */
+ if(H5I_DATATYPE != H5I_get_type(type_id) || buf == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument")
+ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace")
+ if(!(H5S_has_extent(space)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set")
+
+ /* Get the default dataset transfer property list if the user didn't provide one */
+ if(H5P_DEFAULT == dxpl_id)
+ dxpl_id = H5P_DATASET_XFER_DEFAULT;
+ else
+ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms")
+
+ /* Set DXPL for operation */
+ H5CX_set_dxpl(dxpl_id);
+
+ /* Call internal routine */
+ ret_value = H5T_reclaim(type_id, space, buf);
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Dvlen_reclaim() */
+
#endif /* H5_NO_DEPRECATED_SYMBOLS */