summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5trav.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-04-14 22:21:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-04-14 22:21:54 (GMT)
commit2521c4084c06f078846fe06bb1d3cd7bfa506316 (patch)
tree466b9213c163d812778434bba2097705b423e799 /tools/lib/h5trav.c
parent3468ff3a5c4f6c384801edef9ae52ecc4f2de3c5 (diff)
downloadhdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.zip
hdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.tar.gz
hdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.tar.bz2
[svn-r12254] Purpose:
Anti-feature Description: Revert changes to H5G_stat_t struct, to make it compatible with the 1.6.x branch again. The information that was added to the H5G_stat_t struct will be reported through other API routines. Platforms tested: FreeBSD 4.11 (sleipnir) w/C++ Linux 2.4/64 (mir) w/C++ & Fortran Solaris 2.9 (shanti)
Diffstat (limited to 'tools/lib/h5trav.c')
-rw-r--r--tools/lib/h5trav.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index b59162a..f5c6e91 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -292,7 +292,7 @@ static int traverse( hid_t loc_id,
int *idx,
int print)
{
-
+ haddr_t objno; /* Compact form of object's location */
char *name=NULL;
H5G_obj_t type;
int n_names;
@@ -325,6 +325,7 @@ static int traverse( hid_t loc_id,
/* 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 )
@@ -349,10 +350,10 @@ static int traverse( hid_t loc_id,
inserted_objs++;
/* nlink is number of hard links to object */
- if (statbuf.u.obj.nlink > 0 && trav_table_search(statbuf.u.obj.objno, table ) == -1)
+ if (statbuf.nlink > 0 && trav_table_search(objno, table ) == -1)
{
/* add object to table */
- trav_table_add(statbuf.u.obj.objno, path, H5G_GROUP, table );
+ trav_table_add(objno, path, H5G_GROUP, table );
/* print it */
if (print)
@@ -364,9 +365,9 @@ static int traverse( hid_t loc_id,
/* search table
group with more than one link to it */
- if (statbuf.u.obj.nlink > 1)
+ if (statbuf.nlink > 1)
{
- if ((j = trav_table_search(statbuf.u.obj.objno, table )) < 0 )
+ if ((j = trav_table_search(objno, table )) < 0 )
return -1;
trav_table_addlink(table,j,path);
@@ -397,10 +398,10 @@ static int traverse( hid_t loc_id,
inserted_objs++;
/* nlink is number of hard links to object */
- if (statbuf.u.obj.nlink > 0 && trav_table_search(statbuf.u.obj.objno, table ) == -1)
+ if (statbuf.nlink > 0 && trav_table_search(objno, table ) == -1)
{
/* add object to table */
- trav_table_add(statbuf.u.obj.objno, path, H5G_DATASET, table );
+ trav_table_add(objno, path, H5G_DATASET, table );
/* print it */
if (print)
@@ -409,9 +410,9 @@ static int traverse( hid_t loc_id,
/* search table
dataset with more than one link to it */
- if (statbuf.u.obj.nlink > 1)
+ if (statbuf.nlink > 1)
{
- if ((j = trav_table_search(statbuf.u.obj.objno, table )) < 0 )
+ if ((j = trav_table_search(objno, table )) < 0 )
return -1;
trav_table_addlink(table,j,path);
@@ -442,10 +443,10 @@ static int traverse( hid_t loc_id,
inserted_objs++;
/* nlink is number of hard links to object */
- if (statbuf.u.obj.nlink > 0 && trav_table_search(statbuf.u.obj.objno, table ) == -1)
+ if (statbuf.nlink > 0 && trav_table_search(objno, table ) == -1)
{
/* add object to table */
- trav_table_add(statbuf.u.obj.objno, path, H5G_TYPE, table );
+ trav_table_add(objno, path, H5G_TYPE, table );
/* print it */
if (print)
@@ -468,13 +469,13 @@ static int traverse( hid_t loc_id,
/* add object to table */
trav_table_add(HADDR_UNDEF, path, H5G_LINK, table );
- if (statbuf.u.slink.linklen>0)
+ if (statbuf.linklen>0)
{
char *targbuf;
- targbuf = HDmalloc(statbuf.u.slink.linklen);
+ targbuf = HDmalloc(statbuf.linklen);
assert(targbuf);
- H5Gget_linkval(loc_id,path,statbuf.u.slink.linklen,targbuf);
+ H5Gget_linkval(loc_id,path,statbuf.linklen,targbuf);
if (print)
printf(" %-10s %s -> %s\n", "link", path, targbuf);
free(targbuf);