diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-06 17:05:16 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-06 17:05:16 (GMT) |
commit | 5adf1ee1bab95cce501257e538b638a75c9e72fa (patch) | |
tree | 33102c066b0e6e0a5d9e09b373a604106e4806e2 /src | |
parent | 30aad1fd3e4c12d97fdd90bbcae3db7f89eb6ec0 (diff) | |
download | hdf5-5adf1ee1bab95cce501257e538b638a75c9e72fa.zip hdf5-5adf1ee1bab95cce501257e538b638a75c9e72fa.tar.gz hdf5-5adf1ee1bab95cce501257e538b638a75c9e72fa.tar.bz2 |
[svn-r12864] Description:
Changed H5Lget_linkval() to H5Lget_val(), per our design discussion last
Friday afternoon.
Tested on:
Linux/32 2.6 (chicago)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Gdeprec.c | 18 | ||||
-rw-r--r-- | src/H5Gpublic.h | 9 | ||||
-rw-r--r-- | src/H5L.c | 34 | ||||
-rw-r--r-- | src/H5Lprivate.h | 4 | ||||
-rw-r--r-- | src/H5Lpublic.h | 9 |
5 files changed, 40 insertions, 34 deletions
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 0612771..9f8a39f 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -29,9 +29,7 @@ /* Packages needed by this file... */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Gpublic.h" /* Public Group APIs */ -#include "H5Lpublic.h" /* Public Link APIs */ -#include "H5Ppublic.h" /* Property lists */ +#include "H5Lprivate.h" /* Links */ /*------------------------------------------------------------------------- @@ -177,19 +175,27 @@ done: * Function: H5Gget_linkval * * Purpose: Retrieve's a soft link's data. The new API is - * H5Lget_linkval. + * H5Lget_val. * *------------------------------------------------------------------------- */ herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { - herr_t ret_value; + H5G_loc_t loc; + herr_t ret_value = SUCCEED; FUNC_ENTER_API(H5Gget_linkval, FAIL) H5TRACE4("e","iszx",loc_id,name,size,buf); - if((ret_value = H5Lget_linkval(loc_id, name, size, buf, H5P_DEFAULT)) < 0) + /* Check arguments */ + if(H5G_loc(loc_id, &loc)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(!name || !*name) + 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) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "couldn't get link info") done: diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index ada6ca8..2e18d38 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -29,11 +29,10 @@ #include <sys/types.h> /* Public headers needed by this file */ -#include "H5public.h" -#include "H5Ipublic.h" -#include "H5Lpublic.h" -#include "H5Opublic.h" -#include "H5Tpublic.h" +#include "H5public.h" /* Generic Functions */ +#include "H5Lpublic.h" /* Links */ +#include "H5Opublic.h" /* Object headers */ +#include "H5Tpublic.h" /* Datatypes */ /*****************/ /* Public Macros */ @@ -107,11 +107,9 @@ static herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, hid_t lapl_id, hid_t dxpl_id); static herr_t H5L_create_soft(const char *target_path, H5G_loc_t *cur_loc, const char *cur_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -static herr_t H5L_linkval_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +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_linkval(H5G_loc_t *loc, const char *name, size_t size, - void *buf/*out*/, hid_t lapl_id, hid_t dxpl_id); static herr_t H5L_unlink_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*/); @@ -732,7 +730,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Lget_linkval + * Function: H5Lget_val * * Purpose: Returns the link value of a link whose name is NAME. For * symbolic links, this is the path to which the link points, @@ -751,13 +749,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Lget_linkval(hid_t loc_id, const char *name, size_t size, void *buf/*out*/, +H5Lget_val(hid_t loc_id, const char *name, size_t size, void *buf/*out*/, hid_t lapl_id) { H5G_loc_t loc; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lget_linkval, FAIL) + FUNC_ENTER_API(H5Lget_val, FAIL) H5TRACE5("e","iszxi",loc_id,name,size,buf,lapl_id); /* Check arguments */ @@ -767,12 +765,12 @@ H5Lget_linkval(hid_t loc_id, const char *name, size_t size, void *buf/*out*/, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Get the link value */ - if(H5L_linkval(&loc, name, size, buf, lapl_id, H5AC_ind_dxpl_id) < 0) + if(H5L_get_val(&loc, name, size, buf, lapl_id, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link value") done: FUNC_LEAVE_API(ret_value) -} /* end H5Lget_linkval() */ +} /* end H5Lget_val() */ /*------------------------------------------------------------------------- @@ -1438,7 +1436,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_linkval_cb + * Function: H5L_get_val_cb * * Purpose: Callback for retrieving link value or udata. * @@ -1450,14 +1448,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_linkval_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, const H5O_link_t *lnk, +H5L_get_val_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, const H5O_link_t *lnk, H5G_loc_t UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_ud4_t *udata = (H5L_trav_ud4_t *)_udata; /* User data passed in */ const H5L_class_t *link_class; /* User-defined link class */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_linkval_cb) + FUNC_ENTER_NOAPI_NOINIT(H5L_get_val_cb) /* Check if the name in this group resolved to a valid link */ if(lnk == NULL) @@ -1496,11 +1494,11 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_linkval_cb() */ +} /* end H5L_get_val_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_linkval + * Function: H5L_get_val * * Purpose: Returns the value of a symbolic link or the udata for a * user-defined link. @@ -1518,25 +1516,25 @@ done: * *------------------------------------------------------------------------- */ -static herr_t -H5L_linkval(H5G_loc_t *loc, const char *name, size_t size, void *buf/*out*/, hid_t lapl_id, hid_t dxpl_id) +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) { H5L_trav_ud4_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_linkval) + FUNC_ENTER_NOAPI_NOINIT(H5L_get_val) /* Set up user data for retrieving information */ udata.size = size; udata.buf = buf; /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L_linkval_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L_get_val_cb, &udata, lapl_id, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_linkval() */ +} /* H5L_get_val() */ /*------------------------------------------------------------------------- diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index d41a18a..d70835c 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -55,12 +55,14 @@ /******************************/ /* General operations on links */ +H5_DLL herr_t H5L_init(void); H5_DLL herr_t H5L_link(H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); 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_init(void); +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); /* User-defined link functions */ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 12162bf..64955ca 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -26,9 +26,10 @@ #define _H5Lpublic_H /* Public headers needed by this file */ -#include "H5public.h" -#include "H5Ipublic.h" -#include "H5Tpublic.h" +#include "H5public.h" /* Generic Functions */ +#include "H5Ipublic.h" /* IDs */ +#include "H5Ppublic.h" /* Property lists */ +#include "H5Tpublic.h" /* Datatypes */ /*****************/ /* Public Macros */ @@ -139,7 +140,7 @@ H5_DLL herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name, 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 H5Lget_linkval(hid_t loc_id, const char *name, size_t size, +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, H5L_info_t *linkbuf /*out*/, hid_t lapl_id); |