summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-04-03 19:51:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-04-03 19:51:14 (GMT)
commit0fb88ded47762bcafdd4317a3cd48f4c706a011c (patch)
treef46e14f62d1c6f3ebd1fb9aab18fab97509782bd /tools/h5dump
parentd53775c9468afe01b058e59db8dfc7a4d79f0340 (diff)
downloadhdf5-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/h5dump')
-rw-r--r--tools/h5dump/h5dump.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 0af6d5d..555334a 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -1544,25 +1544,26 @@ dump_all(hid_t group, const char *name, void * op_data)
case H5G_UDLINK:
{
indentation(indent);
- switch(linfo.type)
- {
+ switch(linfo.type) {
case H5L_TYPE_EXTERNAL:
{
char *targbuf;
- char *filename;
- char *targname;
+
targbuf = HDmalloc(statbuf.linklen);
HDassert(targbuf);
- if (!doxml) {
- begin_obj(dump_header_format->extlinkbegin, name,
- dump_header_format->extlinkblockbegin);
- }
- if (H5Lget_val(group, name, targbuf, statbuf.linklen, H5P_DEFAULT) < 0) {
+ if(!doxml) {
+ begin_obj(dump_header_format->extlinkbegin, name, dump_header_format->extlinkblockbegin);
+ } /* end if */
+
+ if(H5Lget_val(group, name, targbuf, statbuf.linklen, H5P_DEFAULT) < 0) {
error_msg(progname, "unable to get external link value\n");
d_status = EXIT_FAILURE;
ret = FAIL;
} else {
- if(H5Lunpack_elink_val(targbuf, statbuf.linklen, &filename, &targname) < 0) {
+ const char *filename;
+ const char *targname;
+
+ if(H5Lunpack_elink_val(targbuf, statbuf.linklen, NULL, &filename, &targname) < 0) {
error_msg(progname, "unable to unpack external link value\n");
d_status = EXIT_FAILURE;
ret = FAIL;
@@ -2963,7 +2964,7 @@ parse_hsize_list(const char *h_list)
p_list = calloc(size_count, sizeof(hsize_t));
for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++)
- if (isdigit(*ptr)) {
+ if(isdigit(*ptr)) {
/* we should have an integer now */
p_list[i++] = (hsize_t)atof(ptr);
@@ -3214,8 +3215,6 @@ handle_links(hid_t fid, char *links, void UNUSED * data)
{
H5G_stat_t statbuf;
H5L_info_t linfo;
- char * elink_file;
- char * elink_path;
if(H5Gget_objinfo(fid, links, FALSE, &statbuf) < 0) {
error_msg(progname, "unable to get obj info from \"%s\"\n", links);
@@ -3247,25 +3246,26 @@ handle_links(hid_t fid, char *links, void UNUSED * data)
dump_header_format->udlinkblockbegin);
indentation(COL);
switch(linfo.type) {
- case H5L_TYPE_EXTERNAL:
- begin_obj(dump_header_format->extlinkbegin, links,
+ case H5L_TYPE_EXTERNAL:
+ begin_obj(dump_header_format->extlinkbegin, links,
dump_header_format->extlinkblockbegin);
- if(H5Lget_val(fid, links, buf, statbuf.linklen, H5P_DEFAULT) >= 0) {
- if(H5Lunpack_elink_val(buf, statbuf.linklen, &elink_file, &elink_path)>=0) {
- indentation(COL);
- printf("LINKCLASS %d\n", linfo.type);
- indentation(COL);
- printf("TARGETFILE \"%s\"\n", elink_file);
- indentation(COL);
- printf("TARGETPATH \"%s\"\n", elink_path);
- } else {
- error_msg(progname, "h5dump error: unable to unpack external link value for \"%s\"\n",
- links);
- d_status = EXIT_FAILURE;
- }
+ if(H5Lget_val(fid, links, buf, statbuf.linklen, H5P_DEFAULT) >= 0) {
+ const char *elink_file;
+ const char *elink_path;
+
+ if(H5Lunpack_elink_val(buf, statbuf.linklen, NULL, &elink_file, &elink_path)>=0) {
+ indentation(COL);
+ printf("LINKCLASS %d\n", linfo.type);
+ indentation(COL);
+ printf("TARGETFILE \"%s\"\n", elink_file);
+ indentation(COL);
+ printf("TARGETPATH \"%s\"\n", elink_path);
+ } else {
+ error_msg(progname, "h5dump error: unable to unpack external link value for \"%s\"\n", links);
+ d_status = EXIT_FAILURE;
+ }
} else {
- error_msg(progname, "h5dump error: unable to get external link value for \"%s\"\n",
- links);
+ error_msg(progname, "h5dump error: unable to get external link value for \"%s\"\n", links);
d_status = EXIT_FAILURE;
}
end_obj(dump_header_format->extlinkend,