#include #include #include "jrb.h" static int cmp(const void *a, const void *b) { return strcmp(a, b); } #define INSERT(key, val) \ jrb_insert_gen(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; }