summaryrefslogtreecommitdiffstats
path: root/hl/fortran/src/H5LTfc.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-04-29 20:12:34 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-04-29 20:12:34 (GMT)
commit68e4b6ef398c946b723955553f00db2fd289b8d3 (patch)
treebf063338e311f83c89bba7418499aa90e5054104 /hl/fortran/src/H5LTfc.c
parent2fe77fad31a969fec3594339e8854e1b739b829e (diff)
downloadhdf5-68e4b6ef398c946b723955553f00db2fd289b8d3.zip
hdf5-68e4b6ef398c946b723955553f00db2fd289b8d3.tar.gz
hdf5-68e4b6ef398c946b723955553f00db2fd289b8d3.tar.bz2
[svn-r26970] Added new pointer APIs for h5ltmake_dataset ahd h5ltread_dataset.
Diffstat (limited to 'hl/fortran/src/H5LTfc.c')
-rw-r--r--hl/fortran/src/H5LTfc.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c
index b957d17..dc3c7b9 100644
--- a/hl/fortran/src/H5LTfc.c
+++ b/hl/fortran/src/H5LTfc.c
@@ -598,7 +598,7 @@ h5ltget_attribute_c(hid_t_f *loc_id,
_fcd dsetname,
size_t_f *attrnamelen,
_fcd attrname,
- void *buf, char *dtype)
+ void *buf, char *dtype, size_t_f *size_f)
{
int ret_value = -1;
herr_t ret;
@@ -623,20 +623,23 @@ h5ltget_attribute_c(hid_t_f *loc_id,
c_loc_id = (hid_t)*loc_id;
if( HDstrncmp(dtype,"I",1) == 0) {
- if(sizeof(int_f) == sizeof(int))
- ret = H5LTget_attribute_int(c_loc_id,c_name,c_attrname,(int *)buf);
- else if (sizeof(int_f) == sizeof(long))
- ret = H5LTget_attribute_long(c_loc_id,c_name,c_attrname,(long *)buf);
- else if (sizeof(int_f) == sizeof(long long))
- ret = H5LTget_attribute_long_long(c_loc_id,c_name,c_attrname,(long long *)buf);
+ if((size_t)*size_f == sizeof(int))
+ ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_INT,buf);
+ else if ((size_t)*size_f == sizeof(long))
+ ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_LONG,buf);
+ else if ((size_t)*size_f == sizeof(long long))
+ ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_LLONG,buf);
else
goto done;
} else if ( HDstrncmp(dtype,"R",1) == 0 ) {
- ret = H5LTget_attribute_float(c_loc_id,c_name,c_attrname,(float*)buf);
- } else if ( HDstrncmp(dtype,"D",1) == 0 ) {
- ret = H5LTget_attribute_double(c_loc_id,c_name,c_attrname,(double *)buf);
+ if((size_t)*size_f == sizeof(float))
+ ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_FLOAT,buf);
+ else if((size_t)*size_f == sizeof(double))
+ ret = H5LTget_attribute(c_loc_id,c_name,c_attrname,H5T_NATIVE_DOUBLE,buf);
+ else
+ goto done;
}
-
+
if (ret < 0)
goto done;