www.delorie.com/gnu/docs/avl/libavl_142.html   search  
 
Buy GNU books!


GNU libavl 2.0.1

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.8.5 Starting at an Inserted Node

This implementation is a trivial adaptation of &#60;@xref{\NODE\, , \TITLE\}.&#62;{AVL traverser insertion initializer,179}. In particular, management of generation numbers has been removed.

 
void *
tbst_t_insert (struct tbst_traverser *trav,
struct tbst_table *tree, void *item)
{ void **p; assert (trav != NULL && tree != NULL && item != NULL); p = tbst_probe (tree, item); if (p != NULL)
{ trav-&#62;tbst_table = tree; trav-&#62;tbst_node = ((struct tbst_node *)
((char *) p - offsetof (struct tbst_node, tbst_data))); return *p; }
else
{ tbst_t_init (trav, tree); return NULL; } }
This code is included in @refalso{268


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003