summaryrefslogtreecommitdiffstats
path: root/src/H5Gdense.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/H5Gdense.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/H5Gdense.c')
-rw-r--r--src/H5Gdense.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index 3019d4f..76970fc 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -219,6 +219,9 @@ typedef struct {
/* The v2 B-tree class for indexing 'name' field on links */
H5_DLLVAR const H5B2_class_t H5G_BT2_NAME[1];
+/* The v2 B-tree class for indexing 'creation order' field on links */
+H5_DLLVAR const H5B2_class_t H5G_BT2_CORDER[1];
+
/*****************************/
/* Library Private Variables */
@@ -299,8 +302,8 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
HGOTO_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap")
/* Create the name index v2 B-tree */
- bt2_rrec_size = 4 + /* Name's hash value */
- fheap_id_len; /* Fractal heap ID */
+ bt2_rrec_size = 4 + /* Name's hash value */
+ fheap_id_len; /* Fractal heap ID */
if(H5B2_create(f, dxpl_id, H5G_BT2_NAME,
(size_t)H5G_NAME_BT2_NODE_SIZE, bt2_rrec_size,
H5G_NAME_BT2_SPLIT_PERC, H5G_NAME_BT2_MERGE_PERC,
@@ -310,8 +313,20 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr);
#endif /* QAK */
- /* XXX: Check if we should create a creation order index v2 B-tree */
- /* XXX: Create the creation order index v2 B-tree */
+ /* Check if we should create a creation order index v2 B-tree */
+ if(linfo->index_corder) {
+ /* Create the creation order index v2 B-tree */
+ bt2_rrec_size = 8 + /* Creation order value */
+ fheap_id_len; /* Fractal heap ID */
+ if(H5B2_create(f, dxpl_id, H5G_BT2_CORDER,
+ (size_t)H5G_CORDER_BT2_NODE_SIZE, bt2_rrec_size,
+ H5G_CORDER_BT2_SPLIT_PERC, H5G_CORDER_BT2_MERGE_PERC,
+ &(linfo->corder_bt2_addr)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index")
+#ifdef QAK
+HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_addr);
+#endif /* QAK */
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)