diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-17 15:48:41 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-17 15:48:41 (GMT) |
commit | 1482d3e9cbc0796803e8cea47178b9878ef7a633 (patch) | |
tree | 8234b8b564f03e342d5ab1c459ed15ceb1a5e61b /src/H5Gnode.c | |
parent | d3206adb2efdc50d998352ea7abcf225eadb64d5 (diff) | |
download | hdf5-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/H5Gnode.c')
-rw-r--r-- | src/H5Gnode.c | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 5eb3660..f05fb90 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1483,24 +1483,43 @@ H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t ad HGOTO_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to unprotect symbol name") heap = NULL; name = NULL; - /* Check for internal callback with link info */ - if(udata->lib_internal) { - H5O_link_t lnk; /* Link for entry */ - - /* Convert the entry to a link */ - if(H5G_link_convert(f, dxpl_id, &lnk, udata->heap_addr, &ents[u], s) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_ITER_ERROR, "unable to convert symbol table entry to link") - - /* Call the library's callback */ - ret_value = (udata->op.lib_op)(&lnk, udata->op_data); - - /* Release memory for link object */ - if(H5O_reset(H5O_LINK_ID, &lnk) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, H5B_ITER_ERROR, "unable to release link message") - } /* end if */ - else - /* Make the application's callback */ - ret_value = (udata->op.app_op)(udata->group_id, s, udata->op_data); + /* Check which type of callback to make */ + switch(udata->lnk_op->op_type) { + case H5G_LINK_OP_OLD: + /* Make the old-type application callback */ + ret_value = (udata->lnk_op->u.old_op)(udata->group_id, s, udata->op_data); + break; + + case H5G_LINK_OP_APP: + { + H5L_info_t info; /* Link info for entry */ + + /* Make a link info for an entry */ + if(H5G_ent_to_info(f, dxpl_id, &info, udata->heap_addr, &ents[u]) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_ITER_ERROR, "unable to get info for symbol table entry") + + /* Make the application callback */ + ret_value = (udata->lnk_op->u.app_op)(udata->group_id, s, &info, udata->op_data); + } /* end if */ + break; + + case H5G_LINK_OP_LIB: + /* Call the library's callback */ + { + H5O_link_t lnk; /* Link for entry */ + + /* Convert the entry to a link */ + if(H5G_ent_to_link(f, dxpl_id, &lnk, udata->heap_addr, &ents[u], s) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_ITER_ERROR, "unable to convert symbol table entry to link") + + /* Call the library's callback */ + ret_value = (udata->lnk_op->u.lib_op)(&lnk, udata->op_data); + + /* Release memory for link object */ + if(H5O_reset(H5O_LINK_ID, &lnk) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, H5B_ITER_ERROR, "unable to release link message") + } /* end if */ + } /* end switch */ /* Free the memory for the name, if we used a dynamically allocated buffer */ if(s != buf) |