summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-08-27 13:34:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-08-27 13:34:28 (GMT)
commitfefbe61aca1a42e716e900be7af5b382be5e19c1 (patch)
treedbb600c8b6555569a4d94ff69b24e72c4787693d /tools/lib
parent538d37a1bcc15a600c71fad0566d8480c2344ee6 (diff)
downloadhdf5-fefbe61aca1a42e716e900be7af5b382be5e19c1.zip
hdf5-fefbe61aca1a42e716e900be7af5b382be5e19c1.tar.gz
hdf5-fefbe61aca1a42e716e900be7af5b382be5e19c1.tar.bz2
[svn-r11304] Purpose:
Code cleanup (sorta) Description: Adjust H5G_stat_t to prepare for eventual "external link" information. This also puts the information for regular objects and soft links into more obviously separate places. Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c8
-rw-r--r--tools/lib/h5tools_ref.c8
-rw-r--r--tools/lib/h5tools_str.c8
-rw-r--r--tools/lib/h5tools_utils.c16
-rw-r--r--tools/lib/h5trav.c28
5 files changed, 34 insertions, 34 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 5103280..8066e5e 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -1048,12 +1048,12 @@ diff (hid_t file1_id,
if (H5Gget_objinfo (file1_id, path1, FALSE, &sb2) < 0)
goto out;
- buf1 = malloc (sb1.linklen);
- buf2 = malloc (sb2.linklen);
+ buf1 = malloc (sb1.u.slink.linklen);
+ buf2 = malloc (sb2.u.slink.linklen);
- if (H5Gget_linkval (file1_id, path1, sb1.linklen, buf1) < 0)
+ if (H5Gget_linkval (file1_id, path1, sb1.u.slink.linklen, buf1) < 0)
goto out;
- if (H5Gget_linkval (file2_id, path2, sb1.linklen, buf2) < 0)
+ if (H5Gget_linkval (file2_id, path2, sb1.u.slink.linklen, buf2) < 0)
goto out;
ret = HDstrcmp (buf1, buf2);
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index df2873d..82dd1d0 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -85,7 +85,7 @@ init_ref_path_table(hid_t fid)
}
/* Insert into table (takes ownership of path) */
- ref_path_table_put(root_path, sb.objno);
+ ref_path_table_put(root_path, sb.u.obj.objno);
return(0);
}
@@ -164,7 +164,7 @@ ref_path_table_lookup(const char *thepath)
return HADDR_UNDEF;
/* Return OID or HADDR_UNDEF */
- ret_value = ref_path_table_find(sb.objno) ? sb.objno : HADDR_UNDEF;
+ ret_value = ref_path_table_find(sb.u.obj.objno) ? sb.u.obj.objno : HADDR_UNDEF;
return(ret_value);
}
@@ -327,7 +327,7 @@ fill_ref_path_table(hid_t group, const char *obj_name, void *op_data)
H5Gget_objinfo(group, obj_name, FALSE, &statbuf);
/* Check if the object is in the path table */
- if (!ref_path_table_find(statbuf.objno)) {
+ if (!ref_path_table_find(statbuf.u.obj.objno)) {
size_t tmp_len;
char *thepath;
@@ -344,7 +344,7 @@ fill_ref_path_table(hid_t group, const char *obj_name, void *op_data)
HDstrcat(thepath, obj_name);
/* Insert the object into the path table */
- ref_path_table_put(thepath, statbuf.objno);
+ ref_path_table_put(thepath, statbuf.u.obj.objno);
if(statbuf.type == H5G_GROUP) {
/* Iterate over objects in this group, using this group's
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 82a6100..141aa3e 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -839,9 +839,9 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container,
H5Gget_objinfo(obj, ".", FALSE, &sb);
if (info->dset_hidefileno)
- h5tools_str_append(str, info->dset_format, sb.objno);
+ h5tools_str_append(str, info->dset_format, sb.u.obj.objno);
else
- h5tools_str_append(str, info->dset_format, sb.fileno, sb.objno);
+ h5tools_str_append(str, info->dset_format, sb.fileno, sb.u.obj.objno);
h5tools_str_dump_region(str, region, info);
H5Sclose(region);
@@ -881,9 +881,9 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container,
/* Print OID */
if (info->obj_hidefileno)
- h5tools_str_append(str, info->obj_format, sb.objno);
+ h5tools_str_append(str, info->obj_format, sb.u.obj.objno);
else
- h5tools_str_append(str, info->obj_format, sb.fileno,sb.objno);
+ h5tools_str_append(str, info->obj_format, sb.fileno,sb.u.obj.objno);
/* Print name */
path = lookup_ref_path(*(haddr_t *)vp);
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 8516242..764d8b2 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -491,11 +491,11 @@ find_objs_cb(hid_t group, const char *name, void *op_data)
char *tmp;
case H5G_GROUP:
- if (search_obj(info->group_table, statbuf.objno) == NULL) {
+ if (search_obj(info->group_table, statbuf.u.obj.objno) == NULL) {
char *old_prefix;
tmp = build_obj_path_name(info->prefix, name);
- add_obj(info->group_table, statbuf.objno, tmp, TRUE);
+ add_obj(info->group_table, statbuf.u.obj.objno, tmp, TRUE);
old_prefix = info->prefix;
info->prefix = tmp;
@@ -508,11 +508,11 @@ find_objs_cb(hid_t group, const char *name, void *op_data)
break;
case H5G_DATASET:
- if (search_obj(info->dset_table, statbuf.objno) == NULL) {
+ if (search_obj(info->dset_table, statbuf.u.obj.objno) == NULL) {
hid_t dset;
tmp = build_obj_path_name(info->prefix, name);
- add_obj(info->dset_table, statbuf.objno, tmp, TRUE);
+ add_obj(info->dset_table, statbuf.u.obj.objno, tmp, TRUE);
if ((dset = H5Dopen (group, name)) >= 0) {
hid_t type;
@@ -522,10 +522,10 @@ find_objs_cb(hid_t group, const char *name, void *op_data)
if (H5Tcommitted(type) > 0) {
H5Gget_objinfo(type, ".", TRUE, &statbuf);
- if (search_obj(info->type_table, statbuf.objno) == NULL) {
+ if (search_obj(info->type_table, statbuf.u.obj.objno) == NULL) {
char *type_name = HDstrdup(tmp);
- add_obj(info->type_table, statbuf.objno, type_name, FALSE);
+ add_obj(info->type_table, statbuf.u.obj.objno, type_name, FALSE);
} /* end if */
}
@@ -542,8 +542,8 @@ find_objs_cb(hid_t group, const char *name, void *op_data)
obj_t *found_obj;
tmp = build_obj_path_name(info->prefix, name);
- if ((found_obj = search_obj(info->type_table, statbuf.objno)) == NULL)
- add_obj(info->type_table, statbuf.objno, tmp, TRUE);
+ if ((found_obj = search_obj(info->type_table, statbuf.u.obj.objno)) == NULL)
+ add_obj(info->type_table, statbuf.u.obj.objno, tmp, TRUE);
else {
/* Use latest version of name */
HDfree(found_obj->objname);
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index e3578c9..5030e37 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -370,10 +370,10 @@ int traverse( hid_t loc_id,
inserted_objs++;
/* nlink is number of hard links to object */
- if (statbuf.nlink > 0 && trav_table_search(statbuf.objno, table ) == -1)
+ if (statbuf.u.obj.nlink > 0 && trav_table_search(statbuf.u.obj.objno, table ) == -1)
{
/* add object to table */
- trav_table_add(statbuf.objno, path, H5G_GROUP, table );
+ trav_table_add(statbuf.u.obj.objno, path, H5G_GROUP, table );
/* print it */
if (print)
@@ -385,9 +385,9 @@ int traverse( hid_t loc_id,
/* search table
group with more than one link to it */
- if (statbuf.nlink > 1)
+ if (statbuf.u.obj.nlink > 1)
{
- if ((j = trav_table_search(statbuf.objno, table )) < 0 )
+ if ((j = trav_table_search(statbuf.u.obj.objno, table )) < 0 )
return -1;
trav_table_addlink(table,j,path);
@@ -418,10 +418,10 @@ int traverse( hid_t loc_id,
inserted_objs++;
/* nlink is number of hard links to object */
- if (statbuf.nlink > 0 && trav_table_search(statbuf.objno, table ) == -1)
+ if (statbuf.u.obj.nlink > 0 && trav_table_search(statbuf.u.obj.objno, table ) == -1)
{
/* add object to table */
- trav_table_add(statbuf.objno, path, H5G_DATASET, table );
+ trav_table_add(statbuf.u.obj.objno, path, H5G_DATASET, table );
/* print it */
if (print)
@@ -430,9 +430,9 @@ int traverse( hid_t loc_id,
/* search table
dataset with more than one link to it */
- if (statbuf.nlink > 1)
+ if (statbuf.u.obj.nlink > 1)
{
- if ((j = trav_table_search(statbuf.objno, table )) < 0 )
+ if ((j = trav_table_search(statbuf.u.obj.objno, table )) < 0 )
return -1;
trav_table_addlink(table,j,path);
@@ -463,10 +463,10 @@ int traverse( hid_t loc_id,
inserted_objs++;
/* nlink is number of hard links to object */
- if (statbuf.nlink > 0 && trav_table_search(statbuf.objno, table ) == -1)
+ if (statbuf.u.obj.nlink > 0 && trav_table_search(statbuf.u.obj.objno, table ) == -1)
{
/* add object to table */
- trav_table_add(statbuf.objno, path, H5G_TYPE, table );
+ trav_table_add(statbuf.u.obj.objno, path, H5G_TYPE, table );
/* print it */
if (print)
@@ -489,12 +489,12 @@ int traverse( hid_t loc_id,
inserted_objs++;
/* add object to table */
- trav_table_add(statbuf.objno, path, H5G_LINK, table );
+ trav_table_add(statbuf.u.obj.objno, path, H5G_LINK, table );
- if (statbuf.linklen>0)
+ if (statbuf.u.slink.linklen>0)
{
- targbuf=malloc(statbuf.linklen);
- H5Gget_linkval(loc_id,path,statbuf.linklen,targbuf);
+ targbuf=malloc(statbuf.u.slink.linklen);
+ H5Gget_linkval(loc_id,path,statbuf.u.slink.linklen,targbuf);
if (print)
printf(" %-10s %s -> %s\n", "link", path, targbuf);
if (targbuf)