summaryrefslogtreecommitdiffstats
path: root/src/H5G.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-11-17 15:48:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-11-17 15:48:41 (GMT)
commit1482d3e9cbc0796803e8cea47178b9878ef7a633 (patch)
tree8234b8b564f03e342d5ab1c459ed15ceb1a5e61b /src/H5G.c
parentd3206adb2efdc50d998352ea7abcf225eadb64d5 (diff)
downloadhdf5-1482d3e9cbc0796803e8cea47178b9878ef7a633.zip
hdf5-1482d3e9cbc0796803e8cea47178b9878ef7a633.tar.gz
hdf5-1482d3e9cbc0796803e8cea47178b9878ef7a633.tar.bz2
[svn-r12932] Description:
Basic support for H5Literate() routine. Still needs to be fleshed out and refactored to simplify. Also, needs tests. :-) Tested on: FreeBSD/32 4.11 (sleipnir) Linux/32 2.4 (heping) Linux/64 2.4 (mir) AIX/32 5.? (copper) Mac OS X/32 10.4.8 (amazon)
Diffstat (limited to 'src/H5G.c')
-rw-r--r--src/H5G.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/H5G.c b/src/H5G.c
index 995498b..824c917 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -577,8 +577,9 @@ herr_t
H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op,
void *op_data)
{
- int last_obj; /* Index of last object looked at */
- int idx; /* Internal location to hold index */
+ H5G_link_iterate_t lnk_op; /* Link operator */
+ hsize_t last_obj; /* Index of last object looked at */
+ hsize_t idx; /* Internal location to hold index */
herr_t ret_value;
FUNC_ENTER_API(H5Giterate, FAIL)
@@ -587,17 +588,21 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op,
/* Check args */
if(!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
- idx = (idx_p == NULL ? 0 : *idx_p);
- if(idx < 0)
+ if(idx_p && *idx_p < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified")
if(!op)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified")
/* Set number of objects looked at to zero */
last_obj = 0;
+ idx = (hsize_t)(idx_p == NULL ? 0 : *idx_p);
+
+ /* Build link operator info */
+ lnk_op.op_type = H5G_LINK_OP_OLD;
+ lnk_op.u.old_op = op;
/* Call private function. */
- if((ret_value = H5G_obj_iterate(loc_id, name, H5_ITER_INC, idx, &last_obj, op, op_data, H5AC_ind_dxpl_id)) < 0)
+ if((ret_value = H5G_obj_iterate(loc_id, name, H5L_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5AC_ind_dxpl_id)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed")
/* Check for too high of a starting index (ex post facto :-) */
@@ -607,7 +612,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op,
/* Set the index we stopped at */
if(idx_p)
- *idx_p = last_obj;
+ *idx_p = (int)last_obj;
done:
FUNC_LEAVE_API(ret_value)
@@ -1715,7 +1720,7 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link,
if(ret >=0 && linfo.type != H5L_TYPE_HARD)
{
- statbuf->linklen = linfo.u.link_size;
+ statbuf->linklen = linfo.u.val_size;
if(linfo.type == H5L_TYPE_SOFT)
statbuf->type = H5G_LINK;
else /* UD link. H5L_get_info checked for invalid link classes */