From a84811bfb889762150014188680fad0ce05877ba Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 28 Aug 2007 14:47:00 -0500 Subject: [svn-r14117] Description: Move H5Glink() into "deprecated routines" section, replacing internal usage with H5Lcreate_hard/H5Lcreate_soft. Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Solaris/32 5.10 (linew) --- c++/src/H5CommonFG.cpp | 19 +- examples/h5_group.c | 2 +- fortran/src/H5Gf.c | 75 ++++--- src/H5Gdeprec.c | 2 +- src/H5Gpublic.h | 8 +- src/H5L.c | 24 +- src/H5Lpublic.h | 4 +- test/getname.c | 483 ++++++++++++++++++++--------------------- test/links.c | 6 +- test/mount.c | 14 +- test/objcopy.c | 16 +- test/titerate.c | 8 +- test/tunicode.c | 4 +- test/unlink.c | 22 +- tools/h5diff/h5diffgentest.c | 4 +- tools/h5dump/h5dumpgentest.c | 275 ++++++++++++----------- tools/h5jam/h5jamgentest.c | 2 +- tools/h5repack/h5repack_refs.c | 5 +- tools/h5repack/h5repacktst.c | 12 +- 19 files changed, 503 insertions(+), 482 deletions(-) diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 2b20541..f8b0c05 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -245,10 +245,25 @@ DataSet CommonFG::openDataSet( const H5std_string& name ) const //-------------------------------------------------------------------------- void CommonFG::link( H5G_link_t link_type, const char* curr_name, const char* new_name ) const { - herr_t ret_value = H5Glink( getLocId(), link_type, curr_name, new_name ); + herr_t ret_value; + + switch(link_type) { + case H5L_TYPE_HARD: + ret_value = H5Lcreate_hard( getLocId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT ); + break; + + case H5L_TYPE_SOFT: + ret_value = H5Lcreate_soft( curr_name, getLocId(), new_name, H5P_DEFAULT, H5P_DEFAULT ); + break; + + default: + throwException("link", "unknown link type"); + break; + } /* end switch */ + if( ret_value < 0 ) { - throwException("link", "H5Glink failed"); + throwException("link", "creating link failed"); } } diff --git a/examples/h5_group.c b/examples/h5_group.c index 52f9f53..63331e3 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -118,7 +118,7 @@ main(void) /* * Create hard link to the Data group. */ - status = H5Glink(file, H5G_LINK_HARD, "Data", "Data_new"); + status = H5Lcreate_hard(file, "Data", H5L_SAME_LOC, "Data_new", H5P_DEFAULT, H5P_DEFAULT); /* * We can access "Compressed_Data" dataset using created diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 55faff9..e69f91c 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -253,14 +253,13 @@ DONE: *---------------------------------------------------------------------------*/ int_f -nh5gclose_c ( hid_t_f *grp_id ) +nh5gclose_c(hid_t_f *grp_id) { - int ret_value = 0; - hid_t c_grp_id; + int ret_value = 0; - c_grp_id = (hid_t)*grp_id; - if ( H5Gclose(c_grp_id) < 0 ) ret_value = -1; - return ret_value; + if(H5Gclose((hid_t)*grp_id) < 0) + ret_value = -1; + return ret_value; } @@ -281,40 +280,46 @@ nh5gclose_c ( hid_t_f *grp_id ) *---------------------------------------------------------------------------*/ int_f -nh5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen) +nh5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, + int_f *current_namelen, _fcd new_name, int_f *new_namelen) { - int ret_value = -1; - hid_t c_loc_id; - H5G_link_t c_link_type; - char *c_current_name, *c_new_name; - size_t c_current_namelen, c_new_namelen; - herr_t c_ret_value; - /* - * Convert Fortran name to C name - */ - c_current_namelen =*current_namelen; - c_new_namelen =*new_namelen; - c_current_name = (char *)HD5f2cstring(current_name, c_current_namelen); - if (c_current_name == NULL) return ret_value; + char *c_current_name = NULL, *c_new_name = NULL; + int ret_value = -1; - c_new_name = (char *)HD5f2cstring(new_name, c_new_namelen); - if(c_new_name == NULL) { HDfree(c_current_name); - return ret_value; - } - /* - * Call H5Glink function - */ - c_loc_id = *loc_id; - c_link_type = (H5G_link_t)*link_type; - c_ret_value = H5Glink(c_loc_id, c_link_type, c_current_name, c_new_name); + /* + * Convert Fortran name to C name + */ + if(NULL == (c_current_name = (char *)HD5f2cstring(current_name, (size_t)*current_namelen))) + goto DONE; + if(NULL == (c_new_name = (char *)HD5f2cstring(new_name, (size_t)new_namelen))) + goto DONE; - if(c_ret_value < 0) goto DONE; - ret_value = 0; + /* + * Call appropriate link creation function + */ + switch((H5G_link_t)*link_type) { + case H5L_TYPE_HARD: + if(H5Lcreate_hard((hid_t)*loc_id, c_current_name, H5L_SAME_LOC, c_new_name, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto DONE; + break; + + case H5L_TYPE_SOFT: + if(H5Lcreate_soft(c_current_name, (hid_t)*loc_id, c_new_name, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto DONE; + break; + + default: /* Unknown/unhandled link type */ + goto DONE; + } /* end switch */ + ret_value = 0; DONE: - HDfree(c_current_name); - HDfree(c_new_name); - return ret_value ; + if(c_current_name) + HDfree(c_current_name); + if(c_new_name) + HDfree(c_new_name); + + return ret_value ; } /*---------------------------------------------------------------------------- diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 3814c44..3ee2c2b 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -264,7 +264,6 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Gopen1() */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ /*------------------------------------------------------------------------- @@ -310,6 +309,7 @@ H5Glink(hid_t cur_loc_id, H5L_type_t type, const char *cur_name, const char *new done: FUNC_LEAVE_API(ret_value) } /* end H5Glink() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /*------------------------------------------------------------------------- diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 8b09ea5..4691e09 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -137,12 +137,10 @@ H5_DLL herr_t H5Gclose(hid_t group_id); * * Use of these functions and variables is deprecated. */ -H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5L_type_t type, const char *cur_name, - const char *new_name); -H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name, - const char *dst_name); H5_DLL herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5L_type_t type, hid_t new_loc_id, const char *new_name); +H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name, + const char *dst_name); H5_DLL herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name); H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name); @@ -170,6 +168,8 @@ H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs); /* Function prototypes */ H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint); H5_DLL hid_t H5Gopen1(hid_t loc_id, const char *name); +H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5L_type_t type, const char *cur_name, + const char *new_name); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5L.c b/src/H5L.c index f7b1f56..51ff5db 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -466,12 +466,12 @@ done: /*------------------------------------------------------------------------- * Function: H5Lcreate_soft * - * Purpose: Creates a soft link from NEW_NAME to TARGET_PATH. + * Purpose: Creates a soft link from LINK_NAME to LINK_TARGET. * - * TARGET_PATH can be anything and is interpreted at lookup + * LINK_TARGET can be anything and is interpreted at lookup * time relative to the group which contains the final component - * of NEW_NAME. For instance, if TARGET_PATH is `./foo' and - * NEW_NAME is `./x/y/bar' and a request is made for `./x/y/bar' + * of LINK_NAME. For instance, if LINK_TARGET is `./foo' and + * LINK_NAME is `./x/y/bar' and a request is made for `./x/y/bar' * then the actual object looked up is `./x/y/./foo'. * * Return: Non-negative on success/Negative on failure @@ -482,27 +482,27 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Lcreate_soft(const char *target_path, - hid_t cur_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id) +H5Lcreate_soft(const char *link_target, + hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id) { - H5G_loc_t cur_loc; /* Group location for new link */ + H5G_loc_t link_loc; /* Group location for new link */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(H5Lcreate_soft, FAIL) - H5TRACE5("e", "*si*sii", target_path, cur_loc_id, new_name, lcpl_id, lapl_id); + H5TRACE5("e", "*si*sii", link_target, link_loc_id, link_name, lcpl_id, lapl_id); /* Check arguments */ - if(H5G_loc(cur_loc_id, &cur_loc) < 0) + if(H5G_loc(link_loc_id, &link_loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!target_path || !*target_path) + if(!link_target || !*link_target) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no target specified") - if(!new_name || !*new_name) + if(!link_name || !*link_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") /* Create the link */ - if(H5L_create_soft(target_path, &cur_loc, new_name, lcpl_id, lapl_id, H5AC_dxpl_id) < 0) + if(H5L_create_soft(link_target, &link_loc, link_name, lcpl_id, lapl_id, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") done: diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 679f176..863155e 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -148,8 +148,8 @@ H5_DLL herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id); H5_DLL herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, 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 H5Lcreate_soft(const char *link_target, hid_t link_loc_id, + const char *link_name, hid_t lcpl_id, hid_t lapl_id); H5_DLL herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id); H5_DLL 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); diff --git a/test/getname.c b/test/getname.c index 8348362..29085e0 100644 --- a/test/getname.c +++ b/test/getname.c @@ -188,10 +188,10 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Dcreate"); /* Create the dataspace */ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((dataset_id = H5Dcreate(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR @@ -225,7 +225,7 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Dopen"); /* Reopen the dataset */ - if((dataset_id = H5Dopen(file_id, "d1"))<0) TEST_ERROR + if((dataset_id = H5Dopen(file_id, "d1")) < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR @@ -264,8 +264,8 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file_id, "g2/bar/baz", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a dataset */ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR - if((dataset_id = H5Dcreate(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR /* Close */ H5Dclose(dataset_id); @@ -275,7 +275,7 @@ test_main(hid_t file_id, hid_t fapl) H5Gclose(group3_id); /* Reopen the dataset */ - if((dataset_id = H5Dopen(file_id, "/g2/bar/baz/d1"))<0) TEST_ERROR + if((dataset_id = H5Dopen(file_id, "/g2/bar/baz/d1")) < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "/g2/bar/baz/d1", "/g2/bar/baz/d1") < 0) TEST_ERROR @@ -294,15 +294,15 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Tcommit"); /* Create a datatype */ - if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)))<0) TEST_ERROR + if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) TEST_ERROR /* Insert fields */ - if(H5Tinsert(type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0) TEST_ERROR - if(H5Tinsert(type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) TEST_ERROR - if(H5Tinsert(type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) TEST_ERROR + if(H5Tinsert(type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR /* Save datatype for later */ - if(H5Tcommit(file_id, "t1", type_id)<0) TEST_ERROR + if(H5Tcommit(file_id, "t1", type_id) < 0) TEST_ERROR /* Verify */ if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR @@ -320,7 +320,7 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Topen"); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "t1"))<0) TEST_ERROR + if((type_id=H5Topen(file_id, "t1")) < 0) TEST_ERROR /* Verify */ if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR @@ -364,10 +364,10 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Gmove and H5Dopen"); /* Reopen the dataset */ - if((dataset_id = H5Dopen(file_id, "/d1"))<0) TEST_ERROR + if((dataset_id = H5Dopen(file_id, "/d1")) < 0) TEST_ERROR /* Rename dataset */ - if(H5Gmove(file_id, "/d1", "/d1a")<0) TEST_ERROR + if(H5Gmove(file_id, "/d1", "/d1a") < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "/d1a", "/d1a") < 0) TEST_ERROR @@ -388,10 +388,10 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with H5Gmove and H5Topen"); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "/t1"))<0) TEST_ERROR + if((type_id=H5Topen(file_id, "/t1")) < 0) TEST_ERROR /* Rename datatype */ - if(H5Gmove(file_id, "/t1", "/t1a")<0) TEST_ERROR + if(H5Gmove(file_id, "/t1", "/t1a") < 0) TEST_ERROR /* Verify */ if(check_name(type_id, "/t1a", "/t1a") < 0) TEST_ERROR @@ -471,19 +471,19 @@ test_main(hid_t file_id, hid_t fapl) if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR /* Move group "B" to "D"*/ - if(H5Gmove(file_id, "/g4/A/B", "/g5/C/D")<0) TEST_ERROR + if(H5Gmove(file_id, "/g4/A/B", "/g5/C/D") < 0) TEST_ERROR /* Verify */ if(check_name(group3_id, "/g5/C/D", "/g5/C/D") < 0) TEST_ERROR /* Move group "/g5/C/D" back to "/g4/A/B" using relative name */ - if(H5Gmove2(group5_id, "D", group2_id, "B")<0) TEST_ERROR + if(H5Gmove2(group5_id, "D", group2_id, "B") < 0) TEST_ERROR /* Verify */ if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR /* Move group "/g4/A/B" to "/g4/F/B" using relative name */ - if(H5Gmove2(group_id, "A", group_id, "F")<0) TEST_ERROR + if(H5Gmove2(group_id, "A", group_id, "F") < 0) TEST_ERROR /* Verify */ if(check_name(group3_id, "/g4/F/B", "/g4/F/B") < 0) TEST_ERROR @@ -518,7 +518,7 @@ test_main(hid_t file_id, hid_t fapl) if(check_name(group3_id, "/g6/A/B", "/g6/A/B") < 0) TEST_ERROR /* Move group "A" to "C"*/ - if(H5Gmove(file_id, "/g6/A", "/g7/C")<0) TEST_ERROR + if(H5Gmove(file_id, "/g6/A", "/g7/C") < 0) TEST_ERROR /* Verify */ if(check_name(group2_id, "/g7/C", "/g7/C") < 0) TEST_ERROR @@ -545,7 +545,7 @@ test_main(hid_t file_id, hid_t fapl) if((group_id = H5Gcreate2(file_id, "/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ - if(H5Gunlink(file_id, "/g8")<0) TEST_ERROR + if(H5Gunlink(file_id, "/g8") < 0) TEST_ERROR /* Verify */ if(check_name(group_id, "", "") < 0) TEST_ERROR @@ -568,7 +568,7 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file_id, "g9/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ - if(H5Gunlink(file_id, "/g9/a")<0) TEST_ERROR + if(H5Gunlink(file_id, "/g9/a") < 0) TEST_ERROR /* Verify */ if(check_name(group2_id, "", "") < 0) TEST_ERROR @@ -585,7 +585,7 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete, using relative path */ - if(H5Gunlink(group_id, "a")<0) TEST_ERROR + if(H5Gunlink(group_id, "a") < 0) TEST_ERROR /* Verify */ if(check_name(group2_id, "", "") < 0) TEST_ERROR @@ -606,7 +606,7 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(file_id, "g10/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete */ - if(H5Gunlink(file_id, "/g10/a/b")<0) TEST_ERROR + if(H5Gunlink(file_id, "/g10/a/b") < 0) TEST_ERROR /* Verify */ if(check_name(group3_id, "", "") < 0) TEST_ERROR @@ -618,7 +618,7 @@ test_main(hid_t file_id, hid_t fapl) if((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete, using relative path */ - if(H5Gunlink(group_id, "a/b")<0) TEST_ERROR + if(H5Gunlink(group_id, "a/b") < 0) TEST_ERROR /* Verify */ if(check_name(group3_id, "", "") < 0) TEST_ERROR @@ -645,12 +645,12 @@ test_main(hid_t file_id, hid_t fapl) if((group2_id = H5Gcreate2(file_id, "g11/g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create two datasets "g11/d" and "g11/g/d"*/ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR - if((dataset_id = H5Dcreate(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR - if((dataset2_id = H5Dcreate(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset2_id = H5Dcreate(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR /* Delete */ - if(H5Gunlink(file_id, "/g11/d")<0) TEST_ERROR + if(H5Gunlink(file_id, "/g11/d") < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "", "") < 0) TEST_ERROR @@ -685,24 +685,24 @@ test_main(hid_t file_id, hid_t fapl) file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); /* Create a dataspace */ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create the dataset */ - if((dataset_id = H5Dcreate(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((dataset_id = H5Dcreate(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR /* Close */ H5Dclose(dataset_id); /* Mount second file under "g12" in the first file */ - if(H5Fmount(file_id, "/g12", file1_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g12", file1_id, H5P_DEFAULT) < 0) TEST_ERROR /* Access dataset D in the first file under "/G/D" name */ - if((dataset_id = H5Dopen(file_id, "/g12/d"))<0) TEST_ERROR + if((dataset_id = H5Dopen(file_id, "/g12/d")) < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "/g12/d", "/g12/d") < 0) TEST_ERROR - if(H5Funmount(file_id, "/g12")<0) TEST_ERROR + if(H5Funmount(file_id, "/g12") < 0) TEST_ERROR /* Close */ H5Dclose(dataset_id); @@ -973,25 +973,25 @@ test_main(hid_t file_id, hid_t fapl) TESTING("H5Iget_name with a defined type dataset"); /* Create a datatype */ - if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)))<0) TEST_ERROR + if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) TEST_ERROR /* Insert fields */ - if(H5Tinsert(type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0) TEST_ERROR - if(H5Tinsert(type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) TEST_ERROR - if(H5Tinsert(type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) TEST_ERROR + if(H5Tinsert(type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR /* Create group "g17" */ if((group_id = H5Gcreate2(file_id, "g17", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Save datatype for later */ - if(H5Tcommit(group_id, "t", type_id)<0) TEST_ERROR + if(H5Tcommit(group_id, "t", type_id) < 0) TEST_ERROR /* Create a dataspace */ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create a new dataset */ if((dataset_id = H5Dcreate(group_id , "d", type_id, space_id, - H5P_DEFAULT))<0) TEST_ERROR + H5P_DEFAULT)) < 0) TEST_ERROR /* Close */ H5Dclose(dataset_id); @@ -1000,7 +1000,7 @@ test_main(hid_t file_id, hid_t fapl) H5Gclose(group_id); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "/g17/t"))<0) TEST_ERROR + if((type_id=H5Topen(file_id, "/g17/t")) < 0) TEST_ERROR /* Verify */ if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR @@ -1009,10 +1009,10 @@ test_main(hid_t file_id, hid_t fapl) H5Tclose(type_id); /* Reopen the dataset */ - if((dataset_id = H5Dopen(file_id, "/g17/d"))<0) TEST_ERROR + if((dataset_id = H5Dopen(file_id, "/g17/d")) < 0) TEST_ERROR /* Get datatype*/ - if((type_id=H5Dget_type(dataset_id))<0) TEST_ERROR + if((type_id=H5Dget_type(dataset_id)) < 0) TEST_ERROR /* Verify */ if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR @@ -1024,30 +1024,30 @@ test_main(hid_t file_id, hid_t fapl) PASSED(); -/*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * Test H5Iget_name with objects that have two names *------------------------------------------------------------------------- */ -TESTING("H5Iget_name with datasets that have two names"); + TESTING("H5Iget_name with datasets that have two names"); -/* Open dataset named "d"*/ -if((dataset_id = H5Dopen(file_id, "/g17/d"))<0) TEST_ERROR + /* Open dataset named "d"*/ + if((dataset_id = H5Dopen(file_id, "/g17/d")) < 0) FAIL_STACK_ERROR -/* Create link to dataset named "link" */ -if(H5Glink2(dataset_id,".",H5G_LINK_HARD,file_id,"/g17/link")<0) TEST_ERROR -if((dataset2_id = H5Dopen(file_id, "/g17/link"))<0) TEST_ERROR + /* Create link to dataset named "link" */ + if(H5Glink2(dataset_id,".",H5G_LINK_HARD,file_id,"/g17/link") < 0) FAIL_STACK_ERROR + if((dataset2_id = H5Dopen(file_id, "/g17/link")) < 0) FAIL_STACK_ERROR -/* Make sure that the two IDs use two different names */ + /* Make sure that the two IDs use two different names */ if(check_name(dataset_id, "/g17/d", "/g17/d") < 0) TEST_ERROR if(check_name(dataset2_id, "/g17/link", "/g17/link") < 0) TEST_ERROR -if(H5Dclose(dataset_id)<0) TEST_ERROR -if(H5Dclose(dataset2_id)<0) TEST_ERROR + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR + if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR -PASSED(); + PASSED(); -/*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * Test H5Iget_name with different files, test1 *------------------------------------------------------------------------- */ @@ -1055,22 +1055,22 @@ PASSED(); TESTING("H5Iget_name with different files"); /* Create a new file using default properties. */ - if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR + if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create a new file using default properties. */ - if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR + if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create the dataspace */ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR /* Delete */ - if(H5Gunlink(file2_id, "/d")<0) TEST_ERROR + if(H5Gunlink(file2_id, "/d") < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "", "") < 0) TEST_ERROR @@ -1096,22 +1096,22 @@ PASSED(); TESTING("H5Iget_name with different files #2"); /* Create a new file using default properties. */ - if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR + if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create a new file using default properties. */ - if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR + if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Create the dataspace */ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR /* Delete */ - if(H5Gunlink(file3_id, "/d")<0) TEST_ERROR + if(H5Gunlink(file3_id, "/d") < 0) TEST_ERROR /* Verify */ if(check_name(dataset_id, "/d", "/d") < 0) TEST_ERROR @@ -1211,13 +1211,13 @@ PASSED(); TESTING("H5Iget_name with invalid IDs"); /* Create a dataspace */ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR /* Define a datatype */ - if((type_id = H5Tcopy(H5T_NATIVE_INT))<0) TEST_ERROR + if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(file_id , "d2", type_id, space_id, H5P_DEFAULT))<0) TEST_ERROR + if((dataset_id = H5Dcreate(file_id , "d2", type_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR { char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */ @@ -1253,10 +1253,10 @@ PASSED(); if((group2_id = H5Gcreate2(file_id, "/g18/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Also create a dataset and a datatype */ - if((space_id = H5Screate_simple(1, dims, NULL))<0) TEST_ERROR - if((type_id = H5Tcopy(H5T_NATIVE_INT))<0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR + if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, - H5P_DEFAULT))<0) TEST_ERROR + H5P_DEFAULT)) < 0) TEST_ERROR if(H5Tcommit(file_id, "g18/t2", type_id) <0) TEST_ERROR @@ -1267,7 +1267,7 @@ PASSED(); if((group5_id = H5Gcreate2(file1_id, "/g3/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount first file at "g3/g4" in the second file */ - if(H5Fmount(file1_id, "/g3/g4", file_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file1_id, "/g3/g4", file_id, H5P_DEFAULT) < 0) TEST_ERROR /* Get name for the group ID in the first file, should be "/g18/g2" still */ if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR @@ -1294,7 +1294,7 @@ PASSED(); if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR /* Unmount */ - if(H5Funmount(file1_id, "/g3/g4")<0) TEST_ERROR + if(H5Funmount(file1_id, "/g3/g4") < 0) TEST_ERROR /* Get name for the IDs of the first file, should be unchanged */ if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR @@ -1367,7 +1367,7 @@ PASSED(); if((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount first file at "/g3/g4" in the second file */ - if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT) < 0) TEST_ERROR /* Open the mounted group */ if((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1376,7 +1376,7 @@ PASSED(); if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR /* Delete */ - if(H5Gunlink(file1_id, "/g3/g4/g1/g2")<0) TEST_ERROR + if(H5Gunlink(file1_id, "/g3/g4/g1/g2") < 0) TEST_ERROR /* Verify */ if(check_name(group5_id, "", "") < 0) TEST_ERROR @@ -1415,7 +1415,7 @@ PASSED(); if((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount first file at "g3/g4" in the second file */ - if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT) < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR @@ -1433,14 +1433,14 @@ PASSED(); if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR /* Rename group */ - if(H5Gmove(file2_id, "/g3/g4/g1/g2", "/g3/g4/g1/g5")<0) TEST_ERROR + if(H5Gmove(file2_id, "/g3/g4/g1/g2", "/g3/g4/g1/g5") < 0) TEST_ERROR /* Verify */ if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR /* Rename group */ - if(H5Gmove(file2_id, "/g3/g4/g1", "/g3/g4/g1a")<0) TEST_ERROR + if(H5Gmove(file2_id, "/g3/g4/g1", "/g3/g4/g1a") < 0) TEST_ERROR /* Verify */ if(check_name(group5_id, "/g3/g4/g1a/g5", "/g3/g4/g1a/g5") < 0) TEST_ERROR @@ -1451,7 +1451,7 @@ PASSED(); if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR /* Rename middle group back, using relative path */ - if(H5Gmove(group3_id, "g4/g1a", "g4/g1")<0) TEST_ERROR + if(H5Gmove(group3_id, "g4/g1a", "g4/g1") < 0) TEST_ERROR /* Verify */ if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR @@ -1460,7 +1460,7 @@ PASSED(); if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR /* Rename end group back, using relative path */ - if(H5Gmove(group3_id, "g4/g1/g5", "g4/g1/g2")<0) TEST_ERROR + if(H5Gmove(group3_id, "g4/g1/g5", "g4/g1/g2") < 0) TEST_ERROR /* Verify */ if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR @@ -1469,7 +1469,7 @@ PASSED(); if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR /* Rename mount point */ - if(H5Gmove(file2_id, "/g3/g4", "/g3/g4a")<0) TEST_ERROR + if(H5Gmove(file2_id, "/g3/g4", "/g3/g4a") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g3/g4a", "/g3/g4a") < 0) TEST_ERROR @@ -1477,7 +1477,7 @@ PASSED(); if(check_name(group6_id, "/g3/g4a/g1", "/g3/g4a/g1") < 0) TEST_ERROR /* Rename mount point back, using relative path*/ - if(H5Gmove(group3_id, "g4a", "g4")<0) TEST_ERROR + if(H5Gmove(group3_id, "g4a", "g4") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR @@ -1496,19 +1496,19 @@ PASSED(); PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Glink hard + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Lcreate_hard *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Glink hard"); + TESTING("H5Iget_name with H5Lcreate_hard"); /* Create group "g19/g1" */ if((group_id = H5Gcreate2(file_id, "/g19", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group2_id = H5Gcreate2(file_id, "/g19/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create hard link to "g19/g1/ group */ - if(H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g2")<0) TEST_ERROR + if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR @@ -1520,21 +1520,21 @@ PASSED(); if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR /* Rename original group */ - if(H5Gmove(file_id, "/g19/g1", "/g19/g3")<0) TEST_ERROR + if(H5Gmove(file_id, "/g19/g1", "/g19/g3") < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR /* Rename original group back, using relative path */ - if(H5Gmove(group_id, "g3", "g1")<0) TEST_ERROR + if(H5Gmove(group_id, "g3", "g1") < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR /* Create another hard link to "/g19/g1" group */ - if(H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g3")<0) TEST_ERROR + if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Open the group */ if((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1543,7 +1543,7 @@ PASSED(); if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR /* Delete group */ - if(H5Gunlink(file_id, "/g19/g3")<0) TEST_ERROR + if(H5Gunlink(file_id, "/g19/g3") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g19/g1", "") < 0) TEST_ERROR @@ -1551,10 +1551,10 @@ PASSED(); if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR /* Close the unlinked group */ - H5Gclose(group4_id); + if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR /* Create another hard link to "/g19/g1" group */ - if(H5Glink(file_id, H5G_LINK_HARD, "/g19/g1", "/g19/g3")<0) TEST_ERROR + if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Open the group */ if((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1563,7 +1563,7 @@ PASSED(); if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR /* Delete group, using relative path */ - if(H5Gunlink(group_id, "g3")<0) TEST_ERROR + if(H5Gunlink(group_id, "g3") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g19/g1", "") < 0) TEST_ERROR @@ -1571,30 +1571,30 @@ PASSED(); if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR /* Close the unlinked group */ - H5Gclose(group4_id); + if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Glink symbolic + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Lcreate_soft *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Glink symbolic"); + TESTING("H5Iget_name with H5Lcreate_soft"); /* Create group "g20/g1" */ if((group_id = H5Gcreate2(file_id, "/g20", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group2_id = H5Gcreate2(file_id, "/g20/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g20/g1/ group */ - if(H5Glink(file_id, H5G_LINK_SOFT, "/g20/g1", "/g20/g2")<0) TEST_ERROR + if(H5Lcreate_soft("/g20/g1", file_id, "/g20/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g20/g1", "/g20/g1") < 0) TEST_ERROR @@ -1606,26 +1606,26 @@ PASSED(); if(check_name(group3_id, "/g20/g2", "/g20/g2") < 0) TEST_ERROR /* Close */ - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Glink symbolic and move target + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Lcreate_soft and move target *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Glink symbolic and move target"); + TESTING("H5Iget_name with H5Lcreate_soft and move target"); /* Create group "g21/g1" */ if((group_id = H5Gcreate2(file_id, "/g21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group2_id = H5Gcreate2(file_id, "/g21/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g21/g1/ group */ - if(H5Glink(file_id, H5G_LINK_SOFT, "/g21/g1", "/g21/g2")<0) TEST_ERROR + if(H5Lcreate_soft("/g21/g1", file_id, "/g21/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g21/g1", "/g21/g1") < 0) TEST_ERROR @@ -1634,33 +1634,33 @@ PASSED(); if((group3_id = H5Gopen2(file_id, "/g21/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename group */ - if(H5Gmove(file_id, "/g21/g1", "/g21/g3")<0) TEST_ERROR + if(H5Gmove(file_id, "/g21/g1", "/g21/g3") < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g21/g3", "/g21/g3") < 0) TEST_ERROR if(check_name(group3_id, "/g21/g2", "/g21/g2") < 0) TEST_ERROR /* Close */ - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Glink symbolic and move source + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Lcreate_soft and move source *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Glink symbolic and move source"); + TESTING("H5Iget_name with H5Lcreate_soft and move source"); /* Create group "g22/g1" */ if((group_id = H5Gcreate2(file_id, "/g22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group2_id = H5Gcreate2(file_id, "/g22/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g22/g1/ group */ - if(H5Glink(file_id, H5G_LINK_SOFT, "/g22/g1", "/g22/g2")<0) TEST_ERROR + if(H5Lcreate_soft("/g22/g1", file_id, "/g22/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR @@ -1669,41 +1669,41 @@ PASSED(); if((group3_id = H5Gopen2(file_id, "/g22/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename soft link */ - if(H5Gmove(file_id, "/g22/g2", "/g22/g3")<0) TEST_ERROR + if(H5Gmove(file_id, "/g22/g2", "/g22/g3") < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR if(check_name(group3_id, "/g22/g3", "/g22/g3") < 0) TEST_ERROR /* Rename soft link, using relative paths */ - if(H5Gmove(group_id, "g3", "g2")<0) TEST_ERROR + if(H5Gmove(group_id, "g3", "g2") < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR if(check_name(group3_id, "/g22/g2", "/g22/g2") < 0) TEST_ERROR /* Close */ - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Glink symbolic and unlink target + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Lcreate_soft and unlink target *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Glink symbolic and unlink target"); + TESTING("H5Iget_name with H5Lcreate_soft and unlink target"); /* Create group "g23/g1" */ if((group_id = H5Gcreate2(file_id, "/g23", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group2_id = H5Gcreate2(file_id, "/g23/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g23/g1/ group */ - if(H5Glink(file_id, H5G_LINK_SOFT, "/g23/g1", "/g23/g2")<0) TEST_ERROR + if(H5Lcreate_soft("/g23/g1", file_id, "/g23/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g23/g1", "/g23/g1") < 0) TEST_ERROR @@ -1712,31 +1712,31 @@ PASSED(); if((group3_id = H5Gopen2(file_id, "/g23/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete group */ - if(H5Gunlink(file_id, "/g23/g1")<0) TEST_ERROR + if(H5Gunlink(file_id, "/g23/g1") < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group3_id, "/g23/g2", "/g23/g2") < 0) TEST_ERROR /* Close */ - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Glink symbolic and unlink source + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Lcreate_soft and unlink source *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Glink symbolic and unlink source"); + TESTING("H5Iget_name with H5Lcreate_soft and unlink source"); /* Create group "g24/g1" */ if((group_id = H5Gcreate2(file_id, "/g24", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group2_id = H5Gcreate2(file_id, "/g24/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create symbolic link to "g24/g1/ group */ - if(H5Glink(file_id, H5G_LINK_SOFT, "/g24/g1", "/g24/g2")<0) TEST_ERROR + if(H5Lcreate_soft("/g24/g1", file_id, "/g24/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group2_id, "/g24/g1", "/g24/g1") < 0) TEST_ERROR @@ -1745,15 +1745,15 @@ PASSED(); if((group3_id = H5Gopen2(file_id, "/g24/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Delete symbolic link */ - if(H5Gunlink(file_id, "/g24/g2")<0) TEST_ERROR + if(H5Gunlink(file_id, "/g24/g2") < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group3_id, "/g24/g1", "") < 0) TEST_ERROR /* Close */ - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -1817,7 +1817,7 @@ PASSED(); if(check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0) TEST_ERROR /* Mount second file under "/g25/g1" in the first file */ - if(H5Fmount(file_id, "/g25/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g25/g1", file1_id, H5P_DEFAULT) < 0) TEST_ERROR /* Verify */ if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR @@ -1829,7 +1829,7 @@ PASSED(); if(check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR /* Mount third file under "/g25/g1/g26/g3" in the first file */ - if(H5Fmount(file_id, "/g25/g1/g26/g3", file2_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g25/g1/g26/g3", file2_id, H5P_DEFAULT) < 0) TEST_ERROR /* Verify */ if(check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR @@ -1841,7 +1841,7 @@ PASSED(); if(check_name(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR /* Mount fourth file under "/g25/g1/g26/g3/g27/g5" in the first file */ - if(H5Fmount(file_id, "/g25/g1/g26/g3/g27/g5", file3_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g25/g1/g26/g3/g27/g5", file3_id, H5P_DEFAULT) < 0) TEST_ERROR /* Verify */ if(check_name(group3_id, "", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR @@ -1852,7 +1852,7 @@ PASSED(); /* Verify */ if(check_name(group4_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", "/g25/g1/g26/g3/g27/g5/g28/g7/g8") < 0) TEST_ERROR - if(H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5")<0) TEST_ERROR + if(H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g28/g7/g8", "") < 0) TEST_ERROR @@ -1864,7 +1864,7 @@ PASSED(); H5Gclose(group4_id); H5Fclose(file3_id); - if(H5Funmount(file_id, "/g25/g1/g26/g3")<0) TEST_ERROR + if(H5Funmount(file_id, "/g25/g1/g26/g3") < 0) TEST_ERROR /* Verify */ if(check_name(group3_id, "/g27/g5/g6", "") < 0) TEST_ERROR @@ -1875,7 +1875,7 @@ PASSED(); H5Gclose(group3_id); H5Fclose(file2_id); - if(H5Funmount(file_id, "/g25/g1")<0) TEST_ERROR + if(H5Funmount(file_id, "/g25/g1") < 0) TEST_ERROR /* Verify */ if(check_name(group2_id, "/g26/g3/g4", "") < 0) TEST_ERROR @@ -1905,20 +1905,20 @@ PASSED(); if((group5_id = H5Gcreate2(file_id, "/g29/g1/g2/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename group */ - if(H5Gmove(file_id, "/g29/g1/g2/g1/g2", "/g29/g1/g2/g1/g3")<0) TEST_ERROR + if(H5Gmove(file_id, "/g29/g1/g2/g1/g2", "/g29/g1/g2/g1/g3") < 0) TEST_ERROR /* Verify */ if(check_name(group5_id, "/g29/g1/g2/g1/g3", "/g29/g1/g2/g1/g3") < 0) TEST_ERROR /* Rename group in middle of path, keeping within the same group */ - if(H5Gmove(file_id, "/g29/g1/g2/g1", "/g29/g1/g2/g3")<0) TEST_ERROR + if(H5Gmove(file_id, "/g29/g1/g2/g1", "/g29/g1/g2/g3") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g29/g1/g2/g3", "/g29/g1/g2/g3") < 0) TEST_ERROR if(check_name(group5_id, "/g29/g1/g2/g3/g3", "/g29/g1/g2/g3/g3") < 0) TEST_ERROR /* Rename group in middle of path, moving to another group in file */ - if(H5Gmove(file_id, "/g29/g1/g2/g3", "/g29/g3")<0) TEST_ERROR + if(H5Gmove(file_id, "/g29/g1/g2/g3", "/g29/g3") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g29/g3", "/g29/g3") < 0) TEST_ERROR @@ -1994,7 +1994,7 @@ PASSED(); if(check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0) TEST_ERROR /* Mount second file under "/g30/g1" in the first file */ - if(H5Fmount(file_id, "/g30/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g30/g1", file1_id, H5P_DEFAULT) < 0) TEST_ERROR /* Verify */ if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR @@ -2006,7 +2006,7 @@ PASSED(); if(check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR /* Mount third file under "/g30/g1/g31/g3" in the first file */ - if(H5Fmount(file_id, "/g30/g1/g31/g3", file2_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g30/g1/g31/g3", file2_id, H5P_DEFAULT) < 0) TEST_ERROR /* Verify */ if(check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR @@ -2018,7 +2018,7 @@ PASSED(); if(check_name(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR /* Mount fourth file under "/g30" in the first file, hiding the files below it */ - if(H5Fmount(file_id, "/g30", file3_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g30", file3_id, H5P_DEFAULT) < 0) TEST_ERROR /* Verify */ if(check_name(group3_id, "", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR @@ -2030,7 +2030,7 @@ PASSED(); if(check_name(group4_id, "/g30/g33/g7/g8", "/g30/g33/g7/g8") < 0) TEST_ERROR /* Unmount fourth file */ - if(H5Funmount(file_id, "/g30")<0) TEST_ERROR + if(H5Funmount(file_id, "/g30") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR @@ -2039,7 +2039,7 @@ PASSED(); if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR /* Unmount third file */ - if(H5Funmount(file_id, "/g30/g1/g31/g3")<0) TEST_ERROR + if(H5Funmount(file_id, "/g30/g1/g31/g3") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR @@ -2048,7 +2048,7 @@ PASSED(); if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR /* Unmount second file */ - if(H5Funmount(file_id, "/g30/g1")<0) TEST_ERROR + if(H5Funmount(file_id, "/g30/g1") < 0) TEST_ERROR /* Verify */ if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR @@ -2078,16 +2078,16 @@ PASSED(); TESTING("H5Iget_name with multiple hard links and mounted files"); /* Create second file and group "/g35/g3/g4" in it */ - file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR if((group_id = H5Gcreate2(file1_id, "/g35", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group2_id = H5Gcreate2(file1_id, "/g35/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group3_id = H5Gcreate2(file1_id, "/g35/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR /* Create group "/g34/g1/g2" in first file */ if((group_id = H5Gcreate2(file_id, "/g34", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2095,7 +2095,7 @@ PASSED(); if((group3_id = H5Gcreate2(file_id, "/g34/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create hard link to "/g34/g1/g2 group */ - if(H5Glink(file_id, H5G_LINK_HARD, "/g34/g1/g2", "/g34/g2a")<0) TEST_ERROR + if(H5Lcreate_hard(file_id, "/g34/g1/g2", H5L_SAME_LOC, "/g34/g2a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR @@ -2107,31 +2107,30 @@ PASSED(); if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR /* Mount second file under "/g34/g1" in the first file */ - if(H5Fmount(file_id, "/g34/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g34/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group3_id, "", "/g34/g1/g2") < 0) TEST_ERROR if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR /* Unmount second file */ - if(H5Funmount(file_id, "/g34/g1")<0) TEST_ERROR + if(H5Funmount(file_id, "/g34/g1") < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR /* Close */ - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); - H5Gclose(group4_id); - H5Fclose(file1_id); + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR + if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR PASSED(); - -/*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- * Test H5Iget_name with mounted files and unlinking *------------------------------------------------------------------------- */ @@ -2157,7 +2156,7 @@ PASSED(); if((group4_id = H5Gcreate2(file1_id, "/g37/g4/g5b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Mount second file under "/g36/g1" in the first file */ - if(H5Fmount(file_id, "/g36/g1", file1_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file_id, "/g36/g1", file1_id, H5P_DEFAULT) < 0) TEST_ERROR /* Open group in mounted file */ if((group5_id = H5Gopen2(file_id, "/g36/g1/g37/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2172,7 +2171,7 @@ PASSED(); if(check_name(group6_id, "/g36/g1/g37/g4/g5a", "/g36/g1/g37/g4/g5a") < 0) TEST_ERROR /* Delete end group in mounted file, using relative paths */ - if(H5Gunlink(group5_id, "g4/g5a")<0) TEST_ERROR + if(H5Gunlink(group5_id, "g4/g5a") < 0) TEST_ERROR /* Verify */ if(check_name(group6_id, "", "") < 0) TEST_ERROR @@ -2190,7 +2189,7 @@ PASSED(); if(check_name(group7_id, "/g36/g1/g37/g4/g5b", "/g36/g1/g37/g4/g5b") < 0) TEST_ERROR /* Delete middle group in mounted file, using relative paths */ - if(H5Gunlink(group5_id, "g4")<0) TEST_ERROR + if(H5Gunlink(group5_id, "g4") < 0) TEST_ERROR /* Verify */ if(check_name(group6_id, "", "") < 0) TEST_ERROR @@ -2205,7 +2204,7 @@ PASSED(); /* Close group in mounted file */ H5Gclose(group5_id); - if(H5Funmount(file_id, "/g36/g1")<0) TEST_ERROR + if(H5Funmount(file_id, "/g36/g1") < 0) TEST_ERROR /* Close */ H5Gclose(group_id); @@ -2262,7 +2261,7 @@ PASSED(); H5Gclose(group3_id); /* Mount second file under "/g38/g1" in the first file */ - if(H5Fmount(file1_id, "/g38/g1", file2_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file1_id, "/g38/g1", file2_id, H5P_DEFAULT) < 0) TEST_ERROR if((group_id = H5Gopen2(file1_id, "/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2270,7 +2269,7 @@ PASSED(); if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR /* Mount first file under "/g40/g5" in the third file */ - if(H5Fmount(file3_id, "/g40/g5", file1_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file3_id, "/g40/g5", file1_id, H5P_DEFAULT) < 0) TEST_ERROR if((group2_id = H5Gopen2(file3_id, "/g40/g5/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2279,14 +2278,14 @@ PASSED(); if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR /* Unmount first file */ - if(H5Funmount(file3_id, "/g40/g5")<0) TEST_ERROR + if(H5Funmount(file3_id, "/g40/g5") < 0) TEST_ERROR /* Verify */ if(check_name(group2_id, "/g38/g1/g39/g3/g4", "") < 0) TEST_ERROR if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR /* Unmount second file */ - if(H5Funmount(file1_id, "/g38/g1")<0) TEST_ERROR + if(H5Funmount(file1_id, "/g38/g1") < 0) TEST_ERROR /* Verify */ if(check_name(group_id, "/g39/g3/g4", "") < 0) TEST_ERROR @@ -2332,7 +2331,7 @@ PASSED(); H5Gclose(group3_id); /* Mount second file under "/g41/g1" in the first file */ - if(H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT)<0) TEST_ERROR + if(H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT) < 0) TEST_ERROR if((group_id = H5Gopen2(file1_id, "/g41/g1/g42/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2340,7 +2339,7 @@ PASSED(); if(check_name(group_id, "/g41/g1/g42/g3", "/g41/g1/g42/g3") < 0) TEST_ERROR /* Unmount file */ - if(H5Funmount(file1_id, "/g41/g1")<0) TEST_ERROR + if(H5Funmount(file1_id, "/g41/g1") < 0) TEST_ERROR if((group2_id = H5Gopen2(group_id, "g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2383,13 +2382,13 @@ test_obj_ref(hid_t fapl) /* Create files */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + FAIL_STACK_ERROR if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create dataspace for datasets */ if((sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL)) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create a group */ if((group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -2397,13 +2396,13 @@ test_obj_ref(hid_t fapl) /* Create a single dataset inside the second file, which will be mounted * and used to mask objects in the first file */ if((dataset = H5Dcreate(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create a dataset(inside Group1) */ if((dataset = H5Dcreate(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Initialize data buffer */ for(i = 0; i < SPACE1_DIM1; i++) @@ -2411,112 +2410,112 @@ test_obj_ref(hid_t fapl) /* Write selection to disk */ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tu32) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Close Dataset */ if(H5Dclose(dataset) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create another dataset(inside Group1) */ if((dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Close Dataset */ if(H5Dclose(dataset) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create a datatype to refer to */ if((tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Insert fields */ if(H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Save datatype for later */ if(H5Tcommit(group, "Datatype1", tid1) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Close datatype */ if(H5Tclose(tid1) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create a new group in group1 */ if((group2 = H5Gcreate2(group, "Group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Create a hard link to group1 in group2 */ - if(H5Glink(fid1, H5G_LINK_HARD, "/Group1", "/Group1/Group2/Link") < 0) - TEST_ERROR + if(H5Lcreate_hard(fid1, "/Group1", H5L_SAME_LOC, "/Group1/Group2/Link", H5P_DEFAULT, H5P_DEFAULT) < 0) + FAIL_STACK_ERROR /* Create dataset in that group */ if((dataset = H5Dcreate(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Close Dataset */ if(H5Dclose(dataset) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Close group */ if(H5Gclose(group) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Gclose(group2) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Open up that hard link and make a new dataset there */ if((group = H5Gopen2(fid1, "/Group1/Group2/Link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((dataset = H5Dcreate(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Dclose(dataset) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Gclose(group) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create a dataset to store references */ if((dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT)) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create reference to dataset */ if(H5Rcreate(&wbuf[0], fid1, "/Dataset3", H5R_OBJECT, -1) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create reference to dataset */ if(H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create reference to group */ if(H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, -1) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create reference to named datatype */ if(H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Rcreate(&wbuf[4], fid1, "/Group1/Group2/Dataset4", H5R_OBJECT, -1) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Rcreate(&wbuf[5], fid1, "/Group1/Group2", H5R_OBJECT, -1) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, -1) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Create reference to root group */ if(H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, -1) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Write selection to disk */ if(H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) - TEST_ERROR + FAIL_STACK_ERROR TESTING("getting path to normal dataset in root group"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[0])) < 0) TEST_ERROR + if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[0])) < 0) FAIL_STACK_ERROR i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); - if(H5Dclose(dataset2) < 0) TEST_ERROR + if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0],(char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR @@ -2524,9 +2523,9 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset in /Group1"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) TEST_ERROR + if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); - if(H5Dclose(dataset2) < 0) TEST_ERROR + if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(i == 16))) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1],(char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(i == 16))) TEST_ERROR @@ -2534,9 +2533,9 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to /Group1"); - if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[2])) < 0) TEST_ERROR + if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[2])) < 0) FAIL_STACK_ERROR i = H5Iget_name(group,(char*)buf, sizeof(buf)); - if(H5Gclose(group) < 0) TEST_ERROR + if(H5Gclose(group) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/Group1") == 0) &&(i == 7))) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[2],(char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Group1") == 0) &&(i == 7))) TEST_ERROR @@ -2544,9 +2543,9 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to datatype in /Group1"); - if((tid1 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[3])) < 0) TEST_ERROR + if((tid1 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[3])) < 0) FAIL_STACK_ERROR i = H5Iget_name(tid1,(char*)buf, sizeof(buf)); - if(H5Tclose(tid1) < 0) TEST_ERROR + if(H5Tclose(tid1) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(i == 17))) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[3],(char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(i == 17))) TEST_ERROR @@ -2554,9 +2553,9 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset in nested group"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) TEST_ERROR + if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); - if(H5Dclose(dataset2) < 0) TEST_ERROR + if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(i == 23))) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4],(char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(i == 23))) TEST_ERROR @@ -2564,9 +2563,9 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to nested group"); - if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[5])) < 0) TEST_ERROR + if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[5])) < 0) FAIL_STACK_ERROR i = H5Iget_name(group,(char*)buf, sizeof(buf)); - if(H5Gclose(group) < 0) TEST_ERROR + if(H5Gclose(group) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(i == 14))) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[5],(char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(i == 14))) TEST_ERROR @@ -2574,9 +2573,9 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset created via hard link"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[6])) < 0) TEST_ERROR + if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[6])) < 0) FAIL_STACK_ERROR i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); - if(H5Dclose(dataset2) < 0) TEST_ERROR + if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(i == 16))) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[6],(char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(i == 16))) TEST_ERROR @@ -2584,9 +2583,9 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to root group"); - if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[7])) < 0) TEST_ERROR + if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[7])) < 0) FAIL_STACK_ERROR i = H5Iget_name(group,(char*)buf, sizeof(buf)); - if(H5Gclose(group) < 0) TEST_ERROR + if(H5Gclose(group) < 0) FAIL_STACK_ERROR if(!((HDstrcmp(buf, "/") == 0) &&(i == 1))) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[7],(char*)buf, sizeof(buf)); if(!((HDstrcmp(buf, "/") == 0) &&(i == 1))) TEST_ERROR @@ -2594,12 +2593,12 @@ test_obj_ref(hid_t fapl) /* Now we mount fid2 at /Group2 and look for dataset4. It shouldn't be found */ if(H5Fmount(fid1, "/Group1/Group2", fid2, H5P_DEFAULT) < 0) - TEST_ERROR + FAIL_STACK_ERROR TESTING("getting path to dataset hidden by a mounted file"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) TEST_ERROR - i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); - if(H5Dclose(dataset2) < 0) TEST_ERROR + if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR + i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); + if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR if(i != 0) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4],(char*)buf, sizeof(buf)); if(i != 0) TEST_ERROR @@ -2607,13 +2606,13 @@ test_obj_ref(hid_t fapl) /* Now we try unlinking dataset2 from the file and searching for it. It shouldn't be found */ if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Gunlink(fid1, "/Group1/Dataset2") < 0) - TEST_ERROR + FAIL_STACK_ERROR TESTING("getting path to dataset that has been unlinked"); - i = H5Iget_name(dataset2,(char*)buf, sizeof(buf)); - if(H5Dclose(dataset2) < 0) TEST_ERROR + i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); + if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR if(i != 0) TEST_ERROR i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1],(char*)buf, sizeof(buf)); if(i != 0) TEST_ERROR @@ -2621,17 +2620,17 @@ test_obj_ref(hid_t fapl) /* Close disk dataspace */ if(H5Sclose(sid1) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Close Dataset */ if(H5Dclose(dataset) < 0) - TEST_ERROR + FAIL_STACK_ERROR /* Close file */ if(H5Fclose(fid1) < 0) - TEST_ERROR + FAIL_STACK_ERROR if(H5Fclose(fid2) < 0) - TEST_ERROR + FAIL_STACK_ERROR return 0; diff --git a/test/links.c b/test/links.c index 9fd6c09..0b1a85f 100644 --- a/test/links.c +++ b/test/links.c @@ -1467,6 +1467,7 @@ error: * *------------------------------------------------------------------------- */ +#ifndef H5_NO_DEPRECATED_SYMBOLS static int test_compat(hid_t fapl, hbool_t new_format) { @@ -1562,6 +1563,7 @@ error: } H5E_END_TRY; return 1; } /* end test_compat() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ /*------------------------------------------------------------------------- @@ -5172,7 +5174,7 @@ linkinfo(hid_t fapl, hbool_t new_format) if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR if(H5Tcommit(fid, "datatype", tid) < 0) TEST_ERROR if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Glink(fid, H5G_LINK_SOFT, "group", "softlink") < 0) TEST_ERROR + if(H5Glink2(fid, "group", H5G_LINK_SOFT, H5G_SAME_LOC, "softlink") < 0) TEST_ERROR if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR if((did = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR @@ -9580,7 +9582,9 @@ main(void) nerrors += test_move((new_format ? fapl2 : fapl), new_format); nerrors += test_copy((new_format ? fapl2 : fapl), new_format); nerrors += test_move_preserves((new_format ? fapl2 : fapl), new_format); +#ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += test_compat((new_format ? fapl2 : fapl), new_format); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ #ifndef H5_CANNOT_OPEN_TWICE nerrors += external_link_root((new_format ? fapl2 : fapl), new_format) < 0 ? 1 : 0; #endif /* H5_CANNOT_OPEN_TWICE */ diff --git a/test/mount.c b/test/mount.c index 4ffbbce..7ac362e 100644 --- a/test/mount.c +++ b/test/mount.c @@ -71,8 +71,8 @@ setup(hid_t fapl) if(H5Gclose(H5Gcreate2(file, "/mnt1/file1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(H5Gcreate2(file, "/mnt_unlink", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Gclose(H5Gcreate2(file, "/mnt_move_a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Glink(file, H5L_TYPE_HARD, "/mnt1/file1", "/file1") < 0) FAIL_STACK_ERROR - if(H5Glink(file, H5L_TYPE_HARD, "/mnt1", "/mnt1_link") < 0) FAIL_STACK_ERROR + if(H5Lcreate_hard(file, "/file1", H5L_SAME_LOC, "/mnt1/file1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + if(H5Lcreate_hard(file, "/mnt1_link", H5L_SAME_LOC, "/mnt1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* file 2 */ @@ -847,7 +847,7 @@ test_interlink(hid_t fapl) /* Try an interfile hard link directly */ H5E_BEGIN_TRY { - status = H5Glink(file1, H5L_TYPE_HARD, "/mnt1/file2", "/file2"); + status = H5Lcreate_hard(file1, "/mnt1/file2", H5L_SAME_LOC, "/file2", H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(status >= 0) { H5_FAILED(); @@ -1097,9 +1097,9 @@ test_mount_after_close(hid_t fapl) /* Mount point */ if((gidABM = H5Gcreate2(gidAB, "M", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Soft link */ - if(H5Glink(gidAB, H5L_TYPE_SOFT, "./M/X/Y", "C") < 0) FAIL_STACK_ERROR + if(H5Lcreate_soft("./M/X/Y", gidAB, "C", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Soft link */ - if(H5Glink(gidAB, H5L_TYPE_SOFT, "/A", "T") < 0) FAIL_STACK_ERROR + if(H5Lcreate_soft("/A", gidAB, "T", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Close groups and file */ if(H5Gclose(gidABM) < 0) FAIL_STACK_ERROR @@ -1124,7 +1124,7 @@ test_mount_after_close(hid_t fapl) if((gidXY = H5Gcreate2(gidX, "Y", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((did = H5Dcreate(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Soft link */ - if(H5Glink(gidX, H5L_TYPE_SOFT, "./Y", "T") < 0) FAIL_STACK_ERROR + if(H5Lcreate_soft("./Y", gidX, "T", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Write data to the dataset. */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, bm) < 0) FAIL_STACK_ERROR @@ -3637,7 +3637,7 @@ test_symlink(hid_t fapl) TEST_ERROR /* Create soft link to mounted object */ - if(H5Glink(fid1, H5L_TYPE_SOFT, "./A/D/H", "L") < 0) /* Soft link */ + if(H5Lcreate_soft("./A/D/H", fid1, "L", H5P_DEFAULT, H5P_DEFAULT) < 0) /* Soft link */ TEST_ERROR if(H5Fclose(fid1) < 0) diff --git a/test/objcopy.c b/test/objcopy.c index 8cdca26..a8a7252 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -4979,13 +4979,13 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Dclose(did) < 0) TEST_ERROR /* make a hard link to the dataset */ - if(H5Glink(fid_src, H5L_TYPE_HARD, NAME_LINK_DATASET, NAME_LINK_HARD) < 0) TEST_ERROR + if(H5Glink2(fid_src, NAME_LINK_DATASET, H5L_TYPE_HARD, H5G_SAME_LOC, NAME_LINK_HARD) < 0) TEST_ERROR /* make a soft link to the dataset */ - if(H5Glink(fid_src, H5L_TYPE_SOFT, NAME_LINK_DATASET, NAME_LINK_SOFT) < 0) TEST_ERROR + if(H5Glink2(fid_src, NAME_LINK_DATASET, H5L_TYPE_SOFT, H5G_SAME_LOC, NAME_LINK_SOFT) < 0) TEST_ERROR /* make a soft link to nowhere */ - if(H5Glink(fid_src, H5L_TYPE_SOFT, "nowhere", NAME_LINK_SOFT_DANGLE) < 0) TEST_ERROR + if(H5Glink2(fid_src, "nowhere", H5L_TYPE_SOFT, H5G_SAME_LOC, NAME_LINK_SOFT_DANGLE) < 0) TEST_ERROR /* make a dangling external link */ if(H5Lcreate_external("filename", "obj_name", fid_src, NAME_LINK_EXTERN, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -5114,7 +5114,7 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Dclose(did) < 0) TEST_ERROR /* make a soft link to the dataset */ - if(H5Glink(fid_src, H5L_TYPE_SOFT, NAME_LINK_DATASET, NAME_LINK_SOFT) < 0) TEST_ERROR + if(H5Glink2(fid_src, NAME_LINK_DATASET, H5L_TYPE_SOFT, H5G_SAME_LOC, NAME_LINK_SOFT) < 0) TEST_ERROR /* close the group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -7013,14 +7013,14 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo if((flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG) > 0) { /* Create group to copy */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_LINK, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Glink(fid_src, H5L_TYPE_SOFT, NAME_DATASET_SUB_SUB, NAME_LINK_SOFT) < 0) TEST_ERROR - if(H5Glink(fid_src, H5L_TYPE_SOFT, "nowhere", NAME_LINK_SOFT_DANGLE) < 0) TEST_ERROR + if(H5Glink2(fid_src, NAME_DATASET_SUB_SUB, H5L_TYPE_SOFT, H5G_SAME_LOC, NAME_LINK_SOFT) < 0) TEST_ERROR + if(H5Glink2(fid_src, "nowhere", H5L_TYPE_SOFT, H5G_SAME_LOC, NAME_LINK_SOFT_DANGLE) < 0) TEST_ERROR if(H5Gclose(gid) < 0) TEST_ERROR /* Create group to compare with */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_LINK2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Glink(fid_src, H5L_TYPE_HARD, NAME_DATASET_SUB_SUB, NAME_LINK_SOFT2) < 0) TEST_ERROR - if(H5Glink(fid_src, H5L_TYPE_SOFT, "nowhere", NAME_LINK_SOFT_DANGLE2) < 0) TEST_ERROR + if(H5Glink2(fid_src, NAME_DATASET_SUB_SUB, H5L_TYPE_HARD, H5G_SAME_LOC, NAME_LINK_SOFT2) < 0) TEST_ERROR + if(H5Glink2(fid_src, "nowhere", H5L_TYPE_SOFT, H5G_SAME_LOC, NAME_LINK_SOFT_DANGLE2) < 0) TEST_ERROR if(H5Gclose(gid) < 0) TEST_ERROR } /* end if */ diff --git a/test/titerate.c b/test/titerate.c index 289c3bb..b2dd8d4 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -859,11 +859,11 @@ static void test_links(hid_t fapl) CHECK(gid1, FAIL, "H5Gcreate2"); /* create soft and hard links to the group "/g1". */ - ret = H5Glink (gid, H5L_TYPE_SOFT, "something", "softlink"); - CHECK(ret, FAIL, "H5Glink"); + ret = H5Glink2(gid, "something", H5L_TYPE_SOFT, H5G_SAME_LOC, "softlink"); + CHECK(ret, FAIL, "H5Glink2"); - ret = H5Glink (gid, H5L_TYPE_HARD, "/g1", "hardlink"); - CHECK(ret, FAIL, "H5Glink"); + ret = H5Glink2(gid, "/g1", H5L_TYPE_HARD, H5G_SAME_LOC, "hardlink"); + CHECK(ret, FAIL, "H5Glink2"); ret = H5Gget_num_objs(gid, &nobjs); CHECK(ret, FAIL, "H5Gget_num_objs"); diff --git a/test/tunicode.c b/test/tunicode.c index 7135272..93f2cda 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -491,8 +491,8 @@ void test_objnames(hid_t fid, const char* string) HDstrcpy(path_buf, GROUP2_NAME); HDstrcat(path_buf, "/"); HDstrcat(path_buf, string); - ret = H5Glink(grp3_id, H5G_LINK_SOFT, path_buf, string); - CHECK(ret, FAIL, "H5Glink"); + ret = H5Glink2(grp3_id, path_buf, H5G_LINK_SOFT, H5G_SAME_LOC, string); + CHECK(ret, FAIL, "H5Glink2"); /* Open named datatype using soft link */ type_id = H5Topen(grp3_id, string); diff --git a/test/unlink.c b/test/unlink.c index f2391b1..87ee412 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -178,9 +178,9 @@ test_many(hid_t file) /* Create a bunch of names and unlink them in order */ TESTING("forward unlink"); - for (i=0; i=0; --i) { sprintf(name, "obj_%05d", i); @@ -202,9 +202,9 @@ test_many(hid_t file) /* Create a bunch of names and unlink them from both directions */ TESTING("inward unlink"); - for (i=0; i=0; --i) { if (i%2) { @@ -269,7 +269,7 @@ test_symlink(hid_t file) /* Create a test group and symlink */ if((work = H5Gcreate2(file, "/test_symlink", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Glink(work, H5L_TYPE_SOFT, "link_value", "link") < 0) TEST_ERROR + if(H5Lcreate_soft("link_value", work, "link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Gunlink(work, "link") < 0) TEST_ERROR /* Cleanup */ @@ -320,8 +320,8 @@ test_rename(hid_t file) /* Try renaming a symlink */ TESTING("symlink renaming"); - if (H5Glink(work, H5L_TYPE_SOFT, "link_value", "link_one") < 0) TEST_ERROR - if (H5Gmove(work, "link_one", "link_two") < 0) TEST_ERROR + if(H5Lcreate_soft("link_value", work, "link_one", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Gmove(work, "link_one", "link_two") < 0) TEST_ERROR PASSED(); /* Cleanup */ diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index fa3ec77..048c193 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -365,8 +365,8 @@ int test_types(const char *fname) *------------------------------------------------------------------------- */ - status = H5Glink(fid1, H5L_TYPE_SOFT, "g1", "l1"); - status = H5Glink(fid1, H5L_TYPE_SOFT, "g2", "l2"); + status = H5Lcreate_soft("g1", fid1, "l1", H5P_DEFAULT, H5P_DEFAULT); + status = H5Lcreate_soft("g2", fid1, "l2", H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * H5G_UDLINK diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 38b1f27..2dc39b0 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -431,8 +431,8 @@ static void gent_softlink(void) fid = H5Fcreate(FILE4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); root = H5Gopen2(fid, "/", H5P_DEFAULT); - H5Glink (root, H5L_TYPE_SOFT, "somevalue", "slink1"); - H5Glink (root, H5L_TYPE_SOFT, "linkvalue", "slink2"); + H5Lcreate_soft("somevalue", root, "slink1", H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_soft("linkvalue", root, "slink2", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(root); H5Fclose(fid); @@ -469,19 +469,19 @@ static void gent_hardlink(void) H5Dclose(dataset); group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Glink (group, H5L_TYPE_HARD, "/dset1", "dset2"); + H5Lcreate_hard(group, "/dset1", H5L_SAME_LOC, "dset2", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Glink (group, H5L_TYPE_HARD, "/dset1", "dset3"); + H5Lcreate_hard(group, "/dset1", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); group = H5Gopen2(fid, "/g1", H5P_DEFAULT); - H5Glink (group, H5L_TYPE_HARD, "/g2", "g1.1"); + H5Lcreate_hard(group, "/g2", H5L_SAME_LOC, "g1.1", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); /* create a link to the root group */ - H5Glink (fid, H5L_TYPE_HARD, "/", "g3"); + H5Lcreate_hard(fid, "/", H5L_SAME_LOC, "g3", H5P_DEFAULT, H5P_DEFAULT); H5Fclose(fid); } @@ -906,127 +906,126 @@ static void gent_all(void) int i, j; float dset2_1[10], dset2_2[3][5]; - fid = H5Fcreate(FILE7, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE7, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /* create groups */ - group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); + /* create groups */ + group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); + group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); + group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); + group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - group = H5Gcreate2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); + group = H5Gcreate2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - /* root attributes */ - group = H5Gopen2(fid, "/", H5P_DEFAULT); + /* root attributes */ + group = H5Gopen2(fid, "/", H5P_DEFAULT); - dims[0] = 10; - space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate (group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT); - sprintf(buf, "abcdefghi"); - H5Awrite(attr, H5T_NATIVE_SCHAR, buf); - H5Sclose(space); - H5Aclose(attr); + dims[0] = 10; + space = H5Screate_simple(1, dims, NULL); + attr = H5Acreate (group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT); + sprintf(buf, "abcdefghi"); + H5Awrite(attr, H5T_NATIVE_SCHAR, buf); + H5Sclose(space); + H5Aclose(attr); - dims[0] = 2; dims[1] = 2; - space = H5Screate_simple(2, dims, NULL); - attr = H5Acreate (group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT); - data[0][0] = 0; data[0][1] = 1; data[1][0] = 2; data[1][1] = 3; - H5Awrite(attr, H5T_NATIVE_INT, data); - H5Sclose(space); - H5Aclose(attr); + dims[0] = 2; dims[1] = 2; + space = H5Screate_simple(2, dims, NULL); + attr = H5Acreate (group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT); + data[0][0] = 0; data[0][1] = 1; data[1][0] = 2; data[1][1] = 3; + H5Awrite(attr, H5T_NATIVE_INT, data); + H5Sclose(space); + H5Aclose(attr); - H5Gclose(group); + H5Gclose(group); - group = H5Gopen2(fid, "/g1/g1.1", H5P_DEFAULT); + group = H5Gopen2(fid, "/g1/g1.1", H5P_DEFAULT); - /* dset1.1.1 */ - dims[0] = 10; dims[1] = 10; - space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - for (j = 0; j < 10; j++) + /* dset1.1.1 */ + dims[0] = 10; dims[1] = 10; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT); + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) dset1[i][j] = j*i; - H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); - H5Sclose(space); + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); + H5Sclose(space); - /* attributes of dset1.1.1 */ - dims[0] = 27; - space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate (dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT); - sprintf(buf, "1st attribute of dset1.1.1"); - H5Awrite(attr, H5T_NATIVE_SCHAR, buf); - H5Sclose(space); - H5Aclose(attr); + /* attributes of dset1.1.1 */ + dims[0] = 27; + space = H5Screate_simple(1, dims, NULL); + attr = H5Acreate (dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT); + sprintf(buf, "1st attribute of dset1.1.1"); + H5Awrite(attr, H5T_NATIVE_SCHAR, buf); + H5Sclose(space); + H5Aclose(attr); - dims[0] = 27; - space = H5Screate_simple(1, dims, NULL); - attr = H5Acreate (dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT); - sprintf(buf, "2nd attribute of dset1.1.1"); - H5Awrite(attr, H5T_NATIVE_SCHAR, buf); - H5Sclose(space); - H5Aclose(attr); + dims[0] = 27; + space = H5Screate_simple(1, dims, NULL); + attr = H5Acreate (dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT); + sprintf(buf, "2nd attribute of dset1.1.1"); + H5Awrite(attr, H5T_NATIVE_SCHAR, buf); + H5Sclose(space); + H5Aclose(attr); - H5Dclose(dataset); + H5Dclose(dataset); - /* dset1.1.2 */ - dims[0] = 20; - space = H5Screate_simple(1, dims, NULL); - dataset = H5Dcreate(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT); - for (i = 0; i < 20; i++) - dset2[i] = i; - H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); - H5Sclose(space); - H5Dclose(dataset); + /* dset1.1.2 */ + dims[0] = 20; + space = H5Screate_simple(1, dims, NULL); + dataset = H5Dcreate(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT); + for (i = 0; i < 20; i++) + dset2[i] = i; + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); + H5Sclose(space); + H5Dclose(dataset); - H5Gclose(group); + H5Gclose(group); - /* external link */ - H5Lcreate_external("somefile", "somepath", fid, "/g1/g1.2/extlink", H5P_DEFAULT, H5P_DEFAULT); + /* external link */ + H5Lcreate_external("somefile", "somepath", fid, "/g1/g1.2/extlink", H5P_DEFAULT, H5P_DEFAULT); - /* soft link */ - group = H5Gopen2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT); - H5Glink (group, H5L_TYPE_SOFT, "somevalue", "slink"); - H5Gclose(group); + /* soft link */ + group = H5Gopen2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT); + H5Lcreate_soft("somevalue", group, "slink", H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - group = H5Gopen2(fid, "/g2", H5P_DEFAULT); + group = H5Gopen2(fid, "/g2", H5P_DEFAULT); - /* dset2.1 */ - dims[0] = 10; - space = H5Screate_simple(1, dims, NULL); - dataset = H5Dcreate(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT); - for (i = 0; i < 10; i++) - dset2_1[i] = (float)(i*0.1+1); - H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); - H5Sclose(space); - H5Dclose(dataset); + /* dset2.1 */ + dims[0] = 10; + space = H5Screate_simple(1, dims, NULL); + dataset = H5Dcreate(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT); + for (i = 0; i < 10; i++) + dset2_1[i] = (float)(i*0.1+1); + H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); + H5Sclose(space); + H5Dclose(dataset); - /* dset2.2 */ - dims[0] = 3; dims[1] = 5; - space = H5Screate_simple(2, dims, NULL); - dataset = H5Dcreate(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT); - for (i = 0; i < 3; i++) - for (j = 0; j < 5; j++) + /* dset2.2 */ + dims[0] = 3; dims[1] = 5; + space = H5Screate_simple(2, dims, NULL); + dataset = H5Dcreate(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT); + for (i = 0; i < 3; i++) + for (j = 0; j < 5; j++) dset2_2[i][j] = (float)((i+1)*j*0.1); - H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2); - H5Sclose(space); - H5Dclose(dataset); - - H5Gclose(group); + H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2); + H5Sclose(space); + H5Dclose(dataset); - /* user-defined link */ - H5Lregister(UD_link_class); - H5Lcreate_ud(fid, "/g2/udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - H5Fclose(fid); + /* user-defined link */ + H5Lregister(UD_link_class); + H5Lcreate_ud(fid, "/g2/udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); + H5Fclose(fid); } /* @@ -1041,42 +1040,42 @@ o - group objects */ static void gent_loop(void) { -hid_t fid, group; + hid_t fid, group; - fid = H5Fcreate(FILE10, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE10, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); - group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); + group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); + group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - H5Glink(fid, H5L_TYPE_HARD, "/g2", "/g1/g1.1"); - H5Glink(fid, H5L_TYPE_HARD, "/g1", "/g2/g2.1"); + H5Lcreate_hard(fid, "/g2", H5L_SAME_LOC, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_hard(fid, "/g1", H5L_SAME_LOC, "/g2/g2.1", H5P_DEFAULT, H5P_DEFAULT); - H5Fclose(fid); + H5Fclose(fid); } -static void gent_loop2(void) { -hid_t fid, group; +static void gent_loop2(void) +{ + hid_t fid, group; - fid = H5Fcreate(FILE11, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(FILE11, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /* create group object g1 and implcit path from root object */ - group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); - - /* create group object g2 and implcit path from root object */ - group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(group); + /* create group object g1 and implcit path from root object */ + group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - /* create path from object at /g1 to object at /g2 and name it g1.1 */ - H5Glink (fid, H5L_TYPE_HARD, "/g2", "/g1/g1.1"); + /* create group object g2 and implcit path from root object */ + group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(group); - /* create path from object at /g2 to object at /g1 and name it g2.1 */ - H5Glink (fid, H5L_TYPE_SOFT, "/g1", "/g2/g2.1"); + /* create path from object at /g1 to object at /g2 and name it g1.1 */ + H5Lcreate_hard(fid, "/g2", H5L_SAME_LOC, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT); - H5Fclose(fid); + /* create path from object at /g2 to object at /g1 and name it g2.1 */ + H5Lcreate_soft("/g1", fid, "/g2/g2.1", H5P_DEFAULT, H5P_DEFAULT); + H5Fclose(fid); } /* @@ -1215,11 +1214,11 @@ static void gent_many(void) H5Gclose(group); group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Glink (group, H5L_TYPE_HARD, "/g1/g1.1/dset1", "link1"); + H5Lcreate_hard(group, "/g1/g1.1/dset1", H5L_SAME_LOC, "link1", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Glink (group, H5L_TYPE_SOFT, "/g1", "slink2"); + H5Lcreate_soft("/g1", group, "slink2", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -1243,7 +1242,7 @@ static void gent_many(void) H5Gclose(group); group = H5Gopen2(fid, "/g3", H5P_DEFAULT); - H5Glink (group, H5L_TYPE_HARD, "/g4/dset2", "link3"); + H5Lcreate_hard(group, "/g4/dset2", H5L_SAME_LOC, "link3", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -1266,7 +1265,7 @@ static void gent_many(void) H5Gclose(group); group = H5Gopen2(fid, "/g5", H5P_DEFAULT); - H5Glink (group, H5L_TYPE_SOFT, "/g6/dset3", "slink4"); + H5Lcreate_soft("/g6/dset3", group, "slink4", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); H5Pclose(create_plist); @@ -1281,9 +1280,9 @@ static void gent_many(void) H5Lcreate_ud(fid, "/g8/udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); /* Create links to external and UD links */ - ret= H5Glink (fid, H5L_TYPE_SOFT, "/g8/elink", "/g7/slink5"); + ret= H5Lcreate_soft("/g8/elink", fid, "/g7/slink5", H5P_DEFAULT, H5P_DEFAULT); HDassert(ret >= 0); - ret= H5Glink (fid, H5L_TYPE_SOFT, "/g8/udlink", "/g7/slink6"); + ret= H5Lcreate_soft("/g8/udlink", fid, "/g7/slink6", H5P_DEFAULT, H5P_DEFAULT); HDassert(ret >= 0); H5Fclose(fid); @@ -5010,39 +5009,39 @@ static void gent_fcontents(void) /* hard link to "dset" */ gid1 = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Glink (gid1, H5L_TYPE_HARD, "/dset", "dset1"); + H5Lcreate_hard(gid1, "/dset", H5L_SAME_LOC, "dset1", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(gid1); /* hard link to "dset" */ gid1 = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Glink (gid1, H5L_TYPE_HARD, "/dset", "dset2"); + H5Lcreate_hard(gid1, "/dset", H5L_SAME_LOC, "dset2", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(gid1); /* hard link to "g2" */ gid1 = H5Gopen2(fid, "/g1", H5P_DEFAULT); - H5Glink (gid1, H5L_TYPE_HARD, "/g2", "g1.1"); + H5Lcreate_hard(gid1, "/g2", H5L_SAME_LOC, "g1.1", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(gid1); /* hard link to "dset" */ - ret=H5Glink (fid, H5L_TYPE_HARD, "/dset", "dset3"); + ret=H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); assert(ret>=0); /* hard link to "dset" */ - ret=H5Glink (fid, H5L_TYPE_HARD, "/dset", "dset4"); + ret=H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT); assert(ret>=0); /* soft link to itself */ - ret=H5Glink (fid, H5L_TYPE_SOFT, "mylink", "mylink"); + ret=H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT); assert(ret>=0); /* soft link to "dset" */ - ret=H5Glink (fid, H5L_TYPE_SOFT, "/dset", "softlink"); + ret=H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT); assert(ret>=0); /* dangling external link */ diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index fe31658..96f9bc7 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -271,7 +271,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) /* soft link */ group = H5Gopen2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT); - H5Glink (group, H5L_TYPE_SOFT, "somevalue", "slink"); + H5Lcreate_soft("somevalue", group, "slink", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); group = H5Gopen2(fid, "/g2", H5P_DEFAULT); diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 71e42bb..e8799f8 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -111,8 +111,7 @@ int do_copy_refobjs(hid_t fidin, if(travt->objs[i].nlinks) for(j = 0; j < travt->objs[i].nlinks; j++) - H5Glink(fidout, H5G_LINK_HARD, travt->objs[i].name, travt->objs[i].links[j].new_name); - + H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT); break; /*------------------------------------------------------------------------- @@ -343,7 +342,7 @@ int do_copy_refobjs(hid_t fidin, */ if(travt->objs[i].nlinks) for(j = 0; j < travt->objs[i].nlinks; j++) - H5Glink(fidout, H5G_LINK_HARD, travt->objs[i].name, travt->objs[i].links[j].new_name); + H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT); if(H5Dclose(dset_out)<0) goto error; diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index b8c7948..1d0264a 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1591,7 +1591,7 @@ int make_all_objects(hid_t loc_id) *------------------------------------------------------------------------- */ - H5Glink(loc_id, H5L_TYPE_SOFT, "dset", "link"); + H5Lcreate_soft("dset", loc_id, "link", H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * H5G_UDLINK @@ -1684,13 +1684,13 @@ int make_hlinks(hid_t loc_id) *------------------------------------------------------------------------- */ - if(write_dset(loc_id,2,dims,"dset",H5T_NATIVE_INT,buf)<0) + if(write_dset(loc_id, 2, dims, "dset", H5T_NATIVE_INT, buf) < 0) return -1; - if(H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link1 to dset")<0) + if(H5Lcreate_hard(loc_id, "dset", H5L_SAME_LOC, "link1 to dset", H5P_DEFAULT, H5P_DEFAULT) < 0) return -1; - if(H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link2 to dset")<0) + if(H5Lcreate_hard(loc_id, "dset", H5L_SAME_LOC, "link2 to dset", H5P_DEFAULT, H5P_DEFAULT) < 0) return -1; - if(H5Glink(loc_id, H5L_TYPE_HARD, "dset", "link3 to dset")<0) + if(H5Lcreate_hard(loc_id, "dset", H5L_SAME_LOC, "link3 to dset", H5P_DEFAULT, H5P_DEFAULT) < 0) return -1; @@ -2860,7 +2860,7 @@ void write_dset_in(hid_t loc_id, /* create hard link */ - status = H5Glink(loc_id, H5L_TYPE_HARD, "string", "string_link"); + status = H5Lcreate_hard(loc_id, "string", H5L_SAME_LOC, "string_link", H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * H5T_BITFIELD -- cgit v0.12