summaryrefslogtreecommitdiffstats
path: root/src/H5Pocpl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-04-01 20:14:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-04-01 20:14:11 (GMT)
commit4659f50b832958636db672d9025a610eb70b04f1 (patch)
tree4d6f3e9c523dcd89e1b6d1f07f3cf184a3b007a7 /src/H5Pocpl.c
parent1cd1d6956a9d00ea5eaf57fcfad87b2c8651cf9c (diff)
downloadhdf5-4659f50b832958636db672d9025a610eb70b04f1.zip
hdf5-4659f50b832958636db672d9025a610eb70b04f1.tar.gz
hdf5-4659f50b832958636db672d9025a610eb70b04f1.tar.bz2
[svn-r12189] Purpose:
New/expanded features Description: Check in Peter's changed for the object copy code: - Allow/fix copying datasets using named variable-length datatypes - Start adding framework for property list to control how object copying occurs. Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest
Diffstat (limited to 'src/H5Pocpl.c')
-rwxr-xr-xsrc/H5Pocpl.c93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index 8d146bf..e0bf371 100755
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -31,7 +31,20 @@
* Purpose: set crt_intmd_group so that H5Gcreate(), H5Dcreate, etc.
* will create missing groups along the given path "name"
*
+ * Usage: H5Pset_create_intermediate_group(plist_id, crt_intmd_group)
+ * hid_t plist_id; IN: Property list to create a new group
+ * unsigned crt_intmd_group; IN: Flag to create intermediate group
+ * positive value -- to create intermediate group
+ * otherwise -- do not create intermediate group
+ * For example, H5Pset_create_intermediate_group(plist_id, 1) to create intermediate group;
+ *
* Note: XXX: This property should really be an access property. -QAK
+ * XXX: The property is used only at creation time. It should
+ * be a creation property. However, the property is not
+ * saved with the group. In that sense, it should be access
+ * property. We do not have a good solution for this kind
+ * of property. For now, it is used as a creation property.
+ * -PXC
*
* Return: Non-negative on success/Negative on failure
*
@@ -96,3 +109,83 @@ done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_create_intermediate_group() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_copy_object
+ *
+ * Purpose: Set properties when copying an object (group, dataset, and datatype)
+ * from one location to another
+ *
+ * Usage: H5Pset_copy_group(plist_id, cpy_option)
+ * hid_t plist_id; IN: Property list to copy object
+ * unsigned cpy_option; IN: Options to copy object such as
+ * H5G_COPY_SHALLOW_HIERARCHY_FLAG -- Copy only immediate members
+ * H5G_COPY_EXPAND_SOFT_LINK_FLAG -- Expand soft links into new objects/
+ * H5G_COPY_EXPAND_EXT_LINK_FLAG -- Expand external links into new objects
+ * H5G_COPY_EXPAND_OBJ_REFERENCE_FLAG -- Copy objects that are pointed by references
+ * H5G_COPY_WITHOUT_ATTR_FLAG -- Copy object without copying attributes
+*
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Peter Cao
+ * March 13, 2006
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_copy_object(hid_t plist_id, unsigned cpy_option)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(H5Pset_copy_object, FAIL)
+
+ /* Check parameters */
+ if(cpy_option & ~H5G_COPY_ALL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown option specified")
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Set value */
+ if(H5P_set(plist, H5G_CPY_OPTION_NAME, &cpy_option) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set copy object flag")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pset_copy_object() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_copy_object
+ *
+ * Purpose: Returns the cpy_option, which is set for H5Gcopy(hid_t loc_id,
+ * const char* name, ... ) for copying objects
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Peter Cao
+ * March 13, 2006
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_copy_object(hid_t plist_id, unsigned *cpy_option /*out*/)
+{
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value = SUCCEED; /* return value */
+
+ FUNC_ENTER_API(H5Pget_copy_object, FAIL)
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+
+ /* Get values */
+ if(cpy_option)
+ if(H5P_get(plist, H5G_CPY_OPTION_NAME, cpy_option) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object copy flag")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Pget_copy_object() */
+