summaryrefslogtreecommitdiffstats
path: root/src/H5Opkg.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-12-04 11:25:01 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-12-04 11:25:01 (GMT)
commit304accfb960d747cc4820ed189de2847e87570ff (patch)
treef8f37e777475fa954992ef5aa1573a3138af42db /src/H5Opkg.h
parent786af4b8d7f0e12e58bc7f1ab1ef0928cae9bd17 (diff)
downloadhdf5-304accfb960d747cc4820ed189de2847e87570ff.zip
hdf5-304accfb960d747cc4820ed189de2847e87570ff.tar.gz
hdf5-304accfb960d747cc4820ed189de2847e87570ff.tar.bz2
[svn-r13015] Description:
Migrate more object header routines to use the H5O_msg_ prefix and put them into the src/H5Omessage.c code module. Tested on: Mac OS X/32 10.4.8 (amazon) FreeBSD/32 4.11 (sleipnir) Linux/32 2.4 (heping) AIX/32 5.? (copper)
Diffstat (limited to 'src/H5Opkg.h')
-rw-r--r--src/H5Opkg.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index a403680..0471d5f 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -151,6 +151,24 @@
#define H5O_SIZEOF_CHKSUM_OH(O) \
H5O_SIZEOF_CHKSUM_VERS((O)->version)
+/* Load native information for a message, if it's not already present */
+/* (Only works for messages with decode callback) */
+#define H5O_LOAD_NATIVE(F, DXPL, MSG, ERR) \
+ if(NULL == (MSG)->native) { \
+ const H5O_msg_class_t *decode_type; \
+ \
+ /* Check for shared message */ \
+ if((MSG)->flags & H5O_MSG_FLAG_SHARED) \
+ decode_type = H5O_MSG_SHARED; \
+ else \
+ decode_type = (MSG)->type; \
+ \
+ /* Decode the message */ \
+ 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") \
+ } /* end if */
+
struct H5O_msg_class_t {
unsigned id; /*message type ID on disk */
const char *name; /*for debugging */
@@ -376,13 +394,17 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1];
H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh);
H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_mesg_t *mesg,
hbool_t adj_link);
-H5_DLL herr_t H5O_free_mesg(H5O_mesg_t *mesg);
-H5_DLL void * H5O_free_real(const H5O_msg_class_t *type, void *mesg);
H5_DLL void * H5O_copy_mesg_file(const H5O_msg_class_t *copy_type,
const H5O_msg_class_t *mesg_type, H5F_t *file_src, void *mesg_src,
H5F_t *file_dst, hid_t dxpl_id, H5O_copy_t *cpy_info, void *udata);
H5_DLL const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh);
+/* Object header message routines */
+H5_DLL void *H5O_msg_read_real(H5F_t *f, H5O_t *oh, unsigned type_id,
+ int sequence, void *mesg, hid_t dxpl_id);
+H5_DLL void *H5O_msg_free_real(const H5O_msg_class_t *type, void *mesg);
+H5_DLL herr_t H5O_msg_free_mesg(H5O_mesg_t *mesg);
+
/* Object header allocation routines */
H5_DLL unsigned H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
const H5O_msg_class_t *type, size_t size, hbool_t * oh_dirtied_ptr);