summaryrefslogtreecommitdiffstats
path: root/src/H5Omessage.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/H5Omessage.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/H5Omessage.c')
-rw-r--r--src/H5Omessage.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index 2e01516..628b3e9 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -61,6 +61,13 @@
HDassert(decode_type->decode); \
if(NULL == ((MSG)->native = (decode_type->decode)((F), (DXPL), (MSG)->raw))) \
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \
+ \
+ /* Set the message's "creation index", if it has one */ \
+ if((MSG)->type->set_crt_index) { \
+ /* Set the creation index for the message */ \
+ if(((MSG)->type->set_crt_index)((MSG)->native, (MSG)->crt_idx) < 0) \
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, ERR, "unable to set creation index") \
+ } /* end if */ \
} /* end if */
@@ -1367,8 +1374,7 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type,
else {
/* If the message is shared, get the real message it points to */
if(idx_msg->flags & H5O_MSG_FLAG_SHARED) {
- if(NULL == (native_mesg = H5O_shared_read(f, dxpl_id,
- idx_msg->native, idx_msg->type, NULL)))
+ if(NULL == (native_mesg = H5O_shared_read(f, dxpl_id, idx_msg->native, idx_msg->type, NULL)))
HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "unable to read shared message")
native_mesg_alloc = TRUE;
} /* end if */
@@ -1835,8 +1841,9 @@ done:
*-------------------------------------------------------------------------
*/
void *
-H5O_msg_copy_file(const H5O_msg_class_t *copy_type, const H5O_msg_class_t *mesg_type, H5F_t *file_src, void *native_src,
- H5F_t *file_dst, hid_t dxpl_id, hbool_t *shared, H5O_copy_t *cpy_info, void *udata)
+H5O_msg_copy_file(const H5O_msg_class_t *copy_type, const H5O_msg_class_t *mesg_type,
+ H5F_t *file_src, void *native_src, H5F_t *file_dst, hid_t dxpl_id,
+ hbool_t *shared, H5O_copy_t *cpy_info, void *udata)
{
void *native_mesg=NULL;
void *shared_mesg=NULL;
@@ -1848,8 +1855,8 @@ H5O_msg_copy_file(const H5O_msg_class_t *copy_type, const H5O_msg_class_t *mesg_
/* check args */
HDassert(copy_type);
- HDassert(mesg_type);
HDassert(copy_type->copy_file);
+ HDassert(mesg_type);
HDassert(file_src);
HDassert(native_src);
HDassert(file_dst);
@@ -1991,6 +1998,13 @@ H5O_new_mesg(H5F_t *f, H5O_t *oh, unsigned *mesg_flags, const H5O_msg_class_t *o
if((ret_value = H5O_alloc(f, dxpl_id, oh, orig_type, size, oh_flags_ptr)) == UFAIL)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, UFAIL, "unable to allocate space for message")
+ /* Get the message's "creation index", if it has one */
+ if(orig_type->get_crt_index) {
+ /* Retrieve the creation index for the message */
+ if((orig_type->get_crt_index)(orig_mesg, &oh->mesg[ret_value].crt_idx) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, UFAIL, "unable to retrieve creation index")
+ } /* end if */
+
/* Increment any links in message */
if((*new_type)->link && ((*new_type)->link)(f, dxpl_id, (*new_mesg)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, UFAIL, "unable to adjust shared object link count")
@@ -2138,6 +2152,13 @@ H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_mesg_t *mesg, hbool_t adj_link)
HDassert(type->decode);
if(NULL == (mesg->native = (type->decode)(f, dxpl_id, mesg->raw)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "unable to decode message")
+
+ /* Set the message's "creation index", if it has one */
+ if(mesg->type->set_crt_index) {
+ /* Set the creation index for the message */
+ if((mesg->type->set_crt_index)(mesg->native, mesg->crt_idx) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to set creation index")
+ } /* end if */
} /* end if */
/* Check if this message needs to be removed from the SOHM table if