summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-11-06 17:05:16 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-11-06 17:05:16 (GMT)
commit5adf1ee1bab95cce501257e538b638a75c9e72fa (patch)
tree33102c066b0e6e0a5d9e09b373a604106e4806e2 /tools
parent30aad1fd3e4c12d97fdd90bbcae3db7f89eb6ec0 (diff)
downloadhdf5-5adf1ee1bab95cce501257e538b638a75c9e72fa.zip
hdf5-5adf1ee1bab95cce501257e538b638a75c9e72fa.tar.gz
hdf5-5adf1ee1bab95cce501257e538b638a75c9e72fa.tar.bz2
[svn-r12864] Description:
Changed H5Lget_linkval() to H5Lget_val(), per our design discussion last Friday afternoon. Tested on: Linux/32 2.6 (chicago)
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/h5dump.c8
-rw-r--r--tools/h5ls/h5ls.c45
-rw-r--r--tools/lib/h5diff.c8
3 files changed, 32 insertions, 29 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 2dc89a6..45e90b7 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -1456,7 +1456,7 @@ dump_all(hid_t group, const char *name, void * op_data)
indentation(indent + COL);
}
- if (H5Lget_linkval(group, name, statbuf.linklen, targbuf, H5P_DEFAULT) < 0) {
+ if (H5Lget_val(group, name, statbuf.linklen, targbuf, H5P_DEFAULT) < 0) {
error_msg(progname, "unable to get link value\n");
d_status = EXIT_FAILURE;
ret = FAIL;
@@ -1555,7 +1555,7 @@ dump_all(hid_t group, const char *name, void * op_data)
begin_obj(dump_header_format->extlinkbegin, name,
dump_header_format->extlinkblockbegin);
}
- if (H5Lget_linkval(group, name, statbuf.linklen, targbuf, H5P_DEFAULT) < 0) {
+ if (H5Lget_val(group, name, statbuf.linklen, targbuf, H5P_DEFAULT) < 0) {
error_msg(progname, "unable to get external link value\n");
d_status = EXIT_FAILURE;
ret = FAIL;
@@ -3227,7 +3227,7 @@ handle_links(hid_t fid, char *links, void UNUSED * data)
dump_header_format->softlinkblockbegin);
indentation(COL);
- if(H5Lget_linkval(fid, links, statbuf.linklen, buf, H5P_DEFAULT) >= 0) {
+ if(H5Lget_val(fid, links, statbuf.linklen, buf, H5P_DEFAULT) >= 0) {
printf("LINKTARGET \"%s\"\n", buf);
} else {
error_msg(progname, "h5dump error: unable to get link value for \"%s\"\n",
@@ -3247,7 +3247,7 @@ handle_links(hid_t fid, char *links, void UNUSED * data)
case H5L_TYPE_EXTERNAL:
begin_obj(dump_header_format->extlinkbegin, links,
dump_header_format->extlinkblockbegin);
- if (H5Lget_linkval(fid, links, statbuf.linklen, buf, H5P_DEFAULT) >= 0) {
+ if(H5Lget_val(fid, links, statbuf.linklen, buf, H5P_DEFAULT) >= 0) {
if(H5Lunpack_elink_val(buf, statbuf.linklen, &elink_file, &elink_path)>=0) {
indentation(COL);
printf("LINKCLASS %d\n", linfo.type);
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index effab89..e5117dc 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1720,11 +1720,11 @@ slink_open(hid_t location, const char *name)
{
char buf[64];
- if (H5Lget_linkval (location, name, sizeof(buf), buf, H5P_DEFAULT)<0) return -1;
- if (NULL==HDmemchr(buf, 0, sizeof(buf))) {
- strcpy(buf+sizeof(buf)-4, "...");
- }
- fputs(buf, stdout);
+ if(H5Lget_val(location, name, sizeof(buf), buf, H5P_DEFAULT) < 0)
+ return -1;
+ if(NULL == HDmemchr(buf, 0, sizeof(buf)))
+ HDstrcpy(buf + sizeof(buf) - 4, "...");
+ HDfputs(buf, stdout);
return 0;
}
@@ -1755,30 +1755,33 @@ udlink_open(hid_t location, const char *name)
char * filename = NULL;
char * path = NULL;
- if(H5Lget_info(location, name, &linfo, H5P_DEFAULT) < 0) return -1;
+ if(H5Lget_info(location, name, &linfo, H5P_DEFAULT) < 0)
+ return -1;
switch(linfo.type)
{
- /* For external links, try to display info for the object it points to */
- case H5L_TYPE_EXTERNAL:
- if ((buf = HDmalloc(linfo.u.link_size))==NULL) goto error;
- if (H5Lget_linkval (location, name, sizeof(buf), buf, H5P_DEFAULT)<0) goto error;
-
- if(H5Lunpack_elink_val(buf, linfo.u.link_size, &filename, &path) < 0) goto error;
- fputs("file: ", stdout);
- fputs(filename, stdout);
- fputs(" path: ", stdout);
- fputs(path, stdout);
- break;
-
- default:
- fputs("cannot follow UD links", stdout);
+ /* For external links, try to display info for the object it points to */
+ case H5L_TYPE_EXTERNAL:
+ if((buf = HDmalloc(linfo.u.link_size)) == NULL)
+ goto error;
+ if(H5Lget_val(location, name, sizeof(buf), buf, H5P_DEFAULT) < 0)
+ goto error;
+
+ if(H5Lunpack_elink_val(buf, linfo.u.link_size, &filename, &path) < 0) goto error;
+ HDfputs("file: ", stdout);
+ HDfputs(filename, stdout);
+ HDfputs(" path: ", stdout);
+ HDfputs(path, stdout);
+ break;
+
+ default:
+ HDfputs("cannot follow UD links", stdout);
}
return 0;
error:
if(buf)
- HDfree(buf);
+ HDfree(buf);
return -1;
}
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 5fa88bd..7070898 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -1090,12 +1090,12 @@ hsize_t diff (hid_t file1_id,
buf1 = HDmalloc (li1.u.link_size);
buf2 = HDmalloc (li2.u.link_size);
- if (H5Lget_linkval (file1_id, path1, li1.u.link_size, buf1, H5P_DEFAULT) < 0)
+ if(H5Lget_val(file1_id, path1, li1.u.link_size, buf1, H5P_DEFAULT) < 0)
{
HDfree (buf1); HDfree (buf2);
goto out;
}
- if (H5Lget_linkval (file2_id, path2, li2.u.link_size, buf2, H5P_DEFAULT) < 0)
+ if(H5Lget_val(file2_id, path2, li2.u.link_size, buf2, H5P_DEFAULT) < 0)
{
HDfree (buf1); HDfree (buf2);
goto out;
@@ -1104,12 +1104,12 @@ hsize_t diff (hid_t file1_id,
/* If the buffers are the same size, compare them */
if(li1.u.link_size == li2.u.link_size)
{
- if (H5Lget_linkval (file1_id, path1, li1.u.link_size, buf1, H5P_DEFAULT) < 0)
+ if(H5Lget_val(file1_id, path1, li1.u.link_size, buf1, H5P_DEFAULT) < 0)
{
HDfree (buf1); HDfree (buf2);
goto out;
}
- if (H5Lget_linkval (file2_id, path2, li2.u.link_size, buf2, H5P_DEFAULT) < 0)
+ if(H5Lget_val(file2_id, path2, li2.u.link_size, buf2, H5P_DEFAULT) < 0)
{
HDfree (buf1); HDfree (buf2);
goto out;