diff options
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r-- | src/H5Gstab.c | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c index a5280b5..9ca0c90 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -33,9 +33,8 @@ /* User data for finding link information from B-tree */ typedef struct { /* downward */ - H5F_t *file; /* Pointer to file for query */ const char *name; /* Name to search for */ - H5HL_t *heap; /* Local heap for group */ + H5HL_t *heap; /* Local heap for group */ /* upward */ H5O_link_t *lnk; /* Caller's link location */ @@ -45,7 +44,7 @@ typedef struct { typedef struct H5G_bt_it_gnbi_t { /* downward */ H5G_bt_it_idx_common_t common; /* Common information for "by index" lookup */ - H5HL_t *heap; /*symbol table heap */ + H5HL_t *heap; /*symbol table heap */ /* upward */ char *name; /*member name to be returned */ @@ -67,7 +66,7 @@ typedef struct H5G_bt_it_gtbi_t { typedef struct H5G_bt_it_lbi_t { /* downward */ H5G_bt_it_idx_common_t common; /* Common information for "by index" lookup */ - H5HL_t *heap; /*symbol table heap */ + H5HL_t *heap; /*symbol table heap */ /* upward */ H5O_link_t *lnk; /*link to be returned */ @@ -99,7 +98,7 @@ typedef struct H5G_bt_it_lbi_t { herr_t H5G_stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id) { - H5HL_t *heap = NULL; /* Pointer to local heap */ + H5HL_t *heap = NULL; /* Pointer to local heap */ size_t name_offset; /* Offset of "" name */ herr_t ret_value = SUCCEED; /* Return value */ @@ -136,7 +135,7 @@ H5G_stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t d done: /* Release resources */ - if(heap && H5HL_unprotect(f, dxpl_id, heap, stab->heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -223,7 +222,7 @@ herr_t H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, H5O_link_t *obj_lnk, hid_t dxpl_id) { - H5HL_t *heap = NULL; /* Pointer to local heap */ + H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_ins_t udata; /* Data to pass through B-tree */ herr_t ret_value = SUCCEED; /* Return value */ @@ -250,7 +249,7 @@ H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, done: /* Release resources */ - if(heap && H5HL_unprotect(f, dxpl_id, heap, stab->heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -314,7 +313,7 @@ herr_t H5G_stab_remove(H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, const char *name) { - H5HL_t *heap = NULL; /* Pointer to local heap */ + H5HL_t *heap = NULL; /* Pointer to local heap */ H5O_stab_t stab; /*symbol table message */ H5G_bt_rm_t udata; /*data to pass through B-tree */ herr_t ret_value = SUCCEED; /* Return value */ @@ -343,7 +342,7 @@ H5G_stab_remove(H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, done: /* Release resources */ - if(heap && H5HL_unprotect(loc->file, dxpl_id, heap, stab.heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -366,9 +365,9 @@ herr_t H5G_stab_remove_by_idx(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n) { - H5HL_t *heap = NULL; /* Pointer to local heap */ + H5HL_t *heap = NULL; /* Pointer to local heap */ H5O_stab_t stab; /* Symbol table message */ - H5G_bt_rm_t udata; /* Data to pass through B-tree */ + H5G_bt_rm_t udata; /* Data to pass through B-tree */ H5O_link_t obj_lnk; /* Object's link within group */ hbool_t lnk_copied = FALSE; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ @@ -401,7 +400,7 @@ H5G_stab_remove_by_idx(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_ done: /* Release resources */ - if(heap && H5HL_unprotect(grp_oloc->file, dxpl_id, heap, stab.heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") /* Reset the link information, if we have a copy */ @@ -429,8 +428,8 @@ done: herr_t H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) { - H5HL_t *heap = NULL; /* Pointer to local heap */ - H5G_bt_rm_t udata; /*data to pass through B-tree */ + H5HL_t *heap = NULL; /* Pointer to local heap */ + H5G_bt_rm_t udata; /*data to pass through B-tree */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5G_stab_delete, FAIL) @@ -453,7 +452,7 @@ H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table B-tree") /* Release resources */ - if(H5HL_unprotect(f, dxpl_id, heap, stab->heap_addr) < 0) + if(H5HL_unprotect(heap) < 0) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") heap = NULL; @@ -463,7 +462,7 @@ H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) done: /* Release resources */ - if(heap && H5HL_unprotect(f, dxpl_id, heap, stab->heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -486,7 +485,7 @@ herr_t H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) { - H5HL_t *heap = NULL; /* Local heap for group */ + H5HL_t *heap = NULL; /* Local heap for group */ H5O_stab_t stab; /* Info about symbol table */ H5G_link_table_t ltable = {0, NULL}; /* Link table */ herr_t ret_value; @@ -553,7 +552,7 @@ H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, done: /* Release resources */ - if(heap && H5HL_unprotect(oloc->file, dxpl_id, heap, stab.heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") if(ltable.lnks && H5G_link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -677,7 +676,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) /* Get name offset in heap */ name_off = ent->name_off; - name = H5HL_offset_into(udata->common.f, udata->heap, name_off); + name = H5HL_offset_into(udata->heap, name_off); HDassert(name); udata->name = H5MM_strdup(name); HDassert(udata->name); @@ -703,7 +702,7 @@ ssize_t H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id) { - H5HL_t *heap = NULL; /* Pointer to local heap */ + H5HL_t *heap = NULL; /* Pointer to local heap */ H5O_stab_t stab; /* Info about local heap & B-tree */ H5G_bt_it_gnbi_t udata; /* Iteration information */ ssize_t ret_value; /* Return value */ @@ -761,7 +760,7 @@ H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, done: /* Release resources */ - if(heap && H5HL_unprotect(oloc->file, dxpl_id, heap, stab.heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") /* Free the duplicated name */ @@ -797,7 +796,7 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata) /* Check for setting link info */ if(udata->lnk) /* Convert the entry to a link */ - if(H5G_ent_to_link(udata->file, udata->lnk, udata->heap, ent, udata->name) < 0) + if(H5G_ent_to_link(udata->lnk, udata->heap, ent, udata->name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, FAIL, "unable to convert symbol table entry to link") done: @@ -822,7 +821,7 @@ herr_t H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, hid_t dxpl_id) { - H5HL_t *heap = NULL; /* Pointer to local heap */ + H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_lkp_t bt_udata; /* Data to pass through B-tree */ H5G_stab_fnd_ud_t udata; /* 'User data' to give to callback */ H5O_stab_t stab; /* Symbol table message */ @@ -844,7 +843,6 @@ H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Set up user data to pass to 'find' operation callback */ - udata.file = grp_oloc->file; udata.name = name; udata.lnk = lnk; udata.heap = heap; @@ -861,7 +859,7 @@ H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, done: /* Release resources */ - if(heap && H5HL_unprotect(grp_oloc->file, dxpl_id, heap, stab.heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) @@ -896,11 +894,11 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) HDassert(udata && udata->heap); /* Get a pointer to the link name */ - name = H5HL_offset_into(udata->common.f, udata->heap, ent->name_off); + name = H5HL_offset_into(udata->heap, ent->name_off); HDassert(name); /* Convert the entry to a link */ - if(H5G_ent_to_link(udata->common.f, udata->lnk, udata->heap, ent, name) < 0) + if(H5G_ent_to_link(udata->lnk, udata->heap, ent, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, FAIL, "unable to convert symbol table entry to link") udata->found = TRUE; @@ -926,8 +924,8 @@ herr_t H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id) { - H5HL_t *heap = NULL; /* Pointer to local heap */ - H5G_bt_it_lbi_t udata; /* Iteration information */ + H5HL_t *heap = NULL; /* Pointer to local heap */ + H5G_bt_it_lbi_t udata; /* Iteration information */ H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ @@ -976,7 +974,7 @@ H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, done: /* Release resources */ - if(heap && H5HL_unprotect(grp_oloc->file, dxpl_id, heap, stab.heap_addr) < 0) + if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) |