diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-30 20:03:37 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-30 20:03:37 (GMT) |
commit | a4069db8f48121ca11d0465b260d9cd81152581b (patch) | |
tree | 37348ad7d71058a6f449255073d631db8c33794a /tools | |
parent | 1374654210854d005546459e48c482c5ea01cba2 (diff) | |
download | hdf5-a4069db8f48121ca11d0465b260d9cd81152581b.zip hdf5-a4069db8f48121ca11d0465b260d9cd81152581b.tar.gz hdf5-a4069db8f48121ca11d0465b260d9cd81152581b.tar.bz2 |
[svn-r14131] Description:
Move H5Giterate() and H5G_iterate_t to deprecated symbols section,
replacing them with H5Literate and H5L_iterate_t respectively.
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)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5dump/h5dump.c | 168 | ||||
-rw-r--r-- | tools/h5ls/h5ls.c | 25 | ||||
-rw-r--r-- | tools/h5stat/h5stat.c | 8 | ||||
-rw-r--r-- | tools/lib/h5tools.c | 3 | ||||
-rw-r--r-- | tools/lib/h5tools.h | 2 | ||||
-rw-r--r-- | tools/lib/h5tools_ref.c | 5 | ||||
-rw-r--r-- | tools/lib/h5tools_ref.h | 2 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 6 | ||||
-rw-r--r-- | tools/lib/h5tools_utils.c | 9 | ||||
-rw-r--r-- | tools/lib/h5trav.c | 34 |
10 files changed, 128 insertions, 134 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index d8fe56b..6f77ba3 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -96,7 +96,7 @@ static int indent; /*how far in to indent the line static hid_t h5_fileaccess(void); static void dump_oid(hid_t oid); static void print_enum(hid_t type); -static herr_t dump_all(hid_t group, const char *name, void *op_data); +static herr_t dump_all(hid_t group, const char *name, const H5L_info_t *linfo, void *op_data); static int xml_name_to_XID(const char *, char *, int , int ); static void init_prefix(char **prfx, size_t prfx_len); static void add_prefix(char **prfx, size_t *prfx_len, const char *name); @@ -1411,12 +1411,11 @@ dump_selected_attr(hid_t loc_id, const char *name) *------------------------------------------------------------------------- */ static herr_t -dump_all(hid_t group, const char *name, void * op_data) +dump_all(hid_t group, const char *name, const H5L_info_t *linfo, void * op_data) { hid_t obj; char *obj_path = NULL; /* Full path of object */ H5G_stat_t statbuf; - H5L_info_t linfo; /* Link information */ herr_t ret = SUCCEED; /* Stat the object */ @@ -1426,12 +1425,6 @@ dump_all(hid_t group, const char *name, void * op_data) ret = FAIL; goto done; } /* end if */ - if(H5Lget_info(group, name, &linfo, H5P_DEFAULT) < 0) { - error_msg(progname, "unable to get object information\n"); - d_status = EXIT_FAILURE; - ret = FAIL; - goto done; - } /* end if */ if (*(int *)op_data != H5G_UNKNOWN && statbuf.type != *(int *) op_data) goto done; @@ -1541,9 +1534,10 @@ dump_all(hid_t group, const char *name, void * op_data) HDfree(targbuf); break; } + case H5G_UDLINK: indentation(indent); - switch(linfo.type) { + switch(linfo->type) { case H5L_TYPE_EXTERNAL: { char *targbuf; @@ -1568,7 +1562,7 @@ dump_all(hid_t group, const char *name, void * op_data) } else { if (!doxml) { indentation(indent + COL); - printf("LINKCLASS %d\n", linfo.type); + printf("LINKCLASS %d\n", linfo->type); indentation(indent + COL); printf("TARGETFILE \"%s\"\n", filename); indentation(indent + COL); @@ -1622,7 +1616,7 @@ dump_all(hid_t group, const char *name, void * op_data) indentation(indent + COL); } if (!doxml) - printf("LINKCLASS %d\n", linfo.type); + printf("LINKCLASS %d\n", linfo->type); else /* XML */ { char linkxid[100]; @@ -1644,7 +1638,7 @@ dump_all(hid_t group, const char *name, void * op_data) t_name, /* LinkName */ linkxid, /* OBJ-XID */ t_obj_path, /* H5SourcePath */ - linfo.type, /* LinkClass */ + linfo->type, /* LinkClass */ parentxid, /* Parents */ t_prefix); /* H5ParentPaths */ HDfree(t_prefix); @@ -1879,12 +1873,12 @@ dump_group(hid_t gid, const char *name) /* dump unamed type in root group */ for (u = 0; u < type_table->nobjs; u++) if (!type_table->objs[u].recorded) { - dset = H5Dopen(gid, type_table->objs[u].objname); - type = H5Dget_type(dset); - sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); - dump_function_table->dump_named_datatype_function(type, type_name); - H5Tclose(type); - H5Dclose(dset); + dset = H5Dopen(gid, type_table->objs[u].objname); + type = H5Dget_type(dset); + sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); + dump_function_table->dump_named_datatype_function(type, type_name); + H5Tclose(type); + H5Dclose(dset); } } /* end if */ @@ -1896,22 +1890,22 @@ dump_group(hid_t gid, const char *name) found_obj = search_obj(group_table, objno); - if (found_obj == NULL) { - indentation(indent); - error_msg(progname, "internal error (file %s:line %d)\n", - __FILE__, __LINE__); - d_status = EXIT_FAILURE; - } else if (found_obj->displayed) { - indentation(indent); - printf("%s \"%s\"\n", HARDLINK, found_obj->objname); + if (found_obj == NULL) { + indentation(indent); + error_msg(progname, "internal error (file %s:line %d)\n", + __FILE__, __LINE__); + d_status = EXIT_FAILURE; + } else if (found_obj->displayed) { + indentation(indent); + printf("%s \"%s\"\n", HARDLINK, found_obj->objname); + } else { + found_obj->displayed = TRUE; + H5Aiterate(gid, NULL, dump_attr, NULL); + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); + } } else { - found_obj->displayed = TRUE; H5Aiterate(gid, NULL, dump_attr, NULL); - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); - } - } else { - H5Aiterate(gid, NULL, dump_attr, NULL); - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); } indent -= COL; @@ -3786,7 +3780,7 @@ main(int argc, const char *argv[]) /* find all objects that might be targets of a refernce */ init_ref_path_table(fid); /* Insert the root group into the ref. path table */ - H5Giterate(fid, (const char *)"/", NULL, fill_ref_path_table, (void *)""); + H5Literate(fid, (const char *)"/", H5_INDEX_NAME, H5_ITER_INC, NULL, fill_ref_path_table, (void *)"", H5P_DEFAULT); if(doxml) { /* initialize XML */ @@ -5247,15 +5241,15 @@ xml_dump_group(hid_t gid, const char *name) /* iterate through all the members */ xtype = H5G_TYPE; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); xtype = H5G_DATASET; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); xtype = H5G_GROUP; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); xtype = H5G_LINK; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); xtype = H5G_UDLINK; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); } free(t_name); free(grpxid); @@ -5263,60 +5257,60 @@ xml_dump_group(hid_t gid, const char *name) } } else { - /* only link -- must be first time! */ - char *t_name = xml_escape_the_name(name); - char *grpxid = malloc(100); - char *parentxid = malloc(100); - if (isRoot) { - xml_name_to_XID("/",grpxid,100,1); - printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", - xmlnsprefix,grpxid,"/"); - } else { - char *t_tmp = xml_escape_the_name(tmp); - par_name = xml_escape_the_name(par); - xml_name_to_XID(tmp,grpxid,100,1); - xml_name_to_XID(par,parentxid,100,1); - printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", - xmlnsprefix,t_name, grpxid, t_tmp, - parentxid, par_name); - free(t_tmp); - free(par_name); - } - free(t_name); - free(grpxid); - free(parentxid); + /* only link -- must be first time! */ + char *t_name = xml_escape_the_name(name); + char *grpxid = malloc(100); + char *parentxid = malloc(100); + if (isRoot) { + xml_name_to_XID("/",grpxid,100,1); + printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", + xmlnsprefix,grpxid,"/"); + } else { + char *t_tmp = xml_escape_the_name(tmp); + par_name = xml_escape_the_name(par); + xml_name_to_XID(tmp,grpxid,100,1); + xml_name_to_XID(par,parentxid,100,1); + printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", + xmlnsprefix,t_name, grpxid, t_tmp, + parentxid, par_name); + free(t_tmp); + free(par_name); + } + free(t_name); + free(grpxid); + free(parentxid); - /* 1. do all the attributes of the group */ - H5Aiterate(gid, NULL, dump_function_table->dump_attribute_function, NULL); + /* 1. do all the attributes of the group */ + H5Aiterate(gid, NULL, dump_function_table->dump_attribute_function, NULL); - if (!strcmp(name, "/") && unamedtype) { + if (!strcmp(name, "/") && unamedtype) { unsigned u; - /* Very special case: dump unamed type in root group */ - for (u = 0; u < type_table->nobjs; u++) { - if (!type_table->objs[u].recorded) { - dset = H5Dopen(gid, type_table->objs[u].objname); - type = H5Dget_type(dset); - sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); - dump_function_table->dump_named_datatype_function(type, type_name); - H5Tclose(type); - H5Dclose(dset); - } + /* Very special case: dump unamed type in root group */ + for (u = 0; u < type_table->nobjs; u++) { + if (!type_table->objs[u].recorded) { + dset = H5Dopen(gid, type_table->objs[u].objname); + type = H5Dget_type(dset); + sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); + dump_function_table->dump_named_datatype_function(type, type_name); + H5Tclose(type); + H5Dclose(dset); + } + } } - } - /* iterate through all the members */ - xtype = H5G_TYPE; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); - xtype = H5G_DATASET; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); - xtype = H5G_GROUP; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); - xtype = H5G_LINK; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); - xtype = H5G_UDLINK; - H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); + /* iterate through all the members */ + xtype = H5G_TYPE; + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); + xtype = H5G_DATASET; + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); + xtype = H5G_GROUP; + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); + xtype = H5G_LINK; + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); + xtype = H5G_UDLINK; + H5Literate(gid, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, dump_all, (void *) &xtype, H5P_DEFAULT); } indent -= COL; diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 9dce3f9..c3c89a3 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -76,7 +76,7 @@ static struct dispatch_t { dispatch_g[TYPE].list2 = (LIST2); \ } -static herr_t list (hid_t group, const char *name, void *cd); +static herr_t list (hid_t group, const char *name, const H5L_info_t *linfo, void *cd); static void display_type(hid_t type, int ind); static char *fix_name(const char *path, const char *base); @@ -1673,7 +1673,7 @@ group_list2(hid_t grp, const char *name) if (recursive_g) { iter.container = name; - H5Giterate(grp, ".", NULL, list, &iter); + H5Literate(grp, ".", H5_INDEX_NAME, H5_ITER_INC, NULL, list, &iter, H5P_DEFAULT); } return 0; } @@ -1830,10 +1830,10 @@ error: *------------------------------------------------------------------------- */ static herr_t -list (hid_t group, const char *name, void *_iter) +list(hid_t group, const char *name, const H5L_info_t UNUSED *linfo, void *_iter) { - hid_t obj=-1; - char buf[512], comment[50], *fullname=NULL, *s=NULL; + hid_t obj = -1; + char buf[512], comment[50], *fullname = NULL, *s = NULL; H5G_stat_t sb; haddr_t objno; /* Compact form of object's location */ struct tm *tm; @@ -1855,21 +1855,20 @@ list (hid_t group, const char *name, void *_iter) H5E_BEGIN_TRY { status = H5Gget_objinfo(group, name, FALSE, &sb); } H5E_END_TRY; - if (status<0) { + if(status < 0) { puts("**NOT FOUND**"); return 0; - } else if (sb.type<0 || sb.type>=H5G_NTYPES) { + } else if(sb.type < 0 || sb.type >= H5G_NTYPES) { printf("Unknown type(%d)", sb.type); sb.type = H5G_UNKNOWN; } - if (sb.type>=0 && dispatch_g[sb.type].name) { + if(sb.type >= 0 && dispatch_g[sb.type].name) fputs(dispatch_g[sb.type].name, stdout); - } objno = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long))); /* If the object has already been printed then just show the object ID * and return. */ - if ((s=sym_lookup(&sb))) { + if((s = sym_lookup(&sb))) { printf(", same as "); display_string(stdout, s, TRUE); printf("\n"); @@ -1918,7 +1917,7 @@ list (hid_t group, const char *name, void *_iter) puts("\""); } /* end if */ } /* end if */ - if(sb.type>=0 && dispatch_g[sb.type].list2) + if(sb.type >= 0 && dispatch_g[sb.type].list2) (dispatch_g[sb.type].list2)(obj, fullname); done: @@ -2340,7 +2339,7 @@ main (int argc, const char *argv[]) } /* end if */ /* list */ - H5Giterate(file, oname, NULL, list, &iter); + H5Literate(file, oname, H5_INDEX_NAME, H5_ITER_INC, NULL, list, &iter, H5P_DEFAULT); free(container); } else if((root = H5Gopen2(file, "/", H5P_DEFAULT)) < 0) { @@ -2350,7 +2349,7 @@ main (int argc, const char *argv[]) /* Specified name is a non-group object -- list that object. The * container for the object is everything up to the base name. */ iter.container = show_file_name_g ? fname : "/"; - list(root, oname, &iter); + list(root, oname, NULL, &iter); if(H5Gclose(root) < 0) leave(1); } diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 280023e..6c4f1af 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -459,7 +459,7 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi) */ static herr_t group_stats(hid_t group, const char *name, const char *fullname, - const H5O_info_t *oi, H5G_iterate_t walk, iter_t *iter) + const H5O_info_t *oi, H5L_iterate_t walk, iter_t *iter) { hid_t gid; /* Group ID */ const char *last_container; @@ -525,7 +525,7 @@ group_stats(hid_t group, const char *name, const char *fullname, iter->curr_depth++; /* Recursively descend into current group's objects */ - H5Giterate(group, name, NULL, walk, iter); + H5Literate(group, name, H5_INDEX_NAME, H5_ITER_INC, NULL, walk, iter, H5P_DEFAULT); /* Revert current container info */ iter->container = last_container; @@ -742,7 +742,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, void *_iter) +walk(hid_t group, const char *name, const H5L_info_t *linfo, void *_iter) { iter_t *iter = (iter_t *)_iter; H5O_info_t oi; @@ -1359,7 +1359,7 @@ main(int argc, const char *argv[]) for(i = 0; i < argc; i++) { if(hand[i].obj) { if(hand[i].flag) { - walk(fid, hand[i].obj, &iter); + walk(fid, hand[i].obj, NULL, &iter); print_statistics(hand[i].obj, &iter); } } diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 5334a51..50bc6cd 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -894,9 +894,8 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset if (count == 1) flags |= END_OF_DATA; - for (i = 0; i < ctx.ndims; i++) { + for (i = 0; i < ctx.ndims; i++) ctx.p_max_idx[i] = ctx.p_min_idx[i] + MIN(total_size[i], sm_size[i]); - } /* print array indices. get the lower bound of the hyperslab and calulate the element position at the start of hyperslab */ diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 6313992..dad73e7 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -348,7 +348,7 @@ typedef struct h5tools_context_t { size_t cur_column; /*current column for output */ size_t cur_elmt; /*current element/output line */ int need_prefix; /*is line prefix needed? */ - int ndims; /*dimensionality */ + unsigned ndims; /*dimensionality */ hsize_t p_min_idx[H5S_MAX_RANK]; /*min selected index */ hsize_t p_max_idx[H5S_MAX_RANK]; /*max selected index */ int prev_multiline; /*was prev datum multiline? */ diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 2a7a4ff..0b17b41 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -339,7 +339,8 @@ lookup_ref_path(haddr_t ref) *------------------------------------------------------------------------- */ herr_t -fill_ref_path_table(hid_t group, const char *obj_name, void *op_data) +fill_ref_path_table(hid_t group, const char *obj_name, const H5L_info_t UNUSED *linfo, + void *op_data) { const char *obj_prefix = (const char *)op_data; H5G_stat_t statbuf; @@ -372,7 +373,7 @@ fill_ref_path_table(hid_t group, const char *obj_name, void *op_data) /* Iterate over objects in this group, using this group's * name as their prefix */ - if(H5Giterate(group, obj_name, NULL, fill_ref_path_table, thepath) < 0) { + if(H5Literate(group, obj_name, H5_INDEX_NAME, H5_ITER_INC, NULL, fill_ref_path_table, thepath, H5P_DEFAULT) < 0) { error_msg(progname, "unable to dump group \"%s\"\n", obj_name); d_status = EXIT_FAILURE; } diff --git a/tools/lib/h5tools_ref.h b/tools/lib/h5tools_ref.h index 1922e02..d996114 100644 --- a/tools/lib/h5tools_ref.h +++ b/tools/lib/h5tools_ref.h @@ -24,7 +24,7 @@ extern "C" { int init_ref_path_table(hid_t fid); const char *lookup_ref_path(haddr_t ref); -herr_t fill_ref_path_table(hid_t, const char *, void *); +herr_t fill_ref_path_table(hid_t, const char *, const H5L_info_t *, void *); int get_next_xid(void); haddr_t get_fake_xid (void); haddr_t ref_path_table_lookup(const char *); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index d00d0e7..737c68a 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -845,15 +845,15 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai if (h5tools_is_zero(vp, H5Tget_size(type))) { h5tools_str_append(str, "NULL"); } else { - char name[1024]; + char ref_name[1024]; obj = H5Rdereference(container, H5R_DATASET_REGION, vp); region = H5Rget_region(container, H5R_DATASET_REGION, vp); H5Gget_objinfo(obj, ".", FALSE, &sb); /* get name of the dataset the region reference points to using H5Rget_name */ - H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*)name, 1024); - h5tools_str_append(str, info->dset_format, name); + H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*)ref_name, 1024); + h5tools_str_append(str, info->dset_format, ref_name); h5tools_str_dump_region(str, region, info); H5Sclose(region); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index bba2973..b04f3c6 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -46,7 +46,8 @@ static void dump_table(char* tablename, table_t *table); #endif /* H5DUMP_DEBUG */ static void add_obj(table_t *table, haddr_t objno, char *objname, hbool_t recorded); static char * build_obj_path_name(const char *prefix, const char *name); -static herr_t find_objs_cb(hid_t group, const char *name, void *op_data); +static herr_t find_objs_cb(hid_t group, const char *name, const H5L_info_t *info, + void *op_data); /*------------------------------------------------------------------------- @@ -480,7 +481,7 @@ build_obj_path_name(const char *prefix, const char *name) *------------------------------------------------------------------------- */ static herr_t -find_objs_cb(hid_t group, const char *name, void *op_data) +find_objs_cb(hid_t group, const char *name, const H5L_info_t UNUSED *linfo, void *op_data) { H5G_stat_t statbuf; find_objs_t *info = (find_objs_t*)op_data; @@ -508,7 +509,7 @@ find_objs_cb(hid_t group, const char *name, void *op_data) info->prefix = HDmalloc(tmp_len+1); HDstrcpy(info->prefix, tmp); - if(H5Giterate(group, name, NULL, find_objs_cb, (void *)info) < 0) + if(H5Literate(group, name, H5_INDEX_NAME, H5_ITER_INC, NULL, find_objs_cb, (void *)info, H5P_DEFAULT) < 0) ret_value = FAIL; info->prefix = old_prefix; @@ -625,7 +626,7 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table, /* Find all shared objects */ - return(H5Giterate(fid, "/", NULL, find_objs_cb, (void *)info)); + return(H5Literate(fid, "/", H5_INDEX_NAME, H5_ITER_INC, NULL, find_objs_cb, (void *)info, H5P_DEFAULT)); } diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 7ba2cc3..37fa9a1 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -371,19 +371,19 @@ static hssize_t get_nnames( hid_t loc_id, const char *group_name ) *------------------------------------------------------------------------- */ -static herr_t opget_info( hid_t loc_id, const char *name, void *op_data) +static herr_t +opget_info(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_data) { + H5G_stat_t statbuf; - H5G_stat_t statbuf; + if(H5Gget_objinfo(loc_id, name, FALSE, &statbuf) < 0) + return -1; - 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); + ((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; + /* Define 1 for return. This will cause the iterator to stop */ + return 1; } @@ -410,20 +410,20 @@ static herr_t opget_info( hid_t loc_id, const char *name, void *op_data) static herr_t get_name_type( hid_t loc_id, const char *group_name, - int idx, + int _idx, char **name, H5G_obj_t *type ) { + trav_info_t info; + hsize_t idx = (hsize_t)_idx; - trav_info_t info; + if(H5Literate(loc_id, group_name, H5_INDEX_NAME, H5_ITER_INC, &idx, opget_info, (void *)&info, H5P_DEFAULT) < 0) + return -1; - if (H5Giterate( loc_id, group_name, &idx, opget_info, (void *)&info) < 0 ) - return -1; - - *name = info.name; - *type = info.type; + *name = info.name; + *type = info.type; - return 0; + return 0; } /*------------------------------------------------------------------------- |