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


GNU libavl 2.0.1

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

8.8.8 Backing Up to the Previous Node

 
void *
tbst_t_prev (struct tbst_traverser *trav)
{ assert (trav != NULL); if (trav-&#62;tbst_node == NULL) return tbst_t_last (trav, trav-&#62;tbst_table); else if (trav-&#62;tbst_node-&#62;tbst_tag[0] == TBST_THREAD)
{ trav-&#62;tbst_node = trav-&#62;tbst_node-&#62;tbst_link[0]; return trav-&#62;tbst_node != NULL ? trav-&#62;tbst_node-&#62;tbst_data : NULL; }
else
{ trav-&#62;tbst_node = trav-&#62;tbst_node-&#62;tbst_link[0]; while (trav-&#62;tbst_node-&#62;tbst_tag[1] == TBST_CHILD) trav-&#62;tbst_node = trav-&#62;tbst_node-&#62;tbst_link[1]; return trav-&#62;tbst_node-&#62;tbst_data; } }
This code is included in @refalso{268


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