summaryrefslogtreecommitdiffstats
path: root/fortran/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-29 23:37:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-29 23:37:41 (GMT)
commit71d6bffdd745c865e988b29fac8d0173d7fa0131 (patch)
tree30e3ef0aece889d65fac25b0b038f6b7cc965497 /fortran/src
parentdb3c155bf296fa06ab0df56bb7307f2ba19613e5 (diff)
downloadhdf5-71d6bffdd745c865e988b29fac8d0173d7fa0131.zip
hdf5-71d6bffdd745c865e988b29fac8d0173d7fa0131.tar.gz
hdf5-71d6bffdd745c865e988b29fac8d0173d7fa0131.tar.bz2
[svn-r14127] Description:
Move H5Gget_linkval to deprecated symbol section and replace with H5Lget_val for internal calls. Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) Solaris/32 5.10 (linew) Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'fortran/src')
-rw-r--r--fortran/src/H5Gf.c71
1 files changed, 33 insertions, 38 deletions
diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c
index 5dd00b0..3b25a79 100644
--- a/fortran/src/H5Gf.c
+++ b/fortran/src/H5Gf.c
@@ -523,51 +523,46 @@ DONE:
*---------------------------------------------------------------------------*/
int_f
-nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value )
+nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size,
+ _fcd value)
{
- int ret_value = -1;
- hid_t c_loc_id;
- char *c_name;
- size_t c_namelen;
- char *c_value = NULL;
- size_t c_size;
- herr_t c_ret_value;
- /*
- * Convert Fortran name to C name
- */
- c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
- if(c_name == NULL) return ret_value;
-
- /*
- * Allocate buffer to hold name of the value
- */
- if(*size) c_value = (char *)HDmalloc((size_t)*size);
- if(c_value == NULL) {
- HDfree(c_name);
- return ret_value;
- }
+ char *c_name = NULL;
+ char *c_value = NULL;
+ int ret_value = -1;
- /*
- * Call H5Gget_linkval function
- */
+ /*
+ * Convert Fortran name to C name
+ */
+ if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
+ goto DONE;
- c_size = (size_t)*size;
- c_loc_id = (hid_t)*loc_id;
- c_ret_value = H5Gget_linkval(c_loc_id, c_name, c_size, c_value);
- if(c_ret_value < 0) goto DONE;
+ /*
+ * Allocate buffer to hold name of the value
+ */
+ if(*size) c_value = (char *)HDmalloc((size_t)*size);
+ if(c_value == NULL) {
+ HDfree(c_name);
+ return ret_value;
+ }
+ /*
+ * Call H5Lget_val function
+ */
+ if(H5Lget_val((hid_t)*loc_id, c_name, c_value, (size_t)*size, H5P_DEFAULT) < 0)
+ goto DONE;
- /*
- * Convert C name to FORTRAN and place it in the given buffer
- */
- HD5packFstring(c_value, _fcdtocp(value), (size_t)*size);
- ret_value = 0;
+ /*
+ * Convert C name to FORTRAN and place it in the given buffer
+ */
+ HD5packFstring(c_value, _fcdtocp(value), (size_t)*size);
+ ret_value = 0;
DONE:
- HDfree(c_value);
- HDfree(c_name);
- return ret_value ;
+ if(c_value)
+ HDfree(c_value);
+ if(c_name)
+ HDfree(c_name);
+ return ret_value;
}
/*----------------------------------------------------------------------------