summaryrefslogtreecommitdiffstats
path: root/src/H5Gdeprec.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-09-13 18:26:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-09-13 18:26:12 (GMT)
commit27a1a10fbb6101a071ddb4f5f29e3bcaeb9ef8d0 (patch)
treedc5e01059a3f849f448403a23a62a55ff2bc45f7 /src/H5Gdeprec.c
parent095762a736c3125c0190409b7c3ca01c42605ad7 (diff)
downloadhdf5-27a1a10fbb6101a071ddb4f5f29e3bcaeb9ef8d0.zip
hdf5-27a1a10fbb6101a071ddb4f5f29e3bcaeb9ef8d0.tar.gz
hdf5-27a1a10fbb6101a071ddb4f5f29e3bcaeb9ef8d0.tar.bz2
[svn-r14146] Description:
Move H5Gget_objtype_by_idx() to deprecated symbols section, replacing with H5Oget_info_by_idx() Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) AIX/32 5.3 (copper) Solaris/32 2.10 (linew) Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'src/H5Gdeprec.c')
-rw-r--r--src/H5Gdeprec.c58
1 files changed, 56 insertions, 2 deletions
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index 03b8322..65bea44 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -85,6 +85,8 @@ static herr_t H5G_get_objinfo_cb(H5G_loc_t *grp_loc/*in*/, const char *name,
H5G_own_loc_t *own_loc/*out*/);
static herr_t H5G_get_objinfo(const H5G_loc_t *loc, const char *name,
hbool_t follow_link, H5G_stat_t *statbuf/*out*/, hid_t dxpl_id);
+static H5G_obj_t H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx,
+ hid_t dxpl_id);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -1030,8 +1032,6 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Gget_objname_by_idx() */
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
/*-------------------------------------------------------------------------
* Function: H5Gget_objtype_by_idx
@@ -1074,3 +1074,57 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Gget_objtype_by_idx() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_obj_get_type_by_idx
+ *
+ * Purpose: Private function for H5Gget_objtype_by_idx.
+ * Returns the type of objects in the group by giving index.
+ *
+ * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3)
+ *
+ * Failure: Negative
+ *
+ * Programmer: Raymond Lu
+ * Nov 20, 2002
+ *
+ *-------------------------------------------------------------------------
+ */
+static H5G_obj_t
+H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id)
+{
+ H5O_linfo_t linfo; /* Link info message */
+ H5G_obj_t ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5G_obj_get_type_by_idx, H5G_UNKNOWN)
+
+ /* Sanity check */
+ HDassert(oloc);
+
+ /* Attempt to get the link info for this group */
+ if(H5G_obj_get_linfo(oloc, &linfo, dxpl_id)) {
+ if(H5F_addr_defined(linfo.fheap_addr)) {
+ /* Get the object's name from the dense link storage */
+ if((ret_value = H5G_dense_get_type_by_idx(oloc->file, dxpl_id, &linfo, idx)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type")
+ } /* end if */
+ else {
+ /* Get the object's type from the link messages */
+ if((ret_value = H5G_compact_get_type_by_idx(oloc, dxpl_id, &linfo, idx)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type")
+ } /* end else */
+ } /* end if */
+ else {
+ /* Clear error stack from not finding the link info message */
+ H5E_clear_stack(NULL);
+
+ /* Get the object's type from the symbol table */
+ if((ret_value = H5G_stab_get_type_by_idx(oloc, idx, dxpl_id)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type")
+ } /* end else */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5G_obj_get_type_by_idx() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+