File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / lighttpd / src / splaytree.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Nov 2 10:35:00 2016 UTC (7 years, 7 months ago) by misho
Branches: lighttpd, MAIN
CVS tags: v1_4_41p8, HEAD
lighttpd 1.4.41

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

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