summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-01-22 23:27:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-01-22 23:27:17 (GMT)
commit58db19e6c576fbc12fdf756f1c2aee8186f1e90a (patch)
tree7c413fc2036f5ee887896642101eb02f1609f74c /src
parentae4d8d9319b06f09e66b311a0358b7bf9227ec2e (diff)
downloadhdf5-58db19e6c576fbc12fdf756f1c2aee8186f1e90a.zip
hdf5-58db19e6c576fbc12fdf756f1c2aee8186f1e90a.tar.gz
hdf5-58db19e6c576fbc12fdf756f1c2aee8186f1e90a.tar.bz2
[svn-r13175] Description:
Checkpoint more progress on refactoring the shared message code. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src')
-rw-r--r--src/H5Odtype.c16
-rw-r--r--src/H5Osdspace.c16
-rw-r--r--src/H5Oshared.h15
3 files changed, 38 insertions, 9 deletions
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index b055e4e..2b06ea4 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -95,6 +95,22 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{
* and 'size' callback for places to change when updating this. */
#define H5O_DTYPE_VERSION_LATEST H5O_DTYPE_VERSION_3
+/* Set up & include shared message "interface" info */
+#define H5O_SHARED_TYPE H5O_MSG_DTYPE
+#define H5O_SHARED_DECODE H5O_dtype_shared_decode
+#define H5O_SHARED_DECODE_REAL H5O_dtype_decode
+#define H5O_SHARED_ENCODE H5O_dtype_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O_dtype_encode
+#define H5O_SHARED_SIZE H5O_dtype_shared_size
+#define H5O_SHARED_SIZE_REAL H5O_dtype_size
+#define H5O_SHARED_DELETE H5O_dtype_shared_delete
+#undef H5O_SHARED_DELETE_REAL
+#define H5O_SHARED_LINK H5O_dtype_shared_link
+#undef H5O_SHARED_LINK_REAL
+#define H5O_SHARED_COPY_FILE H5O_dtype_shared_copy_file
+#define H5O_SHARED_COPY_FILE_REAL H5O_dtype_copy_file
+#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
+
/*-------------------------------------------------------------------------
* Function: H5O_dtype_decode_helper
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index 89bfdda..dc5ab95 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -83,6 +83,22 @@ H5FL_EXTERN(H5S_extent_t);
/* Declare external the free list for hsize_t arrays */
H5FL_ARR_EXTERN(hsize_t);
+/* Set up & include shared message "interface" info */
+#define H5O_SHARED_TYPE H5O_MSG_SDSPACE
+#define H5O_SHARED_DECODE H5O_sdspace_shared_decode
+#define H5O_SHARED_DECODE_REAL H5O_sdspace_decode
+#define H5O_SHARED_ENCODE H5O_sdspace_shared_encode
+#define H5O_SHARED_ENCODE_REAL H5O_sdspace_encode
+#define H5O_SHARED_SIZE H5O_sdspace_shared_size
+#define H5O_SHARED_SIZE_REAL H5O_sdspace_size
+#define H5O_SHARED_DELETE H5O_sdspace_shared_delete
+#undef H5O_SHARED_DELETE_REAL
+#define H5O_SHARED_LINK H5O_sdspace_shared_link
+#undef H5O_SHARED_LINK_REAL
+#define H5O_SHARED_COPY_FILE H5O_sdspace_shared_copy_file
+#undef H5O_SHARED_COPY_FILE_REAL
+#include "H5Oshared.h" /* Shared Object Header Message Callbacks */
+
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5Oshared.h b/src/H5Oshared.h
index 24490b5..29bdc35 100644
--- a/src/H5Oshared.h
+++ b/src/H5Oshared.h
@@ -222,9 +222,6 @@ H5O_SHARED_DELETE(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link)
#ifndef H5O_SHARED_DELETE
#error "Need to define H5O_SHARED_DELETE macro!"
#endif /* H5O_SHARED_DELETE */
-#ifndef H5O_SHARED_DELETE_REAL
-#error "Need to define H5O_SHARED_DELETE_REAL macro!"
-#endif /* H5O_SHARED_DELETE_REAL */
/* Check for shared message */
if(H5O_IS_SHARED(sh_mesg->flags)) {
@@ -232,11 +229,13 @@ H5O_SHARED_DELETE(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link)
if(H5O_shared_delete_new(f, dxpl_id, sh_mesg, adj_link) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for shared message")
} /* end if */
+#ifdef H5O_SHARED_DELETE_REAL
else {
/* Decrement the reference count on the native message directly */
if(H5O_SHARED_DELETE_REAL(f, dxpl_id, _mesg, adj_link) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for native message")
} /* end else */
+#endif /* H5O_SHARED_DELETE_REAL */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -275,9 +274,6 @@ H5O_SHARED_LINK(H5F_t *f, hid_t dxpl_id, const void *_mesg)
#ifndef H5O_SHARED_LINK
#error "Need to define H5O_SHARED_LINK macro!"
#endif /* H5O_SHARED_LINK */
-#ifndef H5O_SHARED_LINK_REAL
-#error "Need to define H5O_SHARED_LINK_REAL macro!"
-#endif /* H5O_SHARED_LINK_REAL */
/* Check for shared message */
if(H5O_IS_SHARED(sh_mesg->flags)) {
@@ -285,11 +281,13 @@ H5O_SHARED_LINK(H5F_t *f, hid_t dxpl_id, const void *_mesg)
if(H5O_shared_link_new(f, dxpl_id, sh_mesg) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "unable to increment ref count for shared message")
} /* end if */
+#ifdef H5O_SHARED_LINK_REAL
else {
/* Increment the reference count on the native message directly */
if(H5O_SHARED_LINK_REAL(f, dxpl_id, _mesg) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "unable to increment ref count for native message")
} /* end else */
+#endif /* H5O_SHARED_LINK_REAL */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -329,9 +327,6 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, const H5O_msg_class_t *mesg_type,
#ifndef H5O_SHARED_COPY_FILE
#error "Need to define H5O_SHARED_COPY_FILE macro!"
#endif /* H5O_SHARED_COPY_FILE */
-#ifndef H5O_SHARED_COPY_FILE_REAL
-#error "Need to define H5O_SHARED_COPY_FILE_REAL macro!"
-#endif /* H5O_SHARED_COPY_FILE_REAL */
/* Check for shared message */
if(H5O_IS_SHARED(sh_mesg->flags)) {
@@ -339,12 +334,14 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, const H5O_msg_class_t *mesg_type,
if(NULL == (ret_value = H5O_shared_copy_file_new(file_src, mesg_type, _native_src, file_dst, dxpl_id, cpy_info, udata)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy shared message to another file")
} /* end if */
+#ifdef H5O_SHARED_COPY_FILE_REAL
else {
/* Decrement the reference count on the native message directly */
/* Copy the native message directly to another file */
if(NULL == (ret_value = H5O_SHARED_COPY_FILE_REAL(file_src, mesg_type, _native_src, file_dst, dxpl_id, cpy_info, udata)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy native message to another file")
} /* end else */
+#endif /* H5O_SHARED_COPY_FILE_REAL */
done:
FUNC_LEAVE_NOAPI(ret_value)