summaryrefslogtreecommitdiffstats
path: root/src/H5Goh.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-11-03 13:17:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-11-03 13:17:14 (GMT)
commitd8c4700561368b378dd1fe6b708a9c01378b7dc5 (patch)
tree6c3691a56e0138c089d5dc7682d9e62c0c1f8650 /src/H5Goh.c
parentebd34a6a4d390b0074799a7f1e6a2bd59882df99 (diff)
downloadhdf5-d8c4700561368b378dd1fe6b708a9c01378b7dc5.zip
hdf5-d8c4700561368b378dd1fe6b708a9c01378b7dc5.tar.gz
hdf5-d8c4700561368b378dd1fe6b708a9c01378b7dc5.tar.bz2
[svn-r17807] Description:
Bring r17623 from trunk to 1.8 branch: Bring "compress group's fractal heap" feature from feature branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.1 (amazon) in debug mode Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5Goh.c')
-rw-r--r--src/H5Goh.c75
1 files changed, 73 insertions, 2 deletions
diff --git a/src/H5Goh.c b/src/H5Goh.c
index 0827285..ff75452 100644
--- a/src/H5Goh.c
+++ b/src/H5Goh.c
@@ -45,6 +45,8 @@
/* Local Prototypes */
/********************/
+static void *H5O_group_get_copy_file_udata(void);
+static void H5O_group_free_copy_file_udata(void *udata);
static htri_t H5O_group_isa(H5O_t *loc);
static hid_t H5O_group_open(const H5G_loc_t *obj_loc, hid_t lapl_id,
hid_t dxpl_id, hbool_t app_ref);
@@ -73,8 +75,8 @@ static herr_t H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
const H5O_obj_class_t H5O_OBJ_GROUP[1] = {{
H5O_TYPE_GROUP, /* object type */
"group", /* object name, for debugging */
- NULL, /* get 'copy file' user data */
- NULL, /* free 'copy file' user data */
+ H5O_group_get_copy_file_udata, /* get 'copy file' user data */
+ H5O_group_free_copy_file_udata, /* free 'copy file' user data */
H5O_group_isa, /* "isa" message */
H5O_group_open, /* open an object of this class */
H5O_group_create, /* create an object of this class */
@@ -82,6 +84,75 @@ const H5O_obj_class_t H5O_OBJ_GROUP[1] = {{
H5O_group_bh_info /* get the index & heap info for an object */
}};
+/* Declare the external free list to manage the H5O_ginfo_t struct */
+H5FL_DEFINE(H5G_copy_file_ud_t);
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5O_group_get_copy_file_udata
+ *
+ * Purpose: Allocates the user data needed for copying a group's
+ * object header from file to file.
+ *
+ * Return: Success: Non-NULL pointer to user data
+ *
+ * Failure: NULL
+ *
+ * Programmer: Neil Fortner
+ * Thursday, July 30, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5O_group_get_copy_file_udata(void)
+{
+ void *ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5O_group_get_copy_file_udata)
+
+ /* Allocate space for the 'copy file' user data for copying groups.
+ * Currently this is only a ginfo, so there is no specific struct type for
+ * this operation. */
+ if(NULL == (ret_value = H5FL_CALLOC(H5G_copy_file_ud_t)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5O_group_get_copy_file_udata() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5O_group_free_copy_file_udata
+ *
+ * Purpose: Release the user data needed for copying a group's
+ * object header from file to file.
+ *
+ * Return: <none>
+ *
+ * Programmer: Neil Fortner
+ * Thursday, July 30, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+H5O_group_free_copy_file_udata(void *_udata)
+{
+ H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *)_udata;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_group_free_copy_file_udata)
+
+ /* Sanity check */
+ HDassert(udata);
+
+ /* Free the ginfo struct (including nested data structs) */
+ H5O_msg_free(H5O_PLINE_ID, udata->common.src_pline);
+
+ /* Release space for 'copy file' user data (ginfo struct) */
+ (void)H5FL_FREE(H5G_copy_file_ud_t, udata);
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5O_group_free_copy_file_udata() */
+
/*-------------------------------------------------------------------------
* Function: H5O_group_isa