diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-09-13 18:26:12 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-09-13 18:26:12 (GMT) |
commit | 27a1a10fbb6101a071ddb4f5f29e3bcaeb9ef8d0 (patch) | |
tree | dc5e01059a3f849f448403a23a62a55ff2bc45f7 /src/H5Gcompact.c | |
parent | 095762a736c3125c0190409b7c3ca01c42605ad7 (diff) | |
download | hdf5-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/H5Gcompact.c')
-rw-r--r-- | src/H5Gcompact.c | 134 |
1 files changed, 68 insertions, 66 deletions
diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 68d5ac0..da19ee5 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -260,72 +260,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_compact_get_type_by_idx - * - * Purpose: Returns the type of objects in the group by giving index. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Sep 12, 2005 - * - *------------------------------------------------------------------------- - */ -H5G_obj_t -H5G_compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, - hsize_t idx) -{ - H5G_link_table_t ltable = {0, NULL}; /* Link table */ - H5G_obj_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_compact_get_type_by_idx, H5G_UNKNOWN) - - /* Sanity check */ - HDassert(oloc); - - /* Build table of all link messages */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5G_UNKNOWN, "can't create link message table") - - /* Check for going out of bounds */ - if(idx >= ltable.nlinks) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5G_UNKNOWN, "index out of bound") - - /* Determine type of object */ - if(ltable.lnks[idx].type == H5L_TYPE_SOFT) - ret_value = H5G_LINK; - else if(ltable.lnks[idx].type >= H5L_TYPE_UD_MIN) - ret_value = H5G_UDLINK; - else if(ltable.lnks[idx].type == H5L_TYPE_HARD){ - H5O_loc_t tmp_oloc; /* Temporary object location */ - H5O_type_t obj_type; /* Type of object at location */ - - /* Build temporary object location */ - tmp_oloc.file = oloc->file; - tmp_oloc.addr = ltable.lnks[idx].u.hard.addr; - - /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") - - /* Map to group object type */ - if(H5G_UNKNOWN == (ret_value = H5G_map_obj_type(obj_type))) - HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't determine object type") - } else { - HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "unknown link type") - } /* end else */ - -done: - /* Release link table */ - if(ltable.lnks && H5G_link_release_table(<able) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTFREE, H5G_UNKNOWN, "unable to release link table") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_get_type_by_idx() */ - - -/*------------------------------------------------------------------------- * Function: H5G_compact_remove_common_cb * * Purpose: Common callback routine for deleting 'link' message for a @@ -645,3 +579,71 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_compact_lookup_by_idx() */ +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/*------------------------------------------------------------------------- + * Function: H5G_compact_get_type_by_idx + * + * Purpose: Returns the type of objects in the group by giving index. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Sep 12, 2005 + * + *------------------------------------------------------------------------- + */ +H5G_obj_t +H5G_compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, + hsize_t idx) +{ + H5G_link_table_t ltable = {0, NULL}; /* Link table */ + H5G_obj_t ret_value; /* Return value */ + + FUNC_ENTER_NOAPI(H5G_compact_get_type_by_idx, H5G_UNKNOWN) + + /* Sanity check */ + HDassert(oloc); + + /* Build table of all link messages */ + if(H5G_compact_build_table(oloc, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5G_UNKNOWN, "can't create link message table") + + /* Check for going out of bounds */ + if(idx >= ltable.nlinks) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5G_UNKNOWN, "index out of bound") + + /* Determine type of object */ + if(ltable.lnks[idx].type == H5L_TYPE_SOFT) + ret_value = H5G_LINK; + else if(ltable.lnks[idx].type >= H5L_TYPE_UD_MIN) + ret_value = H5G_UDLINK; + else if(ltable.lnks[idx].type == H5L_TYPE_HARD){ + H5O_loc_t tmp_oloc; /* Temporary object location */ + H5O_type_t obj_type; /* Type of object at location */ + + /* Build temporary object location */ + tmp_oloc.file = oloc->file; + tmp_oloc.addr = ltable.lnks[idx].u.hard.addr; + + /* Get the type of the object */ + if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") + + /* Map to group object type */ + if(H5G_UNKNOWN == (ret_value = H5G_map_obj_type(obj_type))) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't determine object type") + } else { + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "unknown link type") + } /* end else */ + +done: + /* Release link table */ + if(ltable.lnks && H5G_link_release_table(<able) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTFREE, H5G_UNKNOWN, "unable to release link table") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_compact_get_type_by_idx() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + |