7.8.5 Starting at an Inserted Node |
This implementation is a trivial adaptation of <AVL traverser insertion initializer 179>. In particular, management of generation numbers has been removed.
273. <TBST traverser insertion initializer 273> = 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; } }