summaryrefslogtreecommitdiffstats
path: root/src/H5Oshared.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-07-20 17:58:37 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-07-20 17:58:37 (GMT)
commit34595bac3b5f0b2dad3050907c07e023a6972097 (patch)
tree34ce0884c518396dd75dfc88faf15084ee18aa05 /src/H5Oshared.c
parent1dbacc8377754e33e8088ad6c7895a5f68bf7dfb (diff)
downloadhdf5-34595bac3b5f0b2dad3050907c07e023a6972097.zip
hdf5-34595bac3b5f0b2dad3050907c07e023a6972097.tar.gz
hdf5-34595bac3b5f0b2dad3050907c07e023a6972097.tar.bz2
[svn-r518] Changes since 19980720
---------------------- ./doc/html/H5.format.html ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Osdspace.c ./src/H5Oshared.c Added version numbers to some object header messages so we can update them easier in the future. The library currently just gives up if the version numbers don't match, but in the future the library could handle multiple versions of a message. ./test/testhdf5.c Removed an argument from the H5version() call that I missed last time.
Diffstat (limited to 'src/H5Oshared.c')
-rw-r--r--src/H5Oshared.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index f485143..198466b 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -38,6 +38,8 @@ const H5O_class_t H5O_SHARED[1] = {{
H5O_shared_debug, /*debug method */
}};
+#define H5O_SHARED_VERSION 1
+
/* Interface initialization */
#define PABLO_MASK H5O_shared_mask
static hbool_t interface_initialize_g = FALSE;
@@ -57,14 +59,15 @@ static hbool_t interface_initialize_g = FALSE;
* Thursday, April 2, 1998
*
* Modifications:
- *
+ * Robb Matzke, 1998-07-20
+ * Added a version number to the beginning of the message.
*-------------------------------------------------------------------------
*/
static void *
H5O_shared_decode (H5F_t *f, const uint8 *buf, H5O_shared_t __unused__ *sh)
{
H5O_shared_t *mesg;
- uintn flags;
+ uintn flags, version;
FUNC_ENTER (H5O_shared_decode, NULL);
@@ -79,10 +82,21 @@ H5O_shared_decode (H5F_t *f, const uint8 *buf, H5O_shared_t __unused__ *sh)
"memory allocation failed");
}
+ /* Version */
+ version = *buf++;
+ if (version!=H5O_SHARED_VERSION) {
+ HRETURN_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL,
+ "bad version number for shared object message");
+ }
+
+ /* Flags */
flags = *buf++;
mesg->in_gh = (flags & 0x01);
- buf += 7; /*reserved*/
+ /* Reserved */
+ buf += 6;
+
+ /* Body */
if (mesg->in_gh) {
H5F_addr_decode (f, &buf, &(mesg->u.gh.addr));
INT32DECODE (buf, mesg->u.gh.idx);
@@ -107,6 +121,8 @@ H5O_shared_decode (H5F_t *f, const uint8 *buf, H5O_shared_t __unused__ *sh)
* Thursday, April 2, 1998
*
* Modifications:
+ * Robb Matzke, 1998-07-20
+ * Added a version number to the beginning of the message.
*
*-------------------------------------------------------------------------
*/
@@ -124,6 +140,7 @@ H5O_shared_encode (H5F_t *f, uint8 *buf/*out*/, const void *_mesg)
assert (mesg);
/* Encode */
+ *buf++ = H5O_SHARED_VERSION;
flags = mesg->in_gh ? 0x01 : 0x00;
*buf++ = flags;
*buf++ = 0; /*reserved 1*/
@@ -132,7 +149,6 @@ H5O_shared_encode (H5F_t *f, uint8 *buf/*out*/, const void *_mesg)
*buf++ = 0; /*reserved 4*/
*buf++ = 0; /*reserved 5*/
*buf++ = 0; /*reserved 6*/
- *buf++ = 0; /*reserved 7*/
if (mesg->in_gh) {
H5F_addr_encode (f, &buf, &(mesg->u.gh.addr));