/* Returns: TRUE if @node is an ancestor of @descendant  */
gboolean g_node_is_ancestor(GNode *node, GNode *descendant)
/* Returns: TRUE if @node is an ancestor of @descendant  */
gboolean g_node_is_ancestor(GNode *node, GNode *descendant)
{
  g_return_val_if_fail (node != NULL, FALSE);
  g_return_val_if_fail (descendant != NULL, FALSE);
  while (descendant)
    {
      if (descendant->parent == node)
	return TRUE;
      descendant = descendant->parent;
    }
  return FALSE;
}