summaryrefslogtreecommitdiffstats
path: root/src/H5Gstab.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-04-14 04:51:53 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-04-14 04:51:53 (GMT)
commit1f9f510ad41b569bfc8f463a2aa7edf50a94b484 (patch)
tree4d8b2de21967b8607631b67b65b25ce97e38d9be /src/H5Gstab.c
parent32aed76605ffaf1c46f91526ce195ca40c0aadc8 (diff)
downloadhdf5-1f9f510ad41b569bfc8f463a2aa7edf50a94b484.zip
hdf5-1f9f510ad41b569bfc8f463a2aa7edf50a94b484.tar.gz
hdf5-1f9f510ad41b569bfc8f463a2aa7edf50a94b484.tar.bz2
[svn-r6655] Purpose:
New feature. Description: Added ability to release space used for storing symbol table entries and nodes when a group is deleted in a file. Platforms tested: FreeBSD 4.8 (sleipnir) w/C++ Linux 2.4 (burrwhite) w/FORTRAN Solaris 2.7 (arabica) w/FORTRAN IRIX64 6.5 (modi4) w/parallel & FORTRAN (h5committest not run due to my ongoing difficulties with C++ on burrwhite).
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r--src/H5Gstab.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index ff5e735..b5591b8 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -408,3 +408,48 @@ done:
FUNC_LEAVE_NOAPI(ret_value);
}
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_stab_delete
+ *
+ * Purpose: Delete entire symbol table information from file
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, March 20, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5G_stab_delete(H5F_t *f, hid_t dxpl_id, haddr_t btree_addr, haddr_t heap_addr)
+{
+ H5G_bt_ud1_t udata; /*data to pass through B-tree */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(H5G_stab_delete, FAIL);
+
+ assert(f);
+ assert(H5F_addr_defined(btree_addr));
+ assert(H5F_addr_defined(heap_addr));
+
+ /* Set up user data for B-tree deletion */
+ HDmemset(&udata, 0, sizeof udata);
+ udata.operation = H5G_OPER_REMOVE;
+ udata.name = NULL;
+ udata.heap_addr = heap_addr;
+
+ /* Delete entire B-tree */
+ if(H5B_delete(f, dxpl_id, H5B_SNODE, btree_addr, &udata)<0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table B-tree");
+
+ /* Delete local heap for names */
+ if(H5HL_delete(f, dxpl_id, heap_addr)<0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table heap");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5G_stab_delete() */
+