diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2003-03-19 16:13:35 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2003-03-19 16:13:35 (GMT) |
commit | 65f5514a4ff647cff51c37e3af30d5e138733d06 (patch) | |
tree | 4d1a0934ee57c44e3703b4388dcb67a0c6c063ad /fortran/src/H5If.c | |
parent | da4bf69db756aabb448bead90a0d85d7348ff04e (diff) | |
download | hdf5-65f5514a4ff647cff51c37e3af30d5e138733d06.zip hdf5-65f5514a4ff647cff51c37e3af30d5e138733d06.tar.gz hdf5-65f5514a4ff647cff51c37e3af30d5e138733d06.tar.bz2 |
[svn-r6494]
Purpose: Catching up with the C library
Description: Added the follwoing new fortran functions
h5iget_name_f
h5tis_variavle_str_f
h5zunregister_f
h5zfilter_avail_f
h5pset_shuffle_f
h5pset_fletcher32
h5pset_edc_check_f
h5pget_edc_check_f
h5dfill_f
Solution:
Platforms tested: arabica(C and F90), burrwhite (pgcc and pgf90), modi4 (F90 and parallel)
Misc. update:
Diffstat (limited to 'fortran/src/H5If.c')
-rw-r--r-- | fortran/src/H5If.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index f17dc01..574827d 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -27,3 +27,48 @@ nh5iget_type_c (hid_t_f *obj_id, int_f *type) ret_value = 0; return ret_value; } +/*---------------------------------------------------------------------------- + * Name: h5iget_name_c + * Purpose: Call H5Iget_name to get object's name + * Inputs: obj_id - object identifier + * buf_size - size of the buffer + * Outputs: buf - buffer to hold the name + * Returns: length of the name on success, -1 on failure + * Programmer: Elena Pourmal + * Wednesday, March 12, 2003 + * Modifications: + *---------------------------------------------------------------------------*/ +int_f +nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size) +{ + int ret_value = -1; + hid_t c_obj_id; + ssize_t c_size; + size_t c_buf_size; + char *c_buf =NULL; + + /* + * Allocate buffer to hold name of an attribute + */ + c_buf_size = (size_t)*buf_size; + c_buf = (char *)HDmalloc((int)c_buf_size +1); + if (c_buf == NULL) return ret_value; + + /* + * Call H5IAget_name function + */ + c_obj_id = (hid_t)*obj_id; + c_size = H5Iget_name(c_obj_id, c_buf, c_buf_size); + if (c_size < 0) goto DONE; + + /* + * Convert C name to FORTRAN and place it in the given buffer + */ + HD5packFstring(c_buf, _fcdtocp(buf), (int)c_buf_size); + *name_size = (size_t_f)c_size; + ret_value = 0; + +DONE: + HDfree(c_buf); + return ret_value; +} |