summaryrefslogtreecommitdiffstats
path: root/src/H5Gstab.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-11-07 03:13:53 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-11-07 03:13:53 (GMT)
commit08910385629d5cbfde5aa43cef0bcba17f7995b1 (patch)
treec47c355e63c972adac3e025e6bdd4a4dc67c0a47 /src/H5Gstab.c
parent23e994958b6190715aefb698b55dad70deb72049 (diff)
downloadhdf5-08910385629d5cbfde5aa43cef0bcba17f7995b1.zip
hdf5-08910385629d5cbfde5aa43cef0bcba17f7995b1.tar.gz
hdf5-08910385629d5cbfde5aa43cef0bcba17f7995b1.tar.bz2
[svn-r11686] Purpose:
New feature Description: Add in baseline "object copy" code from Peter [in the form of a new API routine: H5Gcopy()]. There's still some work to do (like handling variable- length datatypes and possibly support for references) and it hasn't been tested on mounted files yet, but the core functionality is there and working correctly. I've also got a set of patches to update the 1.6 branch with tweaks to keep the branches mostly in sync, but Elena will kill me if I import them before the 1.6.5 release is out... :-) Platforms tested: FreeBSD 4.11 (sleipnir) h5committested
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r--src/H5Gstab.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 8c83859..b63e1cd 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -315,3 +315,50 @@ H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, hbool_t adj_lin
done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5G_stab_delete() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_stab_copy_tmp
+ *
+ * Purpose: copy a group symbol table and memeber objects from SRC file to DST file.
+ *
+ * Return: Non-negative on success
+ * Negative on failure.
+ *
+ * Programmer: Peter Cao
+ * September 10, 2005
+ *
+ * Note: This routine should be replaced with proper call to "real"
+ * stab creation routine after the "big group revision" checkin
+ * occurs. -QAK
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5G_stab_copy_tmp(H5F_t *f_dst, H5O_stab_t *stab_dst, hid_t dxpl_id)
+{
+ size_t size_init, name_offset;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5G_stab_copy_tmp, FAIL)
+
+ HDassert(f_dst);
+ HDassert(stab_dst);
+
+ /* create B-tree private heap */
+ size_init = MAX(H5G_SIZE_HINT, H5HL_SIZEOF_FREE(f_dst) + 2);
+ if (H5HL_create(f_dst, dxpl_id, size_init, &(stab_dst->heap_addr))<0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create heap")
+
+ name_offset = H5HL_insert(f_dst, dxpl_id, stab_dst->heap_addr, 1, "");
+ if ((size_t)(-1)==name_offset)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't initialize heap")
+ assert(0 == name_offset);
+
+ /* create the B-tree */
+ if (H5B_create(f_dst, dxpl_id, H5B_SNODE, NULL, &(stab_dst->btree_addr)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create B-tree")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5G_stab_copy_tmp() */