From 29bf0662db641fde339ff9237bd1277509a047f1 Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Mon, 20 Jul 1998 09:41:13 -0500 Subject: [svn-r516] Changes since 19980720 ---------------------- ./doc/html/H5.format.html ./src/H5F.c ./src/H5Gprivate.h ./src/H5Oshared.c Added file alignment fields: the boot block has an extra reserved address field. The symbol table entry scratch pad space was reduced from 24 bytes to 16 bytes. The index permutation was moved earlier in the data type message for compound data types and extra padding was added. Four bytes of padding was added to the shared message format. --- README | 2 +- doc/html/H5.format.html | 33 ++++++++++++++++++++++++--------- src/H5F.c | 10 ++++++++-- src/H5Gprivate.h | 2 +- src/H5Odtype.c | 45 ++++++++++++++++++++++++++++++++++++++------- 5 files changed, 72 insertions(+), 20 deletions(-) diff --git a/README b/README index 9b4cfd7..6bec113 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -This is hdf5-1.0.24a released on 1998-06-19 14:51 UTC +This is hdf5-1.0.24a released on 1998-06-20 14:23 UTC Please refer to the INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/doc/html/H5.format.html b/doc/html/H5.format.html index 0b4da0c..ce7e112 100644 --- a/doc/html/H5.format.html +++ b/doc/html/H5.format.html @@ -179,6 +179,10 @@ + Reserved Address + + +
Root Group Symbol Table Entry

@@ -390,6 +394,13 @@ + Reserved Address + This address field is present for alignment purposes and + is always set to the undefined address value (all bits + set). + + + Root Group Symbol Table Entry This symbol-table entry (described later in this document) refers to the entry point into the group @@ -705,7 +716,7 @@ -

Scratch-pad Space (24 bytes)


+

Scratch-pad Space (16 bytes)


@@ -2142,36 +2153,40 @@

Name (null terminated, multiple of - four bytes)


+ eight bytes)


Byte Offset of Member in Compound Instance - + Dimensionality reserved - Size of Dimension 0 (optional) + Dimension Permutation - Size of Dimension 1 (optional) + Reserved - Size of Dimension 2 (optional) + Size of Dimension 0 (required) - Size of Dimension 3 (optional) + Size of Dimension 1 (required) - Dimension Permutation + Size of Dimension 2 (required) + + + + Size of Dimension 3 (required) @@ -3093,7 +3108,7 @@ data-type.
Quincey Koziol
Robb Matzke
-Last modified: Mon Jul 20 09:16:11 EDT 1998 +Last modified: Mon Jul 20 10:17:03 EDT 1998 diff --git a/src/H5F.c b/src/H5F.c index e946b17..96fe5d6 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -742,6 +742,7 @@ H5F_open(const char *name, uintn flags, haddr_t addr1, addr2; /*temporary address */ H5G_entry_t root_ent; /*root symbol table entry */ const H5F_low_class_t *type = NULL; /*low-level file driver */ + haddr_t reserved_addr; /*reserved address */ FUNC_ENTER(H5F_open, NULL); @@ -996,6 +997,7 @@ H5F_open(const char *name, uintn flags, variable_size = H5F_SIZEOF_ADDR(f) + /*base address */ H5F_SIZEOF_ADDR(f) + /*global free list addr */ H5F_SIZEOF_ADDR(f) + /*logical file size */ + H5F_SIZEOF_ADDR(f) + /*reserved address*/ H5G_SIZEOF_ENTRY(f); assert(variable_size <= sizeof buf); addr1 = f->shared->boot_addr; @@ -1009,6 +1011,7 @@ H5F_open(const char *name, uintn flags, H5F_addr_decode(f, &p, &(f->shared->base_addr)); H5F_addr_decode(f, &p, &(f->shared->freespace_addr)); H5F_addr_decode(f, &p, &(f->shared->hdf5_eof)); + H5F_addr_decode(f, &p, &reserved_addr); if (H5G_ent_decode(f, &p, &root_ent) < 0) { HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root symbol entry"); @@ -1311,8 +1314,9 @@ H5Fopen (const char *filename, unsigned flags, hid_t access_id) static herr_t H5F_flush(H5F_t *f, hbool_t invalidate) { - uint8 buf[2048], *p = buf; - + uint8 buf[2048], *p = buf; + haddr_t reserved_addr; + FUNC_ENTER(H5F_flush, FAIL); /* @@ -1357,6 +1361,8 @@ H5F_flush(H5F_t *f, hbool_t invalidate) H5F_addr_encode(f, &p, &(f->shared->base_addr)); H5F_addr_encode(f, &p, &(f->shared->freespace_addr)); H5F_addr_encode(f, &p, &(f->shared->hdf5_eof)); + H5F_addr_undef(&reserved_addr); + H5F_addr_encode(f, &p, &reserved_addr); H5G_ent_encode(f, &p, H5G_entof(f->shared->root_grp)); /* update file length if necessary */ diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 03f0348..0f8f773 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -38,7 +38,7 @@ /* * The disk size for a symbol table entry... */ -#define H5G_SIZEOF_SCRATCH 24 +#define H5G_SIZEOF_SCRATCH 16 #define H5G_SIZEOF_ENTRY(F) \ (H5F_SIZEOF_SIZE(F) + /*offset of name into heap */ \ H5F_SIZEOF_ADDR(F) + /*address of object header */ \ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index aefa335..c890a03 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -174,15 +174,22 @@ H5O_dtype_decode_helper(const uint8 **pp, H5T_t *dt) dt->u.compnd.memb[i].ndims = *(*pp)++; assert(dt->u.compnd.memb[i].ndims <= 4); *pp += 3; /*reserved bytes */ - for (j = 0; j < dt->u.compnd.memb[i].ndims; j++) { - UINT32DECODE(*pp, dt->u.compnd.memb[i].dim[j]); - } + + /* Dimension permutation */ UINT32DECODE(*pp, perm_word); dt->u.compnd.memb[i].perm[0] = (perm_word >> 0) & 0xff; dt->u.compnd.memb[i].perm[1] = (perm_word >> 8) & 0xff; dt->u.compnd.memb[i].perm[2] = (perm_word >> 16) & 0xff; dt->u.compnd.memb[i].perm[3] = (perm_word >> 24) & 0xff; dt->u.compnd.memb[i].type = H5MM_calloc (sizeof(H5T_t)); + + /* Reserved */ + *pp += 4; + + /* Dimension sizes */ + for (j=0; j<4; j++) { + UINT32DECODE(*pp, dt->u.compnd.memb[i].dim[j]); + } if (NULL==dt->u.compnd.memb[i].type) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); @@ -400,23 +407,42 @@ H5O_dtype_encode_helper(uint8 **pp, const H5T_t *dt) */ flags = dt->u.compnd.nmembs & 0xffff; for (i = 0; i < dt->u.compnd.nmembs; i++) { + /* Name, multiple of eight bytes */ HDstrcpy ((char*)(*pp), dt->u.compnd.memb[i].name); n = strlen(dt->u.compnd.memb[i].name); for (z=n+1; z%8; z++) (*pp)[z] = '\0'; *pp += z; + + /* Member offset */ UINT32ENCODE(*pp, dt->u.compnd.memb[i].offset); + + /* Dimensionality */ *(*pp)++ = dt->u.compnd.memb[i].ndims; assert(dt->u.compnd.memb[i].ndims <= 4); + + /* Reserved */ *(*pp)++ = '\0'; *(*pp)++ = '\0'; *(*pp)++ = '\0'; - for (j = 0; j < dt->u.compnd.memb[i].ndims; j++) { - UINT32ENCODE(*pp, dt->u.compnd.memb[i].dim[j]); - } + + /* Dimension permutation */ for (j = 0, perm_word = 0; j < dt->u.compnd.memb[i].ndims; j++) { perm_word |= dt->u.compnd.memb[i].perm[j] << (8 * j); } UINT32ENCODE(*pp, perm_word); + + /* Reserved */ + UINT32ENCODE(*pp, 0); + + /* Dimensions */ + for (j=0; ju.compnd.memb[i].ndims; j++) { + UINT32ENCODE(*pp, dt->u.compnd.memb[i].dim[j]); + } + for (/*void*/; j<4; j++) { + UINT32ENCODE(*pp, 0); + } + + /* Subtype */ if (H5O_dtype_encode_helper(pp, dt->u.compnd.memb[i].type)<0) { HRETURN_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode member type"); @@ -597,7 +623,12 @@ H5O_dtype_size(H5F_t *f, const void *mesg) case H5T_COMPOUND: for (i = 0; i < dt->u.compnd.nmembs; i++) { ret_value += ((HDstrlen(dt->u.compnd.memb[i].name) + 8) / 8) * 8; - ret_value += 12 + dt->u.compnd.memb[i].ndims * 4; + ret_value += 4 + /*member offset*/ + 1 + /*dimensionality*/ + 3 + /*reserved*/ + 4 + /*permutation*/ + 4 + /*reserved*/ + 16; /*dimensions*/ ret_value += H5O_dtype_size(f, dt->u.compnd.memb[i].type); } break; -- cgit v0.12