enhanced qse_htb_t and qse_rbt_t

- defined builtin mancbs'
- changed qse_rbt_t to point to mancbs
- touched up a few other functions
This commit is contained in:
2010-10-30 07:54:36 +00:00
parent 2265531c97
commit d58631e70b
14 changed files with 673 additions and 551 deletions

View File

@ -9,6 +9,20 @@
if (f() == -1) return -1; \
} while (0)
static qse_rbt_mancbs_t mancbs =
{
{
QSE_RBT_COPIER_INLINE,
QSE_RBT_COPIER_INLINE
},
{
QSE_RBT_FREEER_DEFAULT,
QSE_RBT_FREEER_DEFAULT
},
QSE_RBT_COMPER_DEFAULT,
QSE_RBT_KEEPER_DEFAULT
};
static int test1 ()
{
int i;
@ -97,17 +111,13 @@ static int test2 ()
}
mmgr.udd = fma;
if (qse_rbt_init (&rbt, &mmgr) == QSE_NULL)
if (qse_rbt_init (&rbt, &mmgr, QSE_SIZEOF(long), QSE_SIZEOF(long)) == QSE_NULL)
{
qse_printf (QSE_T("cannot initialize a tree\n"));
qse_fma_close (fma);
return -1;
}
qse_rbt_setcopier (&rbt, QSE_RBT_KEY, QSE_RBT_COPIER_INLINE);
qse_rbt_setcopier (&rbt, QSE_RBT_VAL, QSE_RBT_COPIER_INLINE);
qse_rbt_setscale (&rbt, QSE_RBT_KEY, QSE_SIZEOF(long));
qse_rbt_setscale (&rbt, QSE_RBT_VAL, QSE_SIZEOF(long));
qse_rbt_setmancbs (&rbt, &mancbs);
for (x = 10; x < 100; x++)
{