summaryrefslogtreecommitdiffstats
path: root/src/H5Lexternal.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-08-03 22:35:58 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-08-03 22:35:58 (GMT)
commitb5724779d0b10f610de10bf2ab88d62202160272 (patch)
treed89656e3ceb6504d3338ddfb7ae8aec76db66159 /src/H5Lexternal.c
parentb1e0516dd0b0795ec04dbe86f909412e94cbaa2a (diff)
downloadhdf5-b5724779d0b10f610de10bf2ab88d62202160272.zip
hdf5-b5724779d0b10f610de10bf2ab88d62202160272.tar.gz
hdf5-b5724779d0b10f610de10bf2ab88d62202160272.tar.bz2
[svn-r12533] Standardized the way path prefixes are passed to external links using a
LAPL. Now there are H5Pget and H5Pset functions for "elink_prefixes".
Diffstat (limited to 'src/H5Lexternal.c')
-rw-r--r--src/H5Lexternal.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index 5609658..312028a 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -50,6 +50,7 @@ static hid_t H5L_extern_traverse(const char * link_name, hid_t cur_group, void *
hid_t fid;
char *file_name;
char *obj_name;
+ char *prefix;
size_t fname_len;
htri_t result;
hbool_t fname_alloc = FALSE;
@@ -60,25 +61,22 @@ static hid_t H5L_extern_traverse(const char * link_name, hid_t cur_group, void *
obj_name = ((char *) udata) + fname_len + 1;
/* See if the external link prefix property is set */
- if((result = H5Pexist(lapl_id, H5L_ELINK_PREFIX_PROP)) < 0)
+ if(H5Pget_elink_prefix(lapl_id, &prefix) < 0)
goto error;
/* If so, prepend it to the filename */
- if(result > 0)
+ if(prefix != NULL)
{
size_t buf_size;
- if(H5Pget_size(lapl_id, H5L_ELINK_PREFIX_PROP, &buf_size) < 0)
- goto error;
+ buf_size = HDstrlen(prefix);
/* Allocate a buffer to hold the filename plus prefix */
file_name = malloc(buf_size + fname_len + 1);
fname_alloc = TRUE;
- if(H5Pget(lapl_id, H5L_ELINK_PREFIX_PROP, file_name) < 0)
- goto error;
-
/* Add the external link's filename to the prefix supplied */
+ strcpy(file_name, prefix);
strcat(file_name, udata);
}