summaryrefslogtreecommitdiffstats
path: root/src/H5Gobj.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-10-30 14:33:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-10-30 14:33:14 (GMT)
commit12edb97078593e2aa73950919c4823a37367915e (patch)
tree1b3756ce8c00a2abe41273fcb32ae4700351b2d2 /src/H5Gobj.c
parentb27b4889268552a1b02f06e5c26b470c31621d5e (diff)
downloadhdf5-12edb97078593e2aa73950919c4823a37367915e.zip
hdf5-12edb97078593e2aa73950919c4823a37367915e.tar.gz
hdf5-12edb97078593e2aa73950919c4823a37367915e.tar.bz2
[svn-r12825] Description:
Rudimentary support for creating creation order index (but not inserting links in it yet). Testedon: Mac OS X/32 10.4.8 (amazon)
Diffstat (limited to 'src/H5Gobj.c')
-rw-r--r--src/H5Gobj.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/H5Gobj.c b/src/H5Gobj.c
index b6abe4c..fd8a31e 100644
--- a/src/H5Gobj.c
+++ b/src/H5Gobj.c
@@ -219,9 +219,8 @@ done:
*/
herr_t
H5G_obj_create(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
- H5O_loc_t *oloc/*out*/)
+ const H5O_linfo_t *linfo, H5O_loc_t *oloc/*out*/)
{
- H5O_linfo_t linfo; /* Link information */
size_t hdr_size; /* Size of object header to request */
hbool_t use_latest_format; /* Flag indicating the new group format should be used */
herr_t ret_value = SUCCEED; /* Return value */
@@ -242,18 +241,20 @@ H5G_obj_create(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
else
use_latest_format = FALSE;
+ /* Make certain that the creation order is being tracked if an index is
+ * going to be built on it.
+ */
+ if(linfo->index_corder && !ginfo->track_corder)
+ HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "must track creation order to create index for it")
+
/* Check if we should be using the latest version of the group format */
if(use_latest_format) {
- H5O_linfo_t def_linfo = H5G_CRT_LINK_INFO_DEF; /* Default link info */
H5O_link_t lnk; /* Temporary link message info for computing message size */
char null_char = '\0'; /* Character for creating null string */
size_t ginfo_size; /* Size of the group info message */
size_t linfo_size; /* Size of the link info message */
size_t link_size; /* Size of a link message */
- /* Initialize message information */
- HDmemcpy(&linfo, &def_linfo, sizeof(H5O_linfo_t));
-
/* Calculate message size infomation, for creating group's object header */
linfo_size = H5O_mesg_size(H5O_LINFO_ID, f, &linfo, (size_t)0);
HDassert(linfo_size);
@@ -287,7 +288,7 @@ H5G_obj_create(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo,
/* Check for format of group to create */
if(use_latest_format) {
/* Insert link info message */
- if(H5O_modify(oloc, H5O_LINFO_ID, H5O_NEW_MESG, 0, 0, &linfo, dxpl_id) < 0)
+ if(H5O_modify(oloc, H5O_LINFO_ID, H5O_NEW_MESG, 0, 0, linfo, dxpl_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message")
/* Insert group info message */