7.8.5 Starting at an Inserted Node [ToC] [Index]     [Skip Back] [Skip Fwd]     [Prev] [Up] [Next]

This implementation is a trivial adaptation of <AVL traverser insertion initializer 181>. In particular, management of generation numbers has been removed.

275. <TBST traverser insertion initializer 275> =
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->tbst_table = tree; trav->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 270, 397, and 548.