summaryrefslogtreecommitdiffstats
path: root/src/H5Gstab.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-01-07 17:14:26 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-01-07 17:14:26 (GMT)
commit159fa7a232e1961940b83f035f4c27338d26337e (patch)
treeb7344e9cfaadbbec3bc3a0576df8c264debb8239 /src/H5Gstab.c
parent1d17defdfc977c063c7ff20b5868bef9a76e5d9a (diff)
downloadhdf5-159fa7a232e1961940b83f035f4c27338d26337e.zip
hdf5-159fa7a232e1961940b83f035f4c27338d26337e.tar.gz
hdf5-159fa7a232e1961940b83f035f4c27338d26337e.tar.bz2
[svn-r151] Changes since 19980105
---------------------- ./config/freebsd2.2.1 ./config/linux Added -UH5O_DEBUG to the debug flags. Turn this on to get lots of lines on stderr to show what objects are opened and closed. ./src/H5C.o ./src/H5Cpublic.h ./test/dsets.c ./test/tfile.c Split H5Cget_prop() and H5Cset_prop() into functions for each property. ./src/H5D.c ./src/H5Dpublic.h ./src/H5Gstab.c ./src/H5O.c ./src/H5Ocont.c ./src/H5Ocstore.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Oistore.c ./src/H5Oname.c ./src/H5Onull.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Ostab.c ./src/H5P.c ./src/istore.c ./test/tohdr.c Object header functions now understand constant vs. non-constant messages. ./src/H5F.c ./src/H5Fprivate.h The file OID can be closed before other OID's. ./src/H5Flow.c H5F_addr_defined() is a macro in this file. ./src/H5G.c ./src/H5Gpublic.h ./test/tstab.c A current working group cannot be deleted. ./src/H5Gent.c ./src/H5Gpkg.h Removed unused functionality. ./src/H5public.h Includes <sys/types.h> for size_t.
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r--src/H5Gstab.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 1cf36ec..40ac893 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -89,11 +89,17 @@ H5G_stab_create (H5F_t *f, size_t init, H5G_entry_t *self/*out*/)
HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "can't create header");
}
- /* insert the symbol table message */
- if (H5O_modify (f, self, H5O_STAB, H5O_NEW_MESG, &stab)<0) {
- H5O_close (f, self);
+ /*
+ * Insert the symbol table message into the object header and the symbol
+ * table entry.
+ */
+ if (H5O_modify (self, H5O_STAB, H5O_NEW_MESG, H5O_FLAG_CONSTANT, &stab)<0) {
+ H5O_close (self);
HRETURN_ERROR (H5E_SYM, H5E_CANTINIT, FAIL, "can't create message");
}
+ self->cache.stab.btree_addr = stab.btree_addr;
+ self->cache.stab.heap_addr = stab.heap_addr;
+ self->type = H5G_CACHED_STAB;
FUNC_LEAVE (SUCCEED);
}
@@ -121,7 +127,7 @@ H5G_stab_create (H5F_t *f, size_t init, H5G_entry_t *self/*out*/)
*-------------------------------------------------------------------------
*/
herr_t
-H5G_stab_find (H5F_t *f, H5G_entry_t *grp_ent, const char *name,
+H5G_stab_find (H5G_entry_t *grp_ent, const char *name,
H5G_entry_t *obj_ent/*out*/)
{
H5G_bt_ud1_t udata; /*data to pass through B-tree */
@@ -130,12 +136,12 @@ H5G_stab_find (H5F_t *f, H5G_entry_t *grp_ent, const char *name,
FUNC_ENTER (H5G_stab_find, FAIL);
/* Check arguments */
- assert (f);
assert (grp_ent);
+ assert (grp_ent->file);
assert (name && *name);
/* set up the udata */
- if (NULL==H5O_read (f, grp_ent, H5O_STAB, 0, &stab)) {
+ if (NULL==H5O_read (grp_ent, H5O_STAB, 0, &stab)) {
HRETURN_ERROR (H5E_SYM, H5E_BADMESG, FAIL, "can't read message");
}
udata.operation = H5G_OPER_FIND;
@@ -143,7 +149,7 @@ H5G_stab_find (H5F_t *f, H5G_entry_t *grp_ent, const char *name,
udata.heap_addr = stab.heap_addr;
/* search the B-tree */
- if (H5B_find (f, H5B_SNODE, &(stab.btree_addr), &udata)<0) {
+ if (H5B_find (grp_ent->file, H5B_SNODE, &(stab.btree_addr), &udata)<0) {
HRETURN_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "not found");
}
@@ -174,8 +180,7 @@ H5G_stab_find (H5F_t *f, H5G_entry_t *grp_ent, const char *name,
*-------------------------------------------------------------------------
*/
herr_t
-H5G_stab_insert (H5F_t *f, H5G_entry_t *grp_ent, const char *name,
- H5G_entry_t *obj_ent)
+H5G_stab_insert (H5G_entry_t *grp_ent, const char *name, H5G_entry_t *obj_ent)
{
H5O_stab_t stab; /*symbol table message */
H5G_bt_ud1_t udata; /*data to pass through B-tree */
@@ -183,13 +188,13 @@ H5G_stab_insert (H5F_t *f, H5G_entry_t *grp_ent, const char *name,
FUNC_ENTER (H5G_stab_insert, FAIL);
/* check arguments */
- assert (f);
- assert (grp_ent && H5F_addr_defined (&(grp_ent->header)));
+ assert (grp_ent && grp_ent->file);
assert (name && *name);
- assert (obj_ent && H5F_addr_defined (&(obj_ent->header)));
+ assert (obj_ent && obj_ent->file);
+ assert (grp_ent->file->shared==obj_ent->file->shared);
/* initialize data to pass through B-tree */
- if (NULL==H5O_read (f, grp_ent, H5O_STAB, 0, &stab)) {
+ if (NULL==H5O_read (grp_ent, H5O_STAB, 0, &stab)) {
HRETURN_ERROR (H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table");
}
@@ -199,7 +204,7 @@ H5G_stab_insert (H5F_t *f, H5G_entry_t *grp_ent, const char *name,
udata.ent = *obj_ent;
/* insert */
- if (H5B_insert (f, H5B_SNODE, &(stab.btree_addr), &udata)<0) {
+ if (H5B_insert (grp_ent->file, H5B_SNODE, &(stab.btree_addr), &udata)<0) {
HRETURN_ERROR (H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert entry");
}
@@ -241,8 +246,8 @@ H5G_stab_insert (H5F_t *f, H5G_entry_t *grp_ent, const char *name,
*-------------------------------------------------------------------------
*/
intn
-H5G_stab_list (H5F_t *f, H5G_entry_t *grp_ent, intn maxentries,
- char *names[], H5G_entry_t entries[])
+H5G_stab_list (H5G_entry_t *grp_ent, intn maxentries, char *names[]/*out*/,
+ H5G_entry_t entries[]/*out*/)
{
H5G_bt_ud2_t udata;
H5O_stab_t stab;
@@ -251,12 +256,11 @@ H5G_stab_list (H5F_t *f, H5G_entry_t *grp_ent, intn maxentries,
FUNC_ENTER (H5G_stab_list, FAIL);
/* check args */
- assert (f);
- assert (grp_ent && H5F_addr_defined (&(grp_ent->header)));
+ assert (grp_ent && grp_ent->file);
assert (maxentries>=0);
/* initialize data to pass through B-tree */
- if (NULL==H5O_read (f, grp_ent, H5O_STAB, 0, &stab)) {
+ if (NULL==H5O_read (grp_ent, H5O_STAB, 0, &stab)) {
HRETURN_ERROR (H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table");
}
udata.entry = entries;
@@ -267,7 +271,7 @@ H5G_stab_list (H5F_t *f, H5G_entry_t *grp_ent, intn maxentries,
if (names) HDmemset (names, 0, maxentries);
/* list */
- if (H5B_list (f, H5B_SNODE, &(stab.btree_addr), &udata)<0) {
+ if (H5B_list (grp_ent->file, H5B_SNODE, &(stab.btree_addr), &udata)<0) {
if (names) {
for (i=0; i<maxentries; i++) H5MM_xfree (names[i]);
}