summaryrefslogtreecommitdiffstats
path: root/src/H5Gstab.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-07-17 19:35:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-07-17 19:35:09 (GMT)
commit4be636f4f00271f85802fbb6ef079146f2dbf7fb (patch)
tree0a3d45b3e72f36a0b71087b194b328edd88d12cc /src/H5Gstab.c
parenta926dc97d531c87ca098cfaac0b500e808ddbd7b (diff)
downloadhdf5-4be636f4f00271f85802fbb6ef079146f2dbf7fb.zip
hdf5-4be636f4f00271f85802fbb6ef079146f2dbf7fb.tar.gz
hdf5-4be636f4f00271f85802fbb6ef079146f2dbf7fb.tar.bz2
[svn-r13984] Description:
Various code cleanups and refactor recent changes for h5stat to fit into the existing library data structures better. Tested on: Mac OS X/32 10.4.10 (amazon) FreeBSD/32 6.2 (duty) Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r--src/H5Gstab.c81
1 files changed, 42 insertions, 39 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 9e9f91b..2bc525c 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -604,6 +604,48 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5G_stab_bh_size
+ *
+ * Purpose: Retrieve storage for btree and heap (1.6)
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi
+ * June 25 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5G_stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, H5_ih_info_t *bh_info)
+{
+ H5B_info_ud_t bh_udata; /* User-data for B-tree callbacks */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(H5G_stab_bh_size, FAIL)
+
+ /* Sanity check */
+ HDassert(f);
+ HDassert(stab);
+ HDassert(bh_info);
+
+ /* Set up user data for B-tree callback */
+ bh_udata.udata = NULL;
+ bh_udata.btree_size = &(bh_info->index_size);
+
+ /* Get the B-tree & symbol table node size info */
+ if(H5B_iterate_size(f, dxpl_id, H5B_SNODE, H5G_node_iterate_size, stab->btree_addr, &bh_udata) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "iteration operator failed")
+
+ /* Get the size of the local heap for the group */
+ if(H5HL_heapsize(f, dxpl_id, stab->heap_addr, &(bh_info->heap_size)) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "iteration operator failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5G_stab_bh_size() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5G_stab_get_name_by_idx_cb
*
* Purpose: Callback for B-tree iteration 'by index' info query to
@@ -1046,43 +1088,4 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G_stab_lookup_by_idx() */
-
-/*-------------------------------------------------------------------------
- * Function: H5G_stab_bh_info
- *
- * Purpose: Retrieve storage for btree and heap (1.6)
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Vailin Choi
- * June 25 2007
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5G_stab_bh_info(H5O_loc_t *oloc, H5O_stab_t *stab, hid_t dxpl_id, H5_ih_info_t *bh_info)
-{
- hsize_t stab_size=0; /* storage used for symbol table nodes */
- herr_t ret_value = SUCCEED;
-
- H5B_info_ud_t bh_udata;
- FUNC_ENTER_NOAPI(H5G_stab_bh_info, FAIL)
-
- /* Sanity check */
- HDassert(oloc);
- HDassert(stab);
- HDassert(bh_info);
-
- bh_udata.udata = NULL;
- bh_udata.btree_size = &(bh_info->index_size);
-
- if (H5B_iterate_btree_size(oloc->file, dxpl_id, H5B_SNODE, H5G_btree_node_iterate, stab->btree_addr, &bh_udata) <0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "iteration operator failed")
-
- if (H5HL_heapsize(oloc->file, dxpl_id, stab->heap_addr, &(bh_info->heap_size)) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "iteration operator failed")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_stab_bh_info() */