diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-09-26 02:50:31 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-09-26 02:50:31 (GMT) |
commit | 3706d53f155e3ac86bc8547c9287bcd857c4eca8 (patch) | |
tree | 346b21f5faf06429015d0587bcbff063ab669d1c /fortran/src | |
parent | 8f84b136fc7a9eff4354416307ae3acc8f73d038 (diff) | |
download | hdf5-3706d53f155e3ac86bc8547c9287bcd857c4eca8.zip hdf5-3706d53f155e3ac86bc8547c9287bcd857c4eca8.tar.gz hdf5-3706d53f155e3ac86bc8547c9287bcd857c4eca8.tar.bz2 |
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'fortran/src')
-rw-r--r-- | fortran/src/H5Tf.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index b1983f3..044da79 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -62,7 +62,7 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) /*---------------------------------------------------------------------------- * Name: h5tcommit_c - * Purpose: Call H5Tcommit to commit a datatype + * Purpose: Call H5Tcommit2 to commit a datatype * Inputs: loc_id - file or group identifier * name - name of the datatype within file or group * namelen - name length @@ -73,32 +73,25 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) +nh5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) { - int ret_value = -1; - char *c_name; - size_t c_namelen; - hid_t c_type_id; - hid_t c_loc_id; - herr_t status; + char *c_name = NULL; + int ret_value = -1; - /* - * Convert FORTRAN name to C name - */ - c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); - if (c_name == NULL) return ret_value; + /* Convert FORTRAN name to C name */ + if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) + goto done; - /* - * Call H5Tcommit function. - */ - c_loc_id = *loc_id; - c_type_id = *type_id; - status = H5Tcommit(c_loc_id, c_name, c_type_id); - HDfree(c_name); - if (status < 0) return ret_value; - ret_value = 0; - return ret_value; + /* Call H5Tcommit2 function */ + if(H5Tcommit2((hid_t)*loc_id, c_name, (hid_t)*type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto done; + + ret_value = 0; + +done: + if(c_name) + HDfree(c_name); + return ret_value; } /*---------------------------------------------------------------------------- |