summaryrefslogtreecommitdiffstats
path: root/src/H5Gent.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-01-06 03:07:15 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-01-06 03:07:15 (GMT)
commit1d17defdfc977c063c7ff20b5868bef9a76e5d9a (patch)
tree718aad3e93d1406d4a97a0fcafeb3f7acd8720db /src/H5Gent.c
parentdfff2572ca834f41d27510244d2886170626b265 (diff)
downloadhdf5-1d17defdfc977c063c7ff20b5868bef9a76e5d9a.zip
hdf5-1d17defdfc977c063c7ff20b5868bef9a76e5d9a.tar.gz
hdf5-1d17defdfc977c063c7ff20b5868bef9a76e5d9a.tar.bz2
[svn-r150] Changes since 19971219
---------------------- ./src/H5private.h Changed HDF5_MAJOR_VERSION to 5 ./src/H5Aprivate.h ./src/H5Apublic.h Added group atoms. ./src/H5D.c ./src/H5P.c ./test/istore.c ./test/tohdr.c ./test/tstab.c Updated for symbol table interface changes. ./src/H5F.c ./src/H5Fprivate.h Simpler handling of special case files: empty files and files with a single object. ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5Gprivate.h ./src/H5Gpublic.h ./src/H5Gshad.c (DELETED) ./src/H5Gstab.c ./src/Makefile.in Removed shadows, simplifying code. Symbol table entries are allowed to cache only constant meta data. Fixed naming. ./src/H5O.c ./src/H5Oprivate.h Access to object headers is always done through a symbol table entry instead of a file address. Added stubs for opening and closing object headers to be used when deletion is implemented.
Diffstat (limited to 'src/H5Gent.c')
-rw-r--r--src/H5Gent.c68
1 files changed, 35 insertions, 33 deletions
diff --git a/src/H5Gent.c b/src/H5Gent.c
index b8510f7..cc33d4c 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -364,35 +364,42 @@ H5G_ent_encode (H5F_t *f, uint8 **pp, H5G_entry_t *ent)
/* check arguments */
assert (f);
assert (pp);
- assert (ent);
-
- /* encode header */
- H5F_encode_length (f, *pp, ent->name_off);
- H5F_addr_encode (f, pp, &(ent->header));
- UINT32ENCODE (*pp, ent->type);
-
- /* encode scratch-pad */
- switch (ent->type) {
- case H5G_NOTHING_CACHED:
- break;
-
- case H5G_CACHED_SDSPACE:
- assert (5*4 <= H5G_SIZEOF_SCRATCH);
- UINT32ENCODE (*pp, ent->cache.sdspace.ndim);
- UINT32ENCODE (*pp, ent->cache.sdspace.dim[0]);
- UINT32ENCODE (*pp, ent->cache.sdspace.dim[1]);
- UINT32ENCODE (*pp, ent->cache.sdspace.dim[2]);
- UINT32ENCODE (*pp, ent->cache.sdspace.dim[3]);
- break;
- case H5G_CACHED_STAB:
- assert (2*H5F_SIZEOF_ADDR (f) <= H5G_SIZEOF_SCRATCH);
- H5F_addr_encode (f, pp, &(ent->cache.stab.btree_addr));
- H5F_addr_encode (f, pp, &(ent->cache.stab.heap_addr));
- break;
-
- default:
- HDabort();
+ if (ent) {
+ /* encode header */
+ H5F_encode_length (f, *pp, ent->name_off);
+ H5F_addr_encode (f, pp, &(ent->header));
+ UINT32ENCODE (*pp, ent->type);
+
+ /* encode scratch-pad */
+ switch (ent->type) {
+ case H5G_NOTHING_CACHED:
+ break;
+
+ case H5G_CACHED_SDSPACE:
+ assert (5*4 <= H5G_SIZEOF_SCRATCH);
+ UINT32ENCODE (*pp, ent->cache.sdspace.ndim);
+ UINT32ENCODE (*pp, ent->cache.sdspace.dim[0]);
+ UINT32ENCODE (*pp, ent->cache.sdspace.dim[1]);
+ UINT32ENCODE (*pp, ent->cache.sdspace.dim[2]);
+ UINT32ENCODE (*pp, ent->cache.sdspace.dim[3]);
+ break;
+
+ case H5G_CACHED_STAB:
+ assert (2*H5F_SIZEOF_ADDR (f) <= H5G_SIZEOF_SCRATCH);
+ H5F_addr_encode (f, pp, &(ent->cache.stab.btree_addr));
+ H5F_addr_encode (f, pp, &(ent->cache.stab.heap_addr));
+ break;
+
+ default:
+ HDabort();
+ }
+ } else {
+ haddr_t undef;
+ H5F_encode_length (f, *pp, 0);
+ H5F_addr_undef (&undef);
+ H5F_addr_encode (f, pp, &undef);
+ UINT32ENCODE (*pp, H5G_NOTHING_CACHED);
}
/* fill with zero */
@@ -443,11 +450,6 @@ H5G_ent_debug (H5F_t *f, H5G_entry_t *ent, FILE *stream, intn indent,
fprintf (stream, "%*s%-*s %s\n", indent, "", fwidth,
"Dirty:",
ent->dirty ? "Yes" : "No");
- fprintf (stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Has a shadow:",
- H5G_shadow_p (ent)?"This is a shadow!" :
- (ent->shadow ? "Yes" : "No"));
-
fprintf (stream, "%*s%-*s ", indent, "", fwidth,
"Symbol type:");
switch (ent->type) {