diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-04-03 19:51:14 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-04-03 19:51:14 (GMT) |
commit | 0fb88ded47762bcafdd4317a3cd48f4c706a011c (patch) | |
tree | f46e14f62d1c6f3ebd1fb9aab18fab97509782bd /tools/lib | |
parent | d53775c9468afe01b058e59db8dfc7a4d79f0340 (diff) | |
download | hdf5-0fb88ded47762bcafdd4317a3cd48f4c706a011c.zip hdf5-0fb88ded47762bcafdd4317a3cd48f4c706a011c.tar.gz hdf5-0fb88ded47762bcafdd4317a3cd48f4c706a011c.tar.bz2 |
[svn-r13580] Description:
Add version # and flags to external link format (as fields in a single
byte), in order to accomodate future changes/expansions.
Tested on:
Mac OS X/32 10.4.9 (amazon)
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5trav.c | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 8abdf55..3646827 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -665,32 +665,29 @@ static int traverse( hid_t loc_id, H5Lget_info( loc_id, path, &linkbuf, H5P_DEFAULT); } H5E_END_TRY; - if(linkbuf.type == H5L_TYPE_EXTERNAL) - { - if (statbuf.linklen>0) - { - char *targbuf; - char *objname; - - targbuf = HDmalloc(statbuf.linklen); - assert(targbuf); - H5Gget_linkval(loc_id,path,statbuf.linklen,targbuf); - H5Lunpack_elink_val(targbuf, statbuf.linklen, NULL, &objname); - if (print) - printf(" %-10s %s -> %s %s\n", "ext link", path, targbuf, objname); - free(targbuf); - } - else - { - if (print) - printf(" %-10s %s ->\n", "udlink", path); - } - } - else /* Unknown user-defined type */ - { - if (print) - printf(" %-10s %s ->\n", "UD link type", path); - } + if(linkbuf.type == H5L_TYPE_EXTERNAL) { + if(statbuf.linklen > 0) { + char *targbuf; + const char *filename; + const char *objname; + + targbuf = HDmalloc(statbuf.linklen); + assert(targbuf); + H5Gget_linkval(loc_id, path, statbuf.linklen, targbuf); + H5Lunpack_elink_val(targbuf, statbuf.linklen, NULL, &filename, &objname); + if(print) + printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); + free(targbuf); + } /* end if */ + else { + if(print) + printf(" %-10s %s ->\n", "udlink", path); + } /* end else */ + } /* end if */ + else { /* Unknown user-defined type */ + if(print) + printf(" %-10s %s ->\n", "UD link type", path); + } /* end else */ } break; @@ -718,12 +715,3 @@ static int traverse( hid_t loc_id, return inserted_objs; } - - - - - - - - - |