summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5trav.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-09-13 15:44:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-09-13 15:44:56 (GMT)
commit579284f422b6ed25b7a5f4a518c19740fff297c8 (patch)
tree564b2a7b4c13854a19ffaf465f94e6abd52d6340 /tools/lib/h5trav.c
parent15d118faedd8e61e8ec2a715cf8fcea5b1afab35 (diff)
downloadhdf5-579284f422b6ed25b7a5f4a518c19740fff297c8.zip
hdf5-579284f422b6ed25b7a5f4a518c19740fff297c8.tar.gz
hdf5-579284f422b6ed25b7a5f4a518c19740fff297c8.tar.bz2
[svn-r14144] Description:
Move H5Gget_objinfo() to deprecated symbols section and retarget internal usage to H5Lget_info()/H5Oget_info(). Misc. other code cleanups... 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 2.10 (linew) Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'tools/lib/h5trav.c')
-rw-r--r--tools/lib/h5trav.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index 65cca66..58d618d 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -171,11 +171,13 @@ traverse_cb(hid_t loc_id, const char *link_name, const H5L_info_t *linfo,
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);
+ if(udata->visitor->visit_obj)
+ (*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);
+ if(udata->visitor->visit_lnk)
+ (*udata->visitor->visit_lnk)(link_path, linfo, udata->visitor->udata);
} /* end else */
/* Check for group that we haven't visited yet & recurse */
@@ -267,7 +269,7 @@ traverse(hid_t file_id, const trav_visitor_t *visitor)
*-------------------------------------------------------------------------
*/
static void
-trav_info_add(trav_info_t *info, const char *path, H5G_obj_t obj_type)
+trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type)
{
size_t idx; /* Index of address to use */
@@ -302,8 +304,8 @@ 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);
+ /* (object types map directly to "traversal" types) */
+ trav_info_add((trav_info_t *)udata, path, (h5trav_type_t)oinfo->type);
return(0);
} /* end trav_info_visit_obj() */
@@ -326,7 +328,7 @@ 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));
+ trav_info_add((trav_info_t *)udata, path, ((linfo->type == H5L_TYPE_SOFT) ? H5TRAV_TYPE_LINK : H5TRAV_TYPE_UDLINK));
return(0);
} /* end trav_info_visit_lnk() */
@@ -647,7 +649,7 @@ trav_table_add(trav_table_t *table,
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].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK;
table->objs[new].nlinks = 0;
table->objs[new].sizelinks = 0;
table->objs[new].links = NULL;
@@ -707,7 +709,7 @@ trav_table_addlink(trav_table_t *table,
void trav_table_addflags(unsigned *flags,
char *name,
- H5G_obj_t type,
+ h5trav_type_t type,
trav_table_t *table)
{
unsigned int new;
@@ -715,7 +717,7 @@ void trav_table_addflags(unsigned *flags,
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 */
new = table->nobjs++;
table->objs[new].objno = 0;