summaryrefslogtreecommitdiffstats
path: root/src/H5L.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5L.c')
-rw-r--r--src/H5L.c134
1 files changed, 71 insertions, 63 deletions
diff --git a/src/H5L.c b/src/H5L.c
index 706ca09..0d5bc02 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -34,7 +34,7 @@
#include "H5Oprivate.h" /* File objects */
#include "H5Pprivate.h" /* Property lists */
#include "H5VLprivate.h" /* Virtual Object Layer */
-
+#include "H5VLnative_private.h" /* Native VOL */
/****************/
/* Local Macros */
@@ -49,7 +49,7 @@
/* User data for path traversal routine for getting link info by name */
typedef struct {
- H5L_info_t *linfo; /* Buffer to return to user */
+ H5L_info2_t *linfo; /* Buffer to return to user */
} H5L_trav_gi_t;
/* User data for path traversal callback to creating a link */
@@ -93,6 +93,7 @@ typedef struct {
void *buf; /* User buffer */
} H5L_trav_gv_t;
+
/********************/
/* Local Prototypes */
/********************/
@@ -274,11 +275,11 @@ herr_t
H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
const char *dst_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5VL_object_t *vol_obj1 = NULL; /* Object token of src_id */
+ H5VL_object_t *vol_obj1 = NULL; /* Object of src_id */
H5VL_loc_params_t loc_params1;
- H5VL_object_t *vol_obj2 = NULL; /* Object token of dst_id */
+ H5VL_object_t *vol_obj2 = NULL; /* Object of dst_id */
H5VL_loc_params_t loc_params2;
- H5VL_object_t tmp_vol_obj; /* Temporary object token */
+ H5VL_object_t tmp_vol_obj; /* Temporary object */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -364,11 +365,11 @@ herr_t
H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
const char *dst_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5VL_object_t *vol_obj1 = NULL; /* Object token of src_id */
+ H5VL_object_t *vol_obj1 = NULL; /* Object of src_id */
H5VL_loc_params_t loc_params1;
- H5VL_object_t *vol_obj2 = NULL; /* Object token of dst_id */
+ H5VL_object_t *vol_obj2 = NULL; /* Object of dst_id */
H5VL_loc_params_t loc_params2;
- H5VL_object_t tmp_vol_obj; /* Temporary object token */
+ H5VL_object_t tmp_vol_obj; /* Temporary object */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -458,7 +459,7 @@ herr_t
H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name,
hid_t lcpl_id, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
@@ -529,9 +530,9 @@ herr_t
H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name,
hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id)
{
- H5VL_object_t *vol_obj1 = NULL; /* Object token of cur_loc_id */
- H5VL_object_t *vol_obj2 = NULL; /* Object token of new_loc_id */
- H5VL_object_t tmp_vol_obj; /* Temporary object token of */
+ H5VL_object_t *vol_obj1 = NULL; /* Object of cur_loc_id */
+ H5VL_object_t *vol_obj2 = NULL; /* Object of new_loc_id */
+ H5VL_object_t tmp_vol_obj; /* Temporary object */
H5VL_loc_params_t loc_params1;
H5VL_loc_params_t loc_params2;
herr_t ret_value = SUCCEED; /* Return value */
@@ -631,7 +632,7 @@ herr_t
H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type,
const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
@@ -696,7 +697,7 @@ done:
herr_t
H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
@@ -753,7 +754,7 @@ herr_t
H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
@@ -816,7 +817,7 @@ herr_t
H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size,
hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
@@ -872,7 +873,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, void *buf/*out*/, size_t size,
hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
@@ -928,7 +929,7 @@ done:
htri_t
H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
htri_t ret_value = FAIL; /* Return value */
@@ -965,13 +966,12 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lget_info
- *
- * Purpose: Gets metadata for a link.
+ * Function: H5Lget_info2
*
- * Return: Success: Non-negative with information in LINFO
+ * Purpose: Gets metadata for a link.
*
- * Failure: Negative
+ * Return: Success: Non-negative with information in LINFO
+ * Failure: Negative
*
* Programmer: James Laird
* Wednesday, June 21, 2006
@@ -979,10 +979,10 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/,
+H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo /*out*/,
hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
@@ -1012,11 +1012,11 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/,
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Lget_info() */
+} /* end H5Lget_info2() */
/*-------------------------------------------------------------------------
- * Function: H5Lget_info_by_idx
+ * Function: H5Lget_info_by_idx2
*
* Purpose: Gets metadata for a link, according to the order within an
* index.
@@ -1030,11 +1030,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Lget_info_by_idx(hid_t loc_id, const char *group_name,
+H5Lget_info_by_idx2(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
- H5L_info_t *linfo /*out*/, hid_t lapl_id)
+ H5L_info2_t *linfo /*out*/, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value = SUCCEED; /* Return value */
@@ -1072,7 +1072,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name,
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Lget_info_by_idx() */
+} /* end H5Lget_info_by_idx2() */
/*-------------------------------------------------------------------------
@@ -1115,6 +1115,10 @@ H5Lregister(const H5L_class_t *cls)
*/
if(cls->version > H5L_LINK_CLASS_T_VERS)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5L_class_t version number")
+#ifdef H5_NO_DEPRECATED_SYMBOLS
+ if(cls->version < H5L_LINK_CLASS_T_VERS)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "deprecated H5L_class_t version number (%d) and library built without deprecated symbol support", cls->version)
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
if(cls->id < H5L_TYPE_UD_MIN || cls->id > H5L_TYPE_MAX)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link identification number")
@@ -1229,7 +1233,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
char *name /*out*/, size_t size, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* object of loc_id */
H5VL_loc_params_t loc_params;
ssize_t ret_value = -1; /* Return value */
@@ -1272,7 +1276,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Literate
+ * Function: H5Literate2
*
* Purpose: Iterates over links in a group, with user callback routine,
* according to the order within an index.
@@ -1290,10 +1294,10 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Literate(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
- hsize_t *idx_p, H5L_iterate_t op, void *op_data)
+H5Literate2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
+ hsize_t *idx_p, H5L_iterate2_t op, void *op_data)
{
- H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
H5VL_loc_params_t loc_params;
H5I_type_t id_type; /* Type of ID */
herr_t ret_value; /* Return value */
@@ -1321,16 +1325,17 @@ H5Literate(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
loc_params.obj_type = H5I_get_type(group_id);
/* Iterate over the links */
- if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (unsigned)FALSE, (int)idx_type, (int)order, idx_p, op, op_data)) < 0)
+ if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (unsigned)FALSE, (int)idx_type, (int)order, idx_p,
+ op, op_data)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Literate() */
+} /* end H5Literate2() */
/*-------------------------------------------------------------------------
- * Function: H5Literate_by_name
+ * Function: H5Literate_by_name2
*
* Purpose: Iterates over links in a group, with user callback routine,
* according to the order within an index.
@@ -1352,11 +1357,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Literate_by_name(hid_t loc_id, const char *group_name,
+H5Literate_by_name2(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p,
- H5L_iterate_t op, void *op_data, hid_t lapl_id)
+ H5L_iterate2_t op, void *op_data, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value; /* Return value */
@@ -1391,7 +1396,8 @@ H5Literate_by_name(hid_t loc_id, const char *group_name,
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
/* Iterate over the links */
- if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, FALSE, idx_type, order, idx_p, op, op_data)) < 0)
+ if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, FALSE, idx_type, order, idx_p,
+ op, op_data)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed")
done:
@@ -1400,7 +1406,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lvisit
+ * Function: H5Lvisit2
*
* Purpose: Recursively visit all the links in a group and all
* the groups that are linked to from that group. Links within
@@ -1423,15 +1429,15 @@ done:
* of the operators.
*
* Programmer: Quincey Koziol
- * November 24 2007
+ * November 24 2007
*
*-------------------------------------------------------------------------
*/
herr_t
-H5Lvisit(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
- H5L_iterate_t op, void *op_data)
+H5Lvisit2(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
+ H5L_iterate2_t op, void *op_data)
{
- H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
H5VL_loc_params_t loc_params;
H5I_type_t id_type; /* Type of ID */
herr_t ret_value; /* Return value */
@@ -1459,16 +1465,17 @@ H5Lvisit(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
/* Iterate over the links */
- if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, TRUE, idx_type, order, NULL, op, op_data)) < 0)
+ if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, TRUE, idx_type, order, NULL,
+ op, op_data)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Lvisit() */
+} /* end H5Lvisit2() */
/*-------------------------------------------------------------------------
- * Function: H5Lvisit_by_name
+ * Function: H5Lvisit_by_name2
*
* Purpose: Recursively visit all the links in a group and all
* the groups that are linked to from that group. Links within
@@ -1496,10 +1503,10 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type,
- H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id)
+H5Lvisit_by_name2(hid_t loc_id, const char *group_name, H5_index_t idx_type,
+ H5_iter_order_t order, H5L_iterate2_t op, void *op_data, hid_t lapl_id)
{
- H5VL_object_t *vol_obj = NULL; /* Object token of loc_id */
+ H5VL_object_t *vol_obj = NULL; /* Object of loc_id */
H5VL_loc_params_t loc_params;
herr_t ret_value; /* Return value */
@@ -1534,12 +1541,13 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type,
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
/* Visit the links */
- if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, TRUE, idx_type, order, NULL, op, op_data)) < 0)
+ if((ret_value = H5VL_link_specific(vol_obj, &loc_params, H5VL_LINK_ITER, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, TRUE, idx_type, order, NULL,
+ op, op_data)) < 0)
HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Lvisit_by_name() */
+} /* end H5Lvisit_by_name2() */
/*
*-------------------------------------------------------------------------
@@ -3143,7 +3151,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5L__get_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name,
+H5L__get_info_cb(H5G_loc_t *grp_loc/*in*/, const char H5_ATTR_UNUSED *name,
const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/,
H5G_own_loc_t *own_loc/*out*/)
{
@@ -3157,7 +3165,7 @@ H5L__get_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNU
HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist")
/* Get information from the link */
- if(H5G_link_to_info(lnk, udata->linfo) < 0)
+ if(H5G_link_to_info(grp_loc->oloc, lnk, udata->linfo) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info")
done:
@@ -3172,7 +3180,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5L_get_info
*
- * Purpose: Returns metadata about a link.
+ * Purpose: Returns metadata about a link.
*
* Return: Non-negative on success/Negative on failure
*
@@ -3182,7 +3190,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linfo/*out*/)
+H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info2_t *linfo/*out*/)
{
H5L_trav_gi_t udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3235,7 +3243,7 @@ H5L__get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_A
lnk_copied = TRUE;
/* Get information from the link */
- if(H5G_link_to_info(&fnd_lnk, udata->linfo) < 0)
+ if(H5G_link_to_info(obj_loc->oloc, &fnd_lnk, udata->linfo) < 0)
HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info")
done:
@@ -3263,7 +3271,7 @@ done:
*/
herr_t
H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, H5L_info_t *linfo /*out*/)
+ H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo /*out*/)
{
H5L_trav_gibi_t udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3516,7 +3524,7 @@ done:
*/
herr_t
H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data)
+ H5_iter_order_t order, hsize_t *idx_p, H5L_iterate2_t op, void *op_data)
{
H5G_link_iterate_t lnk_op; /* Link operator */
hsize_t last_lnk; /* Index of last object looked at */