summaryrefslogtreecommitdiffstats
path: root/src/H5Oshared.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-01-19 14:54:46 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-01-19 14:54:46 (GMT)
commit46598f35cafc38ff166783e57d5622f4a1a3153e (patch)
treec546aa50b62b9e0dff539b8a95c364b64300d4ea /src/H5Oshared.c
parentb6bd503a59621bf51e1eec9d40547a7c8b1858d8 (diff)
downloadhdf5-46598f35cafc38ff166783e57d5622f4a1a3153e.zip
hdf5-46598f35cafc38ff166783e57d5622f4a1a3153e.tar.gz
hdf5-46598f35cafc38ff166783e57d5622f4a1a3153e.tar.bz2
[svn-r13155] Description:
Add "set_crt_index" and "get_crt_index" methods for the object header message class. Unify fractal heap definitions for shared messages and attributes, under "object header" fractal heap definitions. Initial code for adding creation order index to object header messages. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Oshared.c')
-rw-r--r--src/H5Oshared.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index ab341d6..c06871e 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -72,6 +72,8 @@ const H5O_msg_class_t H5O_MSG_SHARED[1] = {{
H5O_shared_pre_copy_file, /* pre copy native value to file */
H5O_shared_copy_file, /* copy native value to file */
NULL, /* post copy native value to file */
+ NULL, /* get creation index */
+ NULL, /* set creation index */
H5O_shared_debug /*debug method */
}};
@@ -83,7 +85,7 @@ const H5O_msg_class_t H5O_MSG_SHARED[1] = {{
/* Newest version, which recognizes messages that are stored in the heap */
#define H5O_SHARED_VERSION_3 3
-#define H5O_SHARED_VERSION H5O_SHARED_VERSION_3
+#define H5O_SHARED_VERSION_LATEST H5O_SHARED_VERSION_3
/* Size of stack buffer for serialized messages */
#define H5O_MESG_BUF_SIZE 128
@@ -288,20 +290,19 @@ H5O_shared_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *buf)
HDassert(buf);
/* Decode */
- if(NULL == (mesg = H5MM_calloc (sizeof(H5O_shared_t))))
+ if(NULL == (mesg = H5MM_calloc(sizeof(H5O_shared_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Version */
version = *buf++;
- if(version < H5O_SHARED_VERSION_1 || version > H5O_SHARED_VERSION)
+ if(version < H5O_SHARED_VERSION_1 || version > H5O_SHARED_VERSION_LATEST)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for shared object message")
/* Get the shared information flags
* Flags are unused before version 3.
*/
- if(version >= H5O_SHARED_VERSION_2) {
+ if(version >= H5O_SHARED_VERSION_2)
mesg->flags = *buf++;
- }
else {
mesg->flags = H5O_COMMITTED_FLAG;
buf++;
@@ -312,9 +313,8 @@ H5O_shared_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *buf)
buf += 6;
/* Body */
- if(version == H5O_SHARED_VERSION_1) {
+ if(version == H5O_SHARED_VERSION_1)
H5G_obj_ent_decode(f, &buf, &(mesg->u.oloc));
- }
else if (version >= H5O_SHARED_VERSION_2) {
/* If this message is in the heap, copy a heap ID.
* Otherwise, it is a named datatype, so copy an H5O_loc_t.
@@ -382,9 +382,8 @@ H5O_shared_encode(H5F_t *f, uint8_t *buf/*out*/, const void *_mesg)
/* If this message is shared in the heap, we need to use version 3 of the
* encoding and encode the SHARED_IN_HEAP flag.
*/
- if(mesg->flags & H5O_SHARED_IN_HEAP_FLAG || H5F_USE_LATEST_FORMAT(f)) {
- version = H5O_SHARED_VERSION;
- }
+ if(mesg->flags & H5O_SHARED_IN_HEAP_FLAG || H5F_USE_LATEST_FORMAT(f))
+ version = H5O_SHARED_VERSION_LATEST;
else {
HDassert(mesg->flags & H5O_COMMITTED_FLAG);
version = H5O_SHARED_VERSION_2; /* version 1 is no longer used */
@@ -396,12 +395,10 @@ H5O_shared_encode(H5F_t *f, uint8_t *buf/*out*/, const void *_mesg)
/* Encode either the heap ID of the message or the address of the
* object header that holds it.
*/
- if(mesg->flags & H5O_SHARED_IN_HEAP_FLAG) {
+ if(mesg->flags & H5O_SHARED_IN_HEAP_FLAG)
HDmemcpy(buf, &(mesg->u.heap_id), sizeof(mesg->u.heap_id));
- }
- else {
+ else
H5F_addr_encode(f, &buf, mesg->u.oloc.addr);
- }
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_shared_encode() */
@@ -480,15 +477,15 @@ H5O_shared_size(const H5F_t *f, const void *_mesg)
if(shared->flags & H5O_COMMITTED_FLAG)
{
ret_value = 1 + /*version */
- 1 + /*the flags field */
- H5F_SIZEOF_ADDR(f); /*sharing by another obj hdr */
+ 1 + /*the flags field */
+ H5F_SIZEOF_ADDR(f); /*sharing by another obj hdr */
}
else
{
HDassert(shared->flags & H5O_SHARED_IN_HEAP_FLAG);
ret_value = 1 + /*version */
- 1 + /*the flags field */
- H5SM_FHEAP_ID_LEN; /* Shared in the heap */
+ 1 + /*the flags field */
+ H5O_FHEAP_ID_LEN; /* Shared in the heap */
}
FUNC_LEAVE_NOAPI(ret_value);