1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 00:41:53 +02:00
wernermisc/qpkg/rbtest.c
Werner Almesberger cc92c67080 qpkg: (jrb) remove _gen suffix, since we removed the non-generic variants
- jrb.h, jrb.c (jrb_find_gte_gen): renamed to jrb_find_gte
- jrb.h, jrb.c (jrb_find_gen): renamed to jrb_find
- jrb.h, jrb.c (jrb_insert_gen): renamed to jrb_insert
- rbtest.c (INSERT): track jrb_insert_gen name change
2010-11-19 19:52:39 -03:00

38 lines
521 B
C

#include <stdio.h>
#include <string.h>
#include "jrb.h"
static int cmp(const void *a, const void *b)
{
return strcmp(a, b);
}
#define INSERT(key, val) \
jrb_insert(tree, key, val, cmp)
int main(void)
{
JRB tree = make_jrb();
JRB p;
INSERT("ab", "have");
INSERT("d", "little");
INSERT("c", "this");
INSERT("b", "passed");
INSERT("e", "regression");
INSERT("fa", "test");
INSERT("aa", "We");
INSERT("ff", "!");
jrb_traverse(p, tree)
printf("%s ", (char *) jrb_val(p));
printf("\n");
return 0;
}