From 3bed8703631cbcffb215ccd82235fcc293e14218 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 6 Sep 2007 10:54:22 -0500 Subject: [PATCH] [svn-r14136] Description: Move H5Gget_num_objs() and several minor macros, etc. to deprecated symbols section, replacing it with H5Gget_info(). Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) AIX/32 5.3 (copper) Solaris/32 5.10 (linew) Mac OS X/32 10.4.10 (amazon) --- c++/examples/h5group.cpp | 2 +- c++/src/H5CommonFG.cpp | 10 +- fortran/src/H5Gf.c | 19 +- src/H5Gdeprec.c | 99 +-- src/H5Gpublic.h | 2 +- test/dt_arith.c | 4 +- test/links.c | 9 +- test/objcopy.c | 16 +- test/th5o.c | 16 +- test/titerate.c | 52 +- test/trefer.c | 10 +- tools/h5dump/h5dump.c | 2 +- tools/h5repack/h5repack_copy.c | 33 +- tools/h5repack/h5repack_refs.c | 24 - tools/h5stat/h5stat.c | 26 +- tools/lib/h5diff.c | 316 ++++--- tools/lib/h5diff.h | 4 - tools/lib/h5diff_dset.c | 4 +- tools/lib/h5trav.c | 1417 +++++++++++++++++--------------- tools/lib/h5trav.h | 57 +- tools/testfiles/h5diff_100.txt | 5 +- tools/testfiles/h5diff_17.txt | 5 +- tools/testfiles/h5diff_70.txt | 1187 +++++++++++++------------- tools/testfiles/h5diff_80.txt | 5 +- tools/testfiles/tcontents.ddl | 3 +- 25 files changed, 1649 insertions(+), 1678 deletions(-) diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index bcaf2c04bb..19245ae474 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -142,7 +142,7 @@ int main(void) /* * Create hard link to the Data group. */ - file->link( H5G_LINK_HARD, "Data", "Data_new" ); + file->link( H5L_TYPE_HARD, "Data", "Data_new" ); /* * We can access "Compressed_Data" dataset using created diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 7b8c5acedc..0ea392374e 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -981,13 +981,14 @@ int CommonFG::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op //-------------------------------------------------------------------------- hsize_t CommonFG::getNumObjs() const { - hsize_t num_objs; - herr_t ret_value = H5Gget_num_objs(getLocId(), &num_objs); + H5G_info_t ginfo; /* Group information */ + + herr_t ret_value = H5Gget_info(getLocId(), ".", &ginfo, H5P_DEFAULT); if(ret_value < 0) { - throwException("getNumObjs", "H5Gget_num_objs failed"); + throwException("getNumObjs", "H5Gget_info failed"); } - return (num_objs); + return (ginfo.nlinks); } //-------------------------------------------------------------------------- @@ -1118,3 +1119,4 @@ CommonFG::~CommonFG() {} #ifndef H5_NO_NAMESPACE } #endif + diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 3796b73abb..5fbaec27f7 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -197,7 +197,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gn_members_c - * Purpose: Call H5Gn_members to find number of objects in the group + * Purpose: Call H5Gget_num_objs to find number of objects in the group * Inputs: loc_id - file or group identifier * name - name of the group * namelen - name length @@ -211,8 +211,7 @@ int_f nh5gn_members_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers) { char *c_name = NULL; - hsize_t c_nmembers; - hid_t gid = (-1); + H5G_info_t ginfo; int ret_value = -1; /* @@ -221,22 +220,14 @@ nh5gn_members_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers) if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) goto DONE; - /* Get a temporary group ID for the group to query */ - if((gid = H5Gopen2((hid_t)*loc_id, c_name, H5P_DEFAULT)) < 0) + /* Call H5Gget_info() for the number of objects in the group */ + if(H5Gget_info((hid_t)*loc_id, c_name, &ginfo, H5P_DEFAULT) < 0) goto DONE; - /* Call H5Gget_num_objs() for the number of objects in the group */ - if(H5Gget_num_objs(gid, &c_nmembers) < 0) - goto DONE; - - *nmembers = (int_f)c_nmembers; + *nmembers = (int_f)ginfo.nlinks; ret_value = 0; DONE: - /* Close the temporary group, if it was opened */ - if(gid > 0) - H5Gclose(gid); - if(c_name) HDfree(c_name); return ret_value; diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 9145b3b6b2..bf90f1ec09 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -787,6 +787,56 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, done: FUNC_LEAVE_API(ret_value) } /* end H5Giterate() */ + + +/*------------------------------------------------------------------------- + * Function: H5Gget_num_objs + * + * Purpose: Returns the number of objects in the group. It iterates + * all B-tree leaves and sum up total number of group members. + * + * Note: Deprecated in favor of H5Gget_info + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Raymond Lu + * Nov 20, 2002 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) +{ + H5G_loc_t loc; /* Location of object */ + H5G_info_t grp_info; /* Group information */ + H5O_type_t obj_type; /* Type of object at location */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(H5Gget_num_objs, FAIL) + H5TRACE2("e", "i*h", loc_id, num_objs); + + /* Check args */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID") + if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") + if(obj_type != H5O_TYPE_GROUP) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + if(!num_objs) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad pointer to # of objects") + + /* Retrieve information about the group */ + if(H5G_obj_info(loc.oloc, &grp_info, H5AC_ind_dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine") + + /* Set the number of objects [sic: links] in the group */ + *num_objs = grp_info.nlinks; + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Gget_num_objs() */ + #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -1022,52 +1072,3 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_get_objinfo() */ - -/*------------------------------------------------------------------------- - * Function: H5Gget_num_objs - * - * Purpose: Returns the number of objects in the group. It iterates - * all B-tree leaves and sum up total number of group members. - * - * Note: Deprecated in favor of H5Gget_info - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Raymond Lu - * Nov 20, 2002 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) -{ - H5G_loc_t loc; /* Location of object */ - H5G_info_t grp_info; /* Group information */ - H5O_type_t obj_type; /* Type of object at location */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_API(H5Gget_num_objs, FAIL) - H5TRACE2("e", "i*h", loc_id, num_objs); - - /* Check args */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_GROUP) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") - if(!num_objs) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad pointer to # of objects") - - /* Retrieve information about the group */ - if(H5G_obj_info(loc.oloc, &grp_info, H5AC_ind_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine") - - /* Set the number of objects [sic: links] in the group */ - *num_objs = grp_info.nlinks; - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Gget_num_objs() */ - diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 6e6560cb01..6f4bc0002a 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -133,7 +133,6 @@ H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char* name, H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx); H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf/*out*/); -H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs); /* Symbols defined for compatibility with previous versions of the HDF5 API. * * Use of these symbols is deprecated. @@ -175,6 +174,7 @@ H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf); H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx, H5G_iterate_t op, void *op_data); +H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 1932e3d6b4..52fd5bf0b0 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -4947,7 +4947,7 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_LDOUBLE); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_LDOUBLE); #endif -#ifdef H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG +#if H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG #if H5_LLONG_TO_LDOUBLE_CORRECT nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_LDOUBLE); #else /* H5_LLONG_TO_LDOUBLE_CORRECT */ @@ -5071,7 +5071,7 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULONG); #endif -#ifdef H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG +#if H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG if(!strcmp(name, "hw")) { /* Hardware conversion */ /* Windows .NET 2003 doesn't work for hardware conversion of this case. * .NET should define this macro H5_HW_FP_TO_LLONG_NOT_WORKS. */ diff --git a/test/links.c b/test/links.c index 96aa255aa0..fb6fdb6e6d 100644 --- a/test/links.c +++ b/test/links.c @@ -1476,6 +1476,7 @@ test_compat(hid_t fapl, hbool_t new_format) hid_t group1_id = -1; hid_t group2_id = -1; H5G_stat_t sb_hard1, sb_hard2, sb_soft1; + hsize_t num_objs; /* Number of objects in a group */ char filename[1024]; char linkval[1024]; @@ -1503,6 +1504,12 @@ test_compat(hid_t fapl, hbool_t new_format) if(H5Glink2(file_id, "group1", H5G_LINK_HARD, group2_id, "link_to_group1") < 0) FAIL_STACK_ERROR if(H5Glink2(file_id, "link_to_group1", H5G_LINK_SOFT, H5G_SAME_LOC, "group2/soft_link_to_group1") < 0) FAIL_STACK_ERROR + /* Test getting the number of objects in a group */ + if(H5Gget_num_objs(file_id, &num_objs) < 0) FAIL_STACK_ERROR + if(num_objs != 2) TEST_ERROR + if(H5Gget_num_objs(group1_id, &num_objs) < 0) FAIL_STACK_ERROR + if(num_objs != 1) TEST_ERROR + /* Test that H5Glink created hard links properly */ if(H5Gget_objinfo(file_id, "/group2", TRUE, &sb_hard1) < 0) FAIL_STACK_ERROR if(H5Gget_objinfo(file_id, "/group1/link_to_group2", TRUE, &sb_hard2) < 0) FAIL_STACK_ERROR @@ -1556,7 +1563,7 @@ test_compat(hid_t fapl, hbool_t new_format) if(H5Gopen2(file_id, "moved_group1/moved_group2", H5P_DEFAULT) >=0) TEST_ERROR } H5E_END_TRY; - if(H5Fclose(file_id) < 0) TEST_ERROR + if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR PASSED(); return 0; diff --git a/test/objcopy.c b/test/objcopy.c index 3c6e03f8a6..331add362b 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1242,8 +1242,8 @@ error: static int compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) { - hsize_t num_objs; /* Number of objects in group */ - hsize_t num_objs2; /* Number of objects in group */ + H5G_info_t ginfo; /* Group info struct */ + H5G_info_t ginfo2; /* Group info struct */ hsize_t idx; /* Index over the objects in group */ unsigned cpy_flags; /* Object copy flags */ @@ -1255,17 +1255,17 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) cpy_flags = 0; /* Check if both groups have the same # of objects */ - if(H5Gget_num_objs(gid, &num_objs) < 0) TEST_ERROR - if(H5Gget_num_objs(gid2, &num_objs2) < 0) TEST_ERROR + if(H5Gget_info(gid, ".", &ginfo, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Gget_info(gid2, ".", &ginfo2, H5P_DEFAULT) < 0) TEST_ERROR if((cpy_flags & H5O_COPY_SHALLOW_HIERARCHY_FLAG) && depth == 0) { - if(num_objs2 != 0) TEST_ERROR + if(ginfo2.nlinks != 0) TEST_ERROR } /* end if */ else { - if(num_objs != num_objs2) TEST_ERROR + if(ginfo.nlinks != ginfo2.nlinks) TEST_ERROR } /* end if */ /* Check contents of groups */ - if(num_objs2 > 0) { + if(ginfo2.nlinks > 0) { char objname[NAME_BUF_SIZE]; /* Name of object in group */ char objname2[NAME_BUF_SIZE]; /* Name of object in group */ H5G_obj_t objtype; /* Type of object in group */ @@ -1277,7 +1277,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) hid_t oid, oid2; /* IDs of objects within group */ /* Loop over contents of groups */ - for(idx = 0; idx < num_objs; idx++) { + for(idx = 0; idx < ginfo.nlinks; idx++) { /* Check name of objects */ if(H5Gget_objname_by_idx(gid, idx, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(H5Gget_objname_by_idx(gid2, idx, objname2, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR diff --git a/test/th5o.c b/test/th5o.c index 86c8c84deb..ff434d6a4f 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -47,7 +47,7 @@ test_h5o_open(void) hid_t grp, dset, dtype, dspace; /* Object identifiers */ hsize_t dims[RANK]; H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ - hsize_t num_objs = 0; /* Number of objects in the group */ + H5G_info_t ginfo; /* Group info struct */ H5T_class_t type_class; /* Class of the datatype */ herr_t ret; /* Value returned from API calls */ @@ -102,9 +102,9 @@ test_h5o_open(void) VERIFY(id_type, H5I_DATASET, "H5Iget_type for dataset ID"); /* Do something more complex with each of the IDs to make sure they "work" */ - ret = H5Gget_num_objs(grp, &num_objs); - CHECK(ret, FAIL, "H5Gget_num_objs"); - VERIFY(num_objs, 1, "H5Gget_num_objs"); /* There should be one object, the datatype */ + ret = H5Gget_info(grp, ".", &ginfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gget_info"); + VERIFY(ginfo.nlinks, 1, "H5Gget_info"); /* There should be one object, the datatype */ type_class = H5Tget_class(dtype); VERIFY(type_class, H5T_INTEGER, "H5Tget_class"); @@ -249,7 +249,7 @@ test_h5o_open_by_addr(void) haddr_t dtype_addr; hsize_t dims[RANK]; H5I_type_t id_type; /* Type of IDs returned from H5Oopen */ - hsize_t num_objs = 0; /* Number of objects in the group */ + H5G_info_t ginfo; /* Group info struct */ H5T_class_t type_class; /* Class of the datatype */ herr_t ret; /* Value returned from API calls */ @@ -315,9 +315,9 @@ test_h5o_open_by_addr(void) VERIFY(id_type, H5I_DATASET, "H5Iget_type for dataset ID"); /* Do something more complex with each of the IDs to make sure they "work" */ - ret = H5Gget_num_objs(grp, &num_objs); - CHECK(ret, FAIL, "H5Gget_num_objs"); - VERIFY(num_objs, 1, "H5Gget_num_objs"); /* There should be one object, the datatype */ + ret = H5Gget_info(grp, ".", &ginfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gget_info"); + VERIFY(ginfo.nlinks, 1, "H5Gget_info"); /* There should be one object, the datatype */ type_class = H5Tget_class(dtype); VERIFY(type_class, H5T_INTEGER, "H5Tget_class"); diff --git a/test/titerate.c b/test/titerate.c index 3c27bdd886..99f099c6d9 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -132,7 +132,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) char *lnames[NDATASETS + 2];/* Names of the links created */ char dataset_name[NAMELEN]; /* dataset name */ iter_info info; /* Custom iteration information */ - hsize_t num_membs; /* Number of group members */ + H5G_info_t ginfo; /* Buffer for querying object's info */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -203,18 +203,18 @@ test_iter_group(hid_t fapl, hbool_t new_format) file = H5Fopen(DATAFILE, H5F_ACC_RDONLY, fapl); CHECK(file, FAIL, "H5Fopen"); - /* These two functions, H5Gget_num_objs and H5Gget_objname_by_idx, actually + /* These two functions, H5Gget_objtype_by_idx and H5Gget_objname_by_idx, actually * iterate through B-tree for group members in internal library design. */ { root_group = H5Gopen2(file, "/", H5P_DEFAULT); CHECK(root_group, FAIL, "H5Gopen2"); - ret = H5Gget_num_objs(root_group, &num_membs); - CHECK(ret, FAIL, "H5Gget_num_objs"); - VERIFY(num_membs, (NDATASETS + 2), "H5Gget_num_objs"); + ret = H5Gget_info(root_group, ".", &ginfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gget_info"); + VERIFY(ginfo.nlinks, (NDATASETS + 2), "H5Gget_info"); - for(i = 0; i< (int)num_membs; i++) { + for(i = 0; i< (int)ginfo.nlinks; i++) { H5G_obj_t obj_type; /* Type of object in file */ ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)i, dataset_name, (size_t)NAMELEN); @@ -233,16 +233,16 @@ test_iter_group(hid_t fapl, hbool_t new_format) CHECK(ret, FAIL, "H5Gclose"); } - /* These two functions, H5Gget_num_objs and H5Gget_objname_by_idx, actually + /* These two functions, H5Gget_objtype_by_idx and H5Gget_objname_by_idx, actually * iterate through B-tree for group members in internal library design. * (Same as test above, but with the file ID instead of opening the root group) */ { - ret = H5Gget_num_objs(file, &num_membs); - CHECK(ret, FAIL, "H5Gget_num_objs"); - VERIFY(num_membs, NDATASETS + 2, "H5Gget_num_objs"); + ret = H5Gget_info(file, ".", &ginfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gget_info"); + VERIFY(ginfo.nlinks, NDATASETS + 2, "H5Gget_info"); - for(i = 0; i< (int)num_membs; i++) { + for(i = 0; i< (int)ginfo.nlinks; i++) { H5G_obj_t obj_type; /* Type of object in file */ ret = (herr_t)H5Gget_objname_by_idx(file, (hsize_t)i, dataset_name, (size_t)NAMELEN); @@ -708,7 +708,7 @@ static void test_grp_memb_funcs(hid_t fapl) char *obj_names[NDATASETS+2];/* Names of the objects in group */ char dataset_name[NAMELEN]; /* dataset name */ ssize_t name_len; /* Length of object's name */ - hsize_t num_membs; /* Number of group members */ + H5G_info_t ginfo; /* Buffer for querying object's info */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -772,17 +772,17 @@ static void test_grp_memb_funcs(hid_t fapl) file = H5Fopen(DATAFILE, H5F_ACC_RDONLY, fapl); CHECK(file, FAIL, "H5Fopen"); - /* These two functions, H5Gget_num_objs and H5Gget_objname_by_idx, actually + /* These two functions, H5Gget_objtype_by_idx and H5Gget_objname_by_idx, actually * iterate through B-tree for group members in internal library design. */ root_group = H5Gopen2(file, "/", H5P_DEFAULT); CHECK(root_group, FAIL, "H5Gopen2"); - ret = H5Gget_num_objs(root_group, &num_membs); - CHECK(ret, FAIL, "H5Gget_num_objs"); - VERIFY(num_membs,NDATASETS+2,"H5Gget_num_objs"); + ret = H5Gget_info(root_group, ".", &ginfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gget_info"); + VERIFY(ginfo.nlinks, (NDATASETS + 2), "H5Gget_info"); - for(i=0; i< (int)num_membs; i++) { + for(i=0; i< (int)ginfo.nlinks; i++) { H5G_obj_t obj_type; /* Type of object in file */ /* Test with NULL for name, to query length */ @@ -819,7 +819,7 @@ static void test_grp_memb_funcs(hid_t fapl) HDqsort(obj_names, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); /* Compare object names */ - for(i = 0; i< (int)num_membs; i++) { + for(i = 0; i< (int)ginfo.nlinks; i++) { ret = HDstrcmp(dnames[i], obj_names[i]); VERIFY(ret, 0, "HDstrcmp"); } /* end for */ @@ -848,11 +848,11 @@ static void test_links(hid_t fapl) hid_t file; /* File ID */ char obj_name[NAMELEN]; /* Names of the object in group */ ssize_t name_len; /* Length of object's name */ - herr_t ret; /* Generic return value */ hid_t gid, gid1; - hsize_t i; H5G_obj_t obj_type; /* Type of object */ - hsize_t nobjs; /* Number of objects */ + H5G_info_t ginfo; /* Buffer for querying object's info */ + hsize_t i; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Soft and Hard Link Iteration Functionality\n")); @@ -875,12 +875,12 @@ static void test_links(hid_t fapl) ret = H5Lcreate_hard(gid, "/g1", H5L_SAME_LOC, "hardlink", H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Lcreate_hard"); - ret = H5Gget_num_objs(gid, &nobjs); - CHECK(ret, FAIL, "H5Gget_num_objs"); - VERIFY(nobjs,3,"H5Gget_num_objs"); + ret = H5Gget_info(gid, ".", &ginfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gget_info"); + VERIFY(ginfo.nlinks, 3, "H5Gget_info"); - /* Test these two functions, H5Gget_num_objs and H5Gget_objname_by_idx */ - for(i = 0; i < nobjs; i++) { + /* Test these two functions, H5Gget_objtype_by_idx and H5Gget_objname_by_idx */ + for(i = 0; i < ginfo.nlinks; i++) { /* Get object name */ name_len = H5Gget_objname_by_idx(gid, i, obj_name, (size_t)NAMELEN); CHECK(name_len, FAIL, "H5Gget_objname_by_idx"); diff --git a/test/trefer.c b/test/trefer.c index 318858e710..ad4b219183 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -985,7 +985,7 @@ test_reference_group(void) hid_t sid; /* Dataspace ID */ hobj_ref_t wref; /* Reference to write */ hobj_ref_t rref; /* Reference to read */ - hsize_t nobjs; + H5G_info_t ginfo; /* Group info struct */ char objname[NAME_SIZE]; /* Buffer to store name */ H5G_obj_t objtype; /* Object type */ int count = 0; /* Count within iterated group */ @@ -1065,14 +1065,12 @@ test_reference_group(void) CHECK(ret, FAIL, "H5Literate"); /* Various queries on the group opened */ - ret = H5Gget_num_objs(gid, &nobjs); - CHECK(ret, FAIL, "H5Gget_num_objs"); - - VERIFY(nobjs, 3, "H5Gget_num_objs"); + ret = H5Gget_info(gid, ".", &ginfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Gget_info"); + VERIFY(ginfo.nlinks, 3, "H5Gget_info"); ret = H5Gget_objname_by_idx(gid, (hsize_t)0, objname, (size_t)NAME_SIZE); CHECK(ret, FAIL, "H5Gget_objname_by_idx"); - VERIFY_STR(objname, DSETNAME2, "H5Gget_objname_by_idx"); objtype = H5Gget_objtype_by_idx(gid, (hsize_t)0); diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 6f77ba3180..0a2ca3b99d 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -2792,7 +2792,7 @@ static void dump_fcontents(hid_t fid) } /* print objects in the files */ - h5trav_getinfo(fid, NULL, 1); + h5trav_print(fid); printf(" %s\n",END); } diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index f32d15d356..c710bce527 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -329,9 +329,18 @@ int do_copy_objects(hid_t fidin, */ case H5G_GROUP: if (options->verbose) - printf(FORMAT_OBJ,"group",travt->objs[i].name ); + printf(FORMAT_OBJ,"group",travt->objs[i].name ); - if (options->grp_compact>0 || options->grp_indexed>0) { + /*------------------------------------------------------------------------- + * the root is a special case, we get an ID for the root group + * and copy its attributes using that ID + *------------------------------------------------------------------------- + */ + if(HDstrcmp(travt->objs[i].name, "/") == 0) { + if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0) + goto error; + } + else if (options->grp_compact>0 || options->grp_indexed>0) { /* Set up group creation property list */ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; @@ -780,26 +789,6 @@ int do_copy_objects(hid_t fidin, } /* i */ - /*------------------------------------------------------------------------- - * the root is a special case, we get an ID for the root group - * and copy its attributes using that ID - *------------------------------------------------------------------------- - */ - - if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0) - goto error; - - if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0) - goto error; - - if (copy_attr(grp_in,grp_out,options)<0) - goto error; - - if (H5Gclose(grp_out)<0) - goto error; - if (H5Gclose(grp_in)<0) - goto error; - return 0; error: diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index e8799f8a00..8a549cd31e 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -397,30 +397,6 @@ int do_copy_refobjs(hid_t fidin, } } - - - /*------------------------------------------------------------------------- - * the root is a special case, we get an ID for the root group - * and copy its attributes using that ID - * it must be done last, because the attributes might contain references to - * objects in the object list - *------------------------------------------------------------------------- - */ - - if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0) - goto error; - - if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0) - goto error; - - if (copy_refs_attr(grp_in, grp_out, options, travt, fidout) < 0) - goto error; - - if (H5Gclose(grp_out) < 0) - goto error; - if (H5Gclose(grp_in) < 0) - goto error; - return 0; error: diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 6c4f1af9da..54c517d37e 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -461,9 +461,8 @@ static herr_t group_stats(hid_t group, const char *name, const char *fullname, const H5O_info_t *oi, H5L_iterate_t walk, iter_t *iter) { - hid_t gid; /* Group ID */ const char *last_container; - hsize_t num_objs; + H5G_info_t ginfo; /* Group information */ unsigned bin; /* "bin" the number of objects falls in */ herr_t ret; @@ -476,21 +475,18 @@ group_stats(hid_t group, const char *name, const char *fullname, iter->group_ohdr_info.total_size += oi->hdr.space.total; iter->group_ohdr_info.free_size += oi->hdr.space.free; - gid = H5Gopen2(group, name, H5P_DEFAULT); - assert(gid > 0); - - /* Get number of links in this group */ - ret = H5Gget_num_objs(gid, &num_objs); + /* Get group information */ + ret = H5Gget_info(group, name, &ginfo, H5P_DEFAULT); assert(ret >= 0); /* Update link stats */ - if(num_objs < SIZE_SMALL_GROUPS) - (iter->num_small_groups[(size_t)num_objs])++; - if(num_objs > iter->max_fanout) - iter->max_fanout = num_objs; + if(ginfo.nlinks < SIZE_SMALL_GROUPS) + (iter->num_small_groups[(size_t)ginfo.nlinks])++; + if(ginfo.nlinks > iter->max_fanout) + iter->max_fanout = ginfo.nlinks; /* Add group count to proper bin */ - bin = ceil_log10((unsigned long)num_objs); + bin = ceil_log10((unsigned long)ginfo.nlinks); if((bin + 1) > iter->group_nbins) { /* Allocate more storage for info about dataset's datatype */ iter->group_bins = realloc(iter->group_bins, (bin + 1) * sizeof(unsigned long)); @@ -515,10 +511,6 @@ group_stats(hid_t group, const char *name, const char *fullname, ret = attribute_stats(iter, oi); assert(ret >= 0); - /* Close current group */ - ret = H5Gclose(gid); - assert(ret >= 0); - /* Update current container info */ last_container = iter->container; iter->container = fullname; @@ -742,7 +734,7 @@ dataset_stats(hid_t group, const char *name, const H5O_info_t *oi, iter_t *iter) *------------------------------------------------------------------------- */ static herr_t -walk(hid_t group, const char *name, const H5L_info_t *linfo, void *_iter) +walk(hid_t group, const char *name, const H5L_info_t UNUSED *linfo, void *_iter) { iter_t *iter = (iter_t *)_iter; H5O_info_t oi; diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 1710347fac..2d7cc7d4be 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -186,180 +186,156 @@ hsize_t h5diff(const char *fname1, const char *objname2, diff_opt_t *options) { - int nobjects1, nobjects2; - trav_info_t *info1 = NULL; - trav_info_t *info2 = NULL; - hid_t file1_id=(-1), file2_id=(-1); - char filenames[2][1024]; - hsize_t nfound = 0; + trav_info_t *info1; + trav_info_t *info2; + hid_t file1_id = (-1), file2_id = (-1); + char filenames[2][1024]; + hsize_t nfound = 0; - memset(filenames, 0, 1024*2); + memset(filenames, 0, 1024*2); - if (options->m_quiet && - (options->m_verbose || options->m_report)) - { - printf("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); - options->err_stat=1; - return 0; - } + if(options->m_quiet && + (options->m_verbose || options->m_report)) + { + printf("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); + options->err_stat=1; + return 0; + } -/*------------------------------------------------------------------------- - * open the files first; if they are not valid, no point in continuing - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * open the files first; if they are not valid, no point in continuing + *------------------------------------------------------------------------- + */ - /* disable error reporting */ - H5E_BEGIN_TRY - { - /* Open the files */ - if ((file1_id = H5Fopen (fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) - { - printf ("h5diff: <%s>: unable to open file\n", fname1); - options->err_stat = 1; + /* disable error reporting */ + H5E_BEGIN_TRY + { + /* Open the files */ + if ((file1_id = H5Fopen (fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + { + printf ("h5diff: <%s>: unable to open file\n", fname1); + options->err_stat = 1; #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { - /* Let tasks know that they won't be needed */ - phdiff_dismiss_workers(); - } + if(g_Parallel) + { + /* Let tasks know that they won't be needed */ + phdiff_dismiss_workers(); + } #endif - goto out; - } - if ((file2_id = H5Fopen (fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) - { - printf ("h5diff: <%s>: unable to open file\n", fname2); - options->err_stat = 1; + goto out; + } + if ((file2_id = H5Fopen (fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + { + printf ("h5diff: <%s>: unable to open file\n", fname2); + options->err_stat = 1; #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { - /* Let tasks know that they won't be needed */ - phdiff_dismiss_workers(); - } + if(g_Parallel) + { + /* Let tasks know that they won't be needed */ + phdiff_dismiss_workers(); + } #endif - goto out; - } - /* enable error reporting */ - } - H5E_END_TRY; + goto out; + } + /* enable error reporting */ + } + H5E_END_TRY; -/*------------------------------------------------------------------------- - * get the number of objects in the files - *------------------------------------------------------------------------- - */ - nobjects1 = h5trav_getinfo (file1_id, NULL, 0); - nobjects2 = h5trav_getinfo (file2_id, NULL, 0); + /*------------------------------------------------------------------------- + * Initialize the info structs + *------------------------------------------------------------------------- + */ + trav_info_init(&info1); + trav_info_init(&info2); - if (nobjects1 < 0 || nobjects2 < 0) - { - printf ("Error: Could not get file contents\n"); - options->err_stat = 1; + /*------------------------------------------------------------------------- + * get the list of objects in the files + *------------------------------------------------------------------------- + */ + if(h5trav_getinfo(file1_id, info1) < 0 || h5trav_getinfo(file2_id, info2) < 0) + { + printf("Error: Could not get file contents\n"); + options->err_stat = 1; #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { - /* Let tasks know that they won't be needed */ - phdiff_dismiss_workers(); - } + if(g_Parallel) + { + /* Let tasks know that they won't be needed */ + phdiff_dismiss_workers(); + } #endif - goto out; - } + goto out; + } -/*------------------------------------------------------------------------- - * get the list of objects in the files - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * object name was supplied + *------------------------------------------------------------------------- + */ - info1 = (trav_info_t *) malloc (nobjects1 * sizeof (trav_info_t)); - info2 = (trav_info_t *) malloc (nobjects2 * sizeof (trav_info_t)); - if (info1 == NULL || info2 == NULL) - { - printf ("Error: Not enough memory for object list\n"); - options->err_stat = 1; - if (info1) h5trav_freeinfo (info1, nobjects1); - if (info2) h5trav_freeinfo (info2, nobjects1); -#ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { - /* Let tasks know that they won't be needed */ - phdiff_dismiss_workers(); - } -#endif - goto out; - } - - h5trav_getinfo (file1_id, info1, 0); - h5trav_getinfo (file2_id, info2, 0); - -/*------------------------------------------------------------------------- - * object name was supplied - *------------------------------------------------------------------------- - */ - - if (objname1) - { + if (objname1) + { #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { - /* Let tasks know that they won't be needed */ - phdiff_dismiss_workers(); - } + if(g_Parallel) + { + /* Let tasks know that they won't be needed */ + phdiff_dismiss_workers(); + } #endif - assert (objname2); - options->cmn_objs = 1; /* eliminate warning */ - nfound = diff_compare (file1_id, fname1, objname1, nobjects1, info1, - file2_id, fname2, objname2, nobjects2, info2, - options); - } + assert (objname2); + options->cmn_objs = 1; /* eliminate warning */ + nfound = diff_compare (file1_id, fname1, objname1, info1, + file2_id, fname2, objname2, info2, + options); + } -/*------------------------------------------------------------------------- - * compare all - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * compare all + *------------------------------------------------------------------------- + */ - else - { + else + { #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { - int i; + if(g_Parallel) + { + int i; - if( (strlen(fname1) > 1024) || (strlen(fname2) > 1024)) - { - fprintf(stderr, "The parallel diff only supports path names up to 1024 characters\n"); - MPI_Abort(MPI_COMM_WORLD, 0); - } + if((HDstrlen(fname1) > 1024) || (HDstrlen(fname2) > 1024)) + { + fprintf(stderr, "The parallel diff only supports path names up to 1024 characters\n"); + MPI_Abort(MPI_COMM_WORLD, 0); + } - strcpy(filenames[0], fname1); - strcpy(filenames[1], fname2); + HDstrcpy(filenames[0], fname1); + HDstrcpy(filenames[1], fname2); - /* Alert the worker tasks that there's going to be work. */ + /* Alert the worker tasks that there's going to be work. */ - for(i=1; i 0 && nobjects2 > 0) ? 1 : 0; + int more_names_exist = (info1->nused > 0 && info2->nused > 0) ? 1 : 0; trav_table_t *table = NULL; int cmp; - int curr1 = 0; - int curr2 = 0; + size_t curr1 = 0; + size_t curr2 = 0; unsigned infile[2]; char c1, c2; hsize_t nfound = 0; @@ -409,12 +383,12 @@ hsize_t diff_match (hid_t file1_id, while (more_names_exist) { /* criteria is string compare */ - cmp = strcmp (info1[curr1].name, info2[curr2].name); + cmp = HDstrcmp(info1->paths[curr1].path, info2->paths[curr2].path); if (cmp == 0) { infile[0] = 1; infile[1] = 1; - trav_table_addflags (infile, info1[curr1].name, info1[curr1].type, + trav_table_addflags (infile, info1->paths[curr1].path, info1->paths[curr1].type, table); curr1++; @@ -424,7 +398,7 @@ hsize_t diff_match (hid_t file1_id, { infile[0] = 1; infile[1] = 0; - trav_table_addflags (infile, info1[curr1].name, info1[curr1].type, + trav_table_addflags (infile, info1->paths[curr1].path, info1->paths[curr1].type, table); curr1++; } @@ -432,37 +406,36 @@ hsize_t diff_match (hid_t file1_id, { infile[0] = 0; infile[1] = 1; - trav_table_addflags (infile, info2[curr2].name, info2[curr2].type, + trav_table_addflags (infile, info2->paths[curr2].path, info2->paths[curr2].type, table); curr2++; } - more_names_exist = (curr1 < nobjects1 && curr2 < nobjects2) ? 1 : 0; - + more_names_exist = (curr1 < info1->nused && curr2 < info2->nused) ? 1 : 0; } /* end while */ /* list1 did not end */ - if (curr1 < nobjects1) + if (curr1 < info1->nused) { - while (curr1 < nobjects1) + while (curr1 < info1->nused) { infile[0] = 1; infile[1] = 0; - trav_table_addflags (infile, info1[curr1].name, info1[curr1].type, + trav_table_addflags (infile, info1->paths[curr1].path, info1->paths[curr1].type, table); curr1++; } } /* list2 did not end */ - if (curr2 < nobjects2) + if (curr2 < info2->nused) { - while (curr2 < nobjects2) + while (curr2 < info2->nused) { infile[0] = 0; infile[1] = 1; - trav_table_addflags (infile, info2[curr2].name, info2[curr2].type, + trav_table_addflags (infile, info2->paths[curr2].path, info2->paths[curr2].type, table); curr2++; } @@ -789,17 +762,6 @@ hsize_t diff_match (hid_t file1_id, /* free table */ trav_table_free (table); - -/*------------------------------------------------------------------------- - * do the diff for the root. - * this is a special case, we get an ID for the root group and call diff() - * with this ID; it compares only the root group attributes - *------------------------------------------------------------------------- - */ - - /* the manager can do this. */ - nfound += diff (file1_id, "/", file2_id, "/", options, H5G_GROUP); - return nfound; } @@ -821,20 +783,18 @@ hsize_t diff_match (hid_t file1_id, hsize_t diff_compare (hid_t file1_id, const char *file1_name, const char *obj1_name, - int nobjects1, trav_info_t * info1, hid_t file2_id, const char *file2_name, const char *obj2_name, - int nobjects2, trav_info_t * info2, diff_opt_t * options) { int f1 = 0, f2 = 0; hsize_t nfound = 0; - int i = h5trav_getindex (obj1_name, nobjects1, info1); - int j = h5trav_getindex (obj2_name, nobjects2, info2); + ssize_t i = h5trav_getindex (info1, obj1_name); + ssize_t j = h5trav_getindex (info2, obj2_name); if (i == -1) { @@ -855,23 +815,23 @@ hsize_t diff_compare (hid_t file1_id, } /* use the name with "/" first, as obtained by iterator function */ - obj1_name = info1[i].name; - obj2_name = info2[j].name; + obj1_name = info1->paths[i].path; + obj2_name = info2->paths[j].path; /* objects are not the same type */ - if (info1[i].type != info2[j].type) + if (info1->paths[i].type != info2->paths[j].type) { if (options->m_verbose) parallel_print ("Comparison not possible: <%s> is of type %s and <%s> is of type %s\n", - obj1_name, get_type (info1[i].type), obj2_name, - get_type (info2[j].type)); + obj1_name, get_type (info1->paths[i].type), obj2_name, + get_type (info2->paths[j].type)); options->not_cmp=1; return 0; } nfound = - diff (file1_id, obj1_name, file2_id, obj2_name, options, info1[i].type); + diff (file1_id, obj1_name, file2_id, obj2_name, options, info1->paths[i].type); return nfound; } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 9125d7c693..e22502ff53 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -94,20 +94,16 @@ hsize_t diff( hid_t file1_id, hsize_t diff_compare( hid_t file1_id, const char *file1_name, const char *obj1_name, - int nobjects1, trav_info_t *info1, hid_t file2_id, const char *file2_name, const char *obj2_name, - int nobjects2, trav_info_t *info2, diff_opt_t *options ); hsize_t diff_match( hid_t file1_id, - int nobjects1, trav_info_t *info1, hid_t file2_id, - int nobjects2, trav_info_t *info2, diff_opt_t *options ); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index b5a287271b..d3a7078e2e 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -25,6 +25,7 @@ * *------------------------------------------------------------------------- */ +#if defined (H5DIFF_DEBUG) static void print_size (int rank, hsize_t *dims) { @@ -40,6 +41,7 @@ print_size (int rank, hsize_t *dims) parallel_print("]\n" ); } +#endif /* H5DIFF_DEBUG */ @@ -279,8 +281,6 @@ hsize_t diff_datasetid( hid_t did1, storage_size1=H5Dget_storage_size(did1); storage_size2=H5Dget_storage_size(did2); - if (storage_size1<0 || storage_size2<0) - goto error; if (storage_size1==0 || storage_size2==0) { diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 6ff68d5da4..65cca66d02 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -17,32 +17,321 @@ #include "h5trav.h" #include "H5private.h" +/*------------------------------------------------------------------------- + * local typedefs + *------------------------------------------------------------------------- + */ +typedef struct trav_addr_t { + size_t nalloc; + size_t nused; + haddr_t *addrs; +} trav_addr_t; + +typedef struct { + herr_t (*visit_obj)(const char *path_name, const H5O_info_t *oinfo, hbool_t already_visited, void *udata); + herr_t (*visit_lnk)(const char *path_name, const H5L_info_t *linfo, void *udata); + void *udata; /* User data to pass to callbacks */ +} trav_visitor_t; + +typedef struct { + trav_addr_t *seen; /* List of addresses seen already */ + const char *curr_path; /* Current path to parent group */ + const trav_visitor_t *visitor; /* Information for visiting each link/object */ +} trav_ud_traverse_t; + +typedef struct { + hid_t fid; /* File ID being traversed */ + trav_table_t *table; /* Table for tracking name of objects with >1 hard link */ +} trav_print_udata_t; + /*------------------------------------------------------------------------- * local functions *------------------------------------------------------------------------- */ -static int traverse( hid_t loc_id, - const char *group_name, - trav_table_t *table, - trav_info_t *info, - int *idx, - int print); +static void trav_table_add(trav_table_t *table, + const char *objname, + const H5O_info_t *oinfo); -static hssize_t get_nnames( hid_t loc_id, - const char *group_name ); - -static herr_t get_name_type( hid_t loc_id, - const char *group_name, - int idx, - char **name, - H5G_obj_t *type ); +static size_t trav_table_search(const trav_table_t *table, haddr_t objno); +static void trav_table_addlink(trav_table_t *table, + size_t j /* the object index */, + const char *path); /*------------------------------------------------------------------------- * "h5trav info" public functions. used in h5diff *------------------------------------------------------------------------- */ + +/*------------------------------------------------------------------------- + * Function: trav_addr_add + * + * Purpose: Add a hardlink address to visited data structure + * + * Return: void + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static void +trav_addr_add(trav_addr_t *visited, haddr_t addr) +{ + size_t idx; /* Index of address to use */ + + /* Allocate space if necessary */ + if(visited->nused == visited->nalloc) { + visited->nalloc = MAX(1, visited->nalloc * 2);; + visited->addrs = (haddr_t *)HDrealloc(visited->addrs, visited->nalloc * sizeof(haddr_t)); + } /* end if */ + + /* Append it */ + idx = visited->nused++; + visited->addrs[idx] = addr; +} /* end trav_addr_add() */ + + +/*------------------------------------------------------------------------- + * Function: trav_addr_visited + * + * Purpose: Check if an address has already been visited + * + * Return: TRUE/FALSE + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static hbool_t +trav_addr_visited(trav_addr_t *visited, haddr_t addr) +{ + size_t u; /* Local index variable */ + + /* Look for address */ + for(u = 0; u < visited->nused; u++) + /* Check for address already in array */ + if(visited->addrs[u] == addr) + return(TRUE); + + /* Didn't find address */ + return(FALSE); +} /* end trav_addr_visited() */ + + +/*------------------------------------------------------------------------- + * Function: traverse_cb + * + * Purpose: Iterator callback for traversing objects in file + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +traverse_cb(hid_t loc_id, const char *link_name, const H5L_info_t *linfo, + void *_udata) +{ + trav_ud_traverse_t *udata = (trav_ud_traverse_t *)_udata; /* User data */ + hbool_t is_group = FALSE; /* If the object is a group */ + hbool_t already_visited = FALSE; /* Whether the link/object was already visited */ + char *link_path; /* Full path name of a link */ + + /* Construct the full path name of this link */ + link_path = (char*)HDmalloc(HDstrlen(udata->curr_path) + HDstrlen(link_name) + 2); + HDassert(link_path); + HDstrcpy(link_path, udata->curr_path); + HDstrcat(link_path, "/"); + HDstrcat(link_path, link_name); + + /* Perform the correct action for different types of links */ + if(linfo->type == H5L_TYPE_HARD) { + H5O_info_t oinfo; + + /* Get information about the object */ + if(H5Oget_info(loc_id, link_name, &oinfo, H5P_DEFAULT) < 0) + return(H5_ITER_ERROR); + + /* If the object has multiple links, add it to the list of addresses + * already visited, if it isn't there already + */ + if(oinfo.rc > 1) { + already_visited = trav_addr_visited(udata->seen, oinfo.addr); + if(!already_visited) + trav_addr_add(udata->seen, oinfo.addr); + } /* end if */ + + /* Check if object is a group, for later */ + is_group = (oinfo.type == H5O_TYPE_GROUP) ? TRUE : FALSE; + + /* Make 'visit object' callback */ + (*udata->visitor->visit_obj)(link_path, &oinfo, already_visited, udata->visitor->udata); + } /* end if */ + else { + /* Make 'visit link' callback */ + (*udata->visitor->visit_lnk)(link_path, linfo, udata->visitor->udata); + } /* end else */ + + /* Check for group that we haven't visited yet & recurse */ + if(is_group && !already_visited) { + const char *prev_path = udata->curr_path; /* Previous path to link's parent group */ + + /* Set current path to this object */ + udata->curr_path = link_path; + + /* Iterate over all links in group object */ + if(H5Literate(loc_id, link_name, H5_INDEX_NAME, H5_ITER_INC, NULL, traverse_cb, udata, H5P_DEFAULT) < 0) + return(H5_ITER_ERROR); + + /* Restore path in udata */ + udata->curr_path = prev_path; + } /* end if */ + + /* Free path name for current link/object */ + HDfree(link_path); + + return(H5_ITER_CONT); +} /* end traverse_cb() */ + + +/*------------------------------------------------------------------------- + * Function: traverse + * + * Purpose: Iterate over all the objects/links in a file. Conforms to the + * "visitor" pattern. + * + * Return: 0 on success, -1 on failure + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static int +traverse(hid_t file_id, const trav_visitor_t *visitor) +{ + H5O_info_t oinfo; /* Object info for root group */ + trav_addr_t seen; /* List of addresses seen */ + trav_ud_traverse_t udata; /* User data for iteration callback */ + + /* Get info for root group */ + if(H5Oget_info(file_id, "/", &oinfo, H5P_DEFAULT) < 0) + return -1; + + /* Visit the root group of the file */ + (*visitor->visit_obj)("/", &oinfo, FALSE, visitor->udata); + + /* Init addresses seen */ + seen.nused = seen.nalloc = 0; + seen.addrs = NULL; + + /* Check for multiple links to root group */ + if(oinfo.rc > 1) + trav_addr_add(&seen, oinfo.addr); + + /* Set up user data structure */ + udata.seen = &seen; + udata.curr_path = ""; + udata.visitor = visitor; + + /* Iterate over all links in root group */ + if(H5Literate(file_id, "/", H5_INDEX_NAME, H5_ITER_INC, NULL, traverse_cb, &udata, H5P_DEFAULT) < 0) + return -1; + + /* Free visited addresses table */ + if(seen.addrs) + HDfree(seen.addrs); + + return 0; +} + + +/*------------------------------------------------------------------------- + * Function: trav_info_add + * + * Purpose: Add a link path & type to info struct + * + * Return: void + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static void +trav_info_add(trav_info_t *info, const char *path, H5G_obj_t obj_type) +{ + size_t idx; /* Index of address to use */ + + /* Allocate space if necessary */ + if(info->nused == info->nalloc) { + info->nalloc = MAX(1, info->nalloc * 2);; + info->paths = (trav_path_t *)HDrealloc(info->paths, info->nalloc * sizeof(trav_path_t)); + } /* end if */ + + /* Append it */ + idx = info->nused++; + info->paths[idx].path = HDstrdup(path); + info->paths[idx].type = obj_type; +} /* end trav_info_add() */ + + +/*------------------------------------------------------------------------- + * Function: trav_info_visit_obj + * + * Purpose: Callback for visiting object, with 'info' structure + * + * Return: 0 on success, -1 on failure + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static int +trav_info_visit_obj(const char *path, const H5O_info_t *oinfo, + hbool_t UNUSED already_visited, void *udata) +{ + /* Add the object to the 'info' struct */ + /* (object types map directly to "group" types) */ + trav_info_add((trav_info_t *)udata, path, (H5G_obj_t)oinfo->type); + + return(0); +} /* end trav_info_visit_obj() */ + + +/*------------------------------------------------------------------------- + * Function: trav_info_visit_lnk + * + * Purpose: Callback for visiting link, with 'info' structure + * + * Return: 0 on success, -1 on failure + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static int +trav_info_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) +{ + /* Add the link to the 'info' struct */ + trav_info_add((trav_info_t *)udata, path, ((linfo->type == H5L_TYPE_SOFT) ? H5G_LINK : H5G_UDLINK)); + + return(0); +} /* end trav_info_visit_lnk() */ + + /*------------------------------------------------------------------------- * Function: h5trav_getinfo * @@ -57,25 +346,21 @@ static herr_t get_name_type( hid_t loc_id, * *------------------------------------------------------------------------- */ - -int h5trav_getinfo(hid_t file_id, - trav_info_t *info, - int print ) +int +h5trav_getinfo(hid_t file_id, trav_info_t *info) { - trav_table_t *table = NULL; - int nnames = 0; + trav_visitor_t info_visitor; /* Visitor structure for trav_info_t's */ - /* init table */ - trav_table_init(&table); + /* Init visitor structure */ + info_visitor.visit_obj = trav_info_visit_obj; + info_visitor.visit_lnk = trav_info_visit_lnk; + info_visitor.udata = info; - /* iterate starting on the root group */ - if((nnames = traverse(file_id, "/", table, info, &nnames, print)) < 0) + /* Traverse all objects in the file, visiting each object & link */ + if(traverse(file_id, &info_visitor) < 0) return -1; - /* free table */ - trav_table_free(table); - - return nnames; + return 0; } /*------------------------------------------------------------------------- @@ -92,96 +377,173 @@ int h5trav_getinfo(hid_t file_id, *------------------------------------------------------------------------- */ -int h5trav_getindex( const char *obj, int nobjs, trav_info_t *info ) +ssize_t +h5trav_getindex(const trav_info_t *info, const char *obj) { - char *pdest; - int result; - int i; + size_t u; /* Local index variable */ - for ( i = 0; i < nobjs; i++) - { - if ( strcmp(obj,info[i].name)==0 ) - return i; + /* Loop over all paths in 'info' struct, looking for object */ + for(u = 0; u < info->nused; u++) { + /* Check for object name having full path (with leading '/') */ + if(HDstrcmp(obj, info->paths[u].path) == 0) + return((ssize_t)u); - pdest = strstr( info[i].name, obj ); - result = (int)(pdest - info[i].name); + /* Check for object name without leading '/' */ + if(HDstrcmp(obj, (info->paths[u].path + 1)) == 0) + return((ssize_t)u); + } /* end for */ + + return((ssize_t)-1); +} /* end h5trav_getindex() */ - /* found at position 1, meaning without '/' */ - if( pdest != NULL && result==1 ) - return i; - } - return -1; -} /*------------------------------------------------------------------------- - * Function: h5trav_freeinfo + * Function: trav_info_init + * + * Purpose: Initialize the info + * + * Return: void + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 6, 2007 + * + *------------------------------------------------------------------------- + */ + +void +trav_info_init(trav_info_t **_info) +{ + trav_info_t *info = (trav_info_t *)HDmalloc(sizeof(trav_info_t)); + + /* Init info structure */ + info->nused = info->nalloc = 0; + info->paths = NULL; + + *_info = info; +} /* end trav_info_init() */ + + +/*------------------------------------------------------------------------- + * Function: trav_info_free * * Purpose: free info memory * *------------------------------------------------------------------------- */ -void h5trav_freeinfo( trav_info_t *info, int nobjs ) +void +trav_info_free(trav_info_t *info) { - int i; - if ( info ) - { - for ( i = 0; i < nobjs; i++) - { - if (info[i].name) - HDfree( info[i].name ); - } - HDfree(info); - } -} + size_t u; /* Local index variable */ + + if(info) { + /* Free path names */ + for(u = 0; u < info->nused; u++) + HDfree(info->paths[u].path); + HDfree(info->paths); + HDfree(info); + } /* end if */ +} /* end trav_info_free() */ -/*------------------------------------------------------------------------- - * Function: h5trav_printinfo - * - * Purpose: print list of names in file - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * - *------------------------------------------------------------------------- - */ -void h5trav_printinfo(int nobjs, trav_info_t *travi) -{ - int i; - for ( i = 0; i < nobjs; i++) - { - switch ( travi[i].type ) - { - case H5G_GROUP: - printf(" %-10s %s\n", "group", travi[i].name ); - break; - case H5G_DATASET: - printf(" %-10s %s\n", "dataset", travi[i].name ); - break; - case H5G_TYPE: - printf(" %-10s %s\n", "datatype", travi[i].name ); - break; - case H5G_LINK: - printf(" %-10s %s\n", "link", travi[i].name ); - break; - case H5G_UDLINK: - printf(" %-10s %s\n", "User defined link", travi[i].name ); - break; - default: - printf(" %-10s %s\n", "User defined object", travi[i].name ); - break; - } - } -} /*------------------------------------------------------------------------- * "h5trav table" public functions. used in h5repack *------------------------------------------------------------------------- */ + +/*------------------------------------------------------------------------- + * Function: trav_table_visit_obj + * + * Purpose: Callback for visiting object, with 'table' sructure + * + * Return: 0 on success, -1 on failure + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static int +trav_table_visit_obj(const char *path, const H5O_info_t *oinfo, + hbool_t already_visited, void *udata) +{ + trav_table_t *table = (trav_table_t *)udata; + + /* Check if we've already seen this object */ + if(!already_visited) + /* add object to table */ + trav_table_add(table, path, oinfo); + else { + size_t found; /* Index of original object seen */ + + /* Look for object in existing table */ + found = trav_table_search(table, oinfo->addr); + HDassert(found < table->nobjs); + + /* Add alias for object to table */ + trav_table_addlink(table, found, path); + } /* end else */ + + return(0); +} /* end trav_table_visit_obj() */ + + +/*------------------------------------------------------------------------- + * Function: trav_table_visit_lnk + * + * Purpose: Callback for visiting link, with 'table' sructure + * + * Return: 0 on success, -1 on failure + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 1, 2007 + * + *------------------------------------------------------------------------- + */ +static int +trav_table_visit_lnk(const char *path, const H5L_info_t UNUSED *linfo, void *udata) +{ + /* Add the link to the 'table' struct */ + trav_table_add((trav_table_t *)udata, path, NULL); + + return(0); +} /* end trav_table_visit_lnk() */ + + +/*------------------------------------------------------------------------- + * Function: h5trav_gettable + * + * Purpose: get the trav_table_t struct + * + * Return: 0, -1 on error + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: December 17, 2003 + * + *------------------------------------------------------------------------- + */ + +int +h5trav_gettable(hid_t fid, trav_table_t *table) +{ + trav_visitor_t table_visitor; /* Visitor structure for trav_table_t's */ + + /* Init visitor structure */ + table_visitor.visit_obj = trav_table_visit_obj; + table_visitor.visit_lnk = trav_table_visit_lnk; + table_visitor.udata = table; + + /* Traverse all objects in the file, visiting each object & link */ + if(traverse(fid, &table_visitor) < 0) + return -1; + return 0; +} + /*------------------------------------------------------------------------- * Function: h5trav_getindext * @@ -196,481 +558,37 @@ void h5trav_printinfo(int nobjs, trav_info_t *travi) *------------------------------------------------------------------------- */ -int h5trav_getindext(const char *name, trav_table_t *table) +int +h5trav_getindext(const char *name, const trav_table_t *table) { - char *pdest; - int result; - unsigned int i, j; + unsigned int i; - for ( i = 0; i < table->nobjs; i++) - { - if ( strcmp(name,table->objs[i].name)==0 ) - return i; + for(i = 0; i < table->nobjs; i++) { + /* Check for object name having full path (with leading '/') */ + if(HDstrcmp(name, table->objs[i].name) == 0) + return(i); - pdest = strstr( table->objs[i].name, name ); - result = (int)(pdest - table->objs[i].name); + /* Check for object name without leading '/' */ + if(HDstrcmp(name, table->objs[i].name + 1) == 0) + return(i); - /* found at position 1, meaning without '/' */ - if( pdest != NULL && result==1 && strlen(table->objs[i].name)-1==strlen(name)) - return i; + /* search also in the list of links */ + if(table->objs[i].nlinks) { + unsigned int j; - /* search also in the list of links */ - if (table->objs[i].nlinks) - { - for ( j=0; jobjs[i].nlinks; j++) - { - if ( strcmp(name,table->objs[i].links[j].new_name)==0 ) - return i; + for ( j=0; jobjs[i].nlinks; j++) { + /* Check for object name having full path (with leading '/') */ + if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0) + return(i); - pdest = strstr( table->objs[i].links[j].new_name, name ); - result = (int)(pdest - table->objs[i].links[j].new_name); - - /* found at position 1, meaning without '/' */ - if( pdest != NULL && result==1 ) - return i; - - } - } - - } - return -1; -} - -/*------------------------------------------------------------------------- - * Function: h5trav_gettable - * - * Purpose: get the trav_table_t struct - * - * Return: 0, -1 on error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 17, 2003 - * - *------------------------------------------------------------------------- - */ - -int h5trav_gettable(hid_t fid, trav_table_t *travt) -{ - int nnames = 0; - - /* iterate starting on the root group */ - if((nnames = traverse(fid, "/", travt, NULL, &nnames, 0)) < 0) - return -1; - - return 0; -} - -/*------------------------------------------------------------------------- - * Function: h5trav_printtable - * - * Purpose: print list of objects in file - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * - *------------------------------------------------------------------------- - */ -void h5trav_printtable(trav_table_t *table) -{ - unsigned int i, j; - - for ( i = 0; i < table->nobjs; i++) - { - switch ( table->objs[i].type ) - { - case H5G_GROUP: - printf(" %-10s %s\n", "group", table->objs[i].name ); - break; - case H5G_DATASET: - printf(" %-10s %s\n", "dataset", table->objs[i].name ); - break; - case H5G_TYPE: - printf(" %-10s %s\n", "datatype", table->objs[i].name ); - break; - case H5G_LINK: - printf(" %-10s %s\n", "link", table->objs[i].name ); - break; - default: - printf(" %-10s %s\n", "User defined object", table->objs[i].name ); - break; - } - - if (table->objs[i].nlinks) - { - for ( j=0; jobjs[i].nlinks; j++) - { - printf(" %-10s %s\n", " hardlink", table->objs[i].links[j].new_name ); - } - } - - } -} - - -/*------------------------------------------------------------------------- - * Function: get_nnames - * - * Purpose: Counts the number of names in the group GROUP_NAME - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 10, 2002 - * - * Return: - * Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. - * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - *------------------------------------------------------------------------- - */ - -static hssize_t get_nnames( hid_t loc_id, const char *group_name ) -{ - hid_t gid; - hsize_t nobjs = 0; - - /* Open the group */ - if((gid = H5Gopen2(loc_id, group_name, H5P_DEFAULT)) < 0) - return(-1); - - /* Retrieve the number of objects in it */ - if(H5Gget_num_objs(gid, &nobjs) < 0) - return(-1); - - /* Close the group */ - if(H5Gclose(gid) < 0) - return(-1); - - return((hssize_t)nobjs); -} - - -/*------------------------------------------------------------------------- - * Function: opget_info - * - * Purpose: operator function - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 10, 2002 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ - -static herr_t -opget_info(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_data) -{ - H5G_stat_t statbuf; - - if(H5Gget_objinfo(loc_id, name, FALSE, &statbuf) < 0) - return -1; - - ((trav_info_t *)op_data)->type = statbuf.type; - ((trav_info_t *)op_data)->name = (char *)HDstrdup(name); - - /* Define 1 for return. This will cause the iterator to stop */ - return 1; -} - - -/*------------------------------------------------------------------------- - * Function: get_name_type - * - * Purpose: - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 10, 2002 - * - * Return: - * Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. - * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - *------------------------------------------------------------------------- - */ - -static herr_t get_name_type( hid_t loc_id, - const char *group_name, - int _idx, - char **name, - H5G_obj_t *type ) -{ - trav_info_t info; - hsize_t idx = (hsize_t)_idx; - - if(H5Literate(loc_id, group_name, H5_INDEX_NAME, H5_ITER_INC, &idx, opget_info, (void *)&info, H5P_DEFAULT) < 0) - return -1; - - *name = info.name; - *type = info.type; - - return 0; -} - -/*------------------------------------------------------------------------- - * Function: traverse - * - * Purpose: recursive function that searches HDF5 objects in LOC_ID - * - * Return: number of objects found in LOC_ID - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 - * - *------------------------------------------------------------------------- - */ - -static int traverse(hid_t loc_id, - const char *group_name, - trav_table_t *table, - trav_info_t *info, - int *idx, - int print) -{ - haddr_t objno; /* Compact form of object's location */ - char *name = NULL; - H5G_obj_t type; - int n_names; - char *path = NULL; - H5G_stat_t statbuf; - int inserted_objs = 0; - int i, j; - - /* get the number of names */ - if((n_names = (int)get_nnames(loc_id, group_name)) < 0) - return -1; - - for(i = 0; i < n_names; i++) { - if(get_name_type(loc_id, group_name, i, &name, &type) < 0) - return -1; - - /* allocate path buffer */ - path = (char*) HDmalloc(HDstrlen(group_name) + HDstrlen(name) + 2); - - /* initialize path */ - HDstrcpy( path, group_name ); - if(HDstrcmp(group_name, "/") != 0) - HDstrcat( path, "/" ); - HDstrcat(path, name); - - /* disable error reporting */ - H5E_BEGIN_TRY { - /* get info */ - H5Gget_objinfo( loc_id, path, FALSE, &statbuf); - } H5E_END_TRY; - objno = (haddr_t)statbuf.objno[0] | ((haddr_t)statbuf.objno[1] << (8 * sizeof(long))); - - /* add to array */ - if(info) { - info[*idx].name = (char *)HDstrdup(path); - info[*idx].type = type; - (*idx)++; + /* Check for object name without leading '/' */ + if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) + return(i); + } /* end for */ } /* end if */ + } /* end for */ - switch(type) { - /*------------------------------------------------------------------------- - * H5G_GROUP - *------------------------------------------------------------------------- - */ - case H5G_GROUP: - /* increment */ - inserted_objs++; - - /* nlink is number of hard links to object */ - if(statbuf.nlink > 0 && trav_table_search(objno, table) == -1) { - /* add object to table */ - trav_table_add(objno, path, H5G_GROUP, table); - - /* print it */ - if(print) - printf(" %-10s %s\n", "group", path); - - /* recurse with the absolute name */ - inserted_objs += traverse(loc_id, path, table, info, idx, print); - } /* end if */ - - /* search table group with more than one link to it */ - if(statbuf.nlink > 1) { - if((j = trav_table_search(objno, table)) < 0) - return -1; - - trav_table_addlink(table, j, path); - - if(table->objs[j].displayed == 0) { - table->objs[j].displayed = 1; - } - else { - /* print it */ - if (print) - printf(" %-10s %s %s %s\n", "group", path, "->", table->objs[j].name ); - } - } /* end if */ - break; - - /*------------------------------------------------------------------------- - * H5G_DATASET - *------------------------------------------------------------------------- - */ - case H5G_DATASET: - /* increment */ - inserted_objs++; - - /* nlink is number of hard links to object */ - if(statbuf.nlink > 0 && trav_table_search(objno, table) == -1) { - /* add object to table */ - trav_table_add(objno, path, H5G_DATASET, table ); - - /* print it */ - if(print) - printf(" %-10s %s\n", "dataset", path ); - } /* end if */ - - /* search table dataset with more than one link to it */ - if(statbuf.nlink > 1) { - if((j = trav_table_search(objno, table)) < 0) - return -1; - - trav_table_addlink(table, j, path); - - if(table->objs[j].displayed == 0) { - table->objs[j].displayed = 1; - } - else { - /* print it */ - if(print) - printf(" %-10s %s %s %s\n", "dataset", path, "->", table->objs[j].name); - } /* displayed==1 */ - } /* nlink>1 */ - break; - - /*------------------------------------------------------------------------- - * H5G_TYPE - *------------------------------------------------------------------------- - */ - - case H5G_TYPE: - /* increment */ - inserted_objs++; - - /* nlink is number of hard links to object */ - if(statbuf.nlink > 0 && trav_table_search(objno, table) == -1) { - /* add object to table */ - trav_table_add(objno, path, H5G_TYPE, table); - - /* print it */ - if(print) - printf(" %-10s %s\n", "datatype", path ); - } /* end if */ - break; - - - /*------------------------------------------------------------------------- - * H5G_LINK - *------------------------------------------------------------------------- - */ - - case H5G_LINK: - /* increment */ - inserted_objs++; - - /* add object to table */ - trav_table_add(HADDR_UNDEF, path, H5G_LINK, table); - - if(statbuf.linklen > 0) { - char *targbuf; - - targbuf = HDmalloc(statbuf.linklen); - assert(targbuf); - H5Lget_val(loc_id, path, targbuf, statbuf.linklen, H5P_DEFAULT); - if(print) - printf(" %-10s %s -> %s\n", "link", path, targbuf); - free(targbuf); - } - else { - if(print) - printf(" %-10s %s ->\n", "link", path); - } - break; - - /*------------------------------------------------------------------------- - * H5G_UDLINK - *------------------------------------------------------------------------- - */ - - case H5G_UDLINK: - { - H5L_info_t linkbuf; - - /* increment */ - inserted_objs++; - - /* add object to table */ - trav_table_add(HADDR_UNDEF, path, H5G_UDLINK, table); - - /* Get type of link */ - H5E_BEGIN_TRY { - /* get link class info */ - H5Lget_info(loc_id, path, &linkbuf, H5P_DEFAULT); - } H5E_END_TRY; - - if(linkbuf.type == H5L_TYPE_EXTERNAL) { - if(statbuf.linklen > 0) { - char *targbuf; - const char *filename; - const char *objname; - - targbuf = HDmalloc(statbuf.linklen); - assert(targbuf); - H5Lget_val(loc_id, path, targbuf, statbuf.linklen, H5P_DEFAULT); - H5Lunpack_elink_val(targbuf, statbuf.linklen, NULL, &filename, &objname); - if(print) - printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); - free(targbuf); - } /* end if */ - else { - if(print) - printf(" %-10s %s ->\n", "udlink", path); - } /* end else */ - } /* end if */ - else { /* Unknown user-defined type */ - if(print) - printf(" %-10s %s ->\n", "UD link type", path); - } /* end else */ - } - break; - - - default: - HDfprintf(stderr, "traverse: Unknown object %d!\n", type); - return(-1); - break; - } /* end switch */ - - if(name) - HDfree(name); - if(path) - HDfree(path); - } /* i */ - - return inserted_objs; + return -1; } /*------------------------------------------------------------------------- @@ -687,15 +605,15 @@ static int traverse(hid_t loc_id, *------------------------------------------------------------------------- */ -int trav_table_search(haddr_t objno, trav_table_t *table ) +static size_t +trav_table_search(const trav_table_t *table, haddr_t objno) { - unsigned int i; + size_t i; - for (i = 0; i < table->nobjs; i++) - if (table->objs[i].objno == objno) - return i; - - return -1; + for(i = 0; i < table->nobjs; i++) + if(table->objs[i].objno == objno) + return(i); + return(i); } @@ -713,40 +631,65 @@ int trav_table_search(haddr_t objno, trav_table_t *table ) *------------------------------------------------------------------------- */ -void trav_table_add(haddr_t objno, - char *name, - H5G_obj_t type, - trav_table_t *table) +static void +trav_table_add(trav_table_t *table, + const char *path, + const H5O_info_t *oinfo) { - unsigned int i; + size_t new; - if (table->nobjs == table->size) { - table->size *= 2; - table->objs = - (trav_obj_t*)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + if(table->nobjs == table->size) { + table->size = MAX(1, table->size * 2); + table->objs = (trav_obj_t*)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + } /* end if */ - for (i = table->nobjs; i < table->size; i++) { - table->objs[i].objno = 0; - table->objs[i].flags[0] = table->objs[i].flags[1] = 0; - table->objs[i].displayed = 0; - table->objs[i].type = H5G_UNKNOWN; - table->objs[i].name = NULL; - table->objs[i].links = NULL; - table->objs[i].nlinks = 0; - table->objs[i].sizelinks = 0; - } - } - - i = table->nobjs++; - table->objs[i].objno = objno; - table->objs[i].flags[0] = table->objs[i].flags[1] = 0; - HDfree(table->objs[i].name); - table->objs[i].name = (char *)HDstrdup(name); - table->objs[i].type = type; - table->objs[i].links = NULL; - table->objs[i].nlinks = 0; + new = table->nobjs++; + table->objs[new].objno = oinfo ? oinfo->addr : HADDR_UNDEF; + table->objs[new].flags[0] = table->objs[new].flags[1] = 0; + table->objs[new].name = (char *)HDstrdup(path); + table->objs[new].type = oinfo ? (H5G_obj_t)oinfo->type : H5G_LINK; + table->objs[new].nlinks = 0; + table->objs[new].sizelinks = 0; + table->objs[new].links = NULL; } +/*------------------------------------------------------------------------- + * Function: trav_table_addlink + * + * Purpose: Add a hardlink name to the object + * + * Return: void + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: December 17, 2003 + * + *------------------------------------------------------------------------- + */ + +static void +trav_table_addlink(trav_table_t *table, + size_t j /* the object index */, + const char *path) +{ + size_t new; + + /* already inserted */ + if(HDstrcmp(table->objs[j].name, path) == 0) + return; + + /* allocate space if necessary */ + if(table->objs[j].nlinks == (unsigned)table->objs[j].sizelinks) { + table->objs[j].sizelinks = MAX(1, table->objs[j].sizelinks * 2); + table->objs[j].links = (trav_link_t*)HDrealloc(table->objs[j].links, table->objs[j].sizelinks * sizeof(trav_link_t)); + } /* end if */ + + /* insert it */ + new = table->objs[j].nlinks++; + table->objs[j].links[new].new_name = (char *)HDstrdup(path); +} + + /*------------------------------------------------------------------------- * Function: trav_table_addflags @@ -767,34 +710,22 @@ void trav_table_addflags(unsigned *flags, H5G_obj_t type, trav_table_t *table) { - unsigned int i; + unsigned int new; - if (table->nobjs == table->size) { - table->size *= 2; - table->objs = - (trav_obj_t*)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + if(table->nobjs == table->size) { + table->size = MAX(1, table->size * 2); + table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + } - for (i = table->nobjs; i < table->size; i++) { - table->objs[i].objno = 0; - table->objs[i].flags[0] = table->objs[i].flags[1] = 0; - table->objs[i].displayed = 0; - table->objs[i].type = H5G_UNKNOWN; - table->objs[i].name = NULL; - table->objs[i].links = NULL; - table->objs[i].nlinks = 0; - table->objs[i].sizelinks = 0; - } - } - - i = table->nobjs++; - table->objs[i].objno = 0; - table->objs[i].flags[0] = flags[0]; - table->objs[i].flags[1] = flags[1]; - HDfree(table->objs[i].name); - table->objs[i].name = (char *)HDstrdup(name); - table->objs[i].type = type; - table->objs[i].links = NULL; - table->objs[i].nlinks = 0; + new = table->nobjs++; + table->objs[new].objno = 0; + table->objs[new].flags[0] = flags[0]; + table->objs[new].flags[1] = flags[1]; + table->objs[new].name = (char *)HDstrdup(name); + table->objs[new].type = type; + table->objs[new].nlinks = 0; + table->objs[new].sizelinks = 0; + table->objs[new].links = NULL; } @@ -812,28 +743,15 @@ void trav_table_addflags(unsigned *flags, *------------------------------------------------------------------------- */ -void trav_table_init( trav_table_t **tbl ) +void trav_table_init(trav_table_t **tbl) { - unsigned int i; - trav_table_t* table = (trav_table_t*) HDmalloc(sizeof(trav_table_t)); + trav_table_t* table = (trav_table_t*) HDmalloc(sizeof(trav_table_t)); - table->size = 20; - table->nobjs = 0; - table->objs = - (trav_obj_t*)HDmalloc(table->size * sizeof(trav_obj_t)); + table->size = 0; + table->nobjs = 0; + table->objs = NULL; - for (i = 0; i < table->size; i++) { - table->objs[i].objno = 0; - table->objs[i].flags[0] = table->objs[i].flags[1] = 0; - table->objs[i].displayed = 0; - table->objs[i].type = H5G_UNKNOWN; - table->objs[i].name = NULL; - table->objs[i].links = NULL; - table->objs[i].nlinks = 0; - table->objs[i].sizelinks = 0; - } - - *tbl = table; + *tbl = table; } @@ -854,60 +772,193 @@ void trav_table_init( trav_table_t **tbl ) void trav_table_free( trav_table_t *table ) { - unsigned int i, j; + if(table->objs) { + unsigned int i; - for ( i = 0; i < table->nobjs; i++) - { - HDfree( table->objs[i].name ); - if (table->objs[i].nlinks) - { - for ( j=0; jobjs[i].nlinks; j++) - HDfree( table->objs[i].links[j].new_name ); + for(i = 0; i < table->nobjs; i++) { + HDfree(table->objs[i].name ); + if(table->objs[i].nlinks) { + unsigned int j; - HDfree(table->objs[i].links); - } - } - HDfree(table->objs); - HDfree(table); + for(j = 0; j < table->objs[i].nlinks; j++) + HDfree(table->objs[i].links[j].new_name); + HDfree(table->objs[i].links); + } /* end if */ + } /* end for */ + HDfree(table->objs); + } /* end if */ + HDfree(table); } - + /*------------------------------------------------------------------------- - * Function: trav_table_addlink + * Function: trav_print_visit_obj * - * Purpose: Add a hardlink name to the object + * Purpose: Callback for visiting object, when printing info * - * Return: void + * Return: 0 on success, -1 on failure * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Programmer: Quincey Koziol, koziol@hdfgroup.org * - * Date: December 17, 2003 + * Date: September 6, 2007 + * + *------------------------------------------------------------------------- + */ +static int +trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, + hbool_t already_visited, void *udata) +{ + trav_print_udata_t *print_udata = (trav_print_udata_t *)udata; + + /* Print the name of the object */ + /* (no new-line, so that objects that we've encountered before can print + * the name of the original object) + */ + switch(oinfo->type) { + case H5O_TYPE_GROUP: + printf(" %-10s %s", "group", path); + break; + + case H5O_TYPE_DATASET: + printf(" %-10s %s", "dataset", path); + break; + + case H5O_TYPE_NAMED_DATATYPE: + printf(" %-10s %s", "datatype", path); + break; + + default: + printf(" %-10s %s", "unknown object type", path); + break; + } /* end switch */ + + /* Check if we've already seen this object */ + if(!already_visited) { + /* Finish printing line about object */ + printf("\n"); + + /* Check if we will encounter another hard link to this object */ + if(oinfo->rc > 1) { + /* Add object to table */ + trav_table_add(print_udata->table, path, oinfo); + } /* end if */ + } /* end if */ + else { + size_t found; /* Index of original object seen */ + + /* Locate object in table */ + found = trav_table_search(print_udata->table, oinfo->addr); + HDassert(found < print_udata->table->nobjs); + + /* Print the link's destination */ + printf(" -> %s\n", print_udata->table->objs[found].name); + } /* end else */ + + return(0); +} /* end trav_print_visit_obj() */ + + +/*------------------------------------------------------------------------- + * Function: trav_print_visit_lnk + * + * Purpose: Callback for visiting link, when printing info + * + * Return: 0 on success, -1 on failure + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 6, 2007 + * + *------------------------------------------------------------------------- + */ +static int +trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) +{ + trav_print_udata_t *print_udata = (trav_print_udata_t *)udata; + + /* Print appropriate information for the type of link */ + switch(linfo->type) { + case H5L_TYPE_SOFT: + if(linfo->u.val_size > 0) { + char *targbuf = HDmalloc(linfo->u.val_size + 1); + HDassert(targbuf); + + H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); + printf(" %-10s %s -> %s\n", "link", path, targbuf); + free(targbuf); + } /* end if */ + else + printf(" %-10s %s ->\n", "link", path); + break; + + case H5L_TYPE_EXTERNAL: + if(linfo->u.val_size > 0) { + char *targbuf; + const char *filename; + const char *objname; + + targbuf = HDmalloc(linfo->u.val_size + 1); + assert(targbuf); + + H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); + H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname); + printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); + free(targbuf); + } /* end if */ + else + printf(" %-10s %s ->\n", "ext link", path); + break; + + default: + printf(" %-10s %s -> ???\n", "unknown type of UD link", path); + break; + } /* end switch() */ + + return(0); +} /* end trav_print_visit_lnk() */ + + +/*------------------------------------------------------------------------- + * Function: h5trav_print + * + * Purpose: Print information about the objects & links in the file + * + * Return: 0, -1 on error + * + * Programmer: Quincey Koziol, koziol@hdfgroup.org + * + * Date: September 6, 2007 * *------------------------------------------------------------------------- */ -void trav_table_addlink(trav_table_t *table, - int j /* the object index */, - char *path ) +int +h5trav_print(hid_t fid) { - unsigned int k; + trav_table_t *table = NULL; /* Table for objects w/multiple hard links */ + trav_print_udata_t print_udata; /* User data for traversal */ + trav_visitor_t print_visitor; /* Visitor structure for printing objects */ - /* already inserted */ - if (strcmp(table->objs[j].name,path)==0) - return; + /* Initialize the table */ + trav_table_init(&table); - /* allocate space if necessary */ - if (table->objs[j].nlinks == (unsigned)table->objs[j].sizelinks) { - table->objs[j].sizelinks += 2; - table->objs[j].links = - (trav_link_t*)HDrealloc(table->objs[j].links, - table->objs[j].sizelinks * sizeof(trav_link_t)); - } + /* Init user data for printing */ + print_udata.fid = fid; + print_udata.table = table; - /* insert it */ - k=table->objs[j].nlinks++; - table->objs[j].links[k].new_name = (char*)HDstrdup(path); + /* Init visitor structure */ + print_visitor.visit_obj = trav_print_visit_obj; + print_visitor.visit_lnk = trav_print_visit_lnk; + print_visitor.udata = &print_udata; + + /* Traverse all objects in the file, visiting each object & link */ + if(traverse(fid, &print_visitor) < 0) + return -1; + + /* Free table */ + trav_table_free(table); + + return 0; } - diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index c11d83598b..4218013494 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -32,9 +32,15 @@ typedef H5G_obj_t H5G_obj_t1; -typedef struct trav_info_t { - char *name; +typedef struct trav_path_t { + char *path; H5G_obj_t type; +} trav_path_t; + +typedef struct trav_info_t { + size_t nalloc; + size_t nused; + trav_path_t *paths; } trav_info_t; @@ -56,11 +62,10 @@ typedef struct trav_obj_t { haddr_t objno; /* object number from H5Gget_objinfo */ unsigned flags[2]; /* h5diff.object is present or not in both files*/ char *name; /* name */ - int displayed; /* hard link already traversed once */ H5G_obj_t type; /* type of object */ trav_link_t *links; /* array of possible link names */ - int sizelinks; /* size of links array */ - unsigned nlinks; /* number of links */ + size_t sizelinks; /* size of links array */ + size_t nlinks; /* number of links */ } trav_obj_t; @@ -70,8 +75,8 @@ typedef struct trav_obj_t { */ typedef struct trav_table_t { - unsigned size; - unsigned nobjs; + size_t size; + size_t nobjs; trav_obj_t *objs; } trav_table_t; @@ -89,24 +94,36 @@ extern "C" { * "h5trav info" public functions *------------------------------------------------------------------------- */ -int h5trav_getinfo( hid_t fid, trav_info_t *info, int print ); -int h5trav_getindex( const char *obj, int nobjs, trav_info_t *info ); -void h5trav_freeinfo( trav_info_t *info, int nobjs ); -void h5trav_printinfo(int nobjs, trav_info_t *info); +int h5trav_getinfo(hid_t file_id, trav_info_t *info); +ssize_t h5trav_getindex(const trav_info_t *info, const char *obj); /*------------------------------------------------------------------------- * "h5trav table" public functions *------------------------------------------------------------------------- */ -int h5trav_getindext(const char *obj,trav_table_t *travt); int h5trav_gettable(hid_t fid, trav_table_t *travt); -void h5trav_printtable(trav_table_t *table); +int h5trav_getindext(const char *obj, const trav_table_t *travt); + +/*------------------------------------------------------------------------- + * "h5trav print" public functions + *------------------------------------------------------------------------- + */ +int h5trav_print(hid_t fid); #ifdef __cplusplus } #endif +/*------------------------------------------------------------------------- + * info private functions + *------------------------------------------------------------------------- + */ + +void trav_info_init(trav_info_t **info); + +void trav_info_free(trav_info_t *info); + /*------------------------------------------------------------------------- * table private functions *------------------------------------------------------------------------- @@ -116,25 +133,11 @@ void trav_table_init(trav_table_t **table); void trav_table_free(trav_table_t *table); -int trav_table_search(haddr_t objno, - trav_table_t *table ); - -void trav_table_add(haddr_t objno, - char *objname, - H5G_obj_t type, - trav_table_t *table); - void trav_table_addflags(unsigned *flags, char *objname, H5G_obj_t type, trav_table_t *table); - -void trav_table_addlink(trav_table_t *table, - int j /* the object index */, - char *path ); - - #endif /* H5TRAV_H__ */ diff --git a/tools/testfiles/h5diff_100.txt b/tools/testfiles/h5diff_100.txt index a2186a78a2..5cf88681c5 100644 --- a/tools/testfiles/h5diff_100.txt +++ b/tools/testfiles/h5diff_100.txt @@ -4,8 +4,11 @@ Expected output for 'h5diff h5diff_hyper1.h5 h5diff_hyper2.h5 -v' file1 file2 --------------------------------------- + x x / x x /big +group : and +0 differences found dataset: and size: [1073741824] [1073741824] position big big difference @@ -1035,5 +1038,3 @@ position big big difference [ 268436478 ] 31 0 31 [ 268436479 ] 31 0 31 1024 differences found -group : and -0 differences found diff --git a/tools/testfiles/h5diff_17.txt b/tools/testfiles/h5diff_17.txt index f7fff969bc..ec787b8040 100644 --- a/tools/testfiles/h5diff_17.txt +++ b/tools/testfiles/h5diff_17.txt @@ -4,6 +4,7 @@ Expected output for 'h5diff h5diff_basic1.h5 h5diff_basic2.h5 -v' file1 file2 --------------------------------------- + x x / x x /g1 x /g1/d1 x /g1/d2 @@ -23,6 +24,8 @@ file1 file2 x /g1/fp2 x /g2 +group : and +0 differences found group : and 0 differences found dataset: and @@ -35,5 +38,3 @@ position dset1 dset1 difference [ 1 1 ] 1 1.001 0.001 [ 2 1 ] 0 1 1 5 differences found -group : and -0 differences found diff --git a/tools/testfiles/h5diff_70.txt b/tools/testfiles/h5diff_70.txt index 3e7e37c4b1..db01d50284 100644 --- a/tools/testfiles/h5diff_70.txt +++ b/tools/testfiles/h5diff_70.txt @@ -4,9 +4,603 @@ Expected output for 'h5diff h5diff_attr1.h5 h5diff_attr2.h5 -v' file1 file2 --------------------------------------- + x x / x x /dset x x /g1 +group : and +0 differences found +attribute: > and > +size: [2] [2] +position string of string of difference +------------------------------------------------------------ +[ 0 ] a z +[ 0 ] b z +[ 1 ] d z +[ 1 ] e z +4 differences found +attribute: > and > +size: [2] [2] +position bitfield of bitfield of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +2 differences found +attribute: > and > +size: [2] [2] +position opaque of opaque of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +2 differences found +attribute: > and > +size: [2] [2] +position compound of compound of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 1 ] 3 0 3 +[ 1 ] 4 0 4 +4 differences found +attribute: > and > +size: [2] [2] +position enum of enum of difference +------------------------------------------------------------ +[ 0 ] RED GREEN +[ 1 ] RED GREEN +2 differences found +attribute: > and > +size: [2] [2] +position vlen of vlen of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +[ 1 ] 3 0 3 +3 differences found +attribute: > and > +size: [2] [2] +position array of array of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +6 differences found +attribute: > and > +size: [2] [2] +position integer of integer of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +2 differences found +attribute: > and > +size: [2] [2] +position float of float of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +2 differences found +attribute: > and > +size: [3x2] [3x2] +position string2D of string2D of difference +------------------------------------------------------------ +[ 0 0 ] a z +[ 0 0 ] b z +[ 0 1 ] c z +[ 0 1 ] d z +[ 1 0 ] e z +[ 1 0 ] f z +[ 1 1 ] g z +[ 1 1 ] h z +[ 2 0 ] i z +[ 2 0 ] j z +[ 2 1 ] k z +[ 2 1 ] l z +12 differences found +attribute: > and > +size: [3x2] [3x2] +position bitfield2D of bitfield2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +6 differences found +attribute: > and > +size: [3x2] [3x2] +position opaque2D of opaque2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +6 differences found +attribute: > and > +size: [3x2] [3x2] +position compound2D of compound2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 0 ] 2 0 2 +[ 0 1 ] 3 0 3 +[ 0 1 ] 4 0 4 +[ 1 0 ] 5 0 5 +[ 1 0 ] 6 0 6 +[ 1 1 ] 7 0 7 +[ 1 1 ] 8 0 8 +[ 2 0 ] 9 0 9 +[ 2 0 ] 10 0 10 +[ 2 1 ] 11 0 11 +[ 2 1 ] 12 0 12 +12 differences found +attribute: > and > +size: [3x2] [3x2] +position enum2D of enum2D of difference +------------------------------------------------------------ +[ 0 0 ] RED GREEN +[ 0 1 ] RED GREEN +[ 1 0 ] RED GREEN +[ 1 1 ] RED GREEN +[ 2 0 ] RED GREEN +[ 2 1 ] RED GREEN +6 differences found +attribute: > and > +size: [3x2] [3x2] +position vlen2D of vlen2D of difference +------------------------------------------------------------ +[ 0 1 ] 1 0 1 +[ 1 0 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 1 1 ] 5 0 5 +[ 2 0 ] 6 0 6 +[ 2 0 ] 7 0 7 +[ 2 0 ] 8 0 8 +[ 2 1 ] 9 0 9 +[ 2 1 ] 10 0 10 +[ 2 1 ] 11 0 11 +11 differences found +attribute: > and > +size: [3x2] [3x2] +position array2D of array2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 0 ] 2 0 2 +[ 0 0 ] 3 0 3 +[ 0 1 ] 4 0 4 +[ 0 1 ] 5 0 5 +[ 0 1 ] 6 0 6 +[ 1 0 ] 7 0 7 +[ 1 0 ] 8 0 8 +[ 1 0 ] 9 0 9 +[ 1 1 ] 10 0 10 +[ 1 1 ] 11 0 11 +[ 1 1 ] 12 0 12 +[ 2 0 ] 13 0 13 +[ 2 0 ] 14 0 14 +[ 2 0 ] 15 0 15 +[ 2 1 ] 16 0 16 +[ 2 1 ] 17 0 17 +[ 2 1 ] 18 0 18 +18 differences found +attribute: > and > +size: [3x2] [3x2] +position integer2D of integer2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +6 differences found +attribute: > and > +size: [3x2] [3x2] +position float2D of float2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +6 differences found +attribute: > and > +size: [4x3x2] [4x3x2] +position string3D of string3D of difference +------------------------------------------------------------ +[ 0 0 0 ] a z +[ 0 0 0 ] b z +[ 0 0 1 ] c z +[ 0 0 1 ] d z +[ 0 1 0 ] e z +[ 0 1 0 ] f z +[ 0 1 1 ] g z +[ 0 1 1 ] h z +[ 0 2 0 ] i z +[ 0 2 0 ] j z +[ 0 2 1 ] k z +[ 0 2 1 ] l z +[ 1 0 0 ] m z +[ 1 0 0 ] n z +[ 1 0 1 ] p z +[ 1 0 1 ] q z +[ 1 1 0 ] r z +[ 1 1 0 ] s z +[ 1 1 1 ] t z +[ 1 1 1 ] u z +[ 1 2 0 ] v z +[ 1 2 0 ] w z +[ 1 2 1 ] x z +[ 2 0 0 ] A z +[ 2 0 0 ] B z +[ 2 0 1 ] C z +[ 2 0 1 ] D z +[ 2 1 0 ] E z +[ 2 1 0 ] F z +[ 2 1 1 ] G z +[ 2 1 1 ] H z +[ 2 2 0 ] I z +[ 2 2 0 ] J z +[ 2 2 1 ] K z +[ 2 2 1 ] L z +[ 3 0 0 ] M z +[ 3 0 0 ] N z +[ 3 0 1 ] P z +[ 3 0 1 ] Q z +[ 3 1 0 ] R z +[ 3 1 0 ] S z +[ 3 1 1 ] T z +[ 3 1 1 ] U z +[ 3 2 0 ] V z +[ 3 2 0 ] W z +[ 3 2 1 ] X z +[ 3 2 1 ] Z z +47 differences found +attribute: > and > +size: [4x3x2] [4x3x2] +position bitfield3D of bitfield3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +24 differences found +attribute: > and > +size: [4x3x2] [4x3x2] +position opaque3D of opaque3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1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 2 1 ] 48 0 48 +48 differences found +attribute: > and > +size: [4x3x2] [4x3x2] +position enum3D of enum3D of difference +------------------------------------------------------------ +[ 0 0 0 ] GREEN RED +[ 0 0 1 ] GREEN RED +[ 0 1 0 ] GREEN RED +[ 0 1 1 ] GREEN RED +[ 0 2 0 ] GREEN RED +[ 0 2 1 ] GREEN RED +[ 1 0 0 ] GREEN RED +[ 1 0 1 ] GREEN RED +[ 1 1 0 ] GREEN RED +[ 1 1 1 ] GREEN RED +[ 1 2 0 ] GREEN RED +[ 1 2 1 ] GREEN RED +[ 2 0 0 ] GREEN RED +[ 2 0 1 ] GREEN RED +[ 2 1 0 ] GREEN RED +[ 2 1 1 ] GREEN RED +[ 2 2 0 ] GREEN RED +[ 2 2 1 ] GREEN RED +[ 3 0 0 ] GREEN RED +[ 3 0 1 ] GREEN RED +[ 3 1 0 ] GREEN RED +[ 3 1 1 ] GREEN RED +[ 3 2 0 ] GREEN RED +[ 3 2 1 ] GREEN RED +24 differences found +attribute: > and > +size: [4x3x2] [4x3x2] +position vlen3D of vlen3D of difference +------------------------------------------------------------ +[ 0 0 1 ] 1 0 1 +[ 0 1 0 ] 2 0 2 +[ 0 1 1 ] 3 0 3 +[ 0 2 0 ] 4 0 4 +[ 0 2 1 ] 5 0 5 +[ 1 0 0 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 0 1 ] 9 0 9 +[ 1 1 0 ] 10 0 10 +[ 1 1 0 ] 11 0 11 +[ 1 1 1 ] 12 0 12 +[ 1 1 1 ] 13 0 13 +[ 1 2 0 ] 14 0 14 +[ 1 2 0 ] 15 0 15 +[ 1 2 1 ] 16 0 16 +[ 1 2 1 ] 17 0 17 +[ 2 0 0 ] 18 0 18 +[ 2 0 0 ] 19 0 19 +[ 2 0 0 ] 20 0 20 +[ 2 0 1 ] 21 0 21 +[ 2 0 1 ] 22 0 22 +[ 2 0 1 ] 23 0 23 +[ 2 1 0 ] 24 0 24 +[ 2 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3 2 1 ] 71 0 71 +[ 3 2 1 ] 72 0 72 +72 differences found +attribute: > and > +size: [4x3x2] [4x3x2] +position integer3D of integer3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +24 differences found +attribute: > and > +size: [4x3x2] [4x3x2] +position float3D of float3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +24 differences found dataset: and or are empty datasets attribute: > and > @@ -1200,599 +1794,6 @@ position float3D of float3D of difference [ 3 2 0 ] 23 0 23 [ 3 2 1 ] 24 0 24 24 differences found -group : and -0 differences found -attribute: > and > -size: [2] [2] -position string of string of difference ------------------------------------------------------------- -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z -4 differences found -attribute: > and > -size: [2] [2] -position bitfield of bitfield of difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -attribute: > and > -size: [2] [2] -position opaque of opaque of difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -attribute: > and > -size: [2] [2] -position compound of compound of difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 0 ] 2 0 2 -[ 1 ] 3 0 3 -[ 1 ] 4 0 4 -4 differences found -attribute: > and > -size: [2] [2] -position enum of enum of difference ------------------------------------------------------------- -[ 0 ] RED GREEN -[ 1 ] RED GREEN -2 differences found -attribute: > and > -size: [2] [2] -position vlen of vlen of difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -[ 1 ] 3 0 3 -3 differences found -attribute: > and > -size: [2] [2] -position array of array of difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 0 ] 2 0 2 -[ 0 ] 3 0 3 -[ 1 ] 4 0 4 -[ 1 ] 5 0 5 -[ 1 ] 6 0 6 -6 differences found -attribute: > and > -size: [2] [2] -position integer of integer of difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -attribute: > and > -size: [2] [2] -position float of float of difference ------------------------------------------------------------- -[ 0 ] 1 0 1 -[ 1 ] 2 0 2 -2 differences found -attribute: > and > -size: [3x2] [3x2] -position string2D of string2D of difference ------------------------------------------------------------- -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z -12 differences found -attribute: > and > -size: [3x2] [3x2] -position bitfield2D of bitfield2D of difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 1 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 2 0 ] 5 0 5 -[ 2 1 ] 6 0 6 -6 differences found -attribute: > and > -size: [3x2] [3x2] -position opaque2D of opaque2D of difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 1 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 2 0 ] 5 0 5 -[ 2 1 ] 6 0 6 -6 differences found -attribute: > and > -size: [3x2] [3x2] -position compound2D of compound2D of difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 0 ] 2 0 2 -[ 0 1 ] 3 0 3 -[ 0 1 ] 4 0 4 -[ 1 0 ] 5 0 5 -[ 1 0 ] 6 0 6 -[ 1 1 ] 7 0 7 -[ 1 1 ] 8 0 8 -[ 2 0 ] 9 0 9 -[ 2 0 ] 10 0 10 -[ 2 1 ] 11 0 11 -[ 2 1 ] 12 0 12 -12 differences found -attribute: > and > -size: [3x2] [3x2] -position enum2D of enum2D of difference ------------------------------------------------------------- -[ 0 0 ] RED GREEN -[ 0 1 ] RED GREEN -[ 1 0 ] RED GREEN -[ 1 1 ] RED GREEN -[ 2 0 ] RED GREEN -[ 2 1 ] RED GREEN -6 differences found -attribute: > and > -size: [3x2] [3x2] -position vlen2D of vlen2D of difference ------------------------------------------------------------- -[ 0 1 ] 1 0 1 -[ 1 0 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 1 1 ] 5 0 5 -[ 2 0 ] 6 0 6 -[ 2 0 ] 7 0 7 -[ 2 0 ] 8 0 8 -[ 2 1 ] 9 0 9 -[ 2 1 ] 10 0 10 -[ 2 1 ] 11 0 11 -11 differences found -attribute: > and > -size: [3x2] [3x2] -position array2D of array2D of difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 0 ] 2 0 2 -[ 0 0 ] 3 0 3 -[ 0 1 ] 4 0 4 -[ 0 1 ] 5 0 5 -[ 0 1 ] 6 0 6 -[ 1 0 ] 7 0 7 -[ 1 0 ] 8 0 8 -[ 1 0 ] 9 0 9 -[ 1 1 ] 10 0 10 -[ 1 1 ] 11 0 11 -[ 1 1 ] 12 0 12 -[ 2 0 ] 13 0 13 -[ 2 0 ] 14 0 14 -[ 2 0 ] 15 0 15 -[ 2 1 ] 16 0 16 -[ 2 1 ] 17 0 17 -[ 2 1 ] 18 0 18 -18 differences found -attribute: > and > -size: [3x2] [3x2] -position integer2D of integer2D of difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 1 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 2 0 ] 5 0 5 -[ 2 1 ] 6 0 6 -6 differences found -attribute: > and > -size: [3x2] [3x2] -position float2D of float2D of difference ------------------------------------------------------------- -[ 0 0 ] 1 0 1 -[ 0 1 ] 2 0 2 -[ 1 0 ] 3 0 3 -[ 1 1 ] 4 0 4 -[ 2 0 ] 5 0 5 -[ 2 1 ] 6 0 6 -6 differences found -attribute: > and > -size: [4x3x2] [4x3x2] -position string3D of string3D of difference ------------------------------------------------------------- -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z -47 differences found -attribute: > and > -size: [4x3x2] [4x3x2] -position bitfield3D of bitfield3D of difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 1 ] 2 0 2 -[ 0 1 0 ] 3 0 3 -[ 0 1 1 ] 4 0 4 -[ 0 2 0 ] 5 0 5 -[ 0 2 1 ] 6 0 6 -[ 1 0 0 ] 7 0 7 -[ 1 0 1 ] 8 0 8 -[ 1 1 0 ] 9 0 9 -[ 1 1 1 ] 10 0 10 -[ 1 2 0 ] 11 0 11 -[ 1 2 1 ] 12 0 12 -[ 2 0 0 ] 13 0 13 -[ 2 0 1 ] 14 0 14 -[ 2 1 0 ] 15 0 15 -[ 2 1 1 ] 16 0 16 -[ 2 2 0 ] 17 0 17 -[ 2 2 1 ] 18 0 18 -[ 3 0 0 ] 19 0 19 -[ 3 0 1 ] 20 0 20 -[ 3 1 0 ] 21 0 21 -[ 3 1 1 ] 22 0 22 -[ 3 2 0 ] 23 0 23 -[ 3 2 1 ] 24 0 24 -24 differences found -attribute: > and > -size: [4x3x2] [4x3x2] -position opaque3D of opaque3D of difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 1 ] 2 0 2 -[ 0 1 0 ] 3 0 3 -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 -[ 2 1 1 ] 31 0 31 -[ 2 1 1 ] 32 0 32 -[ 2 2 0 ] 33 0 33 -[ 2 2 0 ] 34 0 34 -[ 2 2 1 ] 35 0 35 -[ 2 2 1 ] 36 0 36 -[ 3 0 0 ] 37 0 37 -[ 3 0 0 ] 38 0 38 -[ 3 0 1 ] 39 0 39 -[ 3 0 1 ] 40 0 40 -[ 3 1 0 ] 41 0 41 -[ 3 1 0 ] 42 0 42 -[ 3 1 1 ] 43 0 43 -[ 3 1 1 ] 44 0 44 -[ 3 2 0 ] 45 0 45 -[ 3 2 0 ] 46 0 46 -[ 3 2 1 ] 47 0 47 -[ 3 2 1 ] 48 0 48 -48 differences found -attribute: > and > -size: [4x3x2] [4x3x2] -position enum3D of enum3D of difference ------------------------------------------------------------- -[ 0 0 0 ] GREEN RED -[ 0 0 1 ] GREEN RED -[ 0 1 0 ] GREEN RED -[ 0 1 1 ] GREEN RED -[ 0 2 0 ] GREEN RED -[ 0 2 1 ] GREEN RED -[ 1 0 0 ] GREEN RED -[ 1 0 1 ] GREEN RED -[ 1 1 0 ] GREEN RED -[ 1 1 1 ] GREEN RED -[ 1 2 0 ] GREEN RED -[ 1 2 1 ] GREEN RED -[ 2 0 0 ] GREEN RED -[ 2 0 1 ] GREEN RED -[ 2 1 0 ] GREEN RED -[ 2 1 1 ] GREEN RED -[ 2 2 0 ] GREEN RED -[ 2 2 1 ] GREEN RED -[ 3 0 0 ] GREEN RED -[ 3 0 1 ] GREEN RED -[ 3 1 0 ] GREEN RED -[ 3 1 1 ] GREEN RED -[ 3 2 0 ] GREEN RED -[ 3 2 1 ] GREEN RED -24 differences found -attribute: > and > -size: [4x3x2] [4x3x2] -position vlen3D of vlen3D of difference ------------------------------------------------------------- -[ 0 0 1 ] 1 0 1 -[ 0 1 0 ] 2 0 2 -[ 0 1 1 ] 3 0 3 -[ 0 2 0 ] 4 0 4 -[ 0 2 1 ] 5 0 5 -[ 1 0 0 ] 6 0 6 -[ 1 0 0 ] 7 0 7 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53 -[ 2 2 1 ] 54 0 54 -[ 3 0 0 ] 55 0 55 -[ 3 0 0 ] 56 0 56 -[ 3 0 0 ] 57 0 57 -[ 3 0 1 ] 58 0 58 -[ 3 0 1 ] 59 0 59 -[ 3 0 1 ] 60 0 60 -[ 3 1 0 ] 61 0 61 -[ 3 1 0 ] 62 0 62 -[ 3 1 0 ] 63 0 63 -[ 3 1 1 ] 64 0 64 -[ 3 1 1 ] 65 0 65 -[ 3 1 1 ] 66 0 66 -[ 3 2 0 ] 67 0 67 -[ 3 2 0 ] 68 0 68 -[ 3 2 0 ] 69 0 69 -[ 3 2 1 ] 70 0 70 -[ 3 2 1 ] 71 0 71 -[ 3 2 1 ] 72 0 72 -72 differences found -attribute: > and > -size: [4x3x2] [4x3x2] -position integer3D of integer3D of difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 1 ] 2 0 2 -[ 0 1 0 ] 3 0 3 -[ 0 1 1 ] 4 0 4 -[ 0 2 0 ] 5 0 5 -[ 0 2 1 ] 6 0 6 -[ 1 0 0 ] 7 0 7 -[ 1 0 1 ] 8 0 8 -[ 1 1 0 ] 9 0 9 -[ 1 1 1 ] 10 0 10 -[ 1 2 0 ] 11 0 11 -[ 1 2 1 ] 12 0 12 -[ 2 0 0 ] 13 0 13 -[ 2 0 1 ] 14 0 14 -[ 2 1 0 ] 15 0 15 -[ 2 1 1 ] 16 0 16 -[ 2 2 0 ] 17 0 17 -[ 2 2 1 ] 18 0 18 -[ 3 0 0 ] 19 0 19 -[ 3 0 1 ] 20 0 20 -[ 3 1 0 ] 21 0 21 -[ 3 1 1 ] 22 0 22 -[ 3 2 0 ] 23 0 23 -[ 3 2 1 ] 24 0 24 -24 differences found -attribute: > and > -size: [4x3x2] [4x3x2] -position float3D of float3D of difference ------------------------------------------------------------- -[ 0 0 0 ] 1 0 1 -[ 0 0 1 ] 2 0 2 -[ 0 1 0 ] 3 0 3 -[ 0 1 1 ] 4 0 4 -[ 0 2 0 ] 5 0 5 -[ 0 2 1 ] 6 0 6 -[ 1 0 0 ] 7 0 7 -[ 1 0 1 ] 8 0 8 -[ 1 1 0 ] 9 0 9 -[ 1 1 1 ] 10 0 10 -[ 1 2 0 ] 11 0 11 -[ 1 2 1 ] 12 0 12 -[ 2 0 0 ] 13 0 13 -[ 2 0 1 ] 14 0 14 -[ 2 1 0 ] 15 0 15 -[ 2 1 1 ] 16 0 16 -[ 2 2 0 ] 17 0 17 -[ 2 2 1 ] 18 0 18 -[ 3 0 0 ] 19 0 19 -[ 3 0 1 ] 20 0 20 -[ 3 1 0 ] 21 0 21 -[ 3 1 1 ] 22 0 22 -[ 3 2 0 ] 23 0 23 -[ 3 2 1 ] 24 0 24 -24 differences found -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/testfiles/h5diff_80.txt b/tools/testfiles/h5diff_80.txt index 9e31e88573..0093870575 100644 --- a/tools/testfiles/h5diff_80.txt +++ b/tools/testfiles/h5diff_80.txt @@ -4,6 +4,7 @@ Expected output for 'h5diff h5diff_dset1.h5 h5diff_dset2.h5 -v' file1 file2 --------------------------------------- + x x / x x /dset x x /dsetref x x /g1 @@ -39,6 +40,8 @@ file1 file2 x x /g1/vlen3D x x /refreg +group : and +0 differences found dataset: and size: [2] [2] position dset dset difference @@ -782,8 +785,6 @@ point #1 (2,2) (3,3) point #3 (1,6) (2,5) point #4 (2,8) (1,7) 4 differences found -group : and -0 differences found -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/testfiles/tcontents.ddl b/tools/testfiles/tcontents.ddl index 905bac520c..2bb59b9692 100644 --- a/tools/testfiles/tcontents.ddl +++ b/tools/testfiles/tcontents.ddl @@ -4,6 +4,7 @@ Expected output for 'h5dump -n tfcontents1.h5' HDF5 "tfcontents1.h5" { FILE_CONTENTS { datatype /#5616 + group / dataset /dset dataset /dset3 -> /dset dataset /dset4 -> /dset @@ -17,6 +18,6 @@ FILE_CONTENTS { link /mylink -> mylink datatype /mytype link /softlink -> /dset - UD link type /udlink -> + unknown type of UD link /udlink -> ??? } }