File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / lighttpd / src / splaytree.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 10:32:48 2013 UTC (10 years, 8 months ago) by misho
Branches: lighttpd, MAIN
CVS tags: v1_4_35p0, v1_4_35, v1_4_33, HEAD
1.4.33

    1: #ifndef _SPLAY_TREE_H_
    2: #define _SPLAY_TREE_H_
    3: 
    4: typedef struct tree_node {
    5:     struct tree_node * left, * right;
    6:     int key;
    7:     int size;   /* maintained to be the number of nodes rooted here */
    8: 
    9:     void *data;
   10: } splay_tree;
   11: 
   12: 
   13: splay_tree * splaytree_splay (splay_tree *t, int key);
   14: splay_tree * splaytree_insert(splay_tree *t, int key, void *data);
   15: splay_tree * splaytree_delete(splay_tree *t, int key);
   16: splay_tree * splaytree_size(splay_tree *t);
   17: 
   18: #define splaytree_size(x) (((x)==NULL) ? 0 : ((x)->size))
   19: /* This macro returns the size of a node.  Unlike "x->size",     */
   20: /* it works even if x=NULL.  The test could be avoided by using  */
   21: /* a special version of NULL which was a real node with size 0.  */
   22: 
   23: 
   24: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>