diff options
author | MCApollo <34170230+MCApollo@users.noreply.github.com> | 2019-04-29 17:53:00 +0000 |
---|---|---|
committer | MCApollo <34170230+MCApollo@users.noreply.github.com> | 2019-04-29 17:53:00 +0000 |
commit | 59f5fd20e2f59ae186d5a461aef7782dd55e4e7b (patch) | |
tree | 10475faf0b6dcb812b64da679f4ae8ff01c45874 /data/lighttpd/lighttpd-1.4.53/src/splaytree.h | |
parent | f06e297cd175cca39745f6d1970225ae88aa68f1 (diff) |
Updated lighttpd.
Diffstat (limited to 'data/lighttpd/lighttpd-1.4.53/src/splaytree.h')
-rw-r--r-- | data/lighttpd/lighttpd-1.4.53/src/splaytree.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/data/lighttpd/lighttpd-1.4.53/src/splaytree.h b/data/lighttpd/lighttpd-1.4.53/src/splaytree.h new file mode 100644 index 000000000..cc5fe9b1c --- /dev/null +++ b/data/lighttpd/lighttpd-1.4.53/src/splaytree.h @@ -0,0 +1,25 @@ +#ifndef _SPLAY_TREE_H_ +#define _SPLAY_TREE_H_ +#include "first.h" + +typedef struct tree_node { + struct tree_node * left, * right; + int key; + int size; /* maintained to be the number of nodes rooted here */ + + void *data; +} splay_tree; + + +splay_tree * splaytree_splay (splay_tree *t, int key); +splay_tree * splaytree_insert(splay_tree *t, int key, void *data); +splay_tree * splaytree_delete(splay_tree *t, int key); +splay_tree * splaytree_size(splay_tree *t); + +#define splaytree_size(x) (((x)==NULL) ? 0 : ((x)->size)) +/* This macro returns the size of a node. Unlike "x->size", */ +/* it works even if x=NULL. The test could be avoided by using */ +/* a special version of NULL which was a real node with size 0. */ + + +#endif |