summaryrefslogtreecommitdiffstats
path: root/src/H5HFman.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2012-08-20 18:44:14 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2012-08-20 18:44:14 (GMT)
commitd8f67a62cc4e0bd52a5a428608d46188dd5b27b2 (patch)
tree4001900da24308e5bb55934cba2faf140a41ac56 /src/H5HFman.c
parent1560a6ea38d559edb211707d9507db0b8c085635 (diff)
downloadhdf5-d8f67a62cc4e0bd52a5a428608d46188dd5b27b2.zip
hdf5-d8f67a62cc4e0bd52a5a428608d46188dd5b27b2.tar.gz
hdf5-d8f67a62cc4e0bd52a5a428608d46188dd5b27b2.tar.bz2
[svn-r22700] Description:
Minor refactoring to extract managed object length determination. This makes the tiny, managed, and huge code work alike. Tested on: jam (very minor change, no need for full commit test)
Diffstat (limited to 'src/H5HFman.c')
-rw-r--r--src/H5HFman.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/H5HFman.c b/src/H5HFman.c
index 62f5580..58e3318 100644
--- a/src/H5HFman.c
+++ b/src/H5HFman.c
@@ -218,6 +218,44 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5HF_man_get_obj_len
+ *
+ * Purpose: Get the size of a managed heap object
+ *
+ * Return: SUCCEED (Can't fail)
+ *
+ * Programmer: Dana Robinson (derobins@hdfgroup.org)
+ * August 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p)
+{
+
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+
+ /*
+ * Check arguments.
+ */
+ HDassert(hdr);
+ HDassert(id);
+ HDassert(obj_len_p);
+
+ /* Skip over the flag byte */
+ id++;
+
+ /* Skip over object offset */
+ id += hdr->heap_off_size;
+
+ /* Retrieve the entry length */
+ UINT64DECODE_VAR(id, *obj_len_p, hdr->heap_len_size);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5HF_man_get_obj_len() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5HF_man_op_real
*
* Purpose: Internal routine to perform an operation on a managed heap