summaryrefslogtreecommitdiffstats
path: root/src/H5Gstab.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-09-22 15:27:26 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-09-22 15:27:26 (GMT)
commit6d9af583912f6cd35cdac05283740fdccc489cc4 (patch)
tree9c55a12cac6cdc6e7db890ce9f12e8fbbdd0bd39 /src/H5Gstab.c
parentb20de8612aac8f94916dd7813bec0c398c9bff4f (diff)
downloadhdf5-6d9af583912f6cd35cdac05283740fdccc489cc4.zip
hdf5-6d9af583912f6cd35cdac05283740fdccc489cc4.tar.gz
hdf5-6d9af583912f6cd35cdac05283740fdccc489cc4.tar.bz2
[svn-r714] Changes since 19980911
---------------------- This checkin is to fix a couple bugs for Jim Reus. Some features are not fully implemented but it shouldn't break anything. ./config/conclude.in ./test/Makefile.in `make clean' removes object files from the test directory as well as a couple more *.h5 temp files. ./config/hpux9.03 [NEW] New config file for HP/UX 9.03 ./src/H5B.c ./src/H5Bprivate.h ./src/H5Fistore.c ./src/H5G.c ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5Gprivate.h ./src/H5Gstab.c Not-yet-complete version of object removal. ./src/H5Fistore.c ./src/H5Fprivate.h Experimental optimizations, disabled by default. ./src/H5Fprivate.h Default low-level driver was changed to H5F_LOW_SEC instead of H5F_LOW_STDIO because the sec2 driver is much easier to debug. ./src/H5Fsplit.c ./src/H5G.c ./src/H5Z.c Changed a couple return statements to HRETURN. ./src/H5Odtype.c Removed a check for nested compound data types from back when they weren't implemented that raised an error. ./tools/h5tools.c Increased temp buffer sizes and added a check for buffer overflow so we fail an assertion (hopefully). This really needs to be fixed sometime. Added support for printing H5T_STRING data types.
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r--src/H5Gstab.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index b2fa9d2..e5a5bab 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -203,10 +203,54 @@ H5G_stab_insert(H5G_entry_t *grp_ent, const char *name, H5G_entry_t *obj_ent)
/* insert */
if (H5B_insert(grp_ent->file, H5B_SNODE, &(stab.btree_addr), &udata) < 0) {
- HRETURN_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert entry");
+ HRETURN_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry");
}
/* update the name offset in the entry */
obj_ent->name_off = udata.ent.name_off;
FUNC_LEAVE(SUCCEED);
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_stab_remove
+ *
+ * Purpose: Remove NAME from a symbol table.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Robb Matzke
+ * Thursday, September 17, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5G_stab_remove(H5G_entry_t *grp_ent, const char *name)
+{
+ H5O_stab_t stab; /*symbol table message */
+ H5G_bt_ud1_t udata; /*data to pass through B-tree */
+
+ FUNC_ENTER(H5G_stab_remove, FAIL);
+ assert(grp_ent && grp_ent->file);
+ assert(name && *name);
+
+ /* initialize data to pass through B-tree */
+ if (NULL==H5O_read(grp_ent, H5O_STAB, 0, &stab)) {
+ HRETURN_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table");
+ }
+ udata.operation = H5G_OPER_REMOVE;
+ udata.name = name;
+ udata.heap_addr = stab.heap_addr;
+ HDmemset(&(udata.ent), 0, sizeof(udata.ent));
+
+ /* remove */
+ if (H5B_remove(grp_ent->file, H5B_SNODE, &(stab.btree_addr), &udata)<0) {
+ HRETURN_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to remove entry");
+ }
+
+ FUNC_LEAVE(SUCCEED);
+}