summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Tf.c
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2002-10-01 18:55:47 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2002-10-01 18:55:47 (GMT)
commit01a577a4e90c6fcd66888e69705292cd57232da8 (patch)
treeb5e5eeb79887d20a98b397f3a13d05dfa5573202 /fortran/src/H5Tf.c
parent09325c1da67ed0b747b70951f1e373ddd42f9478 (diff)
downloadhdf5-01a577a4e90c6fcd66888e69705292cd57232da8.zip
hdf5-01a577a4e90c6fcd66888e69705292cd57232da8.tar.gz
hdf5-01a577a4e90c6fcd66888e69705292cd57232da8.tar.bz2
[svn-r5956]
Purpose: Added new F90 APIs Description: I added new F90 APIs, tests, and documentation for the following functions: h5fget_obj_count_f h5pequal_f h5tget_member_index_f h5fget_obj_ids_f h5pget_fclose_degree_f h5pset_fclose_degree_f Documentation for exisiting functions was missing: h5freopen_f, h5fflush_f, h5fmount_f, h5unmount_f, h5fget_create_plist_f, h5fget_access_plist_f. Platforms tested: Solaris 2.7, Linux 2.2 and IRIX64-6.5
Diffstat (limited to 'fortran/src/H5Tf.c')
-rw-r--r--fortran/src/H5Tf.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c
index 332a9cd..789649f 100644
--- a/fortran/src/H5Tf.c
+++ b/fortran/src/H5Tf.c
@@ -987,6 +987,49 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* index, _fcd member_name, int_f
ret_value = 0;
return ret_value;
}
+/*----------------------------------------------------------------------------
+ * Name: h5tget_member_index_c
+ * Purpose: Call H5Tget_member_index to get an index of
+ * the specified datatype filed or member.
+ * Inputs: type_id - datatype identifier
+ * name - name of the datatype within file or group
+ * namelen - name length
+ * Outputs: index - 0-based index
+ * Returns: 0 on success, -1 on failure
+ * Programmer: Elena Pourmal
+ * Thursday, September 26, 2002
+ * Modifications:
+ *---------------------------------------------------------------------------*/
+int_f
+nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *index)
+{
+ int ret_value = -1;
+ char *c_name;
+ int c_namelen;
+ hid_t c_type_id;
+ int c_index;
+
+ /*
+ * Convert FORTRAN name to C name
+ */
+ c_namelen = *namelen;
+ c_name = (char *)HD5f2cstring(name, c_namelen);
+ if (c_name == NULL) return ret_value;
+
+ /*
+ * Call H5Tget_member_index function.
+ */
+ c_type_id = (hid_t)*type_id;
+ c_index = H5Tget_member_index(c_type_id, c_name);
+
+ if (c_index < 0) goto DONE;
+ *index = (int_f)c_index;
+DONE:
+ HDfree(c_name);
+ ret_value = 0;
+ return ret_value;
+}
+
/*----------------------------------------------------------------------------
* Name: h5tget_member_offset_c