diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-12-22 18:23:08 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-12-22 18:23:08 (GMT) |
commit | b1c318eebe05605f5086fb79cfd7e88d4b949bcf (patch) | |
tree | 6d5061822fc6856971c94f2568ce6c754127b798 /src/H5Omessage.c | |
parent | e3fe4f7790d6289c8736a20736448d86686751fa (diff) | |
download | hdf5-b1c318eebe05605f5086fb79cfd7e88d4b949bcf.zip hdf5-b1c318eebe05605f5086fb79cfd7e88d4b949bcf.tar.gz hdf5-b1c318eebe05605f5086fb79cfd7e88d4b949bcf.tar.bz2 |
[svn-r13086] Added deletion test for shared messages. I'm not sure that this test is
as complete as it could be, so I may add to it later.
Fixed a bug in reference counting messages that are referenced by shared
messages (attribute datatypes and dataspaces).
Tested on mir, smirom, and Windows.
Diffstat (limited to 'src/H5Omessage.c')
-rw-r--r-- | src/H5Omessage.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 3648d49..bedfcb2 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -2000,6 +2000,46 @@ done: /*------------------------------------------------------------------------- + * Function: H5O_msg_delete + * + * Purpose: Calls a message's delete callback. + * + * JAMES: this is mostly redundant with H5O_delete_mesg below, + * but H5O_delete_mesg only works on messages in object headers + * (i.e., not shared messages). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: James Laird + * December 21, 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_msg_delete(H5F_t *f, hid_t dxpl_id, unsigned type_id, const void *mesg) +{ + const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5O_msg_delete, NULL) + + /* check args */ + HDassert(f); + HDassert(type_id < NELMTS(H5O_msg_class_g)); + type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ + HDassert(type); + + /* delete */ + if((type->del) && (type->del)(f, dxpl_id, mesg, 1) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_msg_decode() */ + + +/*------------------------------------------------------------------------- * Function: H5O_delete_mesg * * Purpose: Internal function to: |