diff options
author | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2015-09-17 04:36:00 (GMT) |
---|---|---|
committer | Jerome Soumagne <jsoumagne@hdfgroup.org> | 2016-11-29 23:42:30 (GMT) |
commit | e286bbb35a8e5476a44bdf18da0ef63efba5eb67 (patch) | |
tree | 03afd7c070a853024e37233414ddd3becd396232 | |
parent | c1025396315101c5c254ecf301627371017272fd (diff) | |
download | hdf5-e286bbb35a8e5476a44bdf18da0ef63efba5eb67.zip hdf5-e286bbb35a8e5476a44bdf18da0ef63efba5eb67.tar.gz hdf5-e286bbb35a8e5476a44bdf18da0ef63efba5eb67.tar.bz2 |
Add H5G_create_anon private routine
-rw-r--r-- | src/H5G.c | 8 | ||||
-rw-r--r-- | src/H5Gint.c | 37 | ||||
-rw-r--r-- | src/H5Gprivate.h | 1 |
3 files changed, 39 insertions, 7 deletions
@@ -377,7 +377,6 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) { H5G_loc_t loc; H5G_t *grp = NULL; - H5G_obj_create_t gcrt_info; /* Information for group creation */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -401,13 +400,8 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) if(TRUE != H5P_isa_class(gapl_id, H5P_GROUP_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group access property list") - /* Set up group creation info */ - gcrt_info.gcpl_id = gcpl_id; - gcrt_info.cache_type = H5G_NOTHING_CACHED; - HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); - /* Create the new group & get its ID */ - if(NULL == (grp = H5G__create(loc.oloc->file, &gcrt_info, H5AC_dxpl_id))) + if(NULL == (grp = H5G_create_anon(&loc, gcpl_id, gapl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") diff --git a/src/H5Gint.c b/src/H5Gint.c index cba4806..efc9fd1 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -311,6 +311,43 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__open_name() */ +/*------------------------------------------------------------------------- + * Function: H5G_create_anon + * + * Purpose: Creates a new group relative to LOC_ID, giving it the + * specified creation property list GCPL_ID and access + * property list GAPL_ID. + * + * Return: Success: Ptr to a new group. + * + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +H5G_t * +H5G_create_anon(const H5G_loc_t *loc, hid_t gcpl_id, hid_t gapl_id) +{ + H5G_obj_create_t gcrt_info; /* Information for group creation */ + H5G_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Check args */ + HDassert(loc); + + /* Set up group creation info */ + gcrt_info.gcpl_id = gcpl_id; + gcrt_info.cache_type = H5G_NOTHING_CACHED; + HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); + + /* Create the new group & get its ID */ + if(NULL == (ret_value = H5G__create(loc->oloc->file, &gcrt_info, H5AC_dxpl_id))) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_create_anon() */ + /*------------------------------------------------------------------------- * Function: H5G_open diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index baf4209..b51784b 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -198,6 +198,7 @@ typedef struct H5G_entry_t H5G_entry_t; H5_DLL struct H5O_loc_t *H5G_oloc(H5G_t *grp); H5_DLL H5G_name_t * H5G_nameof(H5G_t *grp); H5_DLL H5F_t *H5G_fileof(H5G_t *grp); +H5_DLL H5G_t *H5G_create_anon(const H5G_loc_t *loc, hid_t gcpl_id, hid_t gapl_id); H5_DLL H5G_t *H5G_open(const H5G_loc_t *loc, hid_t dxpl_id); H5_DLL herr_t H5G_close(H5G_t *grp); H5_DLL herr_t H5G_get_shared_count(H5G_t *grp); |