Source
38
38
39
39
/******************/
40
40
/* Local Typedefs */
41
41
/******************/
42
42
43
43
44
44
/********************/
45
45
/* Local Prototypes */
46
46
/********************/
47
47
48
+
static void *H5O_group_get_copy_file_udata(void);
49
+
static void H5O_group_free_copy_file_udata(void *udata);
48
50
static htri_t H5O_group_isa(H5O_t *loc);
49
51
static hid_t H5O_group_open(const H5G_loc_t *obj_loc, hid_t lapl_id,
50
52
hid_t dxpl_id, hbool_t app_ref);
51
53
static void *H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc,
52
54
hid_t dxpl_id);
53
55
static H5O_loc_t *H5O_group_get_oloc(hid_t obj_id);
54
56
static herr_t H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
55
57
H5_ih_info_t *bh_info);
56
58
57
59
66
68
67
69
68
70
/*******************/
69
71
/* Local Variables */
70
72
/*******************/
71
73
72
74
/* This message derives from H5O object class */
73
75
const H5O_obj_class_t H5O_OBJ_GROUP[1] = {{
74
76
H5O_TYPE_GROUP, /* object type */
75
77
"group", /* object name, for debugging */
76
-
NULL, /* get 'copy file' user data */
77
-
NULL, /* free 'copy file' user data */
78
+
H5O_group_get_copy_file_udata, /* get 'copy file' user data */
79
+
H5O_group_free_copy_file_udata, /* free 'copy file' user data */
78
80
H5O_group_isa, /* "isa" message */
79
81
H5O_group_open, /* open an object of this class */
80
82
H5O_group_create, /* create an object of this class */
81
83
H5O_group_get_oloc, /* get an object header location for an object */
82
84
H5O_group_bh_info /* get the index & heap info for an object */
83
85
}};
84
86
87
+
/* Declare the external free list to manage the H5O_ginfo_t struct */
88
+
H5FL_DEFINE(H5G_copy_file_ud_t);
89
+
90
+
•
91
+
/*-------------------------------------------------------------------------
92
+
* Function: H5O_group_get_copy_file_udata
93
+
*
94
+
* Purpose: Allocates the user data needed for copying a group's
95
+
* object header from file to file.
96
+
*
97
+
* Return: Success: Non-NULL pointer to user data
98
+
*
99
+
* Failure: NULL
100
+
*
101
+
* Programmer: Neil Fortner
102
+
* Thursday, July 30, 2009
103
+
*
104
+
*-------------------------------------------------------------------------
105
+
*/
106
+
static void *
107
+
H5O_group_get_copy_file_udata(void)
108
+
{
109
+
void *ret_value; /* Return value */
110
+
111
+
FUNC_ENTER_NOAPI_NOINIT(H5O_group_get_copy_file_udata)
112
+
113
+
/* Allocate space for the 'copy file' user data for copying groups.
114
+
* Currently this is only a ginfo, so there is no specific struct type for
115
+
* this operation. */
116
+
if(NULL == (ret_value = H5FL_CALLOC(H5G_copy_file_ud_t)))
117
+
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
118
+
119
+
done:
120
+
FUNC_LEAVE_NOAPI(ret_value)
121
+
} /* end H5O_group_get_copy_file_udata() */
122
+
123
+
•
124
+
/*-------------------------------------------------------------------------
125
+
* Function: H5O_group_free_copy_file_udata
126
+
*
127
+
* Purpose: Release the user data needed for copying a group's
128
+
* object header from file to file.
129
+
*
130
+
* Return: <none>
131
+
*
132
+
* Programmer: Neil Fortner
133
+
* Thursday, July 30, 2009
134
+
*
135
+
*-------------------------------------------------------------------------
136
+
*/
137
+
static void
138
+
H5O_group_free_copy_file_udata(void *_udata)
139
+
{
140
+
H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *)_udata;
141
+
142
+
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_group_free_copy_file_udata)
143
+
144
+
/* Sanity check */
145
+
HDassert(udata);
146
+
147
+
/* Free the ginfo struct (including nested data structs) */
148
+
H5O_msg_free(H5O_PLINE_ID, udata->common.src_pline);
149
+
150
+
/* Release space for 'copy file' user data (ginfo struct) */
151
+
(void)H5FL_FREE(H5G_copy_file_ud_t, udata);
152
+
153
+
FUNC_LEAVE_NOAPI_VOID
154
+
} /* end H5O_group_free_copy_file_udata() */
155
+
85
156
•
86
157
/*-------------------------------------------------------------------------
87
158
* Function: H5O_group_isa
88
159
*
89
160
* Purpose: Determines if an object has the requisite messages for being
90
161
* a group.
91
162
*
92
163
* Return: Success: TRUE if the required group messages are
93
164
* present; FALSE otherwise.
94
165
*