summaryrefslogtreecommitdiffstats
path: root/src/H5Olinfo.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-06-26 22:01:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-06-26 22:01:43 (GMT)
commit8d72542a50fac7a747fe0bfec8d2285de8efd29f (patch)
treeda26f38920601ae4274e77d3363767ca057a66ab /src/H5Olinfo.c
parent785938ace19e2533ab94c14b6cd8de508fe18f15 (diff)
downloadhdf5-8d72542a50fac7a747fe0bfec8d2285de8efd29f.zip
hdf5-8d72542a50fac7a747fe0bfec8d2285de8efd29f.tar.gz
hdf5-8d72542a50fac7a747fe0bfec8d2285de8efd29f.tar.bz2
[svn-r12439] Purpose:
New feature Description: Check in Peter's code to add support for "shallow copy", "create intermediate groups", "no attributes" and "expand soft links" support. Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4 (chicago) w/ & w/o group-revision enabled h5committest
Diffstat (limited to 'src/H5Olinfo.c')
-rw-r--r--src/H5Olinfo.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c
index a14be2a..1b84191 100644
--- a/src/H5Olinfo.c
+++ b/src/H5Olinfo.c
@@ -40,6 +40,8 @@ static herr_t H5O_linfo_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_linfo_copy(const void *_mesg, void *_dest, unsigned update_flags);
static size_t H5O_linfo_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_linfo_free(void *_mesg);
+static void *H5O_linfo_copy_file(H5F_t *file_src, void *native_src,
+ H5F_t *file_dst, hid_t dxpl_id, H5O_copy_t *cpy_info, void *udata);
static herr_t H5O_linfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg,
FILE * stream, int indent, int fwidth);
@@ -59,7 +61,7 @@ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{
NULL, /*get share method */
NULL, /*set share method */
NULL, /* pre copy native value to file */
- NULL, /* copy native value to file */
+ H5O_linfo_copy_file, /* copy native value to file */
NULL, /* post copy native value to file */
H5O_linfo_debug /*debug the message */
}};
@@ -266,6 +268,57 @@ H5O_linfo_free(void *mesg)
/*-------------------------------------------------------------------------
+ * Function: H5O_linfo_copy_file
+ *
+ * Purpose: Copies a message from _MESG to _DEST in file
+ *
+ * Return: Success: Ptr to _DEST
+ *
+ * Failure: NULL
+ *
+ * Programmer: Quincey Koziol
+ * June 26, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5O_linfo_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_dst,
+ hid_t UNUSED dxpl_id, H5O_copy_t *cpy_info, void UNUSED *udata)
+{
+ H5O_linfo_t *linfo_src = (H5O_linfo_t *) native_src;
+ H5O_linfo_t *linfo_dst = NULL;
+ void *ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5O_linfo_copy_file)
+
+ /* check args */
+ HDassert(linfo_src);
+ HDassert(cpy_info);
+
+ /* Copy the source message */
+ if(NULL == (linfo_dst = H5O_linfo_copy(linfo_src, NULL, FALSE)))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "memory allocation failed")
+
+ /* If we are performing a 'shallow hierarchy' copy, and the links in this
+ * group won't be included in the destination, reset the link count for
+ * this group.
+ */
+ if(cpy_info->max_depth >= 0 && cpy_info->curr_depth >= cpy_info->max_depth)
+ linfo_dst->nlinks = 0;
+
+ /* Set return value */
+ ret_value = linfo_dst;
+
+done:
+ if(!ret_value)
+ if(linfo_dst)
+ H5FL_FREE(H5O_linfo_t, linfo_dst);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5O_linfo_copy_file() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5O_linfo_debug
*
* Purpose: Prints debugging info for a message.