* renamed map to htb

* added qse_awk_findgbl()
* added Awk::findGlobal()
* began working on red-black tree
This commit is contained in:
2010-07-09 00:58:44 +00:00
parent 57c56594a5
commit 99c72b1755
34 changed files with 2709 additions and 1777 deletions

View File

@ -1,6 +1,6 @@
AM_CPPFLAGS = -I$(top_srcdir)/include -DNDEBUG
bin_PROGRAMS = chr str sll map lda fio pio sio time main rex01
bin_PROGRAMS = chr str sll lda htb rbt fio pio sio time main rex01
LDFLAGS = -L../../lib/cmn
LDADD = -lqsecmn
@ -8,8 +8,9 @@ LDADD = -lqsecmn
chr_SOURCES = chr.c
str_SOURCES = str.c
sll_SOURCES = sll.c
map_SOURCES = map.c
lda_SOURCES = lda.c
htb_SOURCES = htb.c
rbt_SOURCES = rbt.c
fio_SOURCES = fio.c
pio_SOURCES = pio.c
sio_SOURCES = sio.c

View File

@ -34,9 +34,9 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = chr$(EXEEXT) str$(EXEEXT) sll$(EXEEXT) map$(EXEEXT) \
lda$(EXEEXT) fio$(EXEEXT) pio$(EXEEXT) sio$(EXEEXT) \
time$(EXEEXT) main$(EXEEXT) rex01$(EXEEXT)
bin_PROGRAMS = chr$(EXEEXT) str$(EXEEXT) sll$(EXEEXT) lda$(EXEEXT) \
htb$(EXEEXT) rbt$(EXEEXT) fio$(EXEEXT) pio$(EXEEXT) \
sio$(EXEEXT) time$(EXEEXT) main$(EXEEXT) rex01$(EXEEXT)
subdir = samples/cmn
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@ -61,6 +61,10 @@ am_fio_OBJECTS = fio.$(OBJEXT)
fio_OBJECTS = $(am_fio_OBJECTS)
fio_LDADD = $(LDADD)
fio_DEPENDENCIES =
am_htb_OBJECTS = htb.$(OBJEXT)
htb_OBJECTS = $(am_htb_OBJECTS)
htb_LDADD = $(LDADD)
htb_DEPENDENCIES =
am_lda_OBJECTS = lda.$(OBJEXT)
lda_OBJECTS = $(am_lda_OBJECTS)
lda_LDADD = $(LDADD)
@ -69,14 +73,14 @@ am_main_OBJECTS = main.$(OBJEXT)
main_OBJECTS = $(am_main_OBJECTS)
main_LDADD = $(LDADD)
main_DEPENDENCIES =
am_map_OBJECTS = map.$(OBJEXT)
map_OBJECTS = $(am_map_OBJECTS)
map_LDADD = $(LDADD)
map_DEPENDENCIES =
am_pio_OBJECTS = pio.$(OBJEXT)
pio_OBJECTS = $(am_pio_OBJECTS)
pio_LDADD = $(LDADD)
pio_DEPENDENCIES =
am_rbt_OBJECTS = rbt.$(OBJEXT)
rbt_OBJECTS = $(am_rbt_OBJECTS)
rbt_LDADD = $(LDADD)
rbt_DEPENDENCIES =
am_rex01_OBJECTS = rex01.$(OBJEXT)
rex01_OBJECTS = $(am_rex01_OBJECTS)
rex01_LDADD = $(LDADD)
@ -110,12 +114,13 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(chr_SOURCES) $(fio_SOURCES) $(lda_SOURCES) $(main_SOURCES) \
$(map_SOURCES) $(pio_SOURCES) $(rex01_SOURCES) $(sio_SOURCES) \
$(sll_SOURCES) $(str_SOURCES) $(time_SOURCES)
DIST_SOURCES = $(chr_SOURCES) $(fio_SOURCES) $(lda_SOURCES) \
$(main_SOURCES) $(map_SOURCES) $(pio_SOURCES) $(rex01_SOURCES) \
SOURCES = $(chr_SOURCES) $(fio_SOURCES) $(htb_SOURCES) $(lda_SOURCES) \
$(main_SOURCES) $(pio_SOURCES) $(rbt_SOURCES) $(rex01_SOURCES) \
$(sio_SOURCES) $(sll_SOURCES) $(str_SOURCES) $(time_SOURCES)
DIST_SOURCES = $(chr_SOURCES) $(fio_SOURCES) $(htb_SOURCES) \
$(lda_SOURCES) $(main_SOURCES) $(pio_SOURCES) $(rbt_SOURCES) \
$(rex01_SOURCES) $(sio_SOURCES) $(sll_SOURCES) $(str_SOURCES) \
$(time_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@ -263,8 +268,9 @@ LDADD = -lqsecmn
chr_SOURCES = chr.c
str_SOURCES = str.c
sll_SOURCES = sll.c
map_SOURCES = map.c
lda_SOURCES = lda.c
htb_SOURCES = htb.c
rbt_SOURCES = rbt.c
fio_SOURCES = fio.c
pio_SOURCES = pio.c
sio_SOURCES = sio.c
@ -354,18 +360,21 @@ chr$(EXEEXT): $(chr_OBJECTS) $(chr_DEPENDENCIES)
fio$(EXEEXT): $(fio_OBJECTS) $(fio_DEPENDENCIES)
@rm -f fio$(EXEEXT)
$(LINK) $(fio_OBJECTS) $(fio_LDADD) $(LIBS)
htb$(EXEEXT): $(htb_OBJECTS) $(htb_DEPENDENCIES)
@rm -f htb$(EXEEXT)
$(LINK) $(htb_OBJECTS) $(htb_LDADD) $(LIBS)
lda$(EXEEXT): $(lda_OBJECTS) $(lda_DEPENDENCIES)
@rm -f lda$(EXEEXT)
$(LINK) $(lda_OBJECTS) $(lda_LDADD) $(LIBS)
main$(EXEEXT): $(main_OBJECTS) $(main_DEPENDENCIES)
@rm -f main$(EXEEXT)
$(LINK) $(main_OBJECTS) $(main_LDADD) $(LIBS)
map$(EXEEXT): $(map_OBJECTS) $(map_DEPENDENCIES)
@rm -f map$(EXEEXT)
$(LINK) $(map_OBJECTS) $(map_LDADD) $(LIBS)
pio$(EXEEXT): $(pio_OBJECTS) $(pio_DEPENDENCIES)
@rm -f pio$(EXEEXT)
$(LINK) $(pio_OBJECTS) $(pio_LDADD) $(LIBS)
rbt$(EXEEXT): $(rbt_OBJECTS) $(rbt_DEPENDENCIES)
@rm -f rbt$(EXEEXT)
$(LINK) $(rbt_OBJECTS) $(rbt_LDADD) $(LIBS)
rex01$(EXEEXT): $(rex01_OBJECTS) $(rex01_DEPENDENCIES)
@rm -f rex01$(EXEEXT)
$(LINK) $(rex01_OBJECTS) $(rex01_LDADD) $(LIBS)
@ -390,10 +399,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lda.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/map.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rbt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rex01.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sll.Po@am__quote@

View File

@ -1,7 +1,6 @@
#include <qse/cmn/mem.h>
#include <qse/cmn/chr.h>
#include <qse/cmn/str.h>
#include <qse/cmn/map.h>
#include <qse/cmn/stdio.h>
#include <string.h>

View File

@ -1,7 +1,7 @@
#include <qse/cmn/mem.h>
#include <qse/cmn/chr.h>
#include <qse/cmn/str.h>
#include <qse/cmn/map.h>
#include <qse/cmn/htb.h>
#include <qse/cmn/stdio.h>
#define R(f) \
@ -10,7 +10,7 @@
if (f() == -1) return -1; \
} while (0)
static int test1_build (qse_map_t* s1)
static int test1_build (qse_htb_t* s1)
{
int i;
@ -20,7 +20,7 @@ static int test1_build (qse_map_t* s1)
int j = i * 2;
qse_printf (QSE_T("inserting a key %d and a value %d: "), i, j);
if (qse_map_insert (s1, &i, sizeof(i), &j, sizeof(j)) == QSE_NULL)
if (qse_htb_insert (s1, &i, sizeof(i), &j, sizeof(j)) == QSE_NULL)
{
qse_printf (QSE_T("[FAILED]\n"));
return -1;
@ -32,7 +32,7 @@ static int test1_build (qse_map_t* s1)
return 0;
}
static void test1_delete (qse_map_t* s1)
static void test1_delete (qse_htb_t* s1)
{
int i;
int t[] = { 20, 11, 13, 40 };
@ -41,7 +41,7 @@ static void test1_delete (qse_map_t* s1)
for (i = 1; i < 53; i+=2)
{
qse_printf (QSE_T("deleting a key %d: "), i);
if (qse_map_delete (s1, &i, sizeof(i)) == -1)
if (qse_htb_delete (s1, &i, sizeof(i)) == -1)
qse_printf (QSE_T("[FAILED]\n"));
else
qse_printf (QSE_T("[OK]\n"));
@ -54,7 +54,7 @@ static void test1_delete (qse_map_t* s1)
int v = k * 1000;
qse_printf (QSE_T("updating a key %d value %d: "), k, v);
if (qse_map_update (s1, &k, sizeof(k), &v, sizeof(v)) == QSE_NULL)
if (qse_htb_update (s1, &k, sizeof(k), &v, sizeof(v)) == QSE_NULL)
qse_printf (QSE_T("[FAILED]\n"));
else
qse_printf (QSE_T("[OK]\n"));
@ -66,7 +66,7 @@ static void test1_delete (qse_map_t* s1)
int v = k * 1000;
qse_printf (QSE_T("inserting a key %d value %d: "), k, v);
if (qse_map_insert (s1, &k, sizeof(k), &v, sizeof(v)) == QSE_NULL)
if (qse_htb_insert (s1, &k, sizeof(k), &v, sizeof(v)) == QSE_NULL)
qse_printf (QSE_T("[FAILED]\n"));
else
qse_printf (QSE_T("[OK]\n"));
@ -78,21 +78,21 @@ static void test1_delete (qse_map_t* s1)
int v = k * 2000;
qse_printf (QSE_T("upserting a key %d value %d: "), k, v);
if (qse_map_upsert (s1, &k, sizeof(k), &v, sizeof(v)) == QSE_NULL)
if (qse_htb_upsert (s1, &k, sizeof(k), &v, sizeof(v)) == QSE_NULL)
qse_printf (QSE_T("[FAILED]\n"));
else
qse_printf (QSE_T("[OK]\n"));
}
}
static void test1_dump (qse_map_t* s1)
static void test1_dump (qse_htb_t* s1)
{
int i;
qse_printf (QSE_T("map contains %u pairs\n"), (unsigned)QSE_MAP_SIZE(s1));
qse_printf (QSE_T("map contains %u pairs\n"), (unsigned)QSE_HTB_SIZE(s1));
for (i = 1; i < 50; i++)
{
qse_map_pair_t* p = qse_map_search (s1, &i, sizeof(i));
qse_htb_pair_t* p = qse_htb_search (s1, &i, sizeof(i));
if (p == QSE_NULL)
{
qse_printf (QSE_T("%d => unknown\n"), i);
@ -100,28 +100,28 @@ static void test1_dump (qse_map_t* s1)
else
{
qse_printf (QSE_T("%d => %d(%d)\n"),
i, *(int*)QSE_MAP_VPTR(p), (int)QSE_MAP_VLEN(p));
i, *(int*)QSE_HTB_VPTR(p), (int)QSE_HTB_VLEN(p));
}
}
}
static int test1 ()
{
qse_map_t* s1;
qse_htb_t* s1;
s1 = qse_map_open (QSE_MMGR_GETDFL(), 0, 5, 70);
s1 = qse_htb_open (QSE_MMGR_GETDFL(), 0, 5, 70);
if (s1 == QSE_NULL)
{
qse_printf (QSE_T("cannot open a map\n"));
return -1;
}
qse_map_setcopier (s1, QSE_MAP_KEY, QSE_MAP_COPIER_INLINE);
qse_map_setcopier (s1, QSE_MAP_VAL, QSE_MAP_COPIER_INLINE);
qse_htb_setcopier (s1, QSE_HTB_KEY, QSE_HTB_COPIER_INLINE);
qse_htb_setcopier (s1, QSE_HTB_VAL, QSE_HTB_COPIER_INLINE);
if (test1_build(s1) == -1)
{
qse_map_close (s1);
qse_htb_close (s1);
return -1;
}
test1_dump (s1);
@ -129,22 +129,22 @@ static int test1 ()
test1_delete (s1);
test1_dump (s1);
qse_map_close (s1);
qse_htb_close (s1);
return 0;
}
qse_map_walk_t print_map_pair (qse_map_t* map, qse_map_pair_t* pair, void* arg)
qse_htb_walk_t print_map_pair (qse_htb_t* map, qse_htb_pair_t* pair, void* arg)
{
qse_printf (QSE_T("%.*s[%d] => %.*s[%d]\n"),
(int)QSE_MAP_KLEN(pair), QSE_MAP_KPTR(pair), (int)QSE_MAP_KLEN(pair),
(int)QSE_MAP_VLEN(pair), QSE_MAP_VPTR(pair), (int)QSE_MAP_VLEN(pair));
(int)QSE_HTB_KLEN(pair), QSE_HTB_KPTR(pair), (int)QSE_HTB_KLEN(pair),
(int)QSE_HTB_VLEN(pair), QSE_HTB_VPTR(pair), (int)QSE_HTB_VLEN(pair));
return QSE_MAP_WALK_FORWARD;
return QSE_HTB_WALK_FORWARD;
}
static int test2 ()
{
qse_map_t* s1;
qse_htb_t* s1;
int i;
qse_char_t* keys[] =
{
@ -154,24 +154,24 @@ static int test2 ()
QSE_T("in a given directory")
};
s1 = qse_map_open (QSE_MMGR_GETDFL(), 0, 1, 70);
s1 = qse_htb_open (QSE_MMGR_GETDFL(), 0, 1, 70);
if (s1 == QSE_NULL)
{
qse_printf (QSE_T("cannot open a map\n"));
return -1;
}
qse_map_setcopier (s1, QSE_MAP_KEY, QSE_MAP_COPIER_INLINE);
qse_map_setcopier (s1, QSE_MAP_VAL, QSE_MAP_COPIER_INLINE);
qse_map_setscale (s1, QSE_MAP_KEY, QSE_SIZEOF(qse_char_t));
qse_map_setscale (s1, QSE_MAP_VAL, QSE_SIZEOF(qse_char_t));
qse_htb_setcopier (s1, QSE_HTB_KEY, QSE_HTB_COPIER_INLINE);
qse_htb_setcopier (s1, QSE_HTB_VAL, QSE_HTB_COPIER_INLINE);
qse_htb_setscale (s1, QSE_HTB_KEY, QSE_SIZEOF(qse_char_t));
qse_htb_setscale (s1, QSE_HTB_VAL, QSE_SIZEOF(qse_char_t));
for (i = 0; i < QSE_COUNTOF(keys); i++)
{
int vi = QSE_COUNTOF(keys)-i-1;
qse_printf (QSE_T("inserting a key [%s] and a value [%s]: "), keys[i], keys[vi]);
if (qse_map_insert (s1,
if (qse_htb_insert (s1,
keys[i], qse_strlen(keys[i]),
keys[vi], qse_strlen(keys[vi])) == QSE_NULL)
{
@ -183,31 +183,31 @@ static int test2 ()
}
}
qse_map_walk (s1, print_map_pair, QSE_NULL);
qse_htb_walk (s1, print_map_pair, QSE_NULL);
qse_map_close (s1);
qse_htb_close (s1);
return 0;
}
static int comp_key (qse_map_t* map,
static int comp_key (qse_htb_t* map,
const void* kptr1, qse_size_t klen1,
const void* kptr2, qse_size_t klen2)
{
return qse_strxncasecmp (kptr1, klen1, kptr2, klen2);
}
qse_map_walk_t print_map_pair_3 (qse_map_t* map, qse_map_pair_t* pair, void* arg)
qse_htb_walk_t print_map_pair_3 (qse_htb_t* map, qse_htb_pair_t* pair, void* arg)
{
qse_printf (QSE_T("%.*s[%d] => %d\n"),
(int)QSE_MAP_KLEN(pair), QSE_MAP_KPTR(pair), (int)QSE_MAP_KLEN(pair),
*(int*)QSE_MAP_VPTR(pair));
(int)QSE_HTB_KLEN(pair), QSE_HTB_KPTR(pair), (int)QSE_HTB_KLEN(pair),
*(int*)QSE_HTB_VPTR(pair));
return QSE_MAP_WALK_FORWARD;
return QSE_HTB_WALK_FORWARD;
}
static int test3 ()
{
qse_map_t* s1;
qse_htb_t* s1;
int i;
qse_char_t* keys[] =
{
@ -220,22 +220,22 @@ static int test3 ()
QSE_T("thRee")
};
s1 = qse_map_open (QSE_MMGR_GETDFL(), 0, 1, 70);
s1 = qse_htb_open (QSE_MMGR_GETDFL(), 0, 1, 70);
if (s1 == QSE_NULL)
{
qse_printf (QSE_T("cannot open a map\n"));
return -1;
}
qse_map_setcopier (s1, QSE_MAP_KEY, QSE_MAP_COPIER_INLINE);
qse_map_setcopier (s1, QSE_MAP_VAL, QSE_MAP_COPIER_INLINE);
qse_map_setcomper (s1, comp_key);
qse_map_setscale (s1, QSE_MAP_KEY, QSE_SIZEOF(qse_char_t));
qse_htb_setcopier (s1, QSE_HTB_KEY, QSE_HTB_COPIER_INLINE);
qse_htb_setcopier (s1, QSE_HTB_VAL, QSE_HTB_COPIER_INLINE);
qse_htb_setcomper (s1, comp_key);
qse_htb_setscale (s1, QSE_HTB_KEY, QSE_SIZEOF(qse_char_t));
for (i = 0; i < QSE_COUNTOF(keys); i++)
{
qse_printf (QSE_T("inserting a key [%s] and a value %d: "), keys[i], i);
if (qse_map_insert (s1, keys[i], qse_strlen(keys[i]), &i, sizeof(i)) == QSE_NULL)
if (qse_htb_insert (s1, keys[i], qse_strlen(keys[i]), &i, sizeof(i)) == QSE_NULL)
{
qse_printf (QSE_T("[FAILED]\n"));
}
@ -245,15 +245,15 @@ static int test3 ()
}
}
qse_map_walk (s1, print_map_pair_3, QSE_NULL);
qse_htb_walk (s1, print_map_pair_3, QSE_NULL);
qse_map_close (s1);
qse_htb_close (s1);
return 0;
}
static int test4 ()
{
qse_map_t* s1;
qse_htb_t* s1;
int i;
qse_char_t* keys[] =
{
@ -266,22 +266,22 @@ static int test4 ()
QSE_T("thRee")
};
s1 = qse_map_open (QSE_MMGR_GETDFL(), 0, 1, 70);
s1 = qse_htb_open (QSE_MMGR_GETDFL(), 0, 1, 70);
if (s1 == QSE_NULL)
{
qse_printf (QSE_T("cannot open a map\n"));
return -1;
}
qse_map_setcopier (s1, QSE_MAP_KEY, QSE_MAP_COPIER_INLINE);
qse_map_setcopier (s1, QSE_MAP_VAL, QSE_MAP_COPIER_INLINE);
qse_map_setcomper (s1, comp_key);
qse_map_setscale (s1, QSE_MAP_KEY, QSE_SIZEOF(qse_char_t));
qse_htb_setcopier (s1, QSE_HTB_KEY, QSE_HTB_COPIER_INLINE);
qse_htb_setcopier (s1, QSE_HTB_VAL, QSE_HTB_COPIER_INLINE);
qse_htb_setcomper (s1, comp_key);
qse_htb_setscale (s1, QSE_HTB_KEY, QSE_SIZEOF(qse_char_t));
for (i = 0; i < QSE_COUNTOF(keys); i++)
{
qse_printf (QSE_T("upserting a key [%s] and a value %d: "), keys[i], i);
if (qse_map_upsert (s1, keys[i], qse_strlen(keys[i]), &i, sizeof(i)) == QSE_NULL)
if (qse_htb_upsert (s1, keys[i], qse_strlen(keys[i]), &i, sizeof(i)) == QSE_NULL)
{
qse_printf (QSE_T("[FAILED]\n"));
}
@ -291,9 +291,9 @@ static int test4 ()
}
}
qse_map_walk (s1, print_map_pair_3, QSE_NULL);
qse_htb_walk (s1, print_map_pair_3, QSE_NULL);
qse_map_close (s1);
qse_htb_close (s1);
return 0;
}

94
qse/samples/cmn/rbt.c Normal file
View File

@ -0,0 +1,94 @@
#include <qse/cmn/mem.h>
#include <qse/cmn/str.h>
#include <qse/cmn/rbt.h>
#include <qse/cmn/stdio.h>
#include <stdlib.h>
#define R(f) \
do { \
qse_printf (QSE_T("== %s ==\n"), QSE_T(#f)); \
if (f() == -1) return -1; \
} while (0)
static qse_rbt_walk_t walk (qse_rbt_t* rbt, qse_rbt_node_t* node, void* ctx)
{
qse_printf (QSE_T("key = %d, value = %d\n"), node->key, node->value);
return QSE_RBT_WALK_FORWARD;
}
static int test1 ()
{
qse_rbt_t* s1;
qse_char_t* x[] =
{
QSE_T("this is so good"),
QSE_T("what the fuck"),
QSE_T("do you like it?"),
QSE_T("oopsy!")
};
int i;
s1 = qse_rbt_open (QSE_MMGR_GETDFL(), 0);
if (s1 == QSE_NULL)
{
qse_printf (QSE_T("cannot open a string\n"));
return -1;
}
/*
qse_rbt_setcopier (s1, QSE_LDA_COPIER_INLINE);
qse_rbt_setkeeper (s1, keeper1);
qse_rbt_setscale (s1, QSE_SIZEOF(qse_char_t));
*/
for (i = 0; i < 20; i++)
{
qse_printf (QSE_T("inserting at %d\n"), i);
qse_rbt_insert (s1, i, i * 20);
}
qse_rbt_walk (s1, walk, QSE_NULL);
for (i = 0; i < 20; i += 2)
{
qse_printf (QSE_T("deleting %d\n"), i);
qse_rbt_delete (s1, i);
}
qse_rbt_walk (s1, walk, QSE_NULL);
for (i = 0; i < 20; i++)
{
qse_printf (QSE_T("inserting at %d\n"), i);
qse_rbt_insert (s1, i, i * 20);
}
qse_rbt_walk (s1, walk, QSE_NULL);
qse_rbt_clear (s1);
for (i = 20; i > 0; i--)
{
qse_printf (QSE_T("inserting at %d\n"), i);
qse_rbt_insert (s1, i, i * 20);
}
qse_rbt_walk (s1, walk, QSE_NULL);
for (i = 0; i < 20; i += 3)
{
qse_printf (QSE_T("deleting %d\n"), i);
qse_rbt_delete (s1, i);
}
qse_rbt_walk (s1, walk, QSE_NULL);
qse_rbt_close (s1);
return 0;
}
int main ()
{
R (test1);
return 0;
}