exported splaytree_size

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@700 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.6
Jan Kneschke 17 years ago
parent 7113a665b3
commit 74a71a2ff8
  1. 9
      src/splaytree.c
  2. 7
      src/splaytree.h

@ -53,12 +53,9 @@
#define compare(i,j) ((i)-(j))
/* This is the comparison. */
/* Returns <0 if i<j, =0 if i=j, and >0 if i>j */
#define node_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. */
#define node_size splaytree_size
/* Splay using the key i (which may or may not be in the tree.)
* The starting root is t, and the tree used is defined by rat
* size fields are maintained */

@ -13,5 +13,12 @@ typedef struct tree_node {
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

Loading…
Cancel
Save