summaryrefslogtreecommitdiffstats
path: root/src/H5Ocont.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-09-12 06:02:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-09-12 06:02:55 (GMT)
commit5ffde305cdf2c167234f1ffb38adf557380f2234 (patch)
treef211c5a72d7332885ab83eca1270bcb131e1c6c9 /src/H5Ocont.c
parent966f5f42368663fb589807ae28b2887b98ed8067 (diff)
downloadhdf5-5ffde305cdf2c167234f1ffb38adf557380f2234.zip
hdf5-5ffde305cdf2c167234f1ffb38adf557380f2234.tar.gz
hdf5-5ffde305cdf2c167234f1ffb38adf557380f2234.tar.bz2
[svn-r11384] Purpose:
Code cleanup Description: Merge back changes from "compact group" work that improve the infrastructure of the library and may impact others. In this round of merging, that includes: - Move datatype allocation into single internal routine, instead of duplicated code that was spread out in a dozen or so places. - Clean up guts of object header routines (H5O_*) to allow for some of the fancieroperations that need to be performed on groups, along with some general improvements. - Added a new error code - Some minor cleanups in other code.... Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4 Mac OS X
Diffstat (limited to 'src/H5Ocont.c')
-rw-r--r--src/H5Ocont.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/H5Ocont.c b/src/H5Ocont.c
index b28186c..e62ca07 100644
--- a/src/H5Ocont.c
+++ b/src/H5Ocont.c
@@ -40,7 +40,8 @@
/* PRIVATE PROTOTYPES */
static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_cont_encode(H5F_t *f, uint8_t *p, const void *_mesg);
-static herr_t H5O_cont_free (void *mesg);
+static size_t H5O_cont_size(const H5F_t *f, const void *_mesg);
+static herr_t H5O_cont_free(void *mesg);
static herr_t H5O_cont_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream,
int indent, int fwidth);
@@ -52,7 +53,7 @@ const H5O_class_t H5O_CONT[1] = {{
H5O_cont_decode, /*decode message */
H5O_cont_encode, /*encode message */
NULL, /*no copy method */
- NULL, /*no size method */
+ H5O_cont_size, /*size of header continuation */
NULL, /*reset method */
H5O_cont_free, /* free method */
NULL, /* file delete method */
@@ -147,6 +148,40 @@ H5O_cont_encode(H5F_t *f, uint8_t *p, const void *_mesg)
/*-------------------------------------------------------------------------
+ * Function: H5O_cont_size
+ *
+ * Purpose: Returns the size of the raw message in bytes not counting
+ * the message type or size fields, but only the data fields.
+ * This function doesn't take into account alignment.
+ *
+ * Return: Success: Message data size in bytes without alignment.
+ *
+ * Failure: zero
+ *
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * Sep 6 2005
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static size_t
+H5O_cont_size(const H5F_t *f, const void UNUSED *_mesg)
+{
+ size_t ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cont_size)
+
+ /* Set return value */
+ ret_value = H5F_SIZEOF_ADDR(f) + /* Continuation header address */
+ H5F_SIZEOF_SIZE(f); /* Continuation header length */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O_cont_size() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5O_cont_free
*
* Purpose: Free's the message