summaryrefslogtreecommitdiffstats
path: root/tools/h5ls
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-30 20:03:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-30 20:03:37 (GMT)
commita4069db8f48121ca11d0465b260d9cd81152581b (patch)
tree37348ad7d71058a6f449255073d631db8c33794a /tools/h5ls
parent1374654210854d005546459e48c482c5ea01cba2 (diff)
downloadhdf5-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/h5ls')
-rw-r--r--tools/h5ls/h5ls.c25
1 files changed, 12 insertions, 13 deletions
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);
}