summaryrefslogtreecommitdiff
path: root/sys/include/avl.h
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 16:47:56 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 16:47:56 +0300
commitc558a99e0be506a9abdf677f0ca4490644e05fc1 (patch)
tree17aef678ad05a32ef96ce8385703cb3fe089a5c7 /sys/include/avl.h
parente5888a1ffdae813d7575f5fb02275c6bb07e5199 (diff)
Import sources from 2011-03-30 iso image - sys/include
Diffstat (limited to 'sys/include/avl.h')
-rwxr-xr-xsys/include/avl.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/sys/include/avl.h b/sys/include/avl.h
new file mode 100755
index 000000000..242ee1ba3
--- /dev/null
+++ b/sys/include/avl.h
@@ -0,0 +1,26 @@
+#pragma lib "libavl.a"
+#pragma src "/sys/src/libavl"
+
+typedef struct Avl Avl;
+typedef struct Avltree Avltree;
+typedef struct Avlwalk Avlwalk;
+
+#pragma incomplete Avltree
+#pragma incomplete Avlwalk
+
+struct Avl
+{
+ Avl *p; /* parent */
+ Avl *n[2]; /* children */
+ int bal; /* balance bits */
+};
+
+Avl *avlnext(Avlwalk *walk);
+Avl *avlprev(Avlwalk *walk);
+Avlwalk *avlwalk(Avltree *tree);
+void deleteavl(Avltree *tree, Avl *key, Avl **oldp);
+void endwalk(Avlwalk *walk);
+void insertavl(Avltree *tree, Avl *new, Avl **oldp);
+Avl *lookupavl(Avltree *tree, Avl *key);
+Avltree *mkavltree(int(*cmp)(Avl*, Avl*));
+Avl* searchavl(Avltree *tree, Avl *key, int neighbor);