]> git.kaiwu.me - klib.git/commitdiff
added
authorHeng Li <lh3@me.com>
Tue, 29 Sep 2015 12:28:48 +0000 (08:28 -0400)
committerHeng Li <lh3@me.com>
Tue, 29 Sep 2015 12:28:48 +0000 (08:28 -0400)
kbtree.h
test/Makefile

index 79ab121acd62ccb6b7f50fa7d667b4440f54424a..8b4f9176bf7885db953863acfb01bf6c38fce528 100644 (file)
--- a/kbtree.h
+++ b/kbtree.h
@@ -427,4 +427,11 @@ typedef struct {
                free(__kstack);                                                                                                 \
        } while (0)
 
+#define __kb_get_first(key_t, b, ret) do {     \
+               kbnode_t *__x = (b)->root;                      \
+               while (__KB_PTR(b, __x)[0] != 0)        \
+                       __x = __KB_PTR(b, __x)[0];              \
+               (ret) = __KB_KEY(key_t, __x)[0];        \
+       } while (0)
+
 #endif
index 203308d08313c396b2888729ffc1357bf29b360b..44d9eab9e518431f98b93acde16416558306b1a4 100644 (file)
@@ -4,7 +4,7 @@ CFLAGS=-g -Wall -O2 -I..
 CXXFLAGS=$(CFLAGS)
 PROGS=kbtree_test khash_keith khash_keith2 khash_test klist_test kseq_test kseq_bench \
                kseq_bench2 ksort_test ksort_test-stl kvec_test kmin_test kstring_bench kstring_bench2 kstring_test \
-               kthread_test kthread_test2
+               kthread_test2
 
 all:$(PROGS)