GNU libavl 2.0.1
Author: Ben Pfaff

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;
        }
    }

This code is included in 268, 395, and 546.

7.8.4 Starting at a Found Node | 7.8 Traversal | 7.8.6 Initialization by Copying