From 8b52aae45d4c461644657ee9be2a3e092006887e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 30 Oct 2006 19:45:31 -0500 Subject: [svn-r12835] Description: Change H5Lget_linkinfo() to H5Lget_info() to better align with coming API changes. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) --- examples/h5_extlink.c | 6 +-- release_docs/RELEASE.txt | 2 +- src/H5G.c | 14 +++-- src/H5L.c | 134 +++++++++++++++++++++++++++-------------------- src/H5Lprivate.h | 4 +- src/H5Lpublic.h | 8 +-- test/links.c | 118 ++++++++++++++++++++--------------------- test/objcopy.c | 8 +-- test/th5o.c | 14 ++--- tools/h5dump/h5dump.c | 16 +++--- tools/h5ls/h5ls.c | 4 +- tools/lib/h5diff.c | 10 ++-- tools/lib/h5trav.c | 7 ++- 13 files changed, 180 insertions(+), 165 deletions(-) diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index 45dc01f..edf7609 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -312,7 +312,7 @@ void hard_link_example() { hid_t file_id; hid_t group_id; - H5L_linkinfo_t li; + H5L_info_t li; /* Define the link class that we'll use to register "user-defined hard * links" using the callbacks we defined above. * A link class can have NULL for any callback except its traverse @@ -354,10 +354,10 @@ void hard_link_example() H5Lregister(UD_hard_class); /* Since hard links link by object address, we'll need to retrieve - * the target group's address. We do this by calling H5Lget_linkinfo + * the target group's address. We do this by calling H5Lget_info * on a hard link to the object. */ - H5Lget_linkinfo(file_id, TARGET_GROUP, &li, H5P_DEFAULT); + H5Lget_info(file_id, TARGET_GROUP, &li, H5P_DEFAULT); /* Now create a user-defined link. We give it the group's address * as its udata. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f0bc527..6342a4f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -211,7 +211,7 @@ New Features H5Lcreate_soft - like H5Glink2 for soft links H5Lunlink - just like H5Gunlink H5Lget_linkval - just link H5Gget_linkval - H5Lget_linkinfo - gets link-specific info (like H5Gget_objinfo) + H5Lget_info - gets link-specific info (like H5Gget_objinfo) In addition, H5Gcreate_expand, H5Tcommit_expand, and H5Dcreate_expand no longer create links to objects; objects must be manually linked diff --git a/src/H5G.c b/src/H5G.c index b848c93..c7c0be0 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -1935,7 +1935,7 @@ H5G_get_objinfo_cb(H5G_loc_t *grp_loc/*in*/, const char UNUSED *name, const H5O_ if(H5F_get_fileno((obj_loc ? obj_loc : grp_loc)->oloc->file, &statbuf->fileno[0]) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "unable to read fileno") - /* Info for soft and UD links is gotten by H5L_get_linkinfo. If we have + /* Info for soft and UD links is gotten by H5L_get_info. If we have * a hard link, follow it and get info on the object */ if(udata->follow_link || !lnk || (lnk->type == H5L_TYPE_HARD)) { @@ -2024,29 +2024,27 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, /* If we're pointing at a soft or UD link, get the real link length and type */ if(statbuf && follow_link == 0) { - H5L_linkinfo_t linfo; /* Link information buffer */ + H5L_info_t linfo; /* Link information buffer */ herr_t ret; /* Get information about link to the object. If this fails, e.g. * because the object is ".", just treat the object as a hard link. */ H5E_BEGIN_TRY { - ret = H5L_get_linkinfo(loc, name, &linfo, H5P_DEFAULT, dxpl_id); + ret = H5L_get_info(loc, name, &linfo, H5P_DEFAULT, dxpl_id); } H5E_END_TRY if(ret >=0 && linfo.type != H5L_TYPE_HARD) { statbuf->linklen = linfo.u.link_size; if(linfo.type == H5L_TYPE_SOFT) - { statbuf->type = H5G_LINK; - } - else /* UD link. H5L_get_linkinfo checked for invalid link classes */ + else /* UD link. H5L_get_info checked for invalid link classes */ { HDassert(linfo.type >= H5L_TYPE_UD_MIN && linfo.type <= H5L_TYPE_MAX); statbuf->type = H5G_UDLINK; } - } - } + } /* end if */ + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5L.c b/src/H5L.c index 24d5211..f4cdbd6 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -12,6 +12,10 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/****************/ +/* Module Setup */ +/****************/ + #define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5G_PACKAGE /*suppress error about including H5Gpkg */ #define H5L_PACKAGE /*suppress error about including H5Lpkg */ @@ -19,24 +23,34 @@ /* Interface initialization */ #define H5_INTERFACE_INIT_FUNC H5L_init_interface +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Lpkg.h" /* Links */ -#include "H5Fpkg.h" /* File access */ +#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Fpkg.h" /* File access */ #include "H5Iprivate.h" /* IDs */ +#include "H5Lpkg.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* File objects */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Pprivate.h" /* Property lists */ -#include "H5Gpkg.h" /* Groups */ -/* Local typedefs */ -#define H5L_MOVE_OP 1 -#define H5L_RENAME_OP 2 +/****************/ +/* Local Macros */ +/****************/ + +#define H5L_MIN_TABLE_SIZE 32 /* Minimum size of the user-defined link type table if it is allocated */ + + +/******************/ +/* Local Typedefs */ +/******************/ /* User data for path traversal routine for getting link metadata */ typedef struct { - H5L_linkinfo_t *linfo; /* Buffer to return to user */ + H5L_info_t *linfo; /* Buffer to return to user */ hid_t dxpl_id; /* dxpl to use in callback */ } H5L_trav_ud1_t; @@ -47,7 +61,7 @@ typedef struct { hid_t lcpl_id; /* Link creation property list */ H5G_name_t *path; /* Path to object being linked */ H5O_link_t *lnk; /* Pointer to link information to insert */ -} H5L_trav_ud3_t; +} H5L_trav_ud2_t; /* User data for path traversal routine for moving and renaming a link */ typedef struct { @@ -57,23 +71,18 @@ typedef struct { hbool_t copy; /* TRUE if this is a copy operation */ hid_t lapl_id; /* lapl to use in callback */ hid_t dxpl_id; /* dxpl to use in callback */ -} H5L_trav_ud4_t; +} H5L_trav_ud3_t; /* User data for path traversal routine for getting soft link value */ typedef struct { size_t size; /* Size of user buffer */ void *buf; /* User buffer */ -} H5L_trav_ud5_t; +} H5L_trav_ud4_t; /* User data for path traversal routine for removing link (i.e. unlink) */ typedef struct { hid_t dxpl_id; /* Dataset transfer property list */ -} H5L_trav_ud6_t; - -/* User data for path traversal routine for retrieving link creation property list */ -typedef struct { - H5P_genplist_t *lcpl; /* Copy of default property list to be set */ -} H5L_trav_ud8_t; +} H5L_trav_ud5_t; /* User data for path traversal routine for moving and renaming an object */ typedef struct { @@ -81,13 +90,12 @@ typedef struct { H5O_link_t *lnk; /* Pointer to link information to insert */ hbool_t copy; /* TRUE if this is a copy operation */ hid_t dxpl_id; /* Dataset transfer property list */ -} H5L_trav_ud10_t; - -/* Package variables */ +} H5L_trav_ud6_t; -/* Local variables */ +/********************/ +/* Local Prototypes */ +/********************/ -/* Private prototypes */ static herr_t H5L_link_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*/); @@ -118,21 +126,29 @@ static herr_t H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, static herr_t H5L_move_dest_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_get_linfo_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, +static herr_t H5L_get_info_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*/); static int H5L_find_class_idx(H5L_type_t id); - -/* Information about user-defined links */ -static size_t H5L_table_alloc_g = 0; -static size_t H5L_table_used_g = 0; -static H5L_class_t *H5L_table_g = NULL; +/*********************/ +/* Package Variables */ +/*********************/ +/*****************************/ +/* Library Private Variables */ +/*****************************/ -#define H5L_MIN_TABLE_SIZE 32 /* Minimum size of the user-defined link type table if it is allocated */ +/*******************/ +/* Local Variables */ +/*******************/ + +/* Information about user-defined links */ +static size_t H5L_table_alloc_g = 0; +static size_t H5L_table_used_g = 0; +static H5L_class_t *H5L_table_g = NULL; /*------------------------------------------------------------------------- @@ -805,7 +821,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Lget_linkinfo + * Function: H5Lget_info * * Purpose: Gets metadata for a link. * @@ -819,12 +835,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Lget_linkinfo(hid_t loc_id, const char *name, H5L_linkinfo_t *linkbuf /*out*/, +H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linkbuf /*out*/, hid_t lapl_id) { H5G_loc_t loc; herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Lget_linkinfo, FAIL) + + FUNC_ENTER_API(H5Lget_info, FAIL) H5TRACE4("e","isxi",loc_id,name,linkbuf,lapl_id); /* Check arguments */ @@ -834,7 +851,7 @@ H5Lget_linkinfo(hid_t loc_id, const char *name, H5L_linkinfo_t *linkbuf /*out*/, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Get the creation time */ - if(H5L_get_linkinfo(&loc, name, linkbuf, lapl_id, H5AC_ind_dxpl_id) < 0) + if(H5L_get_info(&loc, name, linkbuf, lapl_id, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info") done: @@ -1086,8 +1103,8 @@ static herr_t H5L_link_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*/) { - H5L_trav_ud3_t *udata = (H5L_trav_ud3_t *)_udata; /* User data passed in */ - H5G_t *grp=NULL; /* H5G_t for this group, opened to pass to user callback */ + H5L_trav_ud2_t *udata = (H5L_trav_ud2_t *)_udata; /* User data passed in */ + H5G_t *grp = NULL; /* H5G_t for this group, opened to pass to user callback */ hid_t grp_id = FAIL; /* Id for this group (passed to user callback */ H5G_loc_t temp_loc; /* For UD callback */ hbool_t temp_loc_init = FALSE; @@ -1151,10 +1168,11 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED if((grp_id = H5I_register(H5I_GROUP, grp)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register ID for group") + /* Make callback */ if((link_class->create_func)(name, grp_id, udata->lnk->u.ud.udata, udata->lnk->u.ud.size, H5P_DEFAULT) < 0) HGOTO_ERROR(H5E_LINK, H5E_CALLBACK, FAIL, "link creation callback failed") - } - } + } /* end if */ + } /* end if */ done: /* Close the location given to the user callback if it was created */ @@ -1206,7 +1224,7 @@ H5L_create_real(H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path unsigned target_flags = H5G_TARGET_NORMAL; /* Flags to pass to group traversal function */ H5T_cset_t char_encoding = H5F_CRT_DEFAULT_CSET; /* Character encoding for link */ H5P_genplist_t* lc_plist; /* Link creation property list */ - H5L_trav_ud3_t udata; /* User data for callback */ + H5L_trav_ud2_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5L_create_real) @@ -1480,7 +1498,7 @@ static herr_t H5L_linkval_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_ud5_t *udata = (H5L_trav_ud5_t *)_udata; /* User data passed in */ + 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 */ @@ -1548,7 +1566,7 @@ 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) { - H5L_trav_ud5_t udata; /* User data for callback */ + H5L_trav_ud4_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5L_linkval) @@ -1585,7 +1603,7 @@ H5L_unlink_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSE { H5G_t *grp=NULL; /* H5G_t for this group, opened to pass to user callback */ hid_t grp_id = FAIL; /* Id for this group (passed to user callback */ - H5L_trav_ud6_t *udata = (H5L_trav_ud6_t *)_udata; /* User data passed in */ + H5L_trav_ud5_t *udata = (H5L_trav_ud5_t *)_udata; /* User data passed in */ H5G_loc_t temp_loc; /* For UD callback */ hbool_t temp_loc_init = FALSE; herr_t ret_value = SUCCEED; @@ -1670,7 +1688,7 @@ done: static herr_t H5L_unlink(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) { - H5L_trav_ud6_t udata; /* User data for callback */ + H5L_trav_ud5_t udata; /* User data for callback */ char *norm_name = NULL; /* Pointer to normalized name */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1718,7 +1736,7 @@ H5L_move_dest_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*/) { - H5L_trav_ud10_t *udata = (H5L_trav_ud10_t *)_udata; /* User data passed in */ + H5L_trav_ud6_t *udata = (H5L_trav_ud6_t *)_udata; /* User data passed in */ H5RS_str_t *dst_name_r = NULL; /* Ref-counted version of dest name */ H5G_t *grp=NULL; /* H5G_t for this group, opened to pass to user callback */ hid_t grp_id = FAIL; /* Id for this group (passed to user callback */ @@ -1835,13 +1853,13 @@ static herr_t H5L_move_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*/) { - H5L_trav_ud4_t *udata = (H5L_trav_ud4_t *)_udata; /* User data passed in */ - H5L_trav_ud10_t udata_out; /* User data for H5L_move_dest_cb traversal */ - H5G_obj_t type; /* Type of object being moved */ + H5L_trav_ud3_t *udata = (H5L_trav_ud3_t *)_udata; /* User data passed in */ + H5L_trav_ud6_t udata_out; /* User data for H5L_move_dest_cb traversal */ + H5G_obj_t type; /* Type of object being moved */ H5RS_str_t *dst_name_r = NULL; /* Ref-counted version of dest name */ char * orig_name = NULL; /* The name of the link in this group */ hbool_t link_copied = FALSE; /* Has udata_out.lnk been allocated? */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5L_move_cb) @@ -1961,7 +1979,7 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, H5T_cset_t char_encoding = H5F_CRT_DEFAULT_CSET; /* Character encoding for link */ H5P_genplist_t* lc_plist; /* Link creation property list */ H5P_genplist_t* la_plist; /* Link access property list */ - H5L_trav_ud4_t udata; /* User data for traversal */ + H5L_trav_ud3_t udata; /* User data for traversal */ hid_t lapl_copy; /* Copy of lapl for this function */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2025,7 +2043,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_linfo_cb + * Function: H5L_get_info_cb * * Purpose: Callback for retrieving a link's metadata * @@ -2037,16 +2055,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_linfo_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, const H5O_link_t *lnk, +H5L_get_info_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_ud1_t *udata = (H5L_trav_ud1_t *)_udata; /* User data passed in */ - H5L_linkinfo_t *linfo = udata->linfo; + H5L_info_t *linfo = udata->linfo; const H5L_class_t *link_class; /* User-defined link class */ ssize_t cb_ret; /* Return value from UD callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_get_linfo_cb) + FUNC_ENTER_NOAPI_NOINIT(H5L_get_info_cb) /* Check if the name in this group resolved to a valid link */ if(lnk == NULL) @@ -2099,11 +2117,11 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_linfo_cb() */ +} /* end H5L_get_info_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_get_linkinfo + * Function: H5L_get_info * * Purpose: Returns metadata about a link. * @@ -2115,23 +2133,23 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_linkinfo(const H5G_loc_t *loc, const char *name, H5L_linkinfo_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id) +H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id) { H5L_trav_ud1_t udata; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_get_linkinfo) + FUNC_ENTER_NOAPI_NOINIT(H5L_get_info) udata.linfo = linkbuf; udata.dxpl_id = dxpl_id; /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(loc, name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, H5L_get_linfo_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, H5L_get_info_cb, &udata, lapl_id, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_get_linkinfo() */ +} /* H5L_get_info() */ /*------------------------------------------------------------------------- diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index 308a6c6..4f152ae 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -44,8 +44,8 @@ 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_linkinfo(const H5G_loc_t *loc, const char *name, - H5L_linkinfo_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id); +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_register_external(void); diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 0611760..12162bf 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -70,7 +70,7 @@ typedef enum { #define H5L_TYPE_BUILTIN_MAX H5L_TYPE_SOFT /* Maximum value link value for "built-in" link types */ #define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL /* Link ids at or above this value are "user-defined" link types. */ -/* Metadata buffer for user query function */ +/* Buffer for user query function */ typedef struct { H5T_cset_t cset; /* Character set of link name */ int64_t corder; /* Creation order */ @@ -80,7 +80,7 @@ typedef struct { haddr_t address; /* Address hard link points to */ size_t link_size; /* Size of a soft link or UD link */ } u; -} H5L_linkinfo_t; +} H5L_info_t; /* The H5L_class_t struct can be used to override the behavior of a * "user-defined" link class. Users should populate the struct with callback @@ -141,8 +141,8 @@ H5_DLL herr_t H5Lcreate_soft(const char *target_path, hid_t cur_loc, 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, void *buf/*out*/, hid_t lapl_id); -H5_DLL herr_t H5Lget_linkinfo(hid_t loc_id, const char *name, - H5L_linkinfo_t *linkbuf /*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); /* UD link functions */ H5_DLL herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, diff --git a/test/links.c b/test/links.c index e8b2e36..c1ebf42 100644 --- a/test/links.c +++ b/test/links.c @@ -812,7 +812,7 @@ test_lcpl(hid_t fapl, hbool_t new_format) hid_t dset_id=-1; hid_t type_id=-1; hid_t lcpl_id=-1; - H5L_linkinfo_t linfo; + H5L_info_t linfo; char filename[1024]; hsize_t dims[2]; @@ -835,7 +835,7 @@ test_lcpl(hid_t fapl, hbool_t new_format) if(H5Gclose(group_id) < 0) TEST_ERROR /* Check that its character encoding is the default */ - if(H5Lget_linkinfo(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5F_CRT_DEFAULT_CSET) TEST_ERROR /* Create and commit a datatype with the default LCPL */ @@ -845,7 +845,7 @@ test_lcpl(hid_t fapl, hbool_t new_format) if(H5Tclose(type_id) < 0) TEST_ERROR; /* Check that its character encoding is the default */ - if(H5Lget_linkinfo(file_id, "type", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "type", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5F_CRT_DEFAULT_CSET) TEST_ERROR /* Create a dataspace */ @@ -859,7 +859,7 @@ test_lcpl(hid_t fapl, hbool_t new_format) if(H5Dclose(dset_id) < 0) TEST_ERROR /* Check that its character encoding is the default */ - if(H5Lget_linkinfo(file_id, "dataset", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "dataset", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5F_CRT_DEFAULT_CSET) TEST_ERROR /* Create a link creation property list with the UTF-8 character encoding */ @@ -872,7 +872,7 @@ test_lcpl(hid_t fapl, hbool_t new_format) if(H5Gclose(group_id) < 0) TEST_ERROR /* Check that its character encoding is UTF-8 */ - if(H5Lget_linkinfo(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR /* Create and commit a datatype with the new LCPL */ @@ -882,7 +882,7 @@ test_lcpl(hid_t fapl, hbool_t new_format) if(H5Tclose(type_id) < 0) TEST_ERROR; /* Check that its character encoding is UTF-8 */ - if(H5Lget_linkinfo(file_id, "type2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "type2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR /* Create a dataset using the new LCPL */ @@ -891,7 +891,7 @@ test_lcpl(hid_t fapl, hbool_t new_format) if(H5Dclose(dset_id) < 0) TEST_ERROR /* Check that its character encoding is UTF-8 */ - if(H5Lget_linkinfo(file_id, "dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR /* Create a new link to the dataset with a different character encoding. */ @@ -902,35 +902,35 @@ test_lcpl(hid_t fapl, hbool_t new_format) if(H5Lcreate_hard(file_id, "/dataset2", file_id, "/dataset2_link", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR /* Check that its character encoding is ASCII */ - if(H5Lget_linkinfo(file_id, "/dataset2_link", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "/dataset2_link", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR /* Check that the first link's encoding hasn't changed */ - if(H5Lget_linkinfo(file_id, "/dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "/dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR /* Make sure that LCPLs work properly for other API calls: */ /* H5Lcreate_soft */ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_UTF8) < 0) TEST_ERROR if(H5Lcreate_soft("dataset2", file_id, "slink_to_dset2", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR - if(H5Lget_linkinfo(file_id, "slink_to_dset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "slink_to_dset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR /* H5Lmove */ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_ASCII) < 0) TEST_ERROR if(H5Lmove(file_id, "slink_to_dset2", file_id, "moved_slink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR - if(H5Lget_linkinfo(file_id, "moved_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "moved_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR /* H5Lcopy */ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_UTF8) < 0) TEST_ERROR if(H5Lcopy(file_id, "moved_slink", file_id, "copied_slink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR - if(H5Lget_linkinfo(file_id, "copied_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "copied_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR /* H5Lcreate_external */ if(H5Lcreate_external("filename", "path", file_id, "extlink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR - if(H5Lget_linkinfo(file_id, "extlink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "extlink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR /* Close open IDs */ @@ -1278,7 +1278,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) hid_t lcpl_id=-1; hid_t lcpl2_id=-1; H5G_stat_t statbuf; - H5L_linkinfo_t linfo; + H5L_info_t linfo; H5T_cset_t old_cset; int64_t old_corder; /* Creation order value of link */ time_t old_modification_time; @@ -1316,7 +1316,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) if(H5Gclose(group_id) < 0) TEST_ERROR /* Get the group's link's information */ - if(H5Lget_linkinfo(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gget_objinfo(file_id, "group", TRUE, &statbuf) < 0) TEST_ERROR old_cset = linfo.cset; if(old_cset != H5T_CSET_UTF8) TEST_ERROR @@ -1335,7 +1335,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR /* Get the link's character set & modification time . They should be unchanged */ - if(H5Lget_linkinfo(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gget_objinfo(file_id, "group", TRUE, &statbuf) < 0) TEST_ERROR if(old_modification_time != statbuf.mtime) TEST_ERROR if(old_cset != linfo.cset) TEST_ERROR @@ -1346,7 +1346,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gget_objinfo(file_id, "group2", TRUE, &statbuf) < 0) TEST_ERROR if(old_modification_time != statbuf.mtime) TEST_ERROR - if(H5Lget_linkinfo(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(old_corder == linfo.corder) TEST_ERROR if(linfo.corder_valid != TRUE) TEST_ERROR if(linfo.corder != 1) TEST_ERROR @@ -1359,7 +1359,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gget_objinfo(file_id, "group_copied", TRUE, &statbuf) < 0) TEST_ERROR if(old_modification_time != statbuf.mtime) TEST_ERROR - if(H5Lget_linkinfo(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.corder_valid != TRUE) TEST_ERROR if(linfo.corder != 2) TEST_ERROR @@ -1370,7 +1370,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gget_objinfo(file_id, "group_copied2", TRUE, &statbuf) < 0) TEST_ERROR if(old_modification_time != statbuf.mtime) TEST_ERROR - if(H5Lget_linkinfo(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.corder_valid != TRUE) TEST_ERROR if(linfo.corder != 3) TEST_ERROR @@ -1380,7 +1380,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) /* Check that the original link is unchanged */ if(H5Gget_objinfo(file_id, "group", TRUE, &statbuf) < 0) TEST_ERROR if(old_modification_time != statbuf.mtime) TEST_ERROR - if(H5Lget_linkinfo(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.corder_valid != TRUE) TEST_ERROR if(old_corder != linfo.corder) TEST_ERROR if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR @@ -1391,7 +1391,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gget_objinfo(file_id, "group_moved", TRUE, &statbuf) < 0) TEST_ERROR if(old_modification_time != statbuf.mtime) TEST_ERROR - if(H5Lget_linkinfo(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.corder_valid != TRUE) TEST_ERROR if(linfo.corder != 4) TEST_ERROR @@ -1402,7 +1402,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format) if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gget_objinfo(file_id, "group_moved_again", TRUE, &statbuf) < 0) TEST_ERROR if(old_modification_time != statbuf.mtime) TEST_ERROR - if(H5Lget_linkinfo(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR if(linfo.corder_valid != TRUE) TEST_ERROR if(linfo.corder != 5) TEST_ERROR @@ -2569,7 +2569,7 @@ external_link_query(hid_t fapl, hbool_t new_format) char *file_name; /* Name of the file the external link points to */ char *object_name; /* Name of the object the external link points to */ H5G_stat_t sb; /* Object information */ - H5L_linkinfo_t li; /* Link information */ + H5L_info_t li; /* Link information */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], /* Names of files to externally link across */ query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */ @@ -2590,7 +2590,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if(H5Lcreate_external(filename2, "/dst", fid, "src", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Get size of buffer for external link */ - if(H5Lget_linkinfo(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.u.link_size != (HDstrlen(filename2) + HDstrlen("/dst") + 2)) TEST_ERROR if (H5L_TYPE_EXTERNAL != li.type) { H5_FAILED(); @@ -2616,7 +2616,7 @@ external_link_query(hid_t fapl, hbool_t new_format) if((fid=H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Get size of buffer for external link */ - if(H5Lget_linkinfo(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.u.link_size != (HDstrlen(filename2) + HDstrlen("/dst") + 2)) TEST_ERROR if (H5L_TYPE_EXTERNAL != li.type) { H5_FAILED(); @@ -3311,7 +3311,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) filename3[NAME_BUF_SIZE], filename4[NAME_BUF_SIZE], /* Names of files to externally link across */ buf[NAME_BUF_SIZE]; /* misc. buffer */ - H5L_linkinfo_t li; + H5L_info_t li; H5G_stat_t sb; hobj_ref_t obj_ref; @@ -3367,8 +3367,8 @@ external_link_closing(hid_t fapl, hbool_t new_format) if(H5Dclose(did) < 0) TEST_ERROR /* Test that getting info works */ - if(H5Lget_linkinfo(fid1, "elink/elink/elink/type1", &li, H5P_DEFAULT) < 0) TEST_ERROR - if(H5Lget_linkinfo(fid1, "elink/elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid1, "elink/elink/elink/type1", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid1, "elink/elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gget_objinfo(fid1, "elink/elink/elink/type1", TRUE, &sb) < 0) TEST_ERROR if(H5Gget_objinfo(fid1, "elink/elink/elink", TRUE, &sb) < 0) TEST_ERROR if(H5Gget_objinfo(fid1, "elink/elink/elink", FALSE, &sb) < 0) TEST_ERROR @@ -3469,13 +3469,13 @@ external_link_closing(hid_t fapl, hbool_t new_format) */ if((gid = H5Gcreate(fid1, "elink/file2group1/file2group2/slink/group3", (size_t)0)) < 0) TEST_ERROR if(H5Gclose(gid) < 0) TEST_ERROR - if(H5Lget_linkinfo(fid1, "elink/file2group1/file2group2/slink/group3", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid1, "elink/file2group1/file2group2/slink/group3", &li, H5P_DEFAULT) < 0) TEST_ERROR /* Some simpler tests */ if((gid = H5Gcreate(fid1, "elink/file2group3", (size_t)0)) < 0) TEST_ERROR if(H5Gclose(gid) < 0) TEST_ERROR - if(H5Lget_linkinfo(fid1, "elink/file2group3", &li, H5P_DEFAULT) < 0) TEST_ERROR - if(H5Lget_linkinfo(fid1, "elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid1, "elink/file2group3", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid1, "elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR /* Close file1, the only file that should still be open */ @@ -3766,7 +3766,7 @@ ud_hard_links(hid_t fapl) { hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - H5L_linkinfo_t li; /* Link information */ + H5L_info_t li; /* Link information */ char objname[NAME_BUF_SIZE]; /* Object name */ ssize_t name_len; /* Length of object name */ h5_stat_size_t empty_size; /* Size of an empty file */ @@ -3800,13 +3800,13 @@ ud_hard_links(hid_t fapl) if((gid = H5Gcreate(fid, "group", (size_t)0)) < 0) TEST_ERROR /* Get address for the group to give to the hard link */ - if(H5Lget_linkinfo(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gclose(gid) < 0) TEST_ERROR /* Create a user-defined "hard link" to the group using the address we got - * from H5Lget_linkinfo */ + * from H5Lget_info */ if(H5Lcreate_ud(fid, "ud_link", UD_HARD_TYPE, &(li.u.address), sizeof(haddr_t), H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Close and re-open file to ensure that data is written to disk */ @@ -3838,7 +3838,7 @@ ud_hard_links(hid_t fapl) if(H5Gclose(gid) < 0) TEST_ERROR /* Check that H5Lget_objinfo works on the hard link */ - if(H5Lget_linkinfo(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR /* UD hard links have no query function, thus return a "link length" of 0 */ if(li.u.link_size != 0) TEST_ERROR if(UD_HARD_TYPE != li.type) { @@ -3932,7 +3932,7 @@ ud_link_reregister(hid_t fapl) { hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ - H5L_linkinfo_t li; /* Link information */ + H5L_info_t li; /* Link information */ char objname[NAME_BUF_SIZE]; /* Object name */ ssize_t name_len; /* Length of object name */ char filename[NAME_BUF_SIZE]; @@ -3962,7 +3962,7 @@ ud_link_reregister(hid_t fapl) /* Point a UD defined hard link to a group in the same way as the previous test */ if((gid = H5Gcreate(fid, "group", (size_t)0)) < 0) TEST_ERROR - if (H5Lget_linkinfo(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR + if (H5Lget_info(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gclose(gid) < 0) TEST_ERROR if(H5Lcreate_ud(fid, "ud_link", UD_HARD_TYPE, &(li.u.address), @@ -4204,7 +4204,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) hid_t gid = (-1); /* Group ID */ hid_t lcpl = (-1); /* Link Creation PL */ H5G_stat_t sb; /* Object information */ - H5L_linkinfo_t li; /* Link information */ + H5L_info_t li; /* Link information */ char ud_target_name[] = UD_CB_TARGET; /* Link target name */ char filename[NAME_BUF_SIZE]; char query_buf[NAME_BUF_SIZE]; @@ -4250,7 +4250,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(H5Gclose(gid) < 0) TEST_ERROR /* Query the link to test its query callback */ - if (H5Lget_linkinfo(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR + if (H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.u.link_size != 16) TEST_ERROR if (UD_CB_TYPE != li.type) { H5_FAILED(); @@ -4283,7 +4283,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) if(H5Pclose(lcpl) < 0) TEST_ERROR /* Check its character encoding */ - if(H5Lget_linkinfo(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.cset != H5T_CSET_UTF8) TEST_ERROR /* Unregister the link class so the library forgets what its callbacks do */ @@ -4299,7 +4299,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format) } H5E_END_TRY /* The query callback should NOT fail, but should be unable to give a linklen */ - if(H5Lget_linkinfo(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.u.link_size != 0) TEST_ERROR if(li.type != UD_CB_TYPE) TEST_ERROR if(H5Gget_objinfo(fid, UD_CB_LINK_NAME, FALSE, &sb) < 0) TEST_ERROR @@ -4677,7 +4677,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) char group_name[NAME_BUF_SIZE]; char filename[NAME_BUF_SIZE]; char query_buf[NAME_BUF_SIZE]; - H5L_linkinfo_t li; /* Link information */ + H5L_info_t li; /* Link information */ if(new_format) TESTING("user-defined link error conditions (w/new group format)") @@ -4727,7 +4727,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) /* The deletion callback will always fail */ if(H5Gunlink(fid, "ud_link") >= 0) TEST_ERROR /* The query callback will fail */ - if(H5Lget_linkinfo(fid, "ud_link", &li, H5P_DEFAULT) >=0) TEST_ERROR + if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) >=0) TEST_ERROR } H5E_END_TRY /* Now use a class with different callback functions */ @@ -4740,7 +4740,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) if(H5Lcopy(fid, "ud_link", fid, "copy_succ", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* The query callback will succeed when we only want to get the size of the buffer... */ - if(H5Lget_linkinfo(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.u.link_size != 0) TEST_ERROR /* ...but fail when we try to write data to the buffer itself*/ H5E_BEGIN_TRY { @@ -4751,7 +4751,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format) if(H5Lregister(UD_cbfail_class3) < 0) TEST_ERROR /* Now querying should succeed */ - if(H5Lget_linkinfo(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.u.link_size != 8) TEST_ERROR if(H5Lget_linkval(fid, "ud_link", (size_t)NAME_BUF_SIZE, query_buf, H5P_DEFAULT) < 0) TEST_ERROR if(HDstrcmp(query_buf, "succeed") != 0) TEST_ERROR @@ -4926,9 +4926,9 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* H5Lunlink */ if(H5Lunlink(fid, "soft17/soft_link", plist) < 0) TEST_ERROR - /* H5Lget_linkval and H5Lget_linkinfo */ + /* H5Lget_linkval and H5Lget_info */ if(H5Lget_linkval(fid, "soft17", (size_t)0, NULL, plist) < 0) TEST_ERROR - if(H5Lget_linkinfo(fid, "soft17", NULL, plist) < 0) TEST_ERROR + if(H5Lget_info(fid, "soft17", NULL, plist) < 0) TEST_ERROR /* H5Lcreate_external and H5Lcreate_ud */ if(H5Lcreate_external("filename", "path", fid, "soft17/extlink", H5P_DEFAULT, plist) < 0) TEST_ERROR @@ -5045,7 +5045,7 @@ linkinfo(hid_t fapl, hbool_t new_format) hid_t gid = (-1); /* Group ID */ hid_t tid = (-1); /* Type ID */ hid_t sid = (-1), did = -(1); /* Dataspace and dataset IDs */ - H5L_linkinfo_t li; /* Link information */ + H5L_info_t li; /* Link information */ char filename[NAME_BUF_SIZE]; if(new_format) @@ -5079,22 +5079,22 @@ linkinfo(hid_t fapl, hbool_t new_format) if(H5Dclose(did) < 0) TEST_ERROR /* Make sure that link type is correct when objects are queried */ - if(H5Lget_linkinfo(fid, "datatype", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "datatype", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.type != H5L_TYPE_HARD) TEST_ERROR - if(H5Lget_linkinfo(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.type != H5L_TYPE_HARD) TEST_ERROR - if(H5Lget_linkinfo(fid, "dataset", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "dataset", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.type != H5L_TYPE_HARD) TEST_ERROR - if(H5Lget_linkinfo(fid, "ext_link", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "ext_link", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.type != H5L_TYPE_EXTERNAL) TEST_ERROR - if(H5Lget_linkinfo(fid, "softlink", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "softlink", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.type != H5G_LINK_SOFT) TEST_ERROR - if(H5Lget_linkinfo(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR if(li.type != UD_PLIST_TYPE) TEST_ERROR /* Ensure that passing a NULL pointer doesn't cause an error */ - if(H5Lget_linkinfo(fid, "group", NULL, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(fid, "group", NULL, H5P_DEFAULT) < 0) TEST_ERROR if(H5Fclose(fid) < 0) TEST_ERROR @@ -5373,11 +5373,11 @@ corder_create_compact(hid_t fapl) /* Loop through links, checking their creation order values */ /* (the name index is used, but the creation order value is in the same order) */ for(u = 0; u < max_compact; u++) { - H5L_linkinfo_t linfo; /* Link information */ + H5L_info_t linfo; /* Link information */ /* Retrieve information for link */ sprintf(objname, "filler %u", u); - if(H5Lget_linkinfo(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR /* Verify creation order of link */ if(linfo.corder_valid != TRUE) TEST_ERROR @@ -5509,11 +5509,11 @@ corder_create_dense(hid_t fapl) /* Loop through links, checking their creation order values */ /* (the name index is used, but the creation order value is in the same order) */ for(u = 0; u < (max_compact + 1); u++) { - H5L_linkinfo_t linfo; /* Link information */ + H5L_info_t linfo; /* Link information */ /* Retrieve information for link */ sprintf(objname, "filler %u", u); - if(H5Lget_linkinfo(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR /* Verify creation order of link */ if(linfo.corder_valid != TRUE) TEST_ERROR diff --git a/test/objcopy.c b/test/objcopy.c index 6745c91..8e6dbd2 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1100,8 +1100,8 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth) H5G_obj_t objtype2; /* Type of object in group */ H5G_stat_t objstat; /* Object info */ H5G_stat_t objstat2; /* Object info */ - H5L_linkinfo_t linfo; /* Link information */ - H5L_linkinfo_t linfo2; /* Link information */ + H5L_info_t linfo; /* Link information */ + H5L_info_t linfo2; /* Link information */ hid_t oid, oid2; /* IDs of objects within group */ /* Loop over contents of groups */ @@ -1127,8 +1127,8 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth) } /* end if */ /* Get link info */ - if(H5Lget_linkinfo(gid, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR - if(H5Lget_linkinfo(gid2, objname2, &linfo2, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(gid, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Lget_info(gid2, objname2, &linfo2, H5P_DEFAULT) < 0) TEST_ERROR /* Check for object already having been compared */ if(addr_lookup(&objstat)) diff --git a/test/th5o.c b/test/th5o.c index 345ec5f..1743a6b 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -242,7 +242,7 @@ test_h5o_open_by_addr(void) { hid_t fid; /* HDF5 File ID */ hid_t grp, dset, dtype, dspace; /* Object identifiers */ - H5L_linkinfo_t li; /* Buffer for H5Lget_linkinfo */ + H5L_info_t li; /* Buffer for H5Lget_info */ haddr_t grp_addr; /* Addresses for objects */ haddr_t dset_addr; haddr_t dtype_addr; @@ -286,14 +286,14 @@ test_h5o_open_by_addr(void) CHECK(ret, FAIL, "H5Sclose"); /* Get address for each object */ - ret = H5Lget_linkinfo(fid, "group", &li, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Lget_linkinfo"); + ret = H5Lget_info(fid, "group", &li, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lget_info"); grp_addr = li.u.address; - ret = H5Lget_linkinfo(fid, "group/datatype", &li, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Lget_linkinfo"); + ret = H5Lget_info(fid, "group/datatype", &li, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lget_info"); dtype_addr = li.u.address; - ret = H5Lget_linkinfo(fid, "dataset", &li, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Lget_linkinfo"); + ret = H5Lget_info(fid, "dataset", &li, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lget_info"); dset_addr = li.u.address; /* Now make sure that H5Oopen_by_addr can open all three types of objects */ diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 384b765..2dc89a6 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -1414,7 +1414,7 @@ dump_all(hid_t group, const char *name, void * op_data) hid_t obj; char *obj_path = NULL; /* Full path of object */ H5G_stat_t statbuf; - H5L_linkinfo_t linfo; /* Link information */ + H5L_info_t linfo; /* Link information */ herr_t ret = SUCCEED; /* Stat the object */ @@ -1424,7 +1424,7 @@ dump_all(hid_t group, const char *name, void * op_data) ret = FAIL; goto done; } /* end if */ - if(H5Lget_linkinfo(group, name, &linfo, H5P_DEFAULT) < 0) { + if(H5Lget_info(group, name, &linfo, H5P_DEFAULT) < 0) { error_msg(progname, "unable to get object information\n"); d_status = EXIT_FAILURE; ret = FAIL; @@ -3210,24 +3210,24 @@ static void handle_links(hid_t fid, char *links, void UNUSED * data) { H5G_stat_t statbuf; - H5L_linkinfo_t linfo; + H5L_info_t linfo; char * elink_file; char * elink_path; - if (H5Gget_objinfo(fid, links, FALSE, &statbuf) < 0) { + if(H5Gget_objinfo(fid, links, FALSE, &statbuf) < 0) { error_msg(progname, "unable to get obj info from \"%s\"\n", links); d_status = EXIT_FAILURE; - } else if (H5Lget_linkinfo(fid, links, &linfo, H5P_DEFAULT) < 0) { + } else if(H5Lget_info(fid, links, &linfo, H5P_DEFAULT) < 0) { error_msg(progname, "unable to get link info from \"%s\"\n", links); d_status = EXIT_FAILURE; - } else if (statbuf.type == H5G_LINK) { /* Soft link */ + } else if(statbuf.type == H5G_LINK) { /* Soft link */ char *buf = HDmalloc(statbuf.linklen); begin_obj(dump_header_format->softlinkbegin, links, dump_header_format->softlinkblockbegin); indentation(COL); - if (H5Lget_linkval(fid, links, statbuf.linklen, buf, H5P_DEFAULT) >= 0) { + if(H5Lget_linkval(fid, links, statbuf.linklen, buf, H5P_DEFAULT) >= 0) { printf("LINKTARGET \"%s\"\n", buf); } else { error_msg(progname, "h5dump error: unable to get link value for \"%s\"\n", @@ -3238,7 +3238,7 @@ handle_links(hid_t fid, char *links, void UNUSED * data) end_obj(dump_header_format->softlinkend, dump_header_format->softlinkblockend); HDfree(buf); - } else if (statbuf.type == H5G_UDLINK) { /* User-defined link */ + } else if(statbuf.type == H5G_UDLINK) { /* User-defined link */ char *buf = HDmalloc(statbuf.linklen); begin_obj(dump_header_format->udlinkbegin, links, dump_header_format->udlinkblockbegin); diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index d34cae0..effab89 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1750,12 +1750,12 @@ slink_open(hid_t location, const char *name) static hid_t udlink_open(hid_t location, const char *name) { - H5L_linkinfo_t linfo; + H5L_info_t linfo; char * buf = NULL; char * filename = NULL; char * path = NULL; - if(H5Lget_linkinfo(location, name, &linfo, H5P_DEFAULT) < 0) return -1; + if(H5Lget_info(location, name, &linfo, H5P_DEFAULT) < 0) return -1; switch(linfo.type) { diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index c7f9265..5fa88bd 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1076,12 +1076,12 @@ hsize_t diff (hid_t file1_id, { char *buf1 = NULL; char *buf2 = NULL; - H5L_linkinfo_t li1; - H5L_linkinfo_t li2; + H5L_info_t li1; + H5L_info_t li2; - if (H5Lget_linkinfo (file1_id, path1, &li1, H5P_DEFAULT) < 0) + if(H5Lget_info(file1_id, path1, &li1, H5P_DEFAULT) < 0) goto out; - if (H5Lget_linkinfo (file1_id, path1, &li2, H5P_DEFAULT) < 0) + if(H5Lget_info(file1_id, path1, &li2, H5P_DEFAULT) < 0) goto out; /* Only external links will have a query function registered */ @@ -1128,7 +1128,7 @@ hsize_t diff (hid_t file1_id, else { /* If one or both of these links isn't an external link, we can only - * compare information from H5Lget_linkinfo since we don't have a query + * compare information from H5Lget_info since we don't have a query * function registered for them. */ /* If the link classes or the buffer length are not the diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 8480f57..dc145ec 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -496,7 +496,7 @@ static int traverse( hid_t loc_id, case H5G_UDLINK: { - H5L_linkinfo_t linkbuf; + H5L_info_t linkbuf; /* increment */ inserted_objs++; @@ -506,9 +506,8 @@ static int traverse( hid_t loc_id, /* Get type of link */ H5E_BEGIN_TRY { - - /* get link class info */ - H5Lget_linkinfo( loc_id, path, &linkbuf, H5P_DEFAULT); + /* get link class info */ + H5Lget_info( loc_id, path, &linkbuf, H5P_DEFAULT); } H5E_END_TRY; if(linkbuf.type == H5L_TYPE_EXTERNAL) -- cgit v0.12