summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Gdeprec.c22
-rw-r--r--src/H5Gloc.c2
-rw-r--r--src/H5Gname.c4
-rw-r--r--src/H5Gprivate.h2
-rw-r--r--src/H5L.c48
-rw-r--r--src/H5Lprivate.h6
-rw-r--r--src/H5Lpublic.h2
7 files changed, 47 insertions, 39 deletions
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index 9f8a39f..fc74bcf 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -151,20 +151,28 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Gunlink
*
- * Purpose: Removes a link. The new API is H5Lunlink.
+ * Purpose: Removes a link. The new API is H5Ldelete.
*
*-------------------------------------------------------------------------
*/
herr_t
H5Gunlink(hid_t loc_id, const char *name)
{
- herr_t ret_value;
+ H5G_loc_t loc; /* Group's location */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5Gunlink, FAIL)
H5TRACE2("e","is",loc_id,name);
- if((ret_value = H5Lunlink(loc_id, name, H5P_DEFAULT)) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "Couldn't delete link")
+ /* Check arguments */
+ if(H5G_loc(loc_id, &loc) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ if(!name || !*name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+
+ /* Call H5L routine... */
+ if(H5L_delete(&loc, name, H5P_DEFAULT, H5AC_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "couldn't delete link")
done:
FUNC_LEAVE_API(ret_value)
@@ -182,8 +190,8 @@ done:
herr_t
H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/)
{
- H5G_loc_t loc;
- herr_t ret_value = SUCCEED;
+ H5G_loc_t loc; /* Group's location */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5Gget_linkval, FAIL)
H5TRACE4("e","iszx",loc_id,name,size,buf);
@@ -195,7 +203,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
/* Call the new link routine which provides this capability */
- if(H5L_get_val(&loc, name, size, buf, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if(H5L_get_val(&loc, name, size, buf, H5P_DEFAULT, H5AC_ind_dxpl_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "couldn't get link info")
done:
diff --git a/src/H5Gloc.c b/src/H5Gloc.c
index d683eff..24cfddb 100644
--- a/src/H5Gloc.c
+++ b/src/H5Gloc.c
@@ -459,7 +459,7 @@ H5G_loc_remove(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, hid_t d
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "component not found")
/* Search the open IDs and replace names for unlinked object */
- if(H5G_name_replace(obj_type, obj_loc, NULL, NULL, H5G_NAME_UNLINK) < 0)
+ if(H5G_name_replace(obj_type, obj_loc, NULL, NULL, H5G_NAME_DELETE) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to replace name")
done:
diff --git a/src/H5Gname.c b/src/H5Gname.c
index e338c3f..d26c74b 100644
--- a/src/H5Gname.c
+++ b/src/H5Gname.c
@@ -823,10 +823,10 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key)
break;
/*-------------------------------------------------------------------------
- * H5G_NAME_UNLINK
+ * H5G_NAME_DELETE
*-------------------------------------------------------------------------
*/
- case H5G_NAME_UNLINK:
+ case H5G_NAME_DELETE:
/* Check if the location being unlinked is in the path for the current object */
if(H5G_common_path(obj_path->full_path_r, names->loc->path->full_path_r)) {
/* Free paths for object */
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index 80a1df9..22013cf 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -103,7 +103,7 @@
/* Type of operation being performed for call to H5G_name_replace() */
typedef enum {
H5G_NAME_MOVE = 0, /* H5*move call */
- H5G_NAME_UNLINK, /* H5Lunlink call */
+ H5G_NAME_DELETE, /* H5Ldelete call */
H5G_NAME_MOUNT, /* H5Fmount call */
H5G_NAME_UNMOUNT /* H5Funmount call */
} H5G_names_op_t;
diff --git a/src/H5L.c b/src/H5L.c
index 09582b0..ee68517 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -110,11 +110,9 @@ static herr_t H5L_create_soft(const char *target_path, H5G_loc_t *cur_loc,
static herr_t H5L_get_val_cb(H5G_loc_t *grp_loc/*in*/, const char *name,
const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/,
H5G_own_loc_t *own_loc/*out*/);
-static herr_t H5L_unlink_cb(H5G_loc_t *grp_loc/*in*/, const char *name,
+static herr_t H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name,
const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/,
H5G_own_loc_t *own_loc/*out*/);
-static herr_t H5L_unlink(H5G_loc_t *loc, const char *name, hid_t lapl_id,
- hid_t dxpl_id);
static herr_t H5L_move(H5G_loc_t *src_loc, const char *src_name,
H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag,
hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id);
@@ -689,7 +687,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Lunlink
+ * Function: H5Ldelete
*
* Purpose: Removes the specified NAME from the group graph and
* decrements the link count for the object to which NAME
@@ -706,12 +704,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Lunlink(hid_t loc_id, const char *name, hid_t lapl_id)
+H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id)
{
- H5G_loc_t loc;
- herr_t ret_value=SUCCEED; /* Return value */
+ H5G_loc_t loc; /* Group's location */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Lunlink, FAIL)
+ FUNC_ENTER_API(H5Ldelete, FAIL)
H5TRACE3("e","isi",loc_id,name,lapl_id);
/* Check arguments */
@@ -721,12 +719,12 @@ H5Lunlink(hid_t loc_id, const char *name, hid_t lapl_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
/* Unlink */
- if(H5L_unlink(&loc, name, lapl_id, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to unlink object")
+ if(H5L_delete(&loc, name, lapl_id, H5AC_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delet link")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Lunlink() */
+} /* end H5Ldelete() */
/*-------------------------------------------------------------------------
@@ -1522,7 +1520,7 @@ H5L_get_val(H5G_loc_t *loc, const char *name, size_t size, void *buf/*out*/, hid
H5L_trav_ud4_t udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5L_get_val)
+ FUNC_ENTER_NOAPI(H5L_get_val, FAIL)
/* Set up user data for retrieving information */
udata.size = size;
@@ -1538,10 +1536,10 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_unlink_cb
+ * Function: H5L_delete_cb
*
- * Purpose: Callback for unlinking an object. This routine
- * deletes the link
+ * Purpose: Callback for deleting a link. This routine
+ * actually deletes the link
*
* Return: Non-negative on success/Negative on failure
*
@@ -1551,7 +1549,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5L_unlink_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED *lnk,
+H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED *lnk,
H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/)
{
H5G_t *grp=NULL; /* H5G_t for this group, opened to pass to user callback */
@@ -1561,7 +1559,7 @@ H5L_unlink_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSE
hbool_t temp_loc_init = FALSE;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT(H5L_unlink_cb)
+ FUNC_ENTER_NOAPI_NOINIT(H5L_delete_cb)
/* Check if the name in this group resolved to a valid link */
if(obj_loc == NULL)
@@ -1623,13 +1621,13 @@ done:
*own_loc = H5G_OWN_NONE;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_unlink_cb() */
+} /* end H5L_delete_cb() */
/*-------------------------------------------------------------------------
- * Function: H5L_unlink
+ * Function: H5L_delete
*
- * Purpose: Unlink a name from a group.
+ * Purpose: Delete a link from a group.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1638,14 +1636,14 @@ done:
*
*-------------------------------------------------------------------------
*/
-static herr_t
-H5L_unlink(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id)
+herr_t
+H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id)
{
H5L_trav_ud5_t udata; /* User data for callback */
char *norm_name = NULL; /* Pointer to normalized name */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5L_unlink)
+ FUNC_ENTER_NOAPI(H5L_delete, FAIL)
/* Sanity check */
HDassert(loc);
@@ -1658,7 +1656,7 @@ H5L_unlink(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id)
/* Set up user data for unlink operation */
udata.dxpl_id = dxpl_id;
- if(H5G_traverse(loc, norm_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK|H5G_TARGET_MOUNT, H5L_unlink_cb, &udata, lapl_id, dxpl_id) < 0)
+ if(H5G_traverse(loc, norm_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK|H5G_TARGET_MOUNT, H5L_delete_cb, &udata, lapl_id, dxpl_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist")
done:
@@ -1667,7 +1665,7 @@ done:
H5MM_xfree(norm_name);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_unlink() */
+} /* end H5L_delete() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h
index d70835c..2ce5e48 100644
--- a/src/H5Lprivate.h
+++ b/src/H5Lprivate.h
@@ -23,8 +23,8 @@
#include "H5Lpublic.h"
/* Private headers needed by this file */
-#include "H5Gprivate.h"
-#include "H5Oprivate.h"
+#include "H5Gprivate.h" /* Groups */
+#include "H5Oprivate.h" /* Object headers */
/**************************/
/* Library Private Macros */
@@ -61,6 +61,8 @@ H5_DLL herr_t H5L_link(H5G_loc_t *new_loc, const char *new_name,
H5_DLL hid_t H5L_get_default_lcpl(void);
H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name,
H5L_info_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id);
+H5_DLL herr_t H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id,
+ hid_t dxpl_id);
H5_DLL herr_t H5L_get_val(H5G_loc_t *loc, const char *name, size_t size,
void *buf/*out*/, hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5L_register_external(void);
diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h
index 64955ca..e944965 100644
--- a/src/H5Lpublic.h
+++ b/src/H5Lpublic.h
@@ -139,7 +139,7 @@ H5_DLL herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name,
hid_t lapl_id);
H5_DLL herr_t H5Lcreate_soft(const char *target_path, hid_t cur_loc,
const char *cur_name, hid_t lcpl_id, hid_t lapl_id);
-H5_DLL herr_t H5Lunlink(hid_t loc_id, const char *name, hid_t lapl_id);
+H5_DLL herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id);
H5_DLL herr_t H5Lget_val(hid_t loc_id, const char *name, size_t size,
void *buf/*out*/, hid_t lapl_id);
H5_DLL herr_t H5Lget_info(hid_t loc_id, const char *name,