summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-07-10 19:39:04 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-07-10 19:39:04 (GMT)
commit932101bb80e44e23ec8c2ed690f8fbc7bd08a47a (patch)
tree0fe2bcd1e23814d17bf343a99858f50e97d540b8
parentbdd61d8a80ba159748cd56ef59299ca749749ab6 (diff)
downloadhdf5-932101bb80e44e23ec8c2ed690f8fbc7bd08a47a.zip
hdf5-932101bb80e44e23ec8c2ed690f8fbc7bd08a47a.tar.gz
hdf5-932101bb80e44e23ec8c2ed690f8fbc7bd08a47a.tar.bz2
[svn-r7201] Purpose:
Code cleanup Description: Finish converting the B-tree 'K' values to use unsigned integers, rather than signed ones, since negative amounts of entries in a B-tree node aren't meaningful. Platforms tested: FreeBSD 4.8 (sleipnir) h5committest
-rw-r--r--c++/src/H5FcreatProp.cpp10
-rw-r--r--c++/src/H5FcreatProp.h8
-rw-r--r--c++/test/tfile.cpp9
-rw-r--r--fortran/src/H5Pf.c16
-rw-r--r--src/H5F.c8
-rw-r--r--src/H5Fdbg.c2
-rw-r--r--src/H5Fpkg.h2
-rw-r--r--src/H5Fprivate.h4
-rw-r--r--src/H5Pfcpl.c222
-rw-r--r--src/H5Ppublic.h7
-rw-r--r--test/tfile.c8
11 files changed, 259 insertions, 37 deletions
diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp
index c59aa11..e28a891 100644
--- a/c++/src/H5FcreatProp.cpp
+++ b/c++/src/H5FcreatProp.cpp
@@ -86,7 +86,7 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con
}
}
-void FileCreatPropList::setSymk( int ik, unsigned lk ) const
+void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const
{
herr_t ret_value = H5Pset_sym_k( id, ik, lk );
if( ret_value < 0 )
@@ -96,7 +96,7 @@ void FileCreatPropList::setSymk( int ik, unsigned lk ) const
}
}
-void FileCreatPropList::getSymk( int& ik, unsigned& lk ) const
+void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const
{
herr_t ret_value = H5Pget_sym_k( id, &ik, &lk );
if( ret_value < 0 )
@@ -106,7 +106,7 @@ void FileCreatPropList::getSymk( int& ik, unsigned& lk ) const
}
}
-void FileCreatPropList::setIstorek( int ik ) const
+void FileCreatPropList::setIstorek( unsigned ik ) const
{
herr_t ret_value = H5Pset_istore_k( id, ik );
if( ret_value < 0 )
@@ -115,9 +115,9 @@ void FileCreatPropList::setIstorek( int ik ) const
"H5Pset_istore_k failed");
}
}
-int FileCreatPropList::getIstorek() const
+unsigned FileCreatPropList::getIstorek() const
{
- int ik;
+ unsigned ik;
herr_t ret_value = H5Pget_istore_k( id, &ik );
if( ret_value < 0 )
{
diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h
index d1ec817..5b73e42 100644
--- a/c++/src/H5FcreatProp.h
+++ b/c++/src/H5FcreatProp.h
@@ -48,18 +48,18 @@ class H5_DLLCPP FileCreatPropList : public PropList {
void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const;
// Sets the size of parameters used to control the symbol table nodes.
- void setSymk( int int_nodes_k, unsigned leaf_nodes_k ) const;
+ void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const;
// Retrieves the size of the symbol table B-tree 1/2 rank and the
// symbol table leaf node 1/2 size.
- void getSymk( int& int_nodes_k, unsigned& leaf_nodes_k ) const;
+ void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const;
// Sets the size of parameter used to control the B-trees for
// indexing chunked datasets.
- void setIstorek( int ik ) const;
+ void setIstorek( unsigned ik ) const;
// Returns the 1/2 rank of an indexed storage B-tree.
- int getIstorek() const;
+ unsigned getIstorek() const;
// Creates a copy of an existing file create property list
// using the property list id
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index 37cc5e1..a911e65 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -152,8 +152,7 @@ test_file_create(void)
VERIFY(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes");
VERIFY(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes");
- int iparm1; /*file-creation parameters */
- unsigned iparm2; /*file-creation parameters */
+ unsigned iparm1,iparm2; /*file-creation parameters */
tmpl1.getSymk( iparm1, iparm2);
VERIFY(iparm1, F1_SYM_INTERN_K, "FileCreatPropList::getSymk");
VERIFY(iparm2, F1_SYM_LEAF_K, "FileCreatPropList::getSymk");
@@ -202,8 +201,7 @@ test_file_create(void)
VERIFY(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes");
VERIFY(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes");
- int iparm1; /*file-creation parameters */
- unsigned iparm2; /*file-creation parameters */
+ unsigned iparm1,iparm2; /*file-creation parameters */
tmpl1->getSymk( iparm1, iparm2);
VERIFY(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk");
VERIFY(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk");
@@ -285,8 +283,7 @@ test_file_open(void)
VERIFY(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes");
VERIFY(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes");
- int iparm1; /*file-creation parameters */
- unsigned iparm2; /*file-creation parameters */
+ unsigned iparm1,iparm2; /*file-creation parameters */
tmpl1.getSymk( iparm1, iparm2);
VERIFY(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk");
VERIFY(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk");
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c
index f647a95..9ef14bc 100644
--- a/fortran/src/H5Pf.c
+++ b/fortran/src/H5Pf.c
@@ -624,16 +624,16 @@ nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk)
{
int ret_value = -1;
hid_t c_prp_id;
- int c_ik;
- int c_lk;
+ unsigned c_ik;
+ unsigned c_lk;
herr_t ret;
/*
* Call H5Pset_sym_k function.
*/
c_prp_id = (hid_t)*prp_id;
- c_ik = (int)*ik;
- c_lk = (int)*lk;
+ c_ik = (unsigned)*ik;
+ c_lk = (unsigned)*lk;
ret = H5Pset_sym_k(c_prp_id, c_ik, c_lk);
if (ret < 0) return ret_value;
@@ -659,7 +659,7 @@ nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk)
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
- int c_ik;
+ unsigned c_ik;
unsigned c_lk;
/*
@@ -690,14 +690,14 @@ nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik)
{
int ret_value = -1;
hid_t c_prp_id;
- int c_ik;
+ unsigned c_ik;
herr_t ret;
/*
* Call H5Pset_istore_k function.
*/
c_prp_id = (hid_t)*prp_id;
- c_ik = (int)*ik;
+ c_ik = (unsigned)*ik;
ret = H5Pset_istore_k(c_prp_id, c_ik);
if (ret < 0) return ret_value;
@@ -722,7 +722,7 @@ nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik)
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
- int c_ik;
+ unsigned c_ik;
/*
* Call H5Pget_istore_k function.
diff --git a/src/H5F.c b/src/H5F.c
index 6f37aa9..20c9dec 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -185,7 +185,7 @@ H5F_init_interface(void)
H5P_genclass_t *crt_pclass;
hsize_t userblock_size = H5F_CRT_USER_BLOCK_DEF;
unsigned sym_leaf_k = H5F_CRT_SYM_LEAF_DEF;
- int btree_k[H5B_NUM_BTREE_ID] = H5F_CRT_BTREE_RANK_DEF;
+ unsigned btree_k[H5B_NUM_BTREE_ID] = H5F_CRT_BTREE_RANK_DEF;
size_t sizeof_addr = H5F_CRT_ADDR_BYTE_NUM_DEF;
size_t sizeof_size = H5F_CRT_OBJ_BYTE_NUM_DEF;
int bootblock_ver = H5F_CRT_BOOT_VERS_DEF;
@@ -1805,7 +1805,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
size_t sizeof_addr = 0;
size_t sizeof_size = 0;
unsigned sym_leaf_k = 0;
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *c_plist;
H5P_genplist_t *a_plist; /* Property list */
H5F_close_degree_t fc_degree;
@@ -2078,7 +2078,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, NULL, "bad 1/2 rank for btree internal nodes");
if(H5P_set(c_plist, H5F_CRT_BTREE_RANK_NAME, btree_k)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set rank for btree internal nodes");
- HDmemcpy(shared->btree_k,btree_k,sizeof(int)*H5B_NUM_BTREE_ID); /* Keep a local copy also */
+ HDmemcpy(shared->btree_k,btree_k,sizeof(unsigned)*H5B_NUM_BTREE_ID); /* Keep a local copy also */
/* File consistency flags. Not really used yet */
UINT32DECODE(p, shared->consist_flags);
@@ -3812,7 +3812,7 @@ unsigned H5F_sym_leaf_k(const H5F_t *f)
* Added this header and removed unused ret_value variable.
*-------------------------------------------------------------------------
*/
-int
+unsigned
H5F_Kvalue(const H5F_t *f, const H5B_class_t *type)
{
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c
index fec3a46..00a545c 100644
--- a/src/H5Fdbg.c
+++ b/src/H5Fdbg.c
@@ -123,7 +123,7 @@ H5F_debug(H5F_t *f, hid_t dxpl_id, FILE * stream, int indent, int fwidth)
"Symbol table leaf node 1/2 rank:", f->shared->sym_leaf_k);
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Symbol table internal node 1/2 rank:",
- (unsigned) (f->shared->btree_k[H5B_SNODE_ID]));
+ f->shared->btree_k[H5B_SNODE_ID]);
HDfprintf(stream, "%*s%-*s 0x%08lx\n", indent, "", fwidth,
"File consistency flags:",
(unsigned long) (f->shared->consist_flags));
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index f0f120b..131cde8 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -116,7 +116,7 @@ typedef struct H5F_file_t {
size_t sizeof_addr; /* Size of addresses in file */
size_t sizeof_size; /* Size of offsets in file */
unsigned sym_leaf_k; /* Size of leaves in symbol tables */
- int btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */
+ unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */
haddr_t boot_addr; /* Absolute address of boot block */
haddr_t base_addr; /* Absolute base address for rel.addrs. */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 945a35d..da6c4f3 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -256,7 +256,7 @@ typedef struct H5F_t H5F_t;
#define H5F_CRT_SYM_LEAF_DEF 4
/* Definitions for the 1/2 rank for btree internal nodes */
#define H5F_CRT_BTREE_RANK_NAME "btree_rank"
-#define H5F_CRT_BTREE_RANK_SIZE sizeof(int[H5B_NUM_BTREE_ID])
+#define H5F_CRT_BTREE_RANK_SIZE sizeof(unsigned[H5B_NUM_BTREE_ID])
#define H5F_CRT_BTREE_RANK_DEF {16,32}
/* Definitions for byte number in an address */
#define H5F_CRT_ADDR_BYTE_NUM_NAME "addr_byte_num"
@@ -398,7 +398,7 @@ H5_DLL htri_t H5F_has_mount(const H5F_t *file);
H5_DLL size_t H5F_sizeof_addr(const H5F_t *f);
H5_DLL size_t H5F_sizeof_size(const H5F_t *f);
H5_DLL unsigned H5F_sym_leaf_k(const H5F_t *f);
-H5_DLL int H5F_Kvalue(const H5F_t *f, const struct H5B_class_t *type);
+H5_DLL unsigned H5F_Kvalue(const H5F_t *f, const struct H5B_class_t *type);
/* Functions that operate on blocks of bytes wrt boot block */
H5_DLL herr_t H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr,
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index 1fbb7e5..bde4d57 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -289,6 +289,7 @@ done:
FUNC_LEAVE_API(ret_value);
}
+#ifdef H5_WANT_H5_V1_6_COMPAT
/*-------------------------------------------------------------------------
* Function: H5Pset_sym_k
@@ -323,7 +324,7 @@ done:
herr_t
H5Pset_sym_k(hid_t plist_id, int ik, unsigned lk)
{
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -338,7 +339,7 @@ H5Pset_sym_k(hid_t plist_id, int ik, unsigned lk)
if (ik > 0) {
if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
- btree_k[H5B_SNODE_ID] = ik;
+ btree_k[H5B_SNODE_ID] = (unsigned)ik;
if(H5P_set(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree nodes");
}
@@ -374,7 +375,117 @@ done:
herr_t
H5Pget_sym_k(hid_t plist_id, int *ik /*out */ , unsigned *lk /*out */ )
{
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(H5Pget_sym_k, FAIL);
+ H5TRACE3("e","ixx",plist_id,ik,lk);
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ /* Get values */
+ if (ik) {
+ if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree nodes");
+ *ik = (int)btree_k[H5B_SNODE_ID];
+ }
+ if (lk)
+ if(H5P_get(plist, H5F_CRT_SYM_LEAF_NAME, lk) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for symbol table leaf nodes");
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+#else /* H5_WANT_H5_V1_6_COMPAT */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_sym_k
+ *
+ * Purpose: IK is one half the rank of a tree that stores a symbol
+ * table for a group. Internal nodes of the symbol table are on
+ * average 75% full. That is, the average rank of the tree is
+ * 1.5 times the value of IK.
+ *
+ * LK is one half of the number of symbols that can be stored in
+ * a symbol table node. A symbol table node is the leaf of a
+ * symbol table tree which is used to store a group. When
+ * symbols are inserted randomly into a group, the group's
+ * symbol table nodes are 75% full on average. That is, they
+ * contain 1.5 times the number of symbols specified by LK.
+ *
+ * Either (or even both) of IK and LK can be zero in which case
+ * that value is left unchanged.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, January 6, 1998
+ *
+ * Modifications:
+ *
+ * Raymond Lu, Oct 14, 2001
+ * Changed to the new generic property list.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk)
+{
+ unsigned btree_k[H5B_NUM_BTREE_ID];
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(H5Pset_sym_k, FAIL);
+ H5TRACE3("e","iIsIu",plist_id,ik,lk);
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ /* Set values */
+ if (ik > 0) {
+ if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
+ btree_k[H5B_SNODE_ID] = ik;
+ if(H5P_set(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree nodes");
+ }
+ if (lk > 0)
+ if(H5P_set(plist, H5F_CRT_SYM_LEAF_NAME, &lk) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for symbol table leaf nodes");
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_sym_k
+ *
+ * Purpose: Retrieves the symbol table B-tree 1/2 rank (IK) and the
+ * symbol table leaf node 1/2 size (LK). See H5Pset_sym_k() for
+ * details. Either (or even both) IK and LK may be null
+ * pointers.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, January 7, 1998
+ *
+ * Modifications:
+ *
+ * Raymond Lu
+ * Changed to the new generic property list.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out */ , unsigned *lk /*out */ )
+{
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -398,7 +509,9 @@ H5Pget_sym_k(hid_t plist_id, int *ik /*out */ , unsigned *lk /*out */ )
done:
FUNC_LEAVE_API(ret_value);
}
+#endif /* H5_WANT_H5_V1_6_COMPAT */
+#ifdef H5_WANT_H5_V1_6_COMPAT
/*-------------------------------------------------------------------------
* Function: H5Pset_istore_k
@@ -422,7 +535,7 @@ done:
herr_t
H5Pset_istore_k(hid_t plist_id, int ik)
{
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -440,7 +553,7 @@ H5Pset_istore_k(hid_t plist_id, int ik)
/* Set value */
if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
- btree_k[H5B_ISTORE_ID] = ik;
+ btree_k[H5B_ISTORE_ID] = (unsigned)ik;
if(H5P_set(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree interanl nodes");
@@ -473,7 +586,103 @@ done:
herr_t
H5Pget_istore_k(hid_t plist_id, int *ik /*out */ )
{
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=SUCCEED; /* return value */
+
+ FUNC_ENTER_API(H5Pget_istore_k, FAIL);
+ H5TRACE2("e","ix",plist_id,ik);
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ /* Get value */
+ if (ik) {
+ if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
+ *ik = (int)btree_k[H5B_ISTORE_ID];
+ }
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+#else /* H5_WANT_H5_V1_6_COMPAT */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_istore_k
+ *
+ * Purpose: IK is one half the rank of a tree that stores chunked raw
+ * data. On average, such a tree will be 75% full, or have an
+ * average rank of 1.5 times the value of IK.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, January 6, 1998
+ *
+ * Modifications:
+ *
+ * Raymond Lu, Oct 14, 2001
+ * Changed to the new generic property list.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_istore_k(hid_t plist_id, unsigned ik)
+{
+ unsigned btree_k[H5B_NUM_BTREE_ID];
+ H5P_genplist_t *plist; /* Property list pointer */
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(H5Pset_istore_k, FAIL);
+ H5TRACE2("e","iIs",plist_id,ik);
+
+ /* Check arguments */
+ if (ik == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "istore IK value must be positive");
+
+ /* Get the plist structure */
+ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
+
+ /* Set value */
+ if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for btree interanl nodes");
+ btree_k[H5B_ISTORE_ID] = ik;
+ if(H5P_set(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree interanl nodes");
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_istore_k
+ *
+ * Purpose: Queries the 1/2 rank of an indexed storage B-tree. See
+ * H5Pset_istore_k() for details. The argument IK may be the
+ * null pointer.
+ *
+ * Return: Success: Non-negative, size returned through IK
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, January 7, 1998
+ *
+ * Modifications:
+ *
+ * Raymond Lu, Oct 14, 2001
+ * Changed to the new generic property list.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out */ )
+{
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* return value */
@@ -494,4 +703,5 @@ H5Pget_istore_k(hid_t plist_id, int *ik /*out */ )
done:
FUNC_LEAVE_API(ret_value);
}
+#endif /* H5_WANT_H5_V1_6_COMPAT */
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 8d9b9d0..d91c1f5 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -157,10 +157,17 @@ H5_DLL herr_t H5Pset_sizes(hid_t plist_id, size_t sizeof_addr,
size_t sizeof_size);
H5_DLL herr_t H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr/*out*/,
size_t *sizeof_size/*out*/);
+#ifdef H5_WANT_H5_V1_6_COMPAT
H5_DLL herr_t H5Pset_sym_k(hid_t plist_id, int ik, unsigned lk);
H5_DLL herr_t H5Pget_sym_k(hid_t plist_id, int *ik/*out*/, unsigned *lk/*out*/);
H5_DLL herr_t H5Pset_istore_k(hid_t plist_id, int ik);
H5_DLL herr_t H5Pget_istore_k(hid_t plist_id, int *ik/*out*/);
+#else /* H5_WANT_H5_V1_6_COMPAT */
+H5_DLL herr_t H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk);
+H5_DLL herr_t H5Pget_sym_k(hid_t plist_id, unsigned *ik/*out*/, unsigned *lk/*out*/);
+H5_DLL herr_t H5Pset_istore_k(hid_t plist_id, unsigned ik);
+H5_DLL herr_t H5Pget_istore_k(hid_t plist_id, unsigned *ik/*out*/);
+#endif /* H5_WANT_H5_V1_6_COMPAT */
H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout);
H5_DLL H5D_layout_t H5Pget_layout(hid_t plist_id);
H5_DLL herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[]);
diff --git a/test/tfile.c b/test/tfile.c
index c285351..c020878 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -79,7 +79,11 @@ test_file_create(void)
hsize_t ublock; /*sizeof userblock */
size_t parm; /*file-creation parameters */
size_t parm2; /*file-creation parameters */
+#ifdef H5_WANT_H5_V1_6_COMPAT
int iparm;
+#else /* H5_WANT_H5_V1_6_COMPAT */
+ unsigned iparm;
+#endif /* H5_WANT_H5_V1_6_COMPAT */
unsigned iparm2;
herr_t ret; /*generic return value */
@@ -314,7 +318,11 @@ test_file_open(void)
hsize_t ublock; /*sizeof user block */
size_t parm; /*file-creation parameters */
size_t parm2; /*file-creation parameters */
+#ifdef H5_WANT_H5_V1_6_COMPAT
int iparm;
+#else /* H5_WANT_H5_V1_6_COMPAT */
+ unsigned iparm;
+#endif /* H5_WANT_H5_V1_6_COMPAT */
unsigned iparm2;
herr_t ret; /*generic return value */