summaryrefslogtreecommitdiffstats
path: root/src/H5Gpkg.h
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-09-22 02:08:54 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-09-22 02:08:54 (GMT)
commit8c8ae76bf5ba6fdc01ce73ff6988064b86e48a9d (patch)
treebdc348ec43b98a67a08790f414c72f0c6b52d9bc /src/H5Gpkg.h
parented9584cc92e4eb561ad47636c3ce87836a2ad8f0 (diff)
downloadhdf5-8c8ae76bf5ba6fdc01ce73ff6988064b86e48a9d.zip
hdf5-8c8ae76bf5ba6fdc01ce73ff6988064b86e48a9d.tar.gz
hdf5-8c8ae76bf5ba6fdc01ce73ff6988064b86e48a9d.tar.bz2
[svn-r106] Fixed some symbol table bugs. Fixed a free memory read in H5Osdim.c.
Diffstat (limited to 'src/H5Gpkg.h')
-rw-r--r--src/H5Gpkg.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index c5ccae9..74881f7 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -16,6 +16,7 @@
#ifndef _H5Gpkg_H
#define _H5Gpkg_H
+#include <H5ACprivate.h>
#include <H5Gprivate.h>
#define H5G_NODE_VERS 1 /*symbol table node version number */
@@ -24,6 +25,20 @@
#define H5G_NODE_SIZEOF_HDR(F) (H5G_NODE_SIZEOF_MAGIC + 4)
#define H5G_DEFAULT_ROOT_SIZE 32
+/*
+ * A symbol table entry. The two important fields are `name_off' and
+ * `header'. The remaining fields are used for caching information that
+ * also appears in the object header to which this symbol table entry
+ * points.
+ */
+struct H5G_entry_t {
+ hbool_t dirty; /*entry out-of-date? */
+ off_t name_off; /*offset of name within name heap */
+ haddr_t header; /*file address of object header */
+ H5G_type_t type; /*type of information cached */
+ H5G_cache_t cache; /*cached data from object header */
+ H5G_shadow_t *shadow; /*optional ptr to the shadow */
+};
/*
* A shadow is a copy of a symbol table entry which corresponds to an
@@ -68,7 +83,7 @@ typedef struct H5G_node_key_t {
*/
typedef enum H5G_oper_t {
H5G_OPER_FIND =0, /*find a symbol */
- H5G_OPER_INSERT =1, /*insert a new symbol */
+ H5G_OPER_INSERT =1 /*insert a new symbol */
} H5G_oper_t;
/*
@@ -87,7 +102,9 @@ typedef struct H5G_bt_ud1_t {
/* downward for INSERT */
H5G_entry_t entry; /*entry to insert into table */
- /* upward for FIND */
+ /* upward for FIND and INSERT */
+ haddr_t node_addr; /*address of node for this entry */
+ H5G_node_t *node_ptr; /*ptr to the node containing the entry */
H5G_entry_t *entry_ptr; /*ptr into cached symbol table node */
} H5G_bt_ud1_t;
@@ -123,6 +140,9 @@ typedef struct H5G_ac_ud1_t {
haddr_t dir_addr;
} H5G_ac_ud1_t;
+/* The cache subclass */
+extern const H5AC_class_t H5AC_SNODE[1];
+
/*
* Functions that understand symbol tables but not directories. The
* functions that understand directories are exported to the rest of
@@ -131,8 +151,8 @@ typedef struct H5G_ac_ud1_t {
haddr_t H5G_stab_new (hdf5_file_t *f, H5G_entry_t *self, size_t init);
H5G_entry_t *H5G_stab_find (hdf5_file_t *f, haddr_t addr, H5G_entry_t *self,
const char *name);
-herr_t H5G_stab_insert (hdf5_file_t *f, H5G_entry_t *self, const char *name,
- H5G_entry_t *ent);
+H5G_entry_t *H5G_stab_insert (hdf5_file_t *f, H5G_entry_t *self,
+ const char *name, H5G_entry_t *ent);
intn H5G_stab_list (hdf5_file_t *f, H5G_entry_t *self, intn maxentries,
char *names[], H5G_entry_t entries[]);
@@ -147,12 +167,17 @@ hbool_t H5G_shadow_p (H5G_entry_t *ent);
herr_t H5G_shadow_dissociate (H5G_entry_t *ent);
herr_t H5G_shadow_assoc_node (hdf5_file_t *f, H5G_node_t *sym,
H5G_ac_ud1_t *ac_udata);
-H5G_shadow_t *H5G_shadow_list (haddr_t stab_header_addr);
+H5G_shadow_t *H5G_shadow_list (hdf5_file_t *f, haddr_t stab_header_addr);
+herr_t H5G_shadow_move (hdf5_file_t *f, H5G_shadow_t *shadow,
+ const char *new_name, H5G_entry_t *new_entry,
+ haddr_t dir_addr);
/*
* Functions that understand symbol table entries.
*/
-herr_t H5G_decode_vec (hdf5_file_t *f, uint8 **pp, H5G_entry_t *ent, intn n);
-herr_t H5G_encode_vec (hdf5_file_t *f, uint8 **pp, H5G_entry_t *ent, intn n);
+herr_t H5G_ent_decode_vec (hdf5_file_t *f, uint8 **pp, H5G_entry_t *ent,
+ intn n);
+herr_t H5G_ent_encode_vec (hdf5_file_t *f, uint8 **pp, H5G_entry_t *ent,
+ intn n);
#endif