/* Returns: immediate child of @root_type and anchestor of @leaf_type  */
GType g_type_next_base(GType type, GType base_type)
/* Returns: immediate child of @root_type and anchestor of @leaf_type  */
GType g_type_next_base(GType type, GType base_type)
{
  GType atype = 0;
  TypeNode *node;
  node = lookup_type_node_I (type);
  if (node)
    {
      TypeNode *base_node = lookup_type_node_I (base_type);
      if (base_node && base_node->n_supers < node->n_supers)
	{
	  guint n = node->n_supers - base_node->n_supers;
	  if (node->supers[n] == base_type)
	    atype = node->supers[n - 1];
	}
    }
  return atype;
}